官术网_书友最值得收藏!

Type constraints

Type constraints are rules associated with a type. They define a subset of all types that, for example, a variable can have. A type constraint takes the form of lower bound (subtype relation) or upper bound (supertype relation). It is possible to define multiple constraints for a single type. In this case, a type must satisfy both of them. Constraints are defined using the symbols >: (lower, unhappy bound) and  <: (upper, happy bound), and the direction of the sign corresponds to the reversed direction of the arrow on the UML diagram, as shown in the following screenshot:

The type constraints are inclusive, which is why type B represents both the upper and lower bounds. Besides B in our type hierarchy, only A obeys the LOWER type constraint and only  obeys the UPPER constraint.

主站蜘蛛池模板: 彭泽县| 呼图壁县| 千阳县| 紫阳县| 南昌县| 济宁市| 威远县| 集安市| 盱眙县| 正蓝旗| 木里| 贵溪市| 开化县| 丰都县| 临海市| 岳普湖县| 荣昌县| 桦甸市| 巨野县| 衡阳县| 抚宁县| 克拉玛依市| 银川市| 楚雄市| 兰溪市| 勃利县| 江源县| 宁津县| 鱼台县| 蕉岭县| 安义县| 拜城县| 稻城县| 茂名市| 上杭县| 赤城县| 安宁市| 广昌县| 岳普湖县| 琼海市| 深水埗区|