Package com.macrofocus.common.interval
Class SimpleBoundedInterval
- java.lang.Object
-
- com.macrofocus.common.interval.AbstractMutableInterval
-
- com.macrofocus.common.interval.AbstractBoundedInterval
-
- com.macrofocus.common.interval.SimpleBoundedInterval
-
- All Implemented Interfaces:
BoundedInterval,Interval,MutableBoundedInterval,MutableInterval
public class SimpleBoundedInterval extends AbstractBoundedInterval implements MutableBoundedInterval
/** Default data model for bounded interval.
-
-
Constructor Summary
Constructors Constructor Description SimpleBoundedInterval(double start, double extent)SimpleBoundedInterval(double start, double minimum, double maximum)SimpleBoundedInterval(double start, double extent, double minimum, double maximum)SimpleBoundedInterval(MutableInterval interval, double minimum, double maximum)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontains(double value)Tests if this interval contains the specified valuebooleancontainsInterval(Interval interval)Tests if this interval contains the specified intervalbooleancontainsStartEnd(double start, double end)Tests if this interval contains the specified intervaldoublegetEnd()MutableProperty<java.lang.Double>getEndProperty()doublegetExtent()doublegetMaximum()doublegetMaximumExtent()doublegetMinimum()doublegetMinimumExtent()doublegetStart()MutableProperty<java.lang.Double>getStartProperty()booleanisDegenerate()Tests whether the starting and ending values are the samebooleanisInverted()booleanisInvertedScale()booleanoverlaps(double start, double end)Tests if this interval overlaps the specified interval.booleanoverlapsInterval(Interval interval)Tests if this interval overlaps the specified interval.voidreset()voidsetEnd(double value)voidsetExtent(double extent)voidsetMaximum(double maximum)voidsetMaximumExtent(double maximumExtent)voidsetMinimum(double minimum)voidsetMinimumExtent(double minimumExtent)voidsetMinMax(double min, double max)voidsetMinMaxExtent(double min, double max, double minExtent, double maxExtent)voidsetStart(double value)voidsetValue(double value, double extent)java.lang.StringtoString()-
Methods inherited from class com.macrofocus.common.interval.AbstractBoundedInterval
addBoundedIntervalListener, addWeakBoundedIntervalListener, isFullRange, notifyBoundedIntervalChanged, removeBoundedIntervalListener, removeBoundedIntervalListeners
-
Methods inherited from class com.macrofocus.common.interval.AbstractMutableInterval
addIntervalListener, addWeakIntervalListener, notifyIntervalChanged, removeIntervalListener, removeIntervalListeners
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.macrofocus.common.interval.BoundedInterval
addBoundedIntervalListener, addWeakBoundedIntervalListener, isFullRange, removeBoundedIntervalListener, removeBoundedIntervalListeners
-
Methods inherited from interface com.macrofocus.common.interval.Interval
addIntervalListener, addWeakIntervalListener, removeIntervalListener, removeIntervalListeners
-
-
-
-
Constructor Detail
-
SimpleBoundedInterval
public SimpleBoundedInterval(double start, double extent)
-
SimpleBoundedInterval
public SimpleBoundedInterval(double start, double minimum, double maximum)
-
SimpleBoundedInterval
public SimpleBoundedInterval(double start, double extent, double minimum, double maximum)
-
SimpleBoundedInterval
public SimpleBoundedInterval(MutableInterval interval, double minimum, double maximum)
-
-
Method Detail
-
setStart
public void setStart(double value)
- Specified by:
setStartin interfaceMutableBoundedInterval- Specified by:
setStartin interfaceMutableInterval
-
setEnd
public void setEnd(double value)
- Specified by:
setEndin interfaceMutableBoundedInterval- Specified by:
setEndin interfaceMutableInterval
-
setExtent
public void setExtent(double extent)
- Specified by:
setExtentin interfaceMutableBoundedInterval- Specified by:
setExtentin interfaceMutableInterval
-
setValue
public void setValue(double value, double extent)- Specified by:
setValuein interfaceMutableBoundedInterval- Specified by:
setValuein interfaceMutableInterval
-
getStartProperty
public MutableProperty<java.lang.Double> getStartProperty()
- Specified by:
getStartPropertyin interfaceInterval- Specified by:
getStartPropertyin interfaceMutableBoundedInterval- Specified by:
getStartPropertyin interfaceMutableInterval
-
getEndProperty
public MutableProperty<java.lang.Double> getEndProperty()
- Specified by:
getEndPropertyin interfaceInterval- Specified by:
getEndPropertyin interfaceMutableBoundedInterval- Specified by:
getEndPropertyin interfaceMutableInterval
-
contains
public boolean contains(double value)
Description copied from interface:IntervalTests if this interval contains the specified value
-
containsStartEnd
public boolean containsStartEnd(double start, double end)Description copied from interface:IntervalTests if this interval contains the specified interval- Specified by:
containsStartEndin interfaceInterval- Parameters:
start- the value to testend- the value to test- Returns:
- true if the interval contains the value, false otherwise
-
containsInterval
public boolean containsInterval(Interval interval)
Description copied from interface:IntervalTests if this interval contains the specified interval- Specified by:
containsIntervalin interfaceInterval- 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.
-
overlapsInterval
public boolean overlapsInterval(Interval interval)
Description copied from interface:IntervalTests if this interval overlaps the specified interval.- Specified by:
overlapsIntervalin interfaceInterval- Parameters:
interval- the interval to test- Returns:
- true if this interval overlaps the specified interval, false otherwise
-
isDegenerate
public boolean isDegenerate()
Description copied from interface:IntervalTests whether the starting and ending values are the same- Specified by:
isDegeneratein interfaceInterval- Returns:
- true if start and end values are identical, false otherwise
-
isInverted
public boolean isInverted()
- Specified by:
isInvertedin interfaceInterval
-
isInvertedScale
public boolean isInvertedScale()
- Specified by:
isInvertedScalein interfaceBoundedInterval
-
setMinimum
public void setMinimum(double minimum)
- Specified by:
setMinimumin interfaceMutableBoundedInterval
-
setMaximum
public void setMaximum(double maximum)
- Specified by:
setMaximumin interfaceMutableBoundedInterval
-
getMinimum
public double getMinimum()
- Specified by:
getMinimumin interfaceBoundedInterval
-
getMaximum
public double getMaximum()
- Specified by:
getMaximumin interfaceBoundedInterval
-
setMinMax
public void setMinMax(double min, double max)- Specified by:
setMinMaxin interfaceMutableBoundedInterval
-
setMinimumExtent
public void setMinimumExtent(double minimumExtent)
- Specified by:
setMinimumExtentin interfaceMutableBoundedInterval
-
setMaximumExtent
public void setMaximumExtent(double maximumExtent)
- Specified by:
setMaximumExtentin interfaceMutableBoundedInterval
-
setMinMaxExtent
public void setMinMaxExtent(double min, double max, double minExtent, double maxExtent)- Specified by:
setMinMaxExtentin interfaceMutableBoundedInterval
-
getMinimumExtent
public double getMinimumExtent()
- Specified by:
getMinimumExtentin interfaceBoundedInterval
-
getMaximumExtent
public double getMaximumExtent()
- Specified by:
getMaximumExtentin interfaceBoundedInterval
-
reset
public void reset()
- Specified by:
resetin interfaceMutableBoundedInterval
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-