org.planx.xmlstore.references
Class ValueReference

java.lang.Object
  extended by org.planx.xmlstore.references.ValueReference
All Implemented Interfaces:
Serializable, Comparable<ValueReference>, Reference

public class ValueReference
extends Object
implements Reference, Serializable, Comparable<ValueReference>

A unique location independent Reference computed from a content hash of a Node (currently MD5). Use reference(Node) to create a ValueReference.

Author:
Kasper Bøgebjerg, Henning Niss, Thomas Ambus
See Also:
Serialized Form

Field Summary
static int LENGTH
           
 
Method Summary
 Identifier asIdentifier()
           
 int compareTo(ValueReference vref)
           
 boolean equals(Object o)
          Returns true if and only if the specified object is also a ValueReference and it represents the same content hash as this ValueReference.
static org.planx.msd.Discriminator<ValueReference> getDiscriminator()
           
static org.planx.msd.Discriminator<ValueReference> getDiscriminator(org.planx.msd.Memory memory)
           
static SizeStreamer<ValueReference> getStreamer()
           
 int hashCode()
           
static ValueReference reference(Node n)
          Creates a ValueReference by computing a content hash of the tree rooted at the specified node.
 String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

LENGTH

public static final int LENGTH
See Also:
Constant Field Values
Method Detail

reference

public static ValueReference reference(Node n)
Creates a ValueReference by computing a content hash of the tree rooted at the specified node. If the node already has a ValueReference set (by some internal means) this ValueReference will be returned instead of computing a new one.


asIdentifier

public Identifier asIdentifier()

equals

public boolean equals(Object o)
Returns true if and only if the specified object is also a ValueReference and it represents the same content hash as this ValueReference.

Overrides:
equals in class Object

compareTo

public int compareTo(ValueReference vref)
Specified by:
compareTo in interface Comparable<ValueReference>

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

getStreamer

public static SizeStreamer<ValueReference> getStreamer()

getDiscriminator

public static org.planx.msd.Discriminator<ValueReference> getDiscriminator()

getDiscriminator

public static org.planx.msd.Discriminator<ValueReference> getDiscriminator(org.planx.msd.Memory memory)


Copyright © 2004-2005 Plan-X. All Rights Reserved.