|
Agent System POND 1.2 (28.2.2002) | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.util.Dictionary | +--FIM.Util.ReadOnlyStore
Similar to a Hashtable
, but only allows to set a value once. Removal of entries
or overwriting values is not allowed.
The data is stored in serialized form. Therefore value must implement java.io.Serializable
.
Changes after adding the object to the store are not reflected.
Hashtable
,
Serializable
, Serialized FormConstructor Summary | |
ReadOnlyStore()
Constructs a new, empty read-only store. |
|
ReadOnlyStore(int initialCapacity)
Constructs a new, empty read-only store with the specified initial capacity. |
Method Summary | |
boolean |
contains(Object value)
Tests if some key maps into the specified value in this store. |
boolean |
containsKey(Object key)
Tests if the specified object is a key in this store. |
Enumeration |
elements()
Returns an enumeration of the values in this store. |
Object |
get(Object key)
Returns the value to which the specified key is mapped in this table. |
boolean |
isEmpty()
Tests if this store maps no keys to values. |
Enumeration |
keys()
Returns an enumeration of the keys in this store. |
Object |
put(Object key,
Object value)
Maps the specified key to the specified
value in this table. |
Object |
remove(Object key)
Removes an object from the store. |
int |
size()
Returns the number of keys in this store. |
Methods inherited from class java.lang.Object |
|
Constructor Detail |
public ReadOnlyStore()
public ReadOnlyStore(int initialCapacity)
initialCapacity
- the initial capacityIllegalArgumentException
- if the initial capacity is less than oneMethod Detail |
public boolean contains(Object value)
value
- a value to search fortrue
if and only if some key maps to the value
argument
in this store as determined by the equals method, false
otherwiseNullPointerException
- if the value is null
containsKey(Object)
public boolean containsKey(Object key)
key
- possible keytrue
if and only if the specified object is a key in this hashtable,
as determined by the equals method, false
otherwisecontains(Object)
public Enumeration elements()
elements
in class Dictionary
Enumeration
,
keys()
public Enumeration keys()
keys
in class Dictionary
Enumeration
,
elements()
public boolean isEmpty()
isEmpty
in class Dictionary
true
if this store maps no keys to values, false
otherwise.public int size()
size
in class Dictionary
public Object get(Object key)
get
in class Dictionary
key
- a key in the htable.null
if the key is not mapped to any value in
this table.put(Object, Object)
public Object remove(Object key)
remove
in class Dictionary
key
- ignoredIllegalStateException
- alwayspublic Object put(Object key, Object value)
key
to the specified
value
in this table. Neither the key nor the
value can be null
. The value must be Serializable
. The key
may not currently exist in the table (Overwriting value is prohibited).
The value can be retrieved by calling the get
method
with a key that is equal to the original key.
put
in class Dictionary
key
- the table keyvalue
- the valuenull
, as overwriting is not allowedNullPointerException
- if the key or value is null
.IllegalArgumentException
- if the value is not serializable.Object.equals(Object)
,
get(Object)
|
Agent System POND 1.2 (28.2.2002) | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |