EXPRESS definition:
==================
A bag data type has as its domain unordered collections of like elements. The optional lower
and upper bounds, which are integer-valued expressions, define the minimum and maximum
number of elements that can be held in the collection defined by a bag data type.
Syntax:
170 bag_type = BAG [ bound_spec ] OF base_type .
176 bound_spec = '[' bound_1 ':' bound_2 ']' .
174 bound_1 = numeric_expression .
175 bound_2 = numeric_expression .
171 base_type = aggregation_types | simple_types | named_types .
Rules and restrictions:
a) The bound_1 expression shall evaluate to an integer value greater than or equal to
zero. It gives the lower bound, which is the minimum number of elements that can be in a
bag value of this data type. bound_1 shall not produce the indeterminate (?) value.
b) The bound_2 expression shall evaluate to an integer value greater than or equal to
bound_1, or an indeterminate (?) value. It gives the upper bound, which is the maximum
number of elements that can be in a bag value of this data type.
If this value is indeterminate (?) the number of elements in a bag value of this data type is
not be bounded from above.
c) If the bound_spec is omitted, the limits are [0:?].
EXAMPLE 29 (This example defines an attribute as a bag of point (where point is a named data
type assumed to have been declared elsewhere).
a_bag_of_points : BAG OF point;
The value of the attribute named a_bag_of_points can contain zero or more points. The same
point instance may appear more than once in the value of a_bag_of_points.
If the value is required to contain at least one element, the specification can provide a lower bound,
as in:
a_bag_of_points : BAG [1:?] OF point;
The value of the attribute named a_bag_of_points now must contain at least one point.
Python definition:
==================
@TODO
def SCL.AggregationDataTypes.BAG.add |
( |
|
self, |
|
|
|
value |
|
) |
| |
Adds a value to the bag
References SCL.AggregationDataTypes.ARRAY._bound_1, SCL.AggregationDataTypes.LIST._bound_1, SCL.AggregationDataTypes.BAG._bound_1, SCL.AggregationDataTypes.SET._bound_1, SCL.AggregationDataTypes.ARRAY._bound_2, SCL.AggregationDataTypes.LIST._bound_2, SCL.AggregationDataTypes.BAG._bound_2, SCL.AggregationDataTypes.SET._bound_2, SCL.AggregationDataTypes.ARRAY._container, SCL.AggregationDataTypes.LIST._container, SCL.AggregationDataTypes.BAG._container, SCL.AggregationDataTypes.SET._container, SCL.AggregationDataTypes.LIST._unbounded, SCL.AggregationDataTypes.BAG._unbounded, SCL.AggregationDataTypes.SET._unbounded, and SCL.BaseType.Type.get_type().
def SCL.AggregationDataTypes.BAG.get_hiindex |
( |
|
self | ) |
|
When V is a bag, list or set, the returned value is the actual number of elements in
the aggregate value.
References SCL.AggregationDataTypes.ARRAY._container, SCL.AggregationDataTypes.LIST._container, SCL.AggregationDataTypes.BAG._container, and SCL.AggregationDataTypes.SET._container.