java.lang.Object
org.esau.ptarmigan.util.Range
- public final class Range
- extends java.lang.Object
Range
A simple holder for a numeric range. Uses long to hold values.
- Version:
- $Revision: 1.1 $ $Date: 2002/09/10 06:24:34 $
|
Constructor Summary |
Range()
|
Range(long offset,
long length)
|
offset
private long offset
length
private long length
Range
public Range()
Range
public Range(long offset,
long length)
getOffset
public long getOffset()
setOffset
public void setOffset(long offset)
getLength
public long getLength()
setLength
public void setLength(long length)
increaseOffset
public void increaseOffset(long diff)
- BOTH increase the offset AND shrink the range length by the specified
amount. The length is unchanged if not yet initialized.
reduceLength
public long reduceLength(long diff)
isOffsetValid
public boolean isOffsetValid()
isLengthValid
public boolean isLengthValid()
isValid
public boolean isValid()
toString
public java.lang.String toString()
- Description copied from class:
java.lang.Object
- Convert this Object to a human-readable String.
There are no limits placed on how long this String
should be or what it should contain. We suggest you
make it as intuitive as possible to be able to place
it into System.out.println() 55
and such.
It is typical, but not required, to ensure that this method
never completes abruptly with a java.lang.RuntimeException.
This method will be called when performing string
concatenation with this object. If the result is
null, string concatenation will instead
use "null".
The default implementation returns
getClass().getName() + "@" +
Integer.toHexString(hashCode()).