Package com.macrofocus.common.interval
Class SimpleClosedInterval
java.lang.Object
com.macrofocus.common.interval.AbstractMutableInterval
com.macrofocus.common.interval.ClosedInterval
com.macrofocus.common.interval.SimpleClosedInterval
- All Implemented Interfaces:
Interval
,MutableInterval
A closed interval is an interval that includes all of its limit points.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
contains
(double value) Tests if this interval contains the specified valueboolean
containsInterval
(Interval interval) Tests if this interval contains the specified intervalboolean
containsStartEnd
(double start, double end) Tests if this interval contains the specified intervaldouble
getEnd()
double
double
getStart()
boolean
Tests whether the starting and ending values are the sameboolean
boolean
overlaps
(double start, double end) Tests if this interval overlaps the specified interval.boolean
overlapsInterval
(Interval interval) Tests if this interval overlaps the specified interval.void
setEnd
(double value) void
setExtent
(double extent) void
setStart
(double value) void
setValue
(double value, double extent) toString()
Methods inherited from class com.macrofocus.common.interval.AbstractMutableInterval
addIntervalListener, addWeakIntervalListener, notifyIntervalChanged, removeIntervalListener, removeIntervalListeners
-
Constructor Details
-
SimpleClosedInterval
public SimpleClosedInterval(double start, double extent)
-
-
Method Details
-
getStartProperty
-
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:
getExtent
in interfaceInterval
- Overrides:
getExtent
in classClosedInterval
-
contains
@JsIgnore public boolean contains(double value) Description copied from interface:Interval
Tests if this interval contains the specified value- Specified by:
contains
in interfaceInterval
- Overrides:
contains
in classClosedInterval
- Parameters:
value
- the value to test- Returns:
- true if the interval contains the value, false otherwise
-
containsStartEnd
public boolean containsStartEnd(double start, double end) Description copied from interface:Interval
Tests if this interval contains the specified interval- Specified by:
containsStartEnd
in interfaceInterval
- Overrides:
containsStartEnd
in classClosedInterval
- Parameters:
start
- the value to testend
- the value to test- Returns:
- true if the interval contains the value, false otherwise
-
containsInterval
Description copied from interface:Interval
Tests if this interval contains the specified interval- Specified by:
containsInterval
in interfaceInterval
- Overrides:
containsInterval
in 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:Interval
Tests if this interval overlaps the specified interval.- Specified by:
overlaps
in interfaceInterval
- Overrides:
overlaps
in classClosedInterval
- Parameters:
start
- the interval to testend
- the interval to test- Returns:
- true if this interval overlaps the specified interval, false otherwise
-
overlapsInterval
Description copied from interface:Interval
Tests if this interval overlaps the specified interval.- Specified by:
overlapsInterval
in interfaceInterval
- Overrides:
overlapsInterval
in classClosedInterval
- Parameters:
interval
- the interval to test- Returns:
- true if this interval overlaps the specified interval, false otherwise
-
isInverted
public boolean isInverted()- Specified by:
isInverted
in interfaceInterval
- Overrides:
isInverted
in classClosedInterval
-
isDegenerate
public boolean isDegenerate()Description copied from interface:Interval
Tests whether the starting and ending values are the same- Specified by:
isDegenerate
in interfaceInterval
- Overrides:
isDegenerate
in classClosedInterval
- Returns:
- true if start and end values are identical, false otherwise
-
toString
-