Package com.macrofocus.interval
Class SimpleClosedInterval
- java.lang.Object
-
- com.macrofocus.interval.AbstractMutableInterval
-
- com.macrofocus.interval.ClosedInterval
-
- com.macrofocus.interval.SimpleClosedInterval
-
- All Implemented Interfaces:
Interval,MutableInterval
@JsType public class SimpleClosedInterval extends ClosedInterval
A closed interval is an interval that includes all of its limit points.
-
-
Constructor Summary
Constructors Constructor Description SimpleClosedInterval(double start, double extent)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontains(double value)Tests if this interval contains the specified valuebooleancontains(double start, double end)Tests if this interval contains the specified intervalbooleancontains(Interval interval)Tests if this interval contains the specified intervaldoublegetEnd()MutableProperty<java.lang.Double>getEndProperty()doublegetExtent()doublegetStart()MutableProperty<java.lang.Double>getStartProperty()booleanisDegenerate()Tests whether the starting and ending values are the samebooleanisInverted()booleanoverlaps(double start, double end)Tests if this interval overlaps the specified interval.booleanoverlaps(Interval interval)Tests if this interval overlaps the specified interval.voidsetEnd(double value)voidsetExtent(double extent)voidsetStart(double value)voidsetValue(double value, double extent)java.lang.StringtoString()-
Methods inherited from class com.macrofocus.interval.AbstractMutableInterval
addIntervalListener, addWeakIntervalListener, notifyIntervalChanged, removeIntervalListener, removeIntervalListeners
-
-
-
-
Method Detail
-
getStartProperty
public MutableProperty<java.lang.Double> getStartProperty()
-
getEndProperty
public MutableProperty<java.lang.Double> getEndProperty()
-
setStart
public void setStart(double value)
-
setEnd
public void setEnd(double value)
-
setExtent
public void setExtent(double extent)
-
setValue
public void setValue(double value, double extent)
-
getStart
public double getStart()
-
getEnd
public double getEnd()
-
getExtent
public double getExtent()
- Specified by:
getExtentin interfaceInterval- Overrides:
getExtentin classClosedInterval
-
contains
@JsIgnore public boolean contains(double value)
Description copied from interface:IntervalTests if this interval contains the specified value- Specified by:
containsin interfaceInterval- Overrides:
containsin classClosedInterval- Parameters:
value- the value to test- Returns:
- true if the interval contains the value, false otherwise
-
contains
public boolean contains(double start, double end)Description copied from interface:IntervalTests if this interval contains the specified interval- Specified by:
containsin interfaceInterval- Overrides:
containsin classClosedInterval- Parameters:
start- the value to testend- the value to test- Returns:
- true if the interval contains the value, false otherwise
-
contains
@JsIgnore public boolean contains(Interval interval)
Description copied from interface:IntervalTests if this interval contains the specified interval- Specified by:
containsin interfaceInterval- Overrides:
containsin classClosedInterval- Parameters:
interval- the interval to test- Returns:
- true if the interval contains the value, false otherwise
-
overlaps
public boolean overlaps(double start, double end)Description copied from interface:IntervalTests if this interval overlaps the specified interval.- Specified by:
overlapsin interfaceInterval- Overrides:
overlapsin classClosedInterval- Parameters:
start- the interval to testend- the interval to test- Returns:
- true if this interval overlaps the specified interval, false otherwise
-
overlaps
@JsIgnore public boolean overlaps(Interval interval)
Description copied from interface:IntervalTests if this interval overlaps the specified interval.- Specified by:
overlapsin interfaceInterval- Overrides:
overlapsin classClosedInterval- Parameters:
interval- the interval to test- Returns:
- true if this interval overlaps the specified interval, false otherwise
-
isInverted
public boolean isInverted()
- Specified by:
isInvertedin interfaceInterval- Overrides:
isInvertedin classClosedInterval
-
isDegenerate
public boolean isDegenerate()
Description copied from interface:IntervalTests whether the starting and ending values are the same- Specified by:
isDegeneratein interfaceInterval- Overrides:
isDegeneratein classClosedInterval- Returns:
- true if start and end values are identical, false otherwise
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-