E
- type of the elements in the collection@External public static interface GeneralCollection.Ordered<E>
isOrdered()
method of subtypes must return true
.
Ordered collections contain the elements in a fixed order, that is, their elements can be referenced with an index. This order does not have to fit the natural ordering or any other kind of ordering of the elements. It is based on the order in which the elements were put into the collection.
See the documentation of Model
for an overview on modeling in
JtxtUML.
Modifier and Type | Method and Description |
---|---|
GeneralCollection.Ordered<E> |
add(int index,
E element)
Returns a collection of the same type as this which contains all the
elements of this with the specified element added to the given index.
|
E |
get(int index)
Returns the element in this collection at the specified index.
|
@External int |
getLowerBound()
Returns the lower bound of this collection, that is, the minimum number
of elements it may contain.
|
@External int |
getUpperBound()
Returns the upper bound of this collection, that is, the maximum number
of elements it may contain.
|
default @External boolean |
isOrdered()
Tells whether this txtUML API collection is ordered or not.
|
@External boolean |
isUnique()
Tells whether this txtUML API collection is a unique collection or not.
|
GeneralCollection.Ordered<E> |
remove(int index)
Returns a collection of the same type as this which contains all the
elements of this except the one at the specified index.
|
@ExternalBody E get(int index)
If the given index is invalid, a model error is raised. The index is invalid if it is not between 0 (inclusive) and the size of this collection (exclusive).
@ExternalBody GeneralCollection.Ordered<E> add(int index, E element)
Index of elements after the given index will be increased by 1.
If the given index is invalid, a model error is raised. The index is invalid if it is not between 0 (inclusive) and the size of this collection (inclusive).
Note that in the case of this method, the size of this collection is
also a valid index. In this case, this method adds the element to the
end of this collection, so it has the same result as the
GeneralCollection.add(Object)
method.
@ExternalBody GeneralCollection.Ordered<E> remove(int index)
Index of elements after the given index will be decreased by 1.
If the given index is invalid, a model error is raised. The index is invalid if it is not between 0 (inclusive) and the size of this collection (exclusive).
@External default @External boolean isOrdered()
Ordered collections contain the elements in a fixed order, that is, their elements can be referenced with an index. This order does not have to fit the natural ordering or any other kind of ordering of the elements. It is based on the order in which the elements were put into the collection.
@External @External boolean isUnique()
Unique collections cannot contain multiple elements which are equal.
@External @External int getLowerBound()
@External @External int getUpperBound()
GeneralCollection.INFINITE_BOUND
, which means that this
collection has no upper bound.