Package com.luciad.util
Class TLcdAssocList
java.lang.Object
com.luciad.util.TLcdAssocList
- All Implemented Interfaces:
ILcdAssocSet,Serializable
This class provides an implementation of
ILcdAssocSet.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new empty TLcdAssocList.TLcdAssocList(ILcdAssoc[] aAssocArray) Creates a newTLcdAssocListfrom an array ofILcdAssocobjects.TLcdAssocList(ILcdAssocSet aAssocSet) Creates a newTLcdAssocListthat has the same key/value pairs as the the given ILcdAssocSet.TLcdAssocList(Object[] aKeys, Object[] aValues) Creates a newTLcdAssocListfrom an array of keys and an array of values. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds an association to this set.elements()intGets the value associated with the given key.booleanTests if the set has a value for the given key.keys()voidAdds an association having with a given value and a given key to this set.Removes the association with the given key.voidRemoves all the associations.voidSets the associations as an array ofILcdAssocobjects.intsize()
-
Constructor Details
-
TLcdAssocList
public TLcdAssocList()Creates a new empty TLcdAssocList. -
TLcdAssocList
Creates a newTLcdAssocListfrom 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
Creates a newTLcdAssocListthat 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
Creates a newTLcdAssocListfrom an array ofILcdAssocobjects.- Parameters:
aAssocArray- the ILcdAssoc objects to be inserted.
-
-
Method Details
-
size
public int size()- Specified by:
sizein interfaceILcdAssocSet- Returns:
- the number of associations in this
ILcdAssocSet.
-
keys
- Specified by:
keysin interfaceILcdAssocSet- Returns:
- an enumeration of the keys.
-
elements
- Specified by:
elementsin interfaceILcdAssocSet- Returns:
- an enumeration of the values.
-
getAssocs
- Specified by:
getAssocsin interfaceILcdAssocSet- Returns:
- the associations as an array of
ILcdAssocobjects.
-
setAssocs
Description copied from interface:ILcdAssocSetSets the associations as an array ofILcdAssocobjects.- Specified by:
setAssocsin interfaceILcdAssocSet
-
add
Description copied from interface:ILcdAssocSetAdds an association to this set. If an association with the same key already exists, it will be replaced by the given one.- Specified by:
addin interfaceILcdAssocSet- Parameters:
aAssoc- the association to be added.
-
put
Description copied from interface:ILcdAssocSetAdds 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:
putin interfaceILcdAssocSet- Parameters:
aKey- the key.aValue- the value.
-
remove
Description copied from interface:ILcdAssocSetRemoves the association with the given key. If the given association does not exist, no action will be performed.- Specified by:
removein interfaceILcdAssocSet- Parameters:
aKey- the key of the association to be removed.- Returns:
- the value corresponding to the key, or
nullif the key does not exist.
-
removeAll
public void removeAll()Description copied from interface:ILcdAssocSetRemoves all the associations.- Specified by:
removeAllin interfaceILcdAssocSet
-
findIndex
-
hasValue
Description copied from interface:ILcdAssocSetTests if the set has a value for the given key.- Specified by:
hasValuein interfaceILcdAssocSet- Parameters:
aKey- the key to look up.- Returns:
- true if the given key has a corresponding value, false otherwise.
-
getValue
Description copied from interface:ILcdAssocSetGets the value associated with the given key.- Specified by:
getValuein interfaceILcdAssocSet- Parameters:
aKey- the key to look up.- Returns:
- the value corresponding to the key, or
nullif the key does not exist.
-
cloneAsILcdAssocSet
- Specified by:
cloneAsILcdAssocSetin interfaceILcdAssocSet- Returns:
- a clone of this
ILcdAssocSet.
-