ModeShape Distribution 3.0.0.CR1

org.modeshape.jcr.query.model
Class SameNodeJoinCondition

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

@Immutable
public class SameNodeJoinCondition
extends Object
implements JoinCondition, SameNodeJoinCondition

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)
           
 String getSelector1Name()
           
 String getSelector2Name()
           
 String getSelector2Path()
           
 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 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

getSelector1Name

public String getSelector1Name()
Specified by:
getSelector1Name in interface SameNodeJoinCondition

getSelector2Name

public String getSelector2Name()
Specified by:
getSelector2Name in interface SameNodeJoinCondition

getSelector2Path

public final String getSelector2Path()
Specified by:
getSelector2Path in interface SameNodeJoinCondition

toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

accept

public void accept(Visitor visitor)
Description copied from interface: Visitable
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

ModeShape Distribution 3.0.0.CR1

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