|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectuavsim.datatypes.Interval<_UNIT_>
_UNIT_ - - the datatypepublic class Interval<_UNIT_ extends I_Unitable<_UNIT_>>
Defines an interval for any I_Unitable datatype.
| Nested Class Summary | |
|---|---|
class |
Interval.Iterator
Defines an iterator over the interval. |
| Field Summary | |
|---|---|
private _UNIT_ |
_end
the end value |
private boolean |
_isInclusive
whether the end value is included in the iteration |
private _UNIT_ |
_start
the start value |
private _UNIT_ |
_step
the step value, if defined; otherwise null |
| Constructor Summary | |
|---|---|
Interval(_UNIT_ start,
_UNIT_ end,
_UNIT_ step)
Creates an interval with a predefined step, meaning any iterator applied to it can use this value or supply one itself. |
|
Interval(_UNIT_ start,
_UNIT_ end,
_UNIT_ step,
boolean isInclusive)
Creates an interval with a predefined step, meaning any iterator applied to it can use this value or supply one itself. |
|
Interval(_UNIT_ start,
_UNIT_ end)
Creates an interval with no step, meaning any iterator applied to it must supply the step itself. |
|
Interval(_UNIT_ start,
_UNIT_ end,
boolean isInclusive)
Creates an interval with no step, meaning any iterator applied to it must supply the step itself. |
|
| Method Summary | |
|---|---|
_UNIT_ |
clamp(_UNIT_ value)
Determines whether a value is off the end of the interval. |
ArcMathematical |
convertToArcMathematical()
Converts this interval to a arc defined by mathematical angles. |
Interval<_UNIT_> |
flip()
Exchanges the start and end values of the interval. |
_UNIT_ |
getEnd()
Gets the end value. |
Interval.Iterator |
getIteratorInstance(_UNIT_ step,
boolean isInclusiveRange)
Generates an iterator with an explicit step, which overrides any provided to the interval. |
Interval.Iterator |
getIteratorInstance(boolean isInclusiveRange)
Generates an iterator with the explicit step provided to the interval. |
_UNIT_ |
getRange()
Returns the range of the interval as the end minus the start. |
Scaler |
getScaler(_UNIT_ value)
Generates a scaler on the interval [0,1] for a value on this interval. |
Scaler |
getScalerInverse(_UNIT_ value)
Generates a scaler on the interval [1,0] for a value on this interval. |
_UNIT_ |
getStart()
Gets the start value. |
_UNIT_ |
getStep()
Gets the step value, if one was was provided; otherwise, this method is illegal. |
double |
getSubdivisionCount(_UNIT_ divisor)
Calculates the number of subdivisions in the interval. |
boolean |
hasStep()
Returns whether a step value was provided. |
boolean |
isInclusive()
Returns whether the end value is considered part of the interval. |
boolean |
isOffRangeEnd(_UNIT_ value)
Determines whether a value is off the end of the interval. |
boolean |
isOffRangeStart(_UNIT_ value)
Determines whether a value is off the start of the interval. |
boolean |
isWithinRange(_UNIT_ value)
Determines whether a value is inclusively on the interval. |
double |
scale(Scaler scaler)
Calculates the value on the interval corresponding to a scaler percentage. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private final _UNIT_ extends I_Unitable<_UNIT_> _end
private final boolean _isInclusive
private final _UNIT_ extends I_Unitable<_UNIT_> _start
private final _UNIT_ extends I_Unitable<_UNIT_> _step
| Constructor Detail |
|---|
public Interval(_UNIT_ start,
_UNIT_ end,
_UNIT_ step)
start - - the start valueend - - the end valuestep - - the step value, which is included in the iteration
public Interval(_UNIT_ start,
_UNIT_ end,
_UNIT_ step,
boolean isInclusive)
start - - the start valueend - - the end valuestep - - the step valueisInclusive - - whether the end value is included in the iteration
public Interval(_UNIT_ start,
_UNIT_ end)
start - - the start valueend - - the end value, which is included in the iteration
public Interval(_UNIT_ start,
_UNIT_ end,
boolean isInclusive)
start - - the start valueend - - the end valueisInclusive - - whether the end value is included in the iteration| Method Detail |
|---|
public _UNIT_ clamp(_UNIT_ value)
value - - the value
public ArcMathematical convertToArcMathematical()
public Interval<_UNIT_> flip()
public _UNIT_ getEnd()
public Interval.Iterator getIteratorInstance(_UNIT_ step,
boolean isInclusiveRange)
step - - the step valujeisInclusiveRange - - whether to include the end of the interval in the iteration
public Interval.Iterator getIteratorInstance(boolean isInclusiveRange)
isInclusiveRange - - whether to include the end of the interval in the iteration
public _UNIT_ getRange()
public Scaler getScaler(_UNIT_ value)
value - - the value
public Scaler getScalerInverse(_UNIT_ value)
value - - the value
public _UNIT_ getStart()
public _UNIT_ getStep()
public double getSubdivisionCount(_UNIT_ divisor)
divisor - - the divisor
public boolean hasStep()
public boolean isInclusive()
public boolean isOffRangeEnd(_UNIT_ value)
value - - the value
public boolean isOffRangeStart(_UNIT_ value)
value - - the value
public boolean isWithinRange(_UNIT_ value)
value - - the value
public double scale(Scaler scaler)
scaler - - the scaler
public java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||