org.apache.jackrabbit.core
Class NodeId

java.lang.Object
  extended byorg.apache.jackrabbit.core.ItemId
      extended byorg.apache.jackrabbit.core.NodeId
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
NodeReferencesId

public class NodeId
extends ItemId

Node identifier. An instance of this class identifies a node using its UUID. Once created a node identifier instance is immutable.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.apache.jackrabbit.core.ItemId
hash
 
Constructor Summary
NodeId(String uuid)
          Creates a node identifier instance for the identified node.
 
Method Summary
 boolean denotesNode()
          Returns true as this class represents a node identifier, not a property identifier.
 boolean equals(Object obj)
          Compares node identifiers for equality.
 String getUUID()
          Returns the UUID of the identified node.
 int hashCode()
          Returns the hash code of the node UUID.
 String toString()
          Returns the node UUID.
static NodeId valueOf(String s)
          Returns a NodeId holding the value of the specified string.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NodeId

public NodeId(String uuid)
Creates a node identifier instance for the identified node.

Parameters:
uuid - node UUID
Method Detail

denotesNode

public boolean denotesNode()
Returns true as this class represents a node identifier, not a property identifier.

Specified by:
denotesNode in class ItemId
Returns:
always true
See Also:
ItemId.denotesNode()

getUUID

public String getUUID()
Returns the UUID of the identified node.

Returns:
node UUID

valueOf

public static NodeId valueOf(String s)
                      throws IllegalArgumentException
Returns a NodeId holding the value of the specified string. The string must be in the format returned by the NodeId.toString() method.

Parameters:
s - a String containing the NodeId representation to be parsed.
Returns:
the NodeId represented by the argument
Throws:
IllegalArgumentException - if the specified string can not be parsed as a NodeId.
See Also:
toString()

equals

public boolean equals(Object obj)
Compares node identifiers for equality.

Parameters:
obj - other object
Returns:
true if the given object is a node identifier instance that identifies the same node as this identifier, false otherwise
See Also:
Object.equals(Object)

toString

public String toString()
Returns the node UUID.

Returns:
node UUID
See Also:
Object.toString()

hashCode

public int hashCode()
Returns the hash code of the node UUID. The computed hash code is memorized for better performance.

Returns:
hash code
See Also:
Object.hashCode()


Copyright © 2004-2005 The Apache Software Foundation. All Rights Reserved.