|
Holger's Java API |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.antelmann.util.Range<T>
public class Range<T>
provides a generic wrapper for lower- and upperbounds of an object. Both bounds are considered inclusive within the range and must not be null.
| Constructor Summary | |
|---|---|
Range(Comparable<T> lowerBound,
Comparable<T> upperBound)
both bounds are considered inclusive within the range. |
|
Range(Comparable<T> lowerBound,
Comparable<T> upperBound,
boolean inclusive)
if either or both (lower- and upperBound) are non-null, they represent a limit that is either inclusive or not depending on the given boolean. |
|
| Method Summary | |
|---|---|
Comparable<T> |
getLowerBound()
|
Comparable<T> |
getUpperBound()
|
boolean |
isInclusive()
|
boolean |
isInRange(T obj)
|
boolean |
isInRangeUnchecked(Object obj)
convenience method for unchecked calls |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Range(Comparable<T> lowerBound,
Comparable<T> upperBound)
public Range(Comparable<T> lowerBound,
Comparable<T> upperBound,
boolean inclusive)
| Method Detail |
|---|
public Comparable<T> getLowerBound()
public Comparable<T> getUpperBound()
public boolean isInclusive()
public boolean isInRange(T obj)
public boolean isInRangeUnchecked(Object obj)
throws ClassCastException
ClassCastException
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||