T
- the type of the optional user objectpublic class MutableChartActivityBase<T> extends ChartActivityBase<T> implements MutableChartActivity
chartValue
DEFAULT_DURATION, endTime, id, name, startTime, userObject
Constructor and Description |
---|
MutableChartActivityBase()
Constructs a new mutable chart activity.
|
MutableChartActivityBase(double value)
Constructs a new mutable chart activity with the given value.
|
MutableChartActivityBase(double value,
Instant time)
Constructs a new mutable chart activity with the given value.
|
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 |
setChartValue(double value)
Sets a new chart value.
|
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 |
setId(String id)
Sets the ID field on 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() |
getChartValue
getEndTime, getId, getName, getStartTime, getUserObject
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getChartValue
getEndTime, getId, getName, getStartTime
public MutableChartActivityBase()
Instant.now()
and the end time will be equal to
Instant.now()
plus the value of ActivityBase.DEFAULT_DURATION
. The
chart value will be equal to zero.public MutableChartActivityBase(double value)
Instant.now()
and the end time will be
equal to Instant.now()
plus the value of
ActivityBase.DEFAULT_DURATION
.value
- the chart value of the activitypublic MutableChartActivityBase(double value, Instant time)
value
- the chart value of the activitytime
- the start and end time of the activitypublic 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 setChartValue(double value)
MutableChartActivity
setChartValue
in interface MutableChartActivity
value
- the new valuepublic String toString()
toString
in class ChartActivityBase<T>
Copyright © 2014 Dirk Lemmermann Software & Consulting. All rights reserved.