|
|
This class implements the DictionaryBag datatype template.
|
Constructor.
~ |
Destructor.
bool |
Add element to head of bag.
Parameters:
key | Key of element to be added. |
element | Element to be added. |
Returns: true, if element has been added; false, if not.
bool |
Add element to tail of bag.
Parameters:
key | Key of element to be added. |
element | Element to be added. |
Returns: true, if element has been added; false, if not.
void |
Remove element from bag.
Parameters:
key | Key for element to be removed. |
void |
Remove element from bag.
Parameters:
element | Element to be removed. |
void |
Remove all elements with given key from bag.
Parameters:
key | Key. |
inline void |
Remove first element from bag.
inline void |
Remove last element from bag.
inline bool |
[const]
Check, if bag contains an element.
Parameters:
element | Element to be checked to be in the bag. |
inline bool |
[const]
Check, if bag contains an element.
Parameters:
key | Key of element to be checked to be in the bag. |
inline T |
[const]
Find element.
Parameters:
key | Key for element to find. |
Returns: Element.
inline cardinal |
[const]
Get number of elements in the bag.
Returns: Number of elements.
inline bool |
Get first element. If true is returned, the given reference will be a reference to the element.
Parameters:
element | Reference to hold the element's reference. |
Returns: true, if the reference is valid.
inline bool |
Get last element. If true is returned, the given reference will be a reference to the element.
Parameters:
element | Reference to hold the element's reference. |
Returns: true, if the reference is valid.
inline bool |
Get next element. If true is returned, the given reference will be a reference to the element.
Parameters:
element | Reference to hold the element's reference. |
Returns: true, if the reference is valid.
inline bool |
Get previous element. If true is returned, the given reference will be a reference to the element.
Parameters:
element | Reference to hold the element's reference. |
Returns: true, if the reference is valid.
inline bool |
Get first element. If true is returned, the given references will be references to the key and the element.
Parameters:
element | Reference to hold the element's reference. |
Returns: true, if the reference is valid.
inline bool |
Get last element. If true is returned, the given references will be references to the key and the element.
Parameters:
element | Reference to hold the element's reference. |
Returns: true, if the reference is valid.
inline bool |
Get next element. If true is returned, the given references will be references to the key and the element.
Parameters:
element | Reference to hold the element's reference. |
Returns: true, if the reference is valid.
inline bool |
Get previous element. If true is returned, the given references will be references to the key and the element.
Parameters:
element | Reference to hold the element's reference. |
Returns: true, if the reference is valid.
DictionaryBagNode<K,T>* |
[protected const]
Get DictionaryBagNode for an element.
Parameters:
element | Element. |
Returns: Pointer to DictionaryBagNode or NULL, if element is not in the bag.
DictionaryBagNode<K,T>* |
[protected const]
Get DictionaryBagNode for an element.
Parameters:
key | Element's key. |
Returns: Pointer to DictionaryBagNode or NULL, if element is not in the bag.
void |
[protected]
Remove a DictionaryBagNode.
Parameters:
node | DictionaryBagNode to be removed. |