org.modeshape.graph.query.model
Class Between

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

@Immutable
public class Between
extends Constraint

A constraint that evaluates to true when the value defined by the dynamic operand evaluates to be within the specified range.

See Also:
Serialized Form

Constructor Summary
Between(DynamicOperand operand, StaticOperand lowerBound, StaticOperand upperBound)
          Create a constraint that the values of the supplied dynamic operand are between the lower and upper bounds (inclusive).
Between(DynamicOperand operand, StaticOperand lowerBound, StaticOperand upperBound, boolean includeLowerBound, boolean includeUpperBound)
          Create a constraint that the values of the supplied dynamic operand are between the lower and upper bounds, specifying whether the boundary values are to be included in the range.
 
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)
          
 StaticOperand getLowerBound()
          Get the lower bound operand.
 DynamicOperand getOperand()
          Get the dynamic operand specification.
 StaticOperand getUpperBound()
          Get the upper bound operand.
 int hashCode()
          
 boolean isLowerBoundIncluded()
          Return whether the lower bound is to be included in the results.
 boolean isUpperBoundIncluded()
          Return whether the upper bound is to be included in the results.
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Between

public Between(DynamicOperand operand,
               StaticOperand lowerBound,
               StaticOperand upperBound)
Create a constraint that the values of the supplied dynamic operand are between the lower and upper bounds (inclusive).

Parameters:
operand - the dynamic operand describing the values that are to be constrained
lowerBound - the lower bound of the range
upperBound - the upper bound of the range
Throws:
IllegalArgumentException - if any of the arguments are null

Between

public Between(DynamicOperand operand,
               StaticOperand lowerBound,
               StaticOperand upperBound,
               boolean includeLowerBound,
               boolean includeUpperBound)
Create a constraint that the values of the supplied dynamic operand are between the lower and upper bounds, specifying whether the boundary values are to be included in the range.

Parameters:
operand - the dynamic operand describing the values that are to be constrained
lowerBound - the lower bound of the range
upperBound - the upper bound of the range
includeLowerBound - true if the lower boundary value is not be included
includeUpperBound - true if the upper boundary value is not be included
Throws:
IllegalArgumentException - if any of the arguments are null
Method Detail

getOperand

public final DynamicOperand getOperand()
Get the dynamic operand specification.

Returns:
the dynamic operand; never null

getLowerBound

public StaticOperand getLowerBound()
Get the lower bound operand.

Returns:
the lower bound; never null

getUpperBound

public StaticOperand getUpperBound()
Get the upper bound operand.

Returns:
the upper bound; never null

isLowerBoundIncluded

public boolean isLowerBoundIncluded()
Return whether the lower bound is to be included in the results.

Returns:
true if the lower bound is to be included, or false otherwise

isUpperBoundIncluded

public boolean isUpperBoundIncluded()
Return whether the upper bound is to be included in the results.

Returns:
true if the upper bound is to be included, or false otherwise

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.