|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object nz.ac.waikato.jdsl.core.ref.HashtableDecorable
public class HashtableDecorable
An implementation of Decorable using a hashtable.
Constructor Summary | |
---|---|
HashtableDecorable()
|
Method Summary | |
---|---|
ObjectIterator |
attributes()
Returns an iterator over all the attributes attached to this decorable. |
protected int |
capacity()
Gets the capacity of this hashtable. |
java.lang.Object |
destroy(java.lang.Object key)
Destroys a decoration. |
java.lang.Object |
get(java.lang.Object key)
Gets the value of a decoration. |
boolean |
has(java.lang.Object key)
Tests if a decoration exists. |
protected int |
hash(java.lang.Object o)
Gets the hashcode for a particular object. |
protected void |
rehash()
|
void |
set(java.lang.Object key,
java.lang.Object value)
Sets the value of a decoration. |
protected int |
size()
Gets the size. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HashtableDecorable()
Method Detail |
---|
public final java.lang.Object destroy(java.lang.Object key) throws InvalidAttributeException, CoreException
destroy
in interface Decorable
key
- The attribute to destroy (eliminate)
InvalidAttributeException
- if the decoration does not exist.
CoreException
public final boolean has(java.lang.Object key)
has
in interface Decorable
key
- The attribute for which to check this decorable
objectpublic final void set(java.lang.Object key, java.lang.Object value) throws InvalidAttributeException, CoreException
set
in interface Decorable
key
- The attribute to set (and create if necessary)value
- the new value of the attribute in the decorable
object
InvalidAttributeException
- if the attribute is invalid
(i.e. wrong class)
CoreException
public final java.lang.Object get(java.lang.Object key) throws InvalidAttributeException, CoreException
get
in interface Decorable
key
- The attribute of which to attempt to get the value
InvalidAttributeException
- if attr
is not
set or is otherwise invalid (i.e. wrong class)
CoreException
public final ObjectIterator attributes()
Decorable
attributes
in interface Decorable
ObjectIterator
over all the attributes
attached to this decorableprotected final int size()
protected final int capacity()
protected final void rehash()
protected final int hash(java.lang.Object o)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |