org.planx.xmlstore.references
Class RelativeReference

java.lang.Object
  extended by org.planx.xmlstore.references.RelativeReference
All Implemented Interfaces:
Serializable, Reference

public class RelativeReference
extends Object
implements Reference, Serializable

A RelativeReference consists of a Reference and a path. The path is an integer array specifying, in order from the origin, the indexes of children to visit in order to reach the Node identified by this RelativeReference.

Author:
Thomas Ambus
See Also:
Serialized Form

Field Summary
static byte CLASS_ID
           
 
Constructor Summary
RelativeReference(Reference root)
           
RelativeReference(Reference root, int childIndex)
           
RelativeReference(Reference root, int[] path)
           
RelativeReference(RelativeReference parent, int childIndex)
           
 
Method Summary
 boolean equals(Object o)
          Returns true if and only if the specified object is a RelativeReference consisting of a root equal to the root of this reference, and a path equal to the path of this reference.
static Discriminator<RelativeReference> getDiscriminator()
           
static Discriminator<RelativeReference> getDiscriminator(Memory memory)
           
 int[] getPath()
           
 Reference getRoot()
           
static Streamer<RelativeReference> getStreamer()
           
 int hashCode()
           
 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

RelativeReference

public RelativeReference(Reference root)

RelativeReference

public RelativeReference(Reference root,
                         int[] path)

RelativeReference

public RelativeReference(Reference root,
                         int childIndex)

RelativeReference

public RelativeReference(RelativeReference parent,
                         int childIndex)
Method Detail

getRoot

public Reference getRoot()

getPath

public int[] getPath()

equals

public boolean equals(Object o)
Returns true if and only if the specified object is a RelativeReference consisting of a root equal to the root of this reference, and a path equal to the path of this reference.

Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

getStreamer

public static Streamer<RelativeReference> getStreamer()

getDiscriminator

public static Discriminator<RelativeReference> getDiscriminator()

getDiscriminator

public static Discriminator<RelativeReference> getDiscriminator(Memory memory)


Copyright © 2010. All Rights Reserved.