info.jonclark.lang
Class LongRange

java.lang.Object
  extended by info.jonclark.lang.LongRange

public class LongRange
extends Object

This class holds 2 longs. Simple, right?

NOTE: This class does not implement the Comparable interface because correct ordering cannot be guaranteed for objects that are farther than Integer.MAX_VALUE apart.


Field Summary
 long first
           
 long last
           
 
Constructor Summary
LongRange(long first, long last)
           
 
Method Summary
 boolean equals(Object o)
           
 boolean isInRange(long n)
           
 long length()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

first

public long first

last

public long last
Constructor Detail

LongRange

public LongRange(long first,
                 long last)
Method Detail

length

public long length()

isInRange

public boolean isInRange(long n)

equals

public boolean equals(Object o)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object