Class TimeParameter

All Implemented Interfaces:
LXPath, LXParameter

public class TimeParameter extends AggregateParameter
A time parameter is a utility for specifying a time of day in discrete hours, minutes, and seconds components.
  • Field Details

  • Constructor Details

    • TimeParameter

      public TimeParameter(String label)
  • Method Details

    • setDescription

      public TimeParameter setDescription(String description)
      Overrides:
      setDescription in class LXListenableParameter
    • setTime

      public TimeParameter setTime(int hours, int minutes, int seconds)
      Sets the value of the time parameter
      Parameters:
      hours - Hours of day (0-23)
      minutes - Minutes of the hour (0-59)
      seconds - Seconds of the hour (0-59)
      Returns:
      this
    • setTime

      public TimeParameter setTime(int secondsOfDay)
      Sets the time parameter to the given number of seconds in the day
      Parameters:
      secondsOfDay - Seconds in the day (0 - TimeParameter.SECONDS_PER_DAY - 1)
      Returns:
      this
    • getSecondsOfDay

      public int getSecondsOfDay()
      Returns the stored time value as a number of seconds elapsed in the day
      Returns:
      Number of seconds in the day this time represents
    • getSecondsOfDay

      public static int getSecondsOfDay(int hours, int minutes, int seconds)
    • getSecondsOfDay

      public static int getSecondsOfDay(Calendar calendar)
    • updateSubparameters

      protected void updateSubparameters(double value)
      Description copied from class: AggregateParameter
      Subclasses should update the subparameter values based upon the raw parameter value if it has been set directly.
      Specified by:
      updateSubparameters in class AggregateParameter
    • onSubparameterUpdate

      protected void onSubparameterUpdate(LXParameter p)
      Description copied from class: AggregateParameter
      Subclasses should update the main parameter value when a sub-parameter has changed
      Specified by:
      onSubparameterUpdate in class AggregateParameter
      Parameters:
      p - Subparameter that has changed