T
- the type of the optional user objectpublic class MutableHighLowChartActivityBase<T> extends HighLowChartActivityBase<T> implements MutableHighLowChartActivity
high, low
DEFAULT_DURATION, endTime, id, name, startTime, userObject
Constructor and 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.
|
Modifier and Type | Method and Description |
---|---|
void |
addDuration(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.
|
void |
addDuration(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.
|
Duration |
getDuration()
Convenience method to determine the duration between the start and the
end time of the activity.
|
void |
setDuration(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.
|
void |
setEndTime(Instant time)
Sets a new end time on the activity.
|
void |
setHigh(double high)
Sets the high value of the activity.
|
void |
setId(String id)
Sets the ID field on the activity.
|
void |
setLow(double low)
Sets the low value of the activity.
|
void |
setName(String name)
Sets the name of the activity.
|
void |
setStartTime(Instant time)
Sets a new start time on the activity.
|
void |
setUserObject(T userObject) |
String |
toString() |
getHigh, getLow
getEndTime, getId, getName, getStartTime, getUserObject
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getHigh, getLow
getEndTime, getId, getName, getStartTime
public MutableHighLowChartActivityBase()
Instant.now()
and the end time will be equal to
Instant.now()
plus ActivityBase.DEFAULT_DURATION
.public MutableHighLowChartActivityBase(double low, double high, Instant startTime, Instant endTime)
low
- the low value of the activityhigh
- the high value of the activitystartTime
- the start time of the activityendTime
- the end time of the activityIllegalArgumentException
- if low is larger than highpublic MutableHighLowChartActivityBase(double low, double high, Instant time)
low
- the low value of the activityhigh
- the high value of the activitytime
- the start and end time of the activityIllegalArgumentException
- if low is larger than highpublic void setId(String id)
MutableActivity
UUID
. Only change it if your application uses its own ID
system.setId
in interface MutableActivity
id
- the new ID of the activitypublic void setName(String name)
MutableActivity
setName
in interface MutableActivity
name
- the new name of the activitypublic void setUserObject(T userObject)
public void setStartTime(Instant time)
MutableActivity
setStartTime
in interface MutableActivity
time
- the new start timepublic void setEndTime(Instant time)
MutableActivity
setEndTime
in interface MutableActivity
time
- the new end timepublic void setDuration(Duration duration)
duration
- the duration of the activitypublic Duration getDuration()
public void addDuration(Duration duration)
duration
- the duration of the activitypublic void addDuration(Duration duration, long multipliedBy)
duration
- the duration of the activitymultipliedBy
- the number of times that the duration will be addedpublic void setHigh(double high)
MutableHighLowChartActivity
setHigh
in interface MutableHighLowChartActivity
high
- the new high valuepublic void setLow(double low)
MutableHighLowChartActivity
setLow
in interface MutableHighLowChartActivity
low
- the new low valuepublic String toString()
toString
in class HighLowChartActivityBase<T>
Copyright © 2014 Dirk Lemmermann Software & Consulting. All rights reserved.