- 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 theActivity
interface.- Since:
- 1.0
-
-
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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Instant
getEndTime()
The end time of the activity.String
getId()
The unique id of the activity.String
getName()
The name of the activity, for example "Flight 3441".Instant
getStartTime()
The start time of the activity.T
getUserObject()
void
setUserObject(T userObject)
String
toString()
-
-
-
Constructor Detail
-
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
public ActivityBase(String name)
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
public ActivityBase(Instant startTime, Instant endTime)
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
-
-
Method Detail
-
getName
public String getName()
Description copied from interface:Activity
The name of the activity, for example "Flight 3441".
-
getId
public String getId()
Description copied from interface:Activity
The unique id of the activity.
-
setUserObject
public void setUserObject(T userObject)
-
getUserObject
public T getUserObject()
-
getStartTime
public Instant getStartTime()
Description copied from interface:Activity
The start time of the activity.- Specified by:
getStartTime
in interfaceActivity
- Returns:
- the activity start time
-
getEndTime
public Instant getEndTime()
Description copied from interface:Activity
The end time of the activity.- Specified by:
getEndTime
in interfaceActivity
- Returns:
- the activity end time
-
-