|
Gephi Toolkit Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.gephi.data.attributes.type.Interval<T>
T
- type of datapublic final class Interval<T>
This class represents an interval with some value.
Constructor Summary | |
---|---|
Interval(double low,
double high)
Constructs a new interval instance with no value and left and right endpoints included by default. |
|
Interval(double low,
double high,
boolean lopen,
boolean ropen)
Constructs a new interval instance with no value. |
|
Interval(double low,
double high,
boolean lopen,
boolean ropen,
T value)
Constructs a new interval instance. |
|
Interval(double low,
double high,
T value)
Constructs a new interval instance with left and right endpoints included by default. |
Method Summary | |
---|---|
int |
compareTo(Interval interval)
Compares this interval with the specified interval for order. |
boolean |
equals(java.lang.Object obj)
Compares this interval with the specified object for equality. |
double |
getHigh()
Returns the right endpoint. |
double |
getLow()
Returns the left endpoint. |
T |
getValue()
Returns the value stored in this interval. |
int |
hashCode()
|
boolean |
isHighExcluded()
Indicates if the right endpoint is excluded. |
boolean |
isLowExcluded()
Indicates if the left endpoint is excluded. |
java.lang.String |
toString()
Returns a string representation of this interval in one of the formats: [low, high, value]
(low, high, value]
[low, high, value)
(low, high, value)
Times are always shown as doubles |
java.lang.String |
toString(boolean timesAsDoubles)
Creates a string representation of the interval with its value. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Interval(double low, double high, boolean lopen, boolean ropen, T value)
Note that value
cannot be null if you want use this
interval
as a value storage. If it is null some estimators
could not work and generate exceptions.
low
- the left endpointhigh
- the right endpointlopen
- indicates if the left endpoint is excluded (true in this case)ropen
- indicates if the right endpoint is excluded (true in this case)value
- the value stored in this interval
java.lang.IllegalArgumentException
- if low
> high
.public Interval(double low, double high, boolean lopen, boolean ropen)
low
- the left endpointhigh
- the right endpointlopen
- indicates if the left endpoint is excluded (true in this case)ropen
- indicates if the right endpoint is excluded (true in this case)
java.lang.IllegalArgumentException
- if low
> high
.public Interval(double low, double high, T value)
Note that value
cannot be null if you want use this
interval
as a value storage. If it is null some estimators
could not work and generate exceptions.
low
- the left endpointhigh
- the right endpointvalue
- the value stored in this interval
java.lang.IllegalArgumentException
- if low
> high
.public Interval(double low, double high)
low
- the left endpointhigh
- the right endpoint
java.lang.IllegalArgumentException
- if low
> high
.Method Detail |
---|
public int compareTo(Interval interval)
Any two intervals i and i' satisfy the interval
trichotomy
; that is, exactly one of the following three properties
holds:
Note that if two intervals are equal (i.low = i'.low
and
i.high = i'.high
), they overlap as well. But if they simply
overlap (for instance i.low < i'.low
and i.high >
i'.high
) they aren't equal. Remember that if two intervals are equal,
they have got the same bounds excluded or included.
compareTo
in interface java.lang.Comparable<Interval>
interval
- the interval to be compared
java.lang.NullPointerException
- if interval
is null.public double getLow()
public double getHigh()
public boolean isLowExcluded()
true
if the left endpoint is excluded,
false
otherwise.public boolean isHighExcluded()
true
if the right endpoint is excluded,
false
otherwise.public T getValue()
public boolean equals(java.lang.Object obj)
Note that two intervals are equal if i.low = i'.low
and
i.high = i'.high
and they have got the bounds excluded/included.
equals
in class java.lang.Object
obj
- object to which this interval is to be compared
true
if and only if the specified Object
is a
Interval
whose low and high are equal to this
Interval's
.compareTo(org.gephi.data.attributes.type.Interval)
,
hashCode()
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString(boolean timesAsDoubles)
timesAsDoubles
- indicates if times should be shown as doubles or dates
public java.lang.String toString()
[low, high, value]
(low, high, value]
[low, high, value)
(low, high, value)
Times are always shown as doubles
toString
in class java.lang.Object
|
Gephi Toolkit Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |