|
TIHashTable<TKey>
|
The TIHashTable class implements and manages a hash table of TKey-interface associations. It stores interfaces (IUnknown and its descendants) indexed by a key. Hash tables provide constant time O(C) search access to any value in the table (using the key) as the table grows (unlike a TList where to search for an item is O(n). The TIHashTable object provides properties and methods to:
• Add or delete the interfaces in the table.
• Locate and access interfaces in the table. |
Note
|
For a small numbers of items, this class may be slower than a TList because its retrieval time constant is larger. It also consumes more memory than a TList.
|
|
|
TInterfaceListIterator
|
The TInterfaceListIterator object provides an enumeration of all the interfaces in a RSInterfaceCollections.TInterfaceListPersistent object, it implements the CommonInterfaces.IInterfaceIterator interface. It effectively hides the underlying implementation, in this case a TInterfaceListPersistent, while still allowing access to all the interfaces stored in the implementation.
The object provides functionality similar to an Enumeration in Java.
To use the iterator is simple, get the iterator and then keep calling the RSInterfaceCollections.TInterfaceListIterator.NextElement method until the RSInterfaceCollections.TInterfaceListIterator.HasMoreElements method returns False. The iterator works by giving you the next element until the end of the list, there is no provision for getting the previous element. The iterator manages its own memory and will free itself when it is completely dereferenced (as long as you use an interface to access it).
|
|
TInterfaceListPersistent
|
To implement a TInterfaceList-clone that is descended from TPersistent and implements the CommonInterfaces.ICloneable interface.
TInterfaceListPersistent represents a list of interfaces.
Use TInterfaceListPersistent to manage a list of interfaces.
Note
|
This class combines features from the old InterfaceCollections|TGInterfaceList and InterfaceCollections|TIList.
|
|
|
TIQueue
|
TIQueue maintains a first-in first-out array, or queue, of interfaces. Use a TIQueue object to store and maintain a first-in first-out list.
To use the class properly as a queue, use the RSInterfaceCollections.TIQueue.Push(IInterface) and RSInterfaceCollections.TIQueue.Pop methods, not Add or Items.
|
|
TIStack
|
Maintains a last-in first-out (LIFO) array, or stack, of interfaces.
Use a TIStack object to store and maintain a last-in first-out list. The TIStack object descends from RSInterfaceCollections.TIQueue but modifies the behavior of the Peek and Pop methods to return the last item added to the list.
|
|
TIStringHashTable
|
The TIStringHashTable class implements and manages a hash table of string-interface associations. It stores interfaces (IUnknown and its descendants) indexed by a string key. Hash tables provide constant time O(C) search access to any value in the table (using the key) as the table grows (unlike a TStringList where to search for an item is O(n). The TIStringHashTable object provides properties and methods to:
• Add or delete the interfaces in the table.
• Locate and access interfaces in the table. |
Note
|
For a small numbers of items, this class may be slower than a TStringList because its retrieval time constant is larger. It also consumes more memory than a TStringList.
|
|
|
TStringsIterator
|
The TStringsIterator object implements the CommonInterfaces.IIterator , CommonInterfaces.IObjectIterator, and CommonInterfaces.IStringIterator interfaces for an underlying TStrings Object. It provides an enumeration of all the items in a TStrings object or its descendants. It effectively hides the underlying implementation, in this case a TStrings, while still allowing access to all the items stored in the implementation.
The object provides functionality similar to an Enumeration in Java.
To use the iterator is simple, get the iterator as an IIterator, IObjectIterator, or IStringIterator interface and then keep calling the NextElement method of the interface until the HasMoreElements method returns False. The iterator works by giving you the next element until the end of the list, there is no provision for getting the previous element. The iterator manages its own memory and will free itself when it is completely dereferenced (as long as you use an interface to access it). The NextElement and CurrentElement methods of the IObjectIterator interface have been mapped to the NextElementO and CurrentElementO of this object; it is completely transparent to the user of the interface. Similarly, the NextElementP and CurrentElementP methods implement the NextElement and CurrentElement methods of the IIterator interface.
Note
|
The enumeration guarantees no ordering in the manner that the next element returns items. It just guarantees all items will be returned eventually, with no item appearing twice.
|
|