org.planx.xmlstore.references
Class RelativeReference<R>

java.lang.Object
  extended by org.planx.xmlstore.references.RelativeReference<R>
All Implemented Interfaces:
Reference
Direct Known Subclasses:
RelativeDualReference

public class RelativeReference<R>
extends Object
implements Reference

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

Author:
Thomas Ambus

Constructor Summary
RelativeReference(R root)
           
RelativeReference(RelativeReference<R> parent, int childIndex)
           
RelativeReference(R root, 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.
 int getIndex()
           
 int[] getPath()
           
 R getRoot()
           
 int hashCode()
           
 boolean isRoot()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RelativeReference

public RelativeReference(R root)

RelativeReference

public RelativeReference(R root,
                         int childIndex)

RelativeReference

public RelativeReference(RelativeReference<R> parent,
                         int childIndex)
Method Detail

isRoot

public boolean isRoot()

getRoot

public R getRoot()

getIndex

public int getIndex()

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


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