Collection Methods
The methods summarized in the following table are implemented for (and inherited by) all Collection subclass instances.
Method | Description |
---|---|
add | Adds an object to a collection |
clear | Removes all entries from a collection |
copy | Copies entries from the receiver to a compatible collection |
countOf | Returns the number of times the specified entry occurs in the collection |
countOf64 | Returns the number of times the specified entry occurs in the collection as an |
createIterator | Creates an iterator for the Collection class and subclasses |
deleteIfEmpty | Deletes a shared or exclusive collection if it is empty |
first | Returns the first entry in the collection or it returns null if the collection is empty |
getOwner | Returns the object that is the owner of the collection |
getStatistics | Analyzes the collection and returns structural statistics |
includes | Returns true if the collection contains a specified object |
includesWithDeferred | Returns true if the collection contains the object specified in the value parameter, taking account of deferred operations visible to the process |
indexNear | Returns an approximate index of an object in a collection |
indexNear64 | Returns an approximate index of an object in a collection as an |
indexOf | Returns the index of a specified entry if it exists in the collection |
indexOf64 | Returns the index of a specified entry if it exists in the collection as an |
inspect | Inspects a collection of objects |
inspectModal | Opens a modal Inspector form for the receiver object |
instantiate | In exclusive collections only, ensures that the object is created before it is used |
isEmpty | Returns true if the collection has no entries |
last | Returns the last entry in the collection or it returns null if the collection is empty |
maxSize | Returns the maximum number of entries that the collection can contain |
maxSize64 | Returns the maximum number of entries that the collection can contain as an |
purge | Deletes all object references in a collection |
rebuild | Removes invalid object references and fixes up dictionary keys in a collection |
remove | Removes an item from a collection |
setBlockSize | Specifies or changes the block size of the receiver |
size | Returns the current number of entries in the collection |
size64 | Returns the current number of entries in the collection as an |
tryAdd | Attempts to add the specified value to the collection |
tryAddDeferred | Executes a deferred attempt to add a value to the collection |
tryAddIfNotNull | Attempts to add the specified value to the collection if the value is not null and it is not already contained in the collection |
tryCopy | Copies the values from the receiver collection to the specified target collection that are not present in the target collection, and returns a reference to the target collection |
tryCopyFrom | Copies the values that are not present in the receiver from the collection specified in the sourceCollection parameter to the receiver |
tryRemove | Attempts to remove the specified value from the collection |
tryRemoveDeferred | Executes a deferred attempt to remove the specified value from the collection |
tryRemoveIfNotNull | Attempts to remove the specified value from the collection if it is not null and is contained in the collection |