java.lang.Object
com.flexganttfx.model.activity.ActivityBase<T>
- Type Parameters:
T
- the type of an optional user object
- All Implemented Interfaces:
Activity
- Direct Known Subclasses:
CalendarActivityBase
,ChartActivityBase
,CompletableActivityBase
,HighLowChartActivityBase
,MutableActivityBase
The base implementation of the
Activity
interface.- Since:
- 1.0
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new activity.ActivityBase
(String name) Constructs a new activity with the given name.ActivityBase
(String name, Instant startTime, Instant endTime) Constructs a new activity with the given name, start time, and end time.ActivityBase
(Instant startTime, Instant endTime) Constructs a new activity with the start time and end time. -
Method Summary
Modifier and TypeMethodDescriptionThe end time of the activity.getId()
The unique id of the activity.getName()
The name of the activity, for example "Flight 3441".The start time of the activity.void
setUserObject
(T userObject) toString()
-
Field Details
-
DEFAULT_DURATION
-
name
-
id
-
userObject
-
startTime
-
endTime
-
-
Constructor Details
-
ActivityBase
public ActivityBase()Constructs a new activity. The initial start time will be set toInstant.now()
and the end time will be equal toInstant.now()
plus the value ofDEFAULT_DURATION
.- Since:
- 1.0
-
ActivityBase
Constructs a new activity with the given name. The initial start time will be set toInstant.now()
and the end time will be equal toInstant.now()
plus the value ofDEFAULT_DURATION
.- Parameters:
name
- the name of the activity- Since:
- 1.0
-
ActivityBase
Constructs a new activity with the start time and end time.- Parameters:
startTime
- the start time of the activityendTime
- the end time of the activity- Since:
- 1.0
-
ActivityBase
Constructs a new activity with the given name, start time, and end time.- Parameters:
name
- the name of the activitystartTime
- the start time of the activityendTime
- the end time of the activity- Since:
- 1.0
-
-
Method Details
-
getName
Description copied from interface:Activity
The name of the activity, for example "Flight 3441". -
getId
Description copied from interface:Activity
The unique id of the activity. -
setUserObject
-
getUserObject
-
getStartTime
Description copied from interface:Activity
The start time of the activity.- Specified by:
getStartTime
in interfaceActivity
- Returns:
- the activity start time
-
getEndTime
Description copied from interface:Activity
The end time of the activity.- Specified by:
getEndTime
in interfaceActivity
- Returns:
- the activity end time
-
toString
-