Class TLcdAssocList

java.lang.Object
com.luciad.util.TLcdAssocList
All Implemented Interfaces:
ILcdAssocSet, Serializable

public class TLcdAssocList extends Object implements ILcdAssocSet
This class provides an implementation of ILcdAssocSet.
See Also:
  • Constructor Details

    • TLcdAssocList

      public TLcdAssocList()
      Creates a new empty TLcdAssocList.
    • TLcdAssocList

      public TLcdAssocList(Object[] aKeys, Object[] aValues)
      Creates a new TLcdAssocList from an array of keys and an array of values. If the arrays have different sizes, the longest one will be truncated.
      Parameters:
      aKeys - the list of keys.
      aValues - the corresponding list of values.
    • TLcdAssocList

      public TLcdAssocList(ILcdAssocSet aAssocSet)
      Creates a new TLcdAssocList that has the same key/value pairs as the the given ILcdAssocSet. The ILcdAssoc objects are copied as well.
      Parameters:
      aAssocSet - the ILcdAssoc to be copied.
    • TLcdAssocList

      public TLcdAssocList(ILcdAssoc[] aAssocArray)
      Creates a new TLcdAssocList from an array of ILcdAssoc objects.
      Parameters:
      aAssocArray - the ILcdAssoc objects to be inserted.
  • Method Details

    • size

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

      public Enumeration keys()
      Specified by:
      keys in interface ILcdAssocSet
      Returns:
      an enumeration of the keys.
    • elements

      public Enumeration elements()
      Specified by:
      elements in interface ILcdAssocSet
      Returns:
      an enumeration of the values.
    • getAssocs

      public ILcdAssoc[] getAssocs()
      Specified by:
      getAssocs in interface ILcdAssocSet
      Returns:
      the associations as an array of ILcdAssoc objects.
    • setAssocs

      public void setAssocs(ILcdAssoc[] aAssocArray)
      Description copied from interface: ILcdAssocSet
      Sets the associations as an array of ILcdAssoc objects.
      Specified by:
      setAssocs in interface ILcdAssocSet
    • add

      public void add(ILcdAssoc aAssoc)
      Description copied from interface: ILcdAssocSet
      Adds an association to this set. If an association with the same key already exists, it will be replaced by the given one.
      Specified by:
      add in interface ILcdAssocSet
      Parameters:
      aAssoc - the association to be added.
    • put

      public void put(Object aKey, Object aValue)
      Description copied from interface: ILcdAssocSet
      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.
      Specified by:
      put in interface ILcdAssocSet
      Parameters:
      aKey - the key.
      aValue - the value.
    • remove

      public Object remove(Object aKey)
      Description copied from interface: ILcdAssocSet
      Removes the association with the given key. If the given association does not exist, no action will be performed.
      Specified by:
      remove in interface ILcdAssocSet
      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

      public void removeAll()
      Description copied from interface: ILcdAssocSet
      Removes all the associations.
      Specified by:
      removeAll in interface ILcdAssocSet
    • findIndex

      public int findIndex(Object aKey)
    • hasValue

      public boolean hasValue(Object aKey)
      Description copied from interface: ILcdAssocSet
      Tests if the set has a value for the given key.
      Specified by:
      hasValue in interface ILcdAssocSet
      Parameters:
      aKey - the key to look up.
      Returns:
      true if the given key has a corresponding value, false otherwise.
    • getValue

      public Object getValue(Object aKey)
      Description copied from interface: ILcdAssocSet
      Gets the value associated with the given key.
      Specified by:
      getValue in interface ILcdAssocSet
      Parameters:
      aKey - the key to look up.
      Returns:
      the value corresponding to the key, or null if the key does not exist.
    • cloneAsILcdAssocSet

      public ILcdAssocSet cloneAsILcdAssocSet()
      Specified by:
      cloneAsILcdAssocSet in interface ILcdAssocSet
      Returns:
      a clone of this ILcdAssocSet.