org.planx.xmlstore.references
Class ContentValueReference

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

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

A ValueReference created from a content hash of a Node (currently MD5). This gives a unique location independent ValueReference that can be computed anywhere based on Node data.

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

Field Summary
static byte CLASS_ID
           
 
Constructor Summary
ContentValueReference(Node node)
          Creates a new ContentValueReference by computing a content hash of the tree rooted at the specified Node.
 
Method Summary
 Identifier asIdentifier()
          Returns this reference as an Identifier acceptable by the routing layer.
 int compareTo(ContentValueReference vref)
           
 boolean equals(Object o)
          Returns true if and only if the specified object is also a ContentValueReference and it represents the same content hash as this ContentValueReference.
static Discriminator<ContentValueReference> getDiscriminator()
           
static Discriminator<ContentValueReference> getDiscriminator(Memory memory)
           
static Streamer<ContentValueReference> getStreamer()
           
 int hashCode()
           
static ContentValueReference reference(Node node, ReferenceListener listener)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

CLASS_ID

public static final byte CLASS_ID
See Also:
Constant Field Values
Constructor Detail

ContentValueReference

public ContentValueReference(Node node)
Creates a new ContentValueReference by computing a content hash of the tree rooted at the specified Node.

Method Detail

reference

public static ContentValueReference reference(Node node,
                                              ReferenceListener listener)

asIdentifier

public Identifier asIdentifier()
Returns this reference as an Identifier acceptable by the routing layer.

Specified by:
asIdentifier in interface ValueReference

equals

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

Overrides:
equals in class Object

compareTo

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

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

getStreamer

public static Streamer<ContentValueReference> getStreamer()

getDiscriminator

public static Discriminator<ContentValueReference> getDiscriminator()

getDiscriminator

public static Discriminator<ContentValueReference> getDiscriminator(Memory memory)


Copyright © 2010. All Rights Reserved.