public class TimeUnit extends Unit<TimeUnit>
Copyright (c) 2014 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
Modifier and Type | Field and Description |
---|---|
static TimeUnit |
DAY
day.
|
static TimeUnit |
HOUR
hour.
|
static TimeUnit |
MILLISECOND
millisecond.
|
static TimeUnit |
MINUTE
minute.
|
static TimeUnit |
SECOND
second.
|
static TimeUnit |
SI
The SI unit for time is second.
|
static TimeUnit |
WEEK
week.
|
Constructor and Description |
---|
TimeUnit(String nameKey,
String abbreviationKey,
UnitSystem unitSystem)
Build a standard unit.
|
TimeUnit(String nameKey,
String abbreviationKey,
UnitSystem unitSystem,
TimeUnit referenceUnit,
double conversionFactorToReferenceUnit)
Build a unit with a conversion factor to another unit.
|
Modifier and Type | Method and Description |
---|---|
String |
getSICoefficientsString() |
TimeUnit |
getStandardUnit() |
getAbbreviation, getAbbreviationKey, getAllUnitsOfThisType, getConversionFactorToStandardUnit, getName, getNameKey, getSICoefficients, getUnits, getUnitSystem, lookupOrCreateSIUnitWithSICoefficients, lookupOrCreateUnitWithSICoefficients, lookupUnitWithSICoefficients, toString
public static final TimeUnit SI
public static final TimeUnit SECOND
public static final TimeUnit MILLISECOND
public static final TimeUnit MINUTE
public static final TimeUnit HOUR
public static final TimeUnit DAY
public static final TimeUnit WEEK
public TimeUnit(String nameKey, String abbreviationKey, UnitSystem unitSystem)
nameKey
- the key to the locale file for the long name of the unitabbreviationKey
- the key to the locale file for the abbreviation of the unitunitSystem
- the unit system, e.g. SI or Imperialpublic TimeUnit(String nameKey, String abbreviationKey, UnitSystem unitSystem, TimeUnit referenceUnit, double conversionFactorToReferenceUnit)
nameKey
- the key to the locale file for the long name of the unitabbreviationKey
- the key to the locale file for the abbreviation of the unitunitSystem
- the unit system, e.g. SI or ImperialreferenceUnit
- the unit to convert toconversionFactorToReferenceUnit
- multiply a value in this unit by the factor to convert to the given
reference unitpublic final TimeUnit getStandardUnit()
getStandardUnit
in class Unit<TimeUnit>
public final String getSICoefficientsString()
getSICoefficientsString
in class Unit<TimeUnit>
Copyright © 2014–2015 Delft University of Technology. All rights reserved.