org.ozoneDB.collections
Class _AbstractOzoneMap_AbstractOzoneNode

java.lang.Object
  extended byorg.ozoneDB.OzoneObject
      extended byorg.ozoneDB.collections._AbstractOzoneMap_AbstractOzoneNode
All Implemented Interfaces:
_AbstractOzoneMap_OzoneNode, java.util.Map.Entry, org.ozoneDB.OzoneCompatible, org.ozoneDB.OzoneCompatibleOrProxy, OzoneMap.Node, org.ozoneDB.OzoneRemote, java.io.Serializable
Direct Known Subclasses:
_NodeTreeMap_OzoneNodeImpl

public class _AbstractOzoneMap_AbstractOzoneNode
extends org.ozoneDB.OzoneObject
implements _AbstractOzoneMap_OzoneNode

Author:
Leo Mekenkamp (mind the anti-sp@m)
See Also:
Serialized Form

Constructor Summary
_AbstractOzoneMap_AbstractOzoneNode(java.lang.Object newKey, java.lang.Object newValue)
          Basic constructor initializes the fields.
 
Method Summary
 boolean equals(java.lang.Object o)
          Compares the specified object with this entry.
 java.lang.Object getKey()
          Get the key corresponding to this entry.
 java.lang.Object getValue()
          Get the value corresponding to this entry.
 int hashCode()
          Returns the hash code of the entry.
 void setKey(java.lang.Object key)
           
 java.lang.Object setValue(java.lang.Object newVal)
          Replaces the value with the specified object.
 java.lang.String toString()
          This provides a string representation of the entry.
 
Methods inherited from class org.ozoneDB.OzoneObject
container, database, deleteRecursive, getHandle, getObjectID, handle, onActivate, onCreate, onDelete, onPassivate, requireWriteLocking, self, setContainer, toXML
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.ozoneDB.OzoneCompatibleOrProxy
getObjectID
 

Constructor Detail

_AbstractOzoneMap_AbstractOzoneNode

public _AbstractOzoneMap_AbstractOzoneNode(java.lang.Object newKey,
                                           java.lang.Object newValue)
Basic constructor initializes the fields.

Parameters:
newKey - the key
newValue - the value
Method Detail

equals

public final boolean equals(java.lang.Object o)
Compares the specified object with this entry. Returns true only if the object is a mapping of identical key and value.

Specified by:
equals in interface java.util.Map.Entry
Parameters:
o - the object to compare
Returns:
true if it is equal

getKey

public final java.lang.Object getKey()
Get the key corresponding to this entry.

Specified by:
getKey in interface java.util.Map.Entry
Returns:
the key

getValue

public final java.lang.Object getValue()
Get the value corresponding to this entry. If you already called Iterator.remove(), the behavior undefined, but in this case it works.

Specified by:
getValue in interface java.util.Map.Entry
Returns:
the value

hashCode

public final int hashCode()
Returns the hash code of the entry. This is defined as the exclusive-or of the hashcodes of the key and value (using 0 for null). In other words, this must be:
(getKey() == null ? 0 : getKey().hashCode())
^ (getValue() == null ? 0 : getValue().hashCode())

Specified by:
hashCode in interface java.util.Map.Entry
Returns:
the hash code

setValue

public java.lang.Object setValue(java.lang.Object newVal)
Replaces the value with the specified object. This writes through to the map, unless you have already called Iterator.remove(). It may be overridden to restrict a null value.

Specified by:
setValue in interface _AbstractOzoneMap_OzoneNode
Parameters:
newVal - the new value to store
Returns:
the old value
Throws:
java.lang.NullPointerException - if the map forbids null values

toString

public final java.lang.String toString()
This provides a string representation of the entry. It is of the form "key=value", where string concatenation is used on key and value.

Returns:
the string representation

setKey

public void setKey(java.lang.Object key)
Specified by:
setKey in interface _AbstractOzoneMap_OzoneNode


Copyright © 2004 The Ozone Database Project - www.ozone-db.org. All Rights Reserved.