Enum Time

java.lang.Object
java.lang.Enum<Time>
ch.framedev.simplejavautils.Time
Alle implementierten Schnittstellen:
Serializable, Comparable<Time>, java.lang.constant.Constable

public enum Time extends Enum<Time>
  • Enum-Konstanten - Details

    • MILLISECONDS

      public static final Time MILLISECONDS
    • SECONDS

      public static final Time SECONDS
    • MINUTES

      public static final Time MINUTES
    • HOURS

      public static final Time HOURS
    • DAYS

      public static final Time DAYS
    • WEEKS

      public static final Time WEEKS
    • MONTHS

      public static final Time MONTHS
    • YEARS

      public static final Time YEARS
  • Methodendetails

    • values

      public static Time[] values()
      Gibt ein Array mit den Konstanten dieses Enum-Typs in der Reihenfolge ihrer Deklaration zurück.
      Gibt zurück:
      ein Array mit den Konstanten dieses Enumerationstyps in der Reihenfolge ihrer Deklaration
    • valueOf

      public static Time valueOf(String name)
      Gibt die Enumerationskonstante dieses Typs mit dem angegebenen Namen zurück. Die Zeichenfolge muss exakt mit einer ID übereinstimmen, mit der eine Enumerationskonstante in diesem Typ deklariert wird. (Zusätzliche Leerzeichen sind nicht zulässig.)
      Parameter:
      name - Name der zurückzugebenden Enumerationskonstante.
      Gibt zurück:
      Enumerationskonstante mit dem angegebenen Namen
      Löst aus:
      IllegalArgumentException - wenn dieser Enumerationstyp keine Konstante mit dem angegebenen Namen enthält
      NullPointerException - wenn das Argument nicht angegeben wird
    • getSecondsPerUnit

      public double getSecondsPerUnit()
    • convert

      public static double convert(double value, Time from, Time to)
      Generic conversion between units (fractional values supported).
    • convert

      public static double convert(long value, Time from, Time to)
      Backwards-compatible overload for integral values.
    • convertTo

      public double convertTo(double value, Time to)
      Convert a value in this unit to the target unit.
    • convertTo

      public double convertTo(long value, Time to)
    • toMilliseconds

      public double toMilliseconds(double value)
    • toMilliseconds

      public double toMilliseconds(long value)
    • toSeconds

      public double toSeconds(double value)
    • toSeconds

      public double toSeconds(long value)
    • toMinutes

      public double toMinutes(double value)
    • toMinutes

      public double toMinutes(long value)
    • toHours

      public double toHours(double value)
    • toHours

      public double toHours(long value)
    • toDays

      public double toDays(double value)
    • toDays

      public double toDays(long value)
    • toWeeks

      public double toWeeks(double value)
    • toWeeks

      public double toWeeks(long value)
    • toMonths

      public double toMonths(double value)
    • toMonths

      public double toMonths(long value)
    • toYears

      public double toYears(double value)
    • toYears

      public double toYears(long value)
    • toString

      public String toString()
      Setzt außer Kraft:
      toString in Klasse Enum<Time>