public enum TimeSize extends java.lang.Enum<TimeSize> implements MeasureEnum<TimeSize>
Enum Constant and Description |
---|
Century
Century
|
Day
Day
|
Decade
Decade
|
Fortnight
A fortnight
|
Hour
Hour
|
Microsecond
Microsecond
|
Millennium
Millenium
|
Millisecond
Millisecond
|
Minute
One minute
|
Month
Month, as 1/12th of a year
|
Nanosecond
Nanosecond
|
Second
Second
|
Week
A week
|
Year
Year, as 365 days
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAbbreviation()
Returns the most common abbreviation for this measure
|
java.util.Collection<java.lang.String> |
getAbbreviations()
Returns a set of all possible abbreviations for this unit
|
TimeSize |
getBaseUnit()
Returns the base unit used as a base in this type
|
RationalNumber |
getConversionRateFromBase()
Gets a rational number that represents the conversion rate from the a base size to this size.
|
RationalNumber |
getConversionRateTo(TimeSize size)
Gets a rational number that represents the conversion rate from the a base size to this size.
|
RationalNumber |
getConversionRateToBase()
Gets a rational number that represents the conversion rate from the given size to the base measure for this size.
|
MeasurementSystem |
getMeasurementSystem()
Returns the measurement system this is a part of
|
java.lang.String |
getName()
Returns the name of this measure.
|
java.lang.String |
getPluralName()
Returns the name of this measure in plural.
|
static java.util.List<TimeSize> |
getSmallestToLargest()
Returns all the sizes, sorted from smallest to largest
|
static TimeSize |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static TimeSize[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final TimeSize Minute
public static final TimeSize Second
public static final TimeSize Millisecond
public static final TimeSize Microsecond
public static final TimeSize Nanosecond
public static final TimeSize Hour
public static final TimeSize Day
public static final TimeSize Week
public static final TimeSize Fortnight
public static final TimeSize Year
public static final TimeSize Month
public static final TimeSize Decade
public static final TimeSize Century
public static final TimeSize Millennium
public static TimeSize[] values()
for (TimeSize c : TimeSize.values()) System.out.println(c);
public static TimeSize valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null@NotNull public TimeSize getBaseUnit()
MeasureEnum
getBaseUnit
in interface MeasureEnum<TimeSize>
@Nullable public java.lang.String getAbbreviation()
MeasureEnum
getAbbreviation
in interface MeasureEnum<TimeSize>
public java.lang.String getName()
MeasureEnum
getName
in interface MeasureEnum<TimeSize>
public java.lang.String getPluralName()
MeasureEnum
getPluralName
in interface MeasureEnum<TimeSize>
public RationalNumber getConversionRateToBase()
MeasureEnum
getConversionRateToBase
in interface MeasureEnum<TimeSize>
public RationalNumber getConversionRateFromBase()
MeasureEnum
getConversionRateFromBase
in interface MeasureEnum<TimeSize>
public RationalNumber getConversionRateTo(@NotNull TimeSize size)
MeasureEnum
getConversionRateTo
in interface MeasureEnum<TimeSize>
size
- The size to convert topublic MeasurementSystem getMeasurementSystem()
MeasureEnum
getMeasurementSystem
in interface MeasureEnum<TimeSize>
public java.util.Collection<java.lang.String> getAbbreviations()
MeasureEnum
getAbbreviations
in interface MeasureEnum<TimeSize>