org.esau.ptarmigan.util
Class Range

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 $
Author:
Reed Esau

Constructor Summary
Range()
           
Range(long offset, long length)
           
 
Method Summary
 long getLength()
           
 long getOffset()
           
 void increaseOffset(long diff)
          BOTH increase the offset AND shrink the range length by the specified amount.
 boolean isLengthValid()
           
 boolean isOffsetValid()
           
 boolean isValid()
           
 long reduceLength(long diff)
           
 void setLength(long length)
           
 void setOffset(long offset)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Range

public Range()

Range

public Range(long offset,
             long length)
Method Detail

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()
Overrides:
toString in class java.lang.Object


Copyright © 2002 Reed Esau, All Rights Reserved.