Get( ) method (Set Collections)
- Last Updated: March 15, 2024
- 1 minute read
- OpenEdge
- Version 12.8
- Documentation
Returns the element from the set collection that matches the element passed in, if it can be
found, according to the comparer implementation (default or custom). Otherwise it
returns the Unknown value (?).
Return type: T
Access: PUBLIC
Applies to: Progress.Collections.SortedSet<T> class, Progress.Collections.KeySet<K> class
Syntax
|
- element
- The element in the set to retrieve.
Notes
- For a
SortedSet, the comparer is always used when determining if the object can be found in the set. The comparer implementation decides that an object is the same by returning the value zero to the get operation.Get()can be used to retrieve the complete object that was added to the set, by using a light-weight version with just the values needed by the comparer to identify an equal element. This allows for faster lookup than having to iterate through the whole set to find the element. - For a
KeySet, the equality comparer (default or custom) associated with the hash map linked to the key set object is called to determine if the key is found in the set or not.Get()raises an error if the key value is invalid, if using the default equality comparer, or if the comparer raises an error.