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
public class ActivityBase<T> extends Object implements Activity
The base implementation of the
Activity interface.- Since:
- 1.0
-
Field Summary
-
Constructor Summary
Constructors Constructor Description ActivityBase()Constructs 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 Type Method Description InstantgetEndTime()The end time of the activity.StringgetId()The unique id of the activity.StringgetName()The name of the activity, for example "Flight 3441".InstantgetStartTime()The start time of the activity.TgetUserObject()voidsetUserObject(T userObject)StringtoString()
-
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:ActivityThe name of the activity, for example "Flight 3441". -
getId
Description copied from interface:ActivityThe unique id of the activity. -
setUserObject
-
getUserObject
-
getStartTime
Description copied from interface:ActivityThe start time of the activity.- Specified by:
getStartTimein interfaceActivity- Returns:
- the activity start time
-
getEndTime
Description copied from interface:ActivityThe end time of the activity.- Specified by:
getEndTimein interfaceActivity- Returns:
- the activity end time
-
toString
-