org.modeshape.graph.query.model
Class ArithmeticOperand

java.lang.Object
  extended by org.modeshape.graph.query.model.ArithmeticOperand
All Implemented Interfaces:
Serializable, DynamicOperand, LanguageObject, Visitable
Direct Known Subclasses:
JcrArithmeticOperand

@Immutable
public class ArithmeticOperand
extends Object
implements DynamicOperand

A dynamic operand that represents a (binary) arithmetic operation upon one or more other operands, used in Comparison and Ordering components.

See Also:
Serialized Form

Constructor Summary
ArithmeticOperand(DynamicOperand left, ArithmeticOperator operator, DynamicOperand right)
          Create a arithmetic dynamic operand that operates upon the supplied operand(s).
 
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()
          
 DynamicOperand left()
          Get the left-hand operand.
 ArithmeticOperator operator()
          Get the operator for this binary operand.
 DynamicOperand right()
          Get the right-hand operand.
 Set<SelectorName> selectorNames()
          Get the selector symbols to which this operand applies.
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ArithmeticOperand

public ArithmeticOperand(DynamicOperand left,
                         ArithmeticOperator operator,
                         DynamicOperand right)
Create a arithmetic dynamic operand that operates upon the supplied operand(s).

Parameters:
left - the left-hand-side operand
operator - the arithmetic operator; may not be null
right - the right-hand-side operand
Throws:
IllegalArgumentException - if any of the arguments is null
Method Detail

selectorNames

public Set<SelectorName> selectorNames()
Get the selector symbols to which this operand applies.

Specified by:
selectorNames in interface DynamicOperand
Returns:
the immutable ordered set of non-null selector names used by this operand; never null and never empty
See Also:
DynamicOperand.selectorNames()

operator

public ArithmeticOperator operator()
Get the operator for this binary operand.

Returns:
the operator; never null

left

public DynamicOperand left()
Get the left-hand operand.

Returns:
the left-hand operator; never null

right

public DynamicOperand right()
Get the right-hand operand.

Returns:
the right-hand operator; never null

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.