Klasse MutableActivityBase<T>

java.lang.Object
com.flexganttfx.model.activity.ActivityBase<T>
com.flexganttfx.model.activity.MutableActivityBase<T>
Typparameter:
T - the type of the optional user object
Alle implementierten Schnittstellen:
Activity, MutableActivity
Bekannte direkte Unterklassen:
MutableCalendarActivityBase

public class MutableActivityBase<T> extends ActivityBase<T> implements MutableActivity
The base implementation of a mutable activity. An activity is considered mutable if it implements the MutableActivity interface. By doing so we now have access to various setter methods to alter the state of the activity.
Seit:
1.0
  • Konstruktordetails

    • MutableActivityBase

      public MutableActivityBase()
      Constructs a new mutable activity. The initial start time will be set to Instant.now() and the end time will be equal to Instant.now() plus the value of ActivityBase.DEFAULT_DURATION.
      Seit:
      1.0
    • MutableActivityBase

      public MutableActivityBase(String name)
      Constructs a new mutable activity with the given name. The initial start time will be set to Instant.now() and the end time will be equal to Instant.now() plus the value of ActivityBase.DEFAULT_DURATION.
      Parameter:
      name - the name of the activity
      Seit:
      1.0
    • MutableActivityBase

      public MutableActivityBase(Instant startTime, Instant endTime)
      Constructs a new mutable activity with the start time and end time.
      Parameter:
      startTime - the start time of the activity
      endTime - the end time of the activity
      Seit:
      1.0
    • MutableActivityBase

      public MutableActivityBase(String name, Instant startTime, Instant endTime)
      Constructs a new mutable activity with the given name, start time, and end time.
      Parameter:
      name - the name of the activity
      startTime - the start time of the activity
      endTime - the end time of the activity
      Seit:
      1.0
  • Methodendetails

    • setName

      public void setName(String name)
      Beschreibung aus Schnittstelle kopiert: MutableActivity
      Sets the name of the activity.
      Angegeben von:
      setName in Schnittstelle MutableActivity
      Parameter:
      name - the new name of the activity
    • setStartTime

      public void setStartTime(Instant time)
      Beschreibung aus Schnittstelle kopiert: MutableActivity
      Sets a new start time on the activity.
      Angegeben von:
      setStartTime in Schnittstelle MutableActivity
      Parameter:
      time - the new start time
    • setEndTime

      public void setEndTime(Instant time)
      Beschreibung aus Schnittstelle kopiert: MutableActivity
      Sets a new end time on the activity.
      Angegeben von:
      setEndTime in Schnittstelle MutableActivity
      Parameter:
      time - the new end time
    • setDuration

      public 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.
      Parameter:
      duration - the duration of the activity
      Seit:
      1.0
    • getDuration

      public Duration getDuration()
      Convenience method to determine the duration between the start and the end time of the activity.
      Gibt zurück:
      the duration of the activity
    • addDuration

      public 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.
      Parameter:
      duration - the duration of the activity
      Seit:
      1.0
    • addDuration

      public 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.
      Parameter:
      duration - the duration of the activity
      multipliedBy - the number of times that the duration will be added
      Seit:
      1.0