public class HashStructureAdapter
extends java.lang.Object
HashStructure
storage. This base implementation provides
a standard implementation of equals(..) and copyTo(..) that most
subclasses can inherit without overriding.Modifier and Type | Field and Description |
---|---|
protected HashStructure |
_hash |
Modifier | Constructor and Description |
---|---|
protected |
HashStructureAdapter(HashStructure hash)
The specified HashStructure must not be null.
|
Modifier and Type | Method and Description |
---|---|
void |
addStructureChangeListener(StructureChangeListener sl)
Adds a listener that will be notified when the hash structure this
object is adapting is modified.
|
boolean |
containsKey(java.lang.String key)
Convenience method for testing if the specified key, which is
relative to the HashStructure that this HashStructureAdapter
attaches to, currently exists in the HashStructure.
|
java.lang.Object |
copyTo(java.lang.Object target)
Copy support.
|
protected void |
copyToImpl(HashStructureAdapter copy)
This method implements the copy operation.
|
boolean |
equals(java.lang.Object o)
Equals support.
|
protected boolean |
equalsImpl(HashStructureAdapter other)
This method implements the equals operation.
|
protected static HashStructure |
findOrCreate(PropertyStorage storage,
java.lang.String name)
This method tries to find an existing instance of a HashStructure
by the specified name.
|
void |
forcedCopyTo(HashStructureAdapter copy)
Copies the HashStructure of this adapter to the HashStructure of
the specified copy.
|
protected HashStructure |
getHashStructure()
Returns the HashStructure this adapter is adapting.
|
void |
removeStructureChangeListener(StructureChangeListener sl)
Removes a listener from the hash structure this object is adapting.
|
protected void |
useObjectEquals()
Deprecated.
Do not use this method. It's only a transition
mechansim that will not be supported in production.
|
protected final HashStructure _hash
protected HashStructureAdapter(HashStructure hash)
java.lang.IllegalArgumentException
- if the specified
HashStructure is null.protected static HashStructure findOrCreate(PropertyStorage storage, java.lang.String name)
This method is guaranteed to return a non-null.
protected final void useObjectEquals()
public java.lang.Object copyTo(java.lang.Object target)
java.lang.IllegalArgumentException
- if the specified target is
null or not the exact same type as this instance.public final void forcedCopyTo(HashStructureAdapter copy)
copy
- The target of the copy operation.protected final void copyToImpl(HashStructureAdapter copy)
copyTo(Object)
method can call this method
to skip the validation logic implemented in copyTo(Object)
.public boolean containsKey(java.lang.String key)
key
- The key to test for existence.true
if the key exists, false
otherwise.public void addStructureChangeListener(StructureChangeListener sl)
If the listener is already attached, this method will do nothing.
sl
- a listener to attach to the hash structure.java.lang.IllegalArgumentException
- if sl is null.public void removeStructureChangeListener(StructureChangeListener sl)
sl
- a listener to remove from the hash structure.protected HashStructure getHashStructure()
public boolean equals(java.lang.Object o)
_hash
, this base equals implementation should be
sufficient and not need to be overridden.equals
in class java.lang.Object
protected final boolean equalsImpl(HashStructureAdapter other)
equals(Object)
can call this method to skip the
validation logic in equals(Object)
.