|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
org.apache.myfaces.trinidad.util.Range<C>
public final class Range<C extends Comparable>
Represents a range of comparable values with a specific start and end. Range instances are constructed using the of() factory method. Range instances are immutable.
| Method Summary | ||
|---|---|---|
boolean |
contains(C value)Tests whether the specified value is contained within this range. |
|
static
|
emptyRange()Returns an empty range. |
|
boolean |
equals(Object o) |
|
C |
getEnd()Returns the end of the range. |
|
C |
getStart()Returns the start of the range. |
|
int |
hashCode() |
|
Range<C> |
intersect(Range<C> otherRange)Computes the intersection of the this range with another range and returns the result in a new Range. |
|
boolean |
isEmpty()Tests whether this range is empty. |
|
static
|
of(C start, C end)Returns a new range consisting of the specified start and end points. |
|
String |
toString() |
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public static <C extends Comparable> Range<C> of(C start,
C end)
IllegalArgumentException - if start or end is nullpublic static <C extends Comparable> Range<C> emptyRange()
public C getStart()
public C getEnd()
public boolean isEmpty()
public boolean contains(C value)
value - the value to testpublic Range<C> intersect(Range<C> otherRange)
otherRange - the (non-null) range to intersect/updatepublic String toString()
toString in class Objectpublic boolean equals(Object o)
equals in class Objectpublic int hashCode()
hashCode in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Copyright © 2001-2013 The Apache Software Foundation. All Rights Reserved.