|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectInterval1D
public class Interval1D
This class represents a simple scalar one-dimensional interval, together with a method for aquiring the intersection with another interval.
Field Summary | |
---|---|
float |
end
End point of the interval. |
float |
start
Start point of the interval. |
Constructor Summary | |
---|---|
Interval1D()
Creates a new Interval1D spanning the whole real axis. |
|
Interval1D(float start,
float end)
Creates a new Interval1D spanning the specified range. |
Method Summary | |
---|---|
void |
intersection(Interval1D other)
Performs the intersection operation between this interval and the supplied one. |
static Interval1D |
intersection(Interval1D first,
Interval1D second)
Performs the intersection operation between the two supplied Interval1D s. |
boolean |
isEmpty()
Indicates whether this Interval1D is empty. |
boolean |
isValid()
Returns whether the Interval1D is valid. |
void |
makeEmpty()
Sets this Interval1D to the empty one. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public float start
public float end
Constructor Detail |
---|
public Interval1D()
Interval1D
spanning the whole real axis.
public Interval1D(float start, float end)
Interval1D
spanning the specified range.
start
- the start point of the interval.end
- the end point of the interval.Method Detail |
---|
public boolean isEmpty()
Interval1D
is empty.
public void makeEmpty()
Interval1D
to the empty one.
public boolean isValid()
Interval1D
is valid. An interval is
considered valid if the end point is greater than the start point. An
empty interval is also counted as a valid one.
public void intersection(Interval1D other)
other
- the interval to intersect this one with.public static Interval1D intersection(Interval1D first, Interval1D second)
Interval1D
s. The result is returned as a new
Interval1D
.
first
- the first interval.second
- the second interval.
Interval1D
as a result of the operation.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |