Charta Software
Back to the base
E-mail:
Wachtwoord:
Aangemaakt door op 2009-06-18 09:57:17
Laatst gewijzigd op 2009-06-18 10:14:54

List

A List is a collection of objects where order is important. Objects can occur more than once in the same list.

Charta supports the collection List which can be used to store a collection of objects when order is important. Objects can be inserted anywhere in the list. If there are any objects after the insertion location then those objects will be moved backwards in the list upon insertion. The same object can occur more than once within the same list.

Supported operations

The following operations are supported by a List:

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