public class TLcdAssocList extends Object implements ILcdAssocSet
ILcdAssocSet
.Constructor and Description |
---|
TLcdAssocList()
Creates a new empty TLcdAssocList.
|
TLcdAssocList(ILcdAssoc[] aAssocArray)
Creates a new
TLcdAssocList from an array of ILcdAssoc
objects. |
TLcdAssocList(ILcdAssocSet aAssocSet)
Creates a new
TLcdAssocList that has the same key/value pairs
as the the given ILcdAssocSet. |
TLcdAssocList(Object[] aKeys,
Object[] aValues)
Creates a new
TLcdAssocList from an array of keys and an array of values. |
Modifier and Type | Method and Description |
---|---|
void |
add(ILcdAssoc aAssoc)
Adds an association to this set.
|
ILcdAssocSet |
cloneAsILcdAssocSet() |
Enumeration |
elements() |
int |
findIndex(Object aKey) |
ILcdAssoc[] |
getAssocs() |
Object |
getValue(Object aKey)
Gets the value associated with the given key.
|
boolean |
hasValue(Object aKey)
Tests if the set has a value for the given key.
|
Enumeration |
keys() |
void |
put(Object aKey,
Object aValue)
Adds an association having with a given value and a given key to this set.
|
Object |
remove(Object aKey)
Removes the association with the given key.
|
void |
removeAll()
Removes all the associations.
|
void |
setAssocs(ILcdAssoc[] aAssocArray)
Sets the associations as an array of
ILcdAssoc objects. |
int |
size() |
public TLcdAssocList()
public TLcdAssocList(Object[] aKeys, Object[] aValues)
TLcdAssocList
from an array of keys and an array of values.
If the arrays have different sizes, the longest one will be truncated.aKeys
- the list of keys.aValues
- the corresponding list of values.public TLcdAssocList(ILcdAssocSet aAssocSet)
TLcdAssocList
that has the same key/value pairs
as the the given ILcdAssocSet. The ILcdAssoc objects are copied as well.aAssocSet
- the ILcdAssoc to be copied.public TLcdAssocList(ILcdAssoc[] aAssocArray)
TLcdAssocList
from an array of ILcdAssoc
objects.aAssocArray
- the ILcdAssoc objects to be inserted.public int size()
size
in interface ILcdAssocSet
ILcdAssocSet
.public Enumeration keys()
keys
in interface ILcdAssocSet
public Enumeration elements()
elements
in interface ILcdAssocSet
public ILcdAssoc[] getAssocs()
getAssocs
in interface ILcdAssocSet
ILcdAssoc
objects.public void setAssocs(ILcdAssoc[] aAssocArray)
ILcdAssocSet
ILcdAssoc
objects.setAssocs
in interface ILcdAssocSet
public void add(ILcdAssoc aAssoc)
ILcdAssocSet
add
in interface ILcdAssocSet
aAssoc
- the association to be added.public void put(Object aKey, Object aValue)
ILcdAssocSet
put
in interface ILcdAssocSet
aKey
- the key.aValue
- the value.public Object remove(Object aKey)
ILcdAssocSet
remove
in interface ILcdAssocSet
aKey
- the key of the association to be removed.null
if the
key does not exist.public void removeAll()
ILcdAssocSet
removeAll
in interface ILcdAssocSet
public int findIndex(Object aKey)
public boolean hasValue(Object aKey)
ILcdAssocSet
hasValue
in interface ILcdAssocSet
aKey
- the key to look up.public Object getValue(Object aKey)
ILcdAssocSet
getValue
in interface ILcdAssocSet
aKey
- the key to look up.null
if the
key does not exist.public ILcdAssocSet cloneAsILcdAssocSet()
cloneAsILcdAssocSet
in interface ILcdAssocSet
ILcdAssocSet
.