|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--container.HashDecorable
This class should typically be extended so that it implements other interfaces besides Decorable. So far, it stores only decorations but no data! Each instance of the class is a position that stores its attributes and their values in a hash table. We assume there will be a lot of positions, and probably not very many attributes per position, so we try to keep the hash table at each position small or nonexistent.
| Field Summary | |
protected java.util.Map |
m
Maps attributes of this object to their values. |
| Constructor Summary | |
HashDecorable()
Constructor. |
|
| Method Summary | |
java.lang.Object |
get(container.Attribute a)
|
boolean |
has(container.Attribute a)
Does this object currently have any value for this attribute? |
java.lang.Object |
put(container.Attribute a,
java.lang.Object o)
Makes this object store o as the value of attribute a. |
java.lang.Object |
remove(container.Attribute a)
Removes attribute a and its associated value from this object. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected java.util.Map m
| Constructor Detail |
public HashDecorable()
| Method Detail |
public boolean has(container.Attribute a)
Decorable
has in interface Decorablepublic java.lang.Object get(container.Attribute a)
get in interface Decorable
public java.lang.Object put(container.Attribute a,
java.lang.Object o)
Decorable
put in interface Decorablepublic java.lang.Object remove(container.Attribute a)
Decorable
remove in interface Decorable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||