Module com.flexganttfx.model
Package com.flexganttfx.model.activity
Class HighLowChartActivityBase<T>
java.lang.Object
com.flexganttfx.model.activity.ActivityBase<T>
com.flexganttfx.model.activity.HighLowChartActivityBase<T>
- Type Parameters:
T- the type of the optional user object
- All Implemented Interfaces:
Activity,HighLowChartActivity
- Direct Known Subclasses:
MutableHighLowChartActivityBase
public class HighLowChartActivityBase<T> extends ActivityBase<T> implements HighLowChartActivity
The base implementation of a high-low activity, which are used in combination
with a
ChartLayout. A typical use-case for such activities are
candle-stick diagrams used for plotting historical stock prices.- Since:
- 1.0
-
Field Summary
Fields inherited from class com.flexganttfx.model.activity.ActivityBase
DEFAULT_DURATION, endTime, id, name, startTime, userObject -
Constructor Summary
Constructors Constructor Description HighLowChartActivityBase()Constructs a new high-low activity.HighLowChartActivityBase(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.HighLowChartActivityBase(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
Methods inherited from class com.flexganttfx.model.activity.ActivityBase
getEndTime, getId, getName, getStartTime, getUserObject, setUserObjectMethods 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, getStartTime
-
Field Details
-
low
protected double low -
high
protected double high
-
-
Constructor Details
-
HighLowChartActivityBase
public HighLowChartActivityBase()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
-
HighLowChartActivityBase
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
-
HighLowChartActivityBase
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
-
getLow
public double getLow()Description copied from interface:HighLowChartActivityReturns the low value of the activity.- Specified by:
getLowin interfaceHighLowChartActivity- Returns:
- the low value
-
getHigh
public double getHigh()Description copied from interface:HighLowChartActivityReturns the high value of the activity.- Specified by:
getHighin interfaceHighLowChartActivity- Returns:
- the high value
-
toString
- Overrides:
toStringin classActivityBase<T>
-