org.modeshape.graph.query.model
Class SameNodeJoinCondition

java.lang.Object
  extended by org.modeshape.graph.query.model.JoinCondition
      extended by org.modeshape.graph.query.model.SameNodeJoinCondition
All Implemented Interfaces:
Serializable, LanguageObject, Visitable

@Immutable
public class SameNodeJoinCondition
extends JoinCondition

A join condition that tests whether two nodes are the same nodes (that is, have the same identifier or have the same relative path from the nearest ancestor with an identifiers).

See Also:
Serialized Form

Constructor Summary
SameNodeJoinCondition(SelectorName selector1Name, SelectorName selector2Name)
          Create a join condition that determines whether the node identified by the first selector is the same as the node identified by the second selector.
SameNodeJoinCondition(SelectorName selector1Name, SelectorName selector2Name, String selector2Path)
          Create a join condition that determines whether the node identified by the first selector is the same as the node at the given path relative to the node identified by the second selector.
 
Method Summary
 void accept(Visitor visitor)
          Accept the supplied visitor, which should call back to the visitor to complete the double-dispatch operation.
 boolean equals(Object obj)
          
 SelectorName getSelector1Name()
          Get the selector name for the first side of the join condition.
 SelectorName getSelector2Name()
          Get the selector name for the second side of the join condition.
 String getSelector2Path()
          Get the path for the node being used, relative to the second selector.
 int hashCode()
          
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SameNodeJoinCondition

public SameNodeJoinCondition(SelectorName selector1Name,
                             SelectorName selector2Name,
                             String selector2Path)
Create a join condition that determines whether the node identified by the first selector is the same as the node at the given path relative to the node identified by the second selector.

Parameters:
selector1Name - the name of the first selector
selector2Name - the name of the second selector
selector2Path - the relative path from the second selector locating the node being compared with the first selector
Throws:
IllegalArgumentException - if the path or either selector name is null

SameNodeJoinCondition

public SameNodeJoinCondition(SelectorName selector1Name,
                             SelectorName selector2Name)
Create a join condition that determines whether the node identified by the first selector is the same as the node identified by the second selector.

Parameters:
selector1Name - the name of the first selector
selector2Name - the name of the second selector
Throws:
IllegalArgumentException - if either selector name is null
Method Detail

getSelector1Name

public final SelectorName getSelector1Name()
Get the selector name for the first side of the join condition.

Returns:
the name of the first selector; never null

getSelector2Name

public final SelectorName getSelector2Name()
Get the selector name for the second side of the join condition.

Returns:
the name of the second selector; never null

getSelector2Path

public final String getSelector2Path()
Get the path for the node being used, relative to the second selector.

Returns:
the relative path to the node; may be null if the second selector is the node being used

toString

public String toString()

Overrides:
toString in class Object
See Also:
Object.toString()

hashCode

public int hashCode()

Overrides:
hashCode in class Object
See Also:
Object.hashCode()

equals

public boolean equals(Object obj)

Overrides:
equals in class Object
See Also:
Object.equals(java.lang.Object)

accept

public void accept(Visitor visitor)
Accept the supplied visitor, which should call back to the visitor to complete the double-dispatch operation.

Parameters:
visitor - the visitor; never null
See Also:
Visitable.accept(org.modeshape.graph.query.model.Visitor)


Copyright © 2008-2010 JBoss, a division of Red Hat. All Rights Reserved.