Class Time

java.lang.Object
com.eco.bio7.time.Time

public class Time extends Object
This class provides methods to access the time and the counter of the Bio7 application.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final double
    The highest and the lowest frame rate (steps per second) of the calculation thread.
    static final int
     
    static final double
     
    static final int
    The shortest and the longest interval of the calculation thread in milliseconds.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    Adds a listener which is called when the interval (the speed) changes (in the thread which changed it).
    static void
    Adds a listener which is called when the pause changes (started or paused; in the thread which changed it).
    static void
    Increments the Bio7 counter.
    static int
    Returns the Bio7 counter.
    static double
    Returns the frame rate (calculation steps per second).
    static int
    Returns the time between two calculation steps.
    static long
    Returns the time between two calculation steps in nanoseconds.
    static int
    Returns the current modulo operator.
    static String
    Returns the month.
    static int
    Returns the month.
    static int
    Returns the number of the month.
    static int
    Method for the abiotic factors panel.
    static int
    Returns the time.
    static int
    Returns the year.
    static boolean
    Returns if the pause is activated.
    static void
    Removes a listener of the interval.
    static void
    Removes a listener of the pause.
    static void
    setCounter(int counter)
    Sets the Bio7 counter.
    static void
    setFps(double fps)
    Sets the frame rate (calculation steps per second).
    static void
    setInterval(int value)
    Sets the time between two calculation steps.
    static void
    setModtime(int modtime)
    Changes the current modulo operator (time % operator).
    static void
    setMonth(String[] month)
    A method to rearrange the sequence of the month.
    static void
    setMonthnumber(int[] month)
    A method which will change the sequence of the month as a number.
    static void
    setNutrienttime(int time)
    Method for the abiotic factors panel.
    static void
    setPause(boolean pause)
    Sets or unsets the pause.
    static void
    setYear(int year)
    Sets the year.
    static void
    Resets the time.
    static void
     

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • MIN_INTERVAL

      public static final int MIN_INTERVAL
      The shortest and the longest interval of the calculation thread in milliseconds.
      See Also:
    • MAX_INTERVAL

      public static final int MAX_INTERVAL
      See Also:
    • MAX_FPS

      public static final double MAX_FPS
      The highest and the lowest frame rate (steps per second) of the calculation thread.
      See Also:
    • MIN_FPS

      public static final double MIN_FPS
      See Also:
  • Constructor Details

    • Time

      public Time()
  • Method Details

    • Timeupdate

      public static void Timeupdate()
    • Timereset

      public static void Timereset()
      Resets the time.
    • getMonth

      public static String getMonth()
      Returns the month.
      Returns:
      the month as string value.
    • getYear

      public static int getYear()
      Returns the year.
      Returns:
      the year as an integer value.
    • getMonthcount

      public static int getMonthcount()
      Returns the month.
      Returns:
      the month as an integer value.
    • getMonthNumber

      public static int getMonthNumber()
      Returns the number of the month.
      Returns:
      the number of the month as an integer value.
    • getNutrienttime

      public static int getNutrienttime()
      Method for the abiotic factors panel.
      Returns:
      the nutrient time as an integer value.
    • setNutrienttime

      public static void setNutrienttime(int time)
      Method for the abiotic factors panel.
      Parameters:
      time - the nutrient time as an integer value.
    • getCounter

      public static int getCounter()
      Returns the Bio7 counter.
      Returns:
      the counter as an integer value.
    • setCounter

      public static void setCounter(int counter)
      Sets the Bio7 counter.
      Parameters:
      counter - the counter as an integer value.
    • count

      public static void count()
      Increments the Bio7 counter.
    • isPause

      public static boolean isPause()
      Returns if the pause is activated.
      Returns:
      a boolean value.
    • setPause

      public static void setPause(boolean pause)
      Sets or unsets the pause.
      Parameters:
      pause - a boolean value.
    • addPauseListener

      public static void addPauseListener(Runnable listener)
      Adds a listener which is called when the pause changes (started or paused; in the thread which changed it).
      Parameters:
      listener - the listener
    • removePauseListener

      public static void removePauseListener(Runnable listener)
      Removes a listener of the pause.
    • getModtime

      public static int getModtime()
      Returns the current modulo operator.
      Returns:
      the modulo operator as an integer value.
    • setModtime

      public static void setModtime(int modtime)
      Changes the current modulo operator (time % operator).
      Parameters:
      modtime - the modulo operator as an integer value.
    • setMonth

      public static void setMonth(String[] month)
      A method to rearrange the sequence of the month. This method has to be used with the setMonthnumber method!
      Parameters:
      month - the month values as a string array.
    • setMonthnumber

      public static void setMonthnumber(int[] month)
      A method which will change the sequence of the month as a number. This method has to be used with the setMonth method!
      Parameters:
      month - the sequence as an integer array.
    • setYear

      public static void setYear(int year)
      Sets the year.
      Parameters:
      year - the year as an integer value.
    • getTime

      public static int getTime()
      Returns the time.
      Returns:
      the time as an integer value.
    • setInterval

      public static void setInterval(int value)
      Sets the time between two calculation steps. The change takes effect immediately, also during a long interval.
      Parameters:
      value - the interval in milliseconds (limited to MIN_INTERVAL - MAX_INTERVAL).
    • setFps

      public static void setFps(double fps)
      Sets the frame rate (calculation steps per second). The change takes effect immediately, also during a long interval.
      Parameters:
      fps - the frames per second (limited to MIN_FPS - MAX_FPS).
    • getFps

      public static double getFps()
      Returns the frame rate (calculation steps per second).
      Returns:
      the frames per second.
    • getIntervalNanos

      public static long getIntervalNanos()
      Returns the time between two calculation steps in nanoseconds.
      Returns:
      the interval in nanoseconds.
    • addIntervalListener

      public static void addIntervalListener(Runnable listener)
      Adds a listener which is called when the interval (the speed) changes (in the thread which changed it).
    • removeIntervalListener

      public static void removeIntervalListener(Runnable listener)
      Removes a listener of the interval.
    • getInterval

      public static int getInterval()
      Returns the time between two calculation steps.
      Returns:
      the interval in milliseconds.