Charta Software
Back to the base
E-mail:
Wachtwoord:
Aangemaakt door op 2009-06-17 17:54:40
Laatst gewijzigd op 2009-06-19 16:59:32

Set

A Set is a collection of objects where order is not important and every object can occur only once.

Charta supports the collection Set which can be used to store a collection of objects when the order of the objects is not important. However, the Set does support access to its members through an integral index. This facilitates the display of large sets by allowing access to a subset of its members at defined locations.

Also, a Set can be used in a for each statement.

Supported operations

The following operations are supported by a Set:

OperationDescription
AddAdds a value to the set if it is not already present.
RemoveRemoves a value from the set if it is present.
SizeRetrieves the current amount of elements in the set
Index ofReturns the index of a value in the set. Returns -1 if the value is not present.
ContainsReturns a Boolean value indicating whether the specified value is present in the set.
For eachA set can be used in a for each statement to iterate over all its members.
[]Set members at specific integral indexes can be retrieved using the [] operator.