ModeShape Distribution 3.0.0.Beta4

org.modeshape.jcr.query.model
Class ArithmeticOperand

java.lang.Object
  extended by org.modeshape.jcr.query.model.ArithmeticOperand
All Implemented Interfaces:
Serializable, DynamicOperand, Operand, ArithmeticOperand, LanguageObject, Visitable

@Immutable
public class ArithmeticOperand
extends Object
implements DynamicOperand, ArithmeticOperand

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)
           
 DynamicOperand getLeft()
          Get the left-hand operand.
 String getOperator()
          Get the operator for this binary operand.
 DynamicOperand getRight()
          Get the right-hand operand.
 int hashCode()
           
 ArithmeticOperator operator()
          Get the operator for this binary 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()
Description copied from interface: DynamicOperand
Get the selector symbols to which this operand applies.

Returns:
the immutable ordered set of non-null selector names used by this operand; never null and never empty

operator

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

Returns:
the operator; never null

getLeft

public DynamicOperand getLeft()
Description copied from interface: ArithmeticOperand
Get the left-hand operand.

Specified by:
getLeft in interface ArithmeticOperand
Returns:
the left-hand operator; never null

getRight

public DynamicOperand getRight()
Description copied from interface: ArithmeticOperand
Get the right-hand operand.

Specified by:
getRight in interface ArithmeticOperand
Returns:
the right-hand operator; never null

getOperator

public String getOperator()
Description copied from interface: ArithmeticOperand
Get the operator for this binary operand.

Specified by:
getOperator in interface ArithmeticOperand
Returns:
the operator; never null

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.Beta4

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