org.modeshape.graph.query.model
Class ReferenceValue

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

@Immutable
public class ReferenceValue
extends DynamicOperand

A dynamic operand that evaluates to the value(s) of a single or any reference property on a selector, used in a Comparison constraint.

See Also:
Serialized Form

Constructor Summary
ReferenceValue(SelectorName selectorName)
          Create a dynamic operand that evaluates to all of the reference values of the node identified by the selector.
ReferenceValue(SelectorName selectorName, String propertyName)
          Create a dynamic operand that evaluates to the values of a single reference property of the node identified by the 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 getPropertyName()
          Get the name of the one reference property.
 SelectorName getSelectorName()
          Get the selector symbol upon which this operand applies.
 int hashCode()
          
 String toString()
          
 
Methods inherited from class org.modeshape.graph.query.model.DynamicOperand
getSelectorNames
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ReferenceValue

public ReferenceValue(SelectorName selectorName)
Create a dynamic operand that evaluates to all of the reference values of the node identified by the selector.

Parameters:
selectorName - the name of the selector
Throws:
IllegalArgumentException - if the selector name is null

ReferenceValue

public ReferenceValue(SelectorName selectorName,
                      String propertyName)
Create a dynamic operand that evaluates to the values of a single reference property of the node identified by the selector.

Parameters:
selectorName - the name of the selector
propertyName - the name of the property
Throws:
IllegalArgumentException - if the selector name is null
Method Detail

getSelectorName

public SelectorName getSelectorName()
Get the selector symbol upon which this operand applies.

Returns:
the one selector names used by this operand; never null

getPropertyName

public final String getPropertyName()
Get the name of the one reference property.

Returns:
the property name; or null if this operand applies to any reference property

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.