|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.ace.range.Range
public class Range
Class that captures a simple, modifiable range.
Constructor Summary | |
---|---|
Range(long number)
Create a range that consists of a single number. |
|
Range(long low,
long high)
Creates a range from a lower to a higher bound. |
|
Range(String representation)
Create a new range based on a string representation of that range. |
Method Summary | |
---|---|
boolean |
contains(long number)
Checks if a number falls within this range. |
long |
getHigh()
Returns the higher bound. |
long |
getLow()
Returns the lower bound. |
void |
setHigh(long high)
Sets a new higher bound. |
void |
setLow(long low)
Sets a new lower bound. |
String |
toRepresentation()
Converts the range to a string representation that can be parsed back to a new Range object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Range(String representation)
representation
- the string representationpublic Range(long number)
number
- the numberpublic Range(long low, long high)
low
- the lower boundhigh
- the higher boundMethod Detail |
---|
public long getLow()
public void setLow(long low)
low
- the new lower boundpublic long getHigh()
public void setHigh(long high)
high
- the new higher boundpublic boolean contains(long number)
number
- the number to check
true
if the number was inside the rangepublic String toRepresentation()
Range
object.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |