org.modeshape.graph.query.model
Class ArithmeticOperand

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

@Immutable
public class ArithmeticOperand
extends 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)
          
 DynamicOperand getLeft()
          Get the left-hand operand.
 ArithmeticOperator getOperator()
          Get the operator for this binary operand.
 DynamicOperand getRight()
          Get the right-hand operand.
 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

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

getOperator

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

Returns:
the operator; never null

getLeft

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

Returns:
the left-hand operator; never null

getRight

public DynamicOperand getRight()
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.

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.