org.apache.sandesha2.util
Class Range

java.lang.Object
  extended by org.apache.sandesha2.util.Range
All Implemented Interfaces:
java.io.Serializable

public class Range
extends java.lang.Object
implements java.io.Serializable

Data structure to represent a range of values from lowerValue->upperValue inclusive.

See Also:
Serialized Form

Field Summary
 long lowerValue
           
 long upperValue
           
 
Constructor Summary
Range(long value)
          Create a range for a single number
Range(long low, long high)
           
Range(java.lang.String s)
          Construct a range from a String object
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 int hashCode()
           
 boolean rangeContainsValue(long value)
          Value is considered to be "in range" if it is with the limits set by the upper and lower values.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

lowerValue

public long lowerValue

upperValue

public long upperValue
Constructor Detail

Range

public Range(long value)
Create a range for a single number

Parameters:
value -

Range

public Range(long low,
             long high)
Parameters:
low -
high - NOTE: low and high can be equal

Range

public Range(java.lang.String s)
Construct a range from a String object

Parameters:
s - a String of the form [lower, upper] NOTE: lower and upper can be equal
Method Detail

rangeContainsValue

public boolean rangeContainsValue(long value)
Value is considered to be "in range" if it is with the limits set by the upper and lower values. e.g. [x, x+n] would return true for all values in the set [x...x+n]


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object


Copyright © The Apache Software Foundation. All Rights Reserved.