Interface ILcdAssocSet

All Superinterfaces:
Serializable
All Known Implementing Classes:
TLcdAssocList

public interface ILcdAssocSet extends Serializable
This interface defines methods for managing and using a non-ordered set of key-value associations. Each association in the set should have a unique key.
See Also:
  • Method Details

    • size

      int size()
      Returns:
      the number of associations in this ILcdAssocSet.
    • keys

      Enumeration keys()
      Returns:
      an enumeration of the keys.
    • elements

      Enumeration elements()
      Returns:
      an enumeration of the values.
    • put

      void put(Object aKey, Object aValue)
      Adds an association having with a given value and a given key to this set. If an association with the same key already exists, it will be replaced by the given one.
      Parameters:
      aKey - the key.
      aValue - the value.
    • getAssocs

      ILcdAssoc[] getAssocs()
      Returns:
      the associations as an array of ILcdAssoc objects.
    • setAssocs

      void setAssocs(ILcdAssoc[] aAssocArray)
      Sets the associations as an array of ILcdAssoc objects.
    • add

      void add(ILcdAssoc aAssoc)
      Adds an association to this set. If an association with the same key already exists, it will be replaced by the given one.
      Parameters:
      aAssoc - the association to be added.
    • remove

      Object remove(Object aKey)
      Removes the association with the given key. If the given association does not exist, no action will be performed.
      Parameters:
      aKey - the key of the association to be removed.
      Returns:
      the value corresponding to the key, or null if the key does not exist.
    • removeAll

      void removeAll()
      Removes all the associations.
    • hasValue

      boolean hasValue(Object aKey)
      Tests if the set has a value for the given key.
      Parameters:
      aKey - the key to look up.
      Returns:
      true if the given key has a corresponding value, false otherwise.
    • getValue

      Object getValue(Object aKey)
      Gets the value associated with the given key.
      Parameters:
      aKey - the key to look up.
      Returns:
      the value corresponding to the key, or null if the key does not exist.
    • cloneAsILcdAssocSet

      ILcdAssocSet cloneAsILcdAssocSet()
      Returns:
      a clone of this ILcdAssocSet.