Class MutableHighLowChartActivityBase<T>

Type Parameters:
T - the type of the optional user object
All Implemented Interfaces:
Activity, HighLowChartActivity, MutableActivity, MutableHighLowChartActivity

public class MutableHighLowChartActivityBase<T>
extends HighLowChartActivityBase<T>
implements MutableHighLowChartActivity
The base implementation of a mutable high / low activity.
Since:
1.0
  • Constructor Details

    • MutableHighLowChartActivityBase

      public MutableHighLowChartActivityBase()
      Constructs a new high-low activity. The initial high and low values will both be equal to zero. The start time will be equal to Instant.now() and the end time will be equal to Instant.now() plus ActivityBase.DEFAULT_DURATION.
      Since:
      1.0
    • MutableHighLowChartActivityBase

      public MutableHighLowChartActivityBase​(double low, double high, Instant startTime, Instant endTime)
      Constructs a new high-low activity with the given initial high and low values and the given start and end time.
      Parameters:
      low - the low value of the activity
      high - the high value of the activity
      startTime - the start time of the activity
      endTime - the end time of the activity
      Throws:
      IllegalArgumentException - if low is larger than high
      Since:
      1.0
    • MutableHighLowChartActivityBase

      public MutableHighLowChartActivityBase​(double low, double high, Instant time)
      Constructs a new high-low activity with the given initial high and low values and the start and end time set to the given time.
      Parameters:
      low - the low value of the activity
      high - the high value of the activity
      time - the start and end time of the activity
      Throws:
      IllegalArgumentException - if low is larger than high
      Since:
      1.0
  • Method Details

    • setName

      public void setName​(String name)
      Description copied from interface: MutableActivity
      Sets the name of the activity.
      Specified by:
      setName in interface MutableActivity
      Parameters:
      name - the new name of the activity
    • setUserObject

      public void setUserObject​(T userObject)
      Overrides:
      setUserObject in class ActivityBase<T>
    • setStartTime

      public void setStartTime​(Instant time)
      Description copied from interface: MutableActivity
      Sets a new start time on the activity.
      Specified by:
      setStartTime in interface MutableActivity
      Parameters:
      time - the new start time
    • setEndTime

      public void setEndTime​(Instant time)
      Description copied from interface: MutableActivity
      Sets a new end time on the activity.
      Specified by:
      setEndTime in interface MutableActivity
      Parameters:
      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.
      Parameters:
      duration - the duration of the activity
      Since:
      1.0
    • getDuration

      public Duration getDuration()
      Convenience method to determine the duration between the start and the end time of the activity.
      Returns:
      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.
      Parameters:
      duration - the duration of the activity
      Since:
      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.
      Parameters:
      duration - the duration of the activity
      multipliedBy - the number of times that the duration will be added
      Since:
      1.0
    • setHigh

      public void setHigh​(double high)
      Description copied from interface: MutableHighLowChartActivity
      Sets the high value of the activity.
      Specified by:
      setHigh in interface MutableHighLowChartActivity
      Parameters:
      high - the new high value
    • setLow

      public void setLow​(double low)
      Description copied from interface: MutableHighLowChartActivity
      Sets the low value of the activity.
      Specified by:
      setLow in interface MutableHighLowChartActivity
      Parameters:
      low - the new low value
    • toString

      public String toString()
      Overrides:
      toString in class HighLowChartActivityBase<T>