Module com.flexganttfx.model
Package com.flexganttfx.model.activity
Class MutableHighLowChartActivityBase<T>
java.lang.Object
com.flexganttfx.model.activity.ActivityBase<T>
com.flexganttfx.model.activity.HighLowChartActivityBase<T>
com.flexganttfx.model.activity.MutableHighLowChartActivityBase<T>
- Type Parameters:
T- the type of the optional user object
- All Implemented Interfaces:
Activity,HighLowChartActivity,MutableActivity,MutableHighLowChartActivity
public class MutableHighLowChartActivityBase<T> extends HighLowChartActivityBase<T> implements MutableHighLowChartActivity
The base implementation of a mutable high / low activity.
- Since:
- 1.0
-
Field Summary
Fields inherited from class com.flexganttfx.model.activity.HighLowChartActivityBase
high, lowFields inherited from class com.flexganttfx.model.activity.ActivityBase
DEFAULT_DURATION, endTime, id, name, startTime, userObject -
Constructor Summary
Constructors Constructor Description MutableHighLowChartActivityBase()Constructs a new high-low activity.MutableHighLowChartActivityBase(double low, double high, Instant time)Constructs a new high-low activity with the given initial high and low values and the start and end time set to the given time.MutableHighLowChartActivityBase(double low, double high, Instant startTime, Instant endTime)Constructs a new high-low activity with the given initial high and low values and the given start and end time. -
Method Summary
Modifier and Type Method Description voidaddDuration(Duration duration)Convenience method to determine a new end time based on a duration that will be added once to the current end time of the activity.voidaddDuration(Duration duration, long multipliedBy)Convenience method to determine a new end time based on a duration that will be added several times to the current end time of the activity.DurationgetDuration()Convenience method to determine the duration between the start and the end time of the activity.voidsetDuration(Duration duration)Convenience method to determine a new end time based on a duration that will be added to the current start time of the activity.voidsetEndTime(Instant time)Sets a new end time on the activity.voidsetHigh(double high)Sets the high value of the activity.voidsetLow(double low)Sets the low value of the activity.voidsetName(String name)Sets the name of the activity.voidsetStartTime(Instant time)Sets a new start time on the activity.voidsetUserObject(T userObject)StringtoString()Methods inherited from class com.flexganttfx.model.activity.HighLowChartActivityBase
getHigh, getLowMethods inherited from class com.flexganttfx.model.activity.ActivityBase
getEndTime, getId, getName, getStartTime, getUserObjectMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.flexganttfx.model.Activity
getEndTime, getId, getName, getStartTimeMethods inherited from interface com.flexganttfx.model.activity.HighLowChartActivity
getHigh, getLow
-
Constructor Details
-
MutableHighLowChartActivityBase
public MutableHighLowChartActivityBase()Constructs a new high-low activity. The initial high and low values will both be equal to zero. The start time will be equal toInstant.now()and the end time will be equal toInstant.now()plusActivityBase.DEFAULT_DURATION.- Since:
- 1.0
-
MutableHighLowChartActivityBase
public MutableHighLowChartActivityBase(double low, double high, Instant startTime, Instant endTime)Constructs a new high-low activity with the given initial high and low values and the given start and end time.- Parameters:
low- the low value of the activityhigh- the high value of the activitystartTime- the start time of the activityendTime- the end time of the activity- Throws:
IllegalArgumentException- if low is larger than high- Since:
- 1.0
-
MutableHighLowChartActivityBase
Constructs a new high-low activity with the given initial high and low values and the start and end time set to the given time.- Parameters:
low- the low value of the activityhigh- the high value of the activitytime- the start and end time of the activity- Throws:
IllegalArgumentException- if low is larger than high- Since:
- 1.0
-
-
Method Details
-
setName
Description copied from interface:MutableActivitySets the name of the activity.- Specified by:
setNamein interfaceMutableActivity- Parameters:
name- the new name of the activity
-
setUserObject
- Overrides:
setUserObjectin classActivityBase<T>
-
setStartTime
Description copied from interface:MutableActivitySets a new start time on the activity.- Specified by:
setStartTimein interfaceMutableActivity- Parameters:
time- the new start time
-
setEndTime
Description copied from interface:MutableActivitySets a new end time on the activity.- Specified by:
setEndTimein interfaceMutableActivity- Parameters:
time- the new end time
-
setDuration
Convenience method to determine a new end time based on a duration that will be added to the current start time of the activity.- Parameters:
duration- the duration of the activity- Since:
- 1.0
-
getDuration
Convenience method to determine the duration between the start and the end time of the activity.- Returns:
- the duration of the activity
-
addDuration
Convenience method to determine a new end time based on a duration that will be added once to the current end time of the activity.- Parameters:
duration- the duration of the activity- Since:
- 1.0
-
addDuration
Convenience method to determine a new end time based on a duration that will be added several times to the current end time of the activity.- Parameters:
duration- the duration of the activitymultipliedBy- the number of times that the duration will be added- Since:
- 1.0
-
setHigh
public void setHigh(double high)Description copied from interface:MutableHighLowChartActivitySets the high value of the activity.- Specified by:
setHighin interfaceMutableHighLowChartActivity- Parameters:
high- the new high value
-
setLow
public void setLow(double low)Description copied from interface:MutableHighLowChartActivitySets the low value of the activity.- Specified by:
setLowin interfaceMutableHighLowChartActivity- Parameters:
low- the new low value
-
toString
- Overrides:
toStringin classHighLowChartActivityBase<T>
-