org.modeshape.graph.query.model
Class SameNodeJoinCondition

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

@Immutable
public class SameNodeJoinCondition
extends Object
implements 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)
          
 int hashCode()
          
 SelectorName selector1Name()
          Get the selector name for the first side of the join condition.
 SelectorName selector2Name()
          Get the selector name for the second side of the join condition.
 String selector2Path()
          Get the path for the node being used, relative to the second selector.
 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

selector1Name

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

Returns:
the name of the first selector; never null

selector2Name

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

Returns:
the name of the second selector; never null

selector2Path

public final String selector2Path()
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.

Specified by:
accept in interface Visitable
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.