Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.esau.ptarmigan.util
Class Range  view Range download Range.java

java.lang.Object
  extended byorg.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 $

Field Summary
private  long length
           
private  long offset
           
 
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()
          Convert this Object to a human-readable String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

offset

private long offset

length

private long length
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()
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()).