public class TimeUnit extends AbsoluteLinearUnit<TimeUnit,DurationUnit>
Copyright (c) 2015-2019 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See DJUNITS License.
$LastChangedDate: 2019-01-18 00:35:01 +0100 (Fri, 18 Jan 2019) $, @version $Revision: 324 $, by $Author: averbraeck $,
initial version May 15, 2014
Modifier and Type | Field and Description |
---|---|
static TimeUnit |
BASE
The base unit for time with an artifical "zero" point.
|
static TimeUnit |
BASE_DAY
The base unit for time with an artifical "zero" point with a calculation in days.
|
static TimeUnit |
BASE_HOUR
The base unit for time with an artifical "zero" point with a calculation in hours.
|
static TimeUnit |
BASE_MICROSECOND
The base unit for time with an artifical "zero" point with a calculation in microseconds.
|
static TimeUnit |
BASE_MILLISECOND
The base unit for time with an artifical "zero" point with a calculation in milliseconds.
|
static TimeUnit |
BASE_MINUTE
The base unit for time with an artifical "zero" point with a calculation in minutes.
|
static TimeUnit |
BASE_SECOND
The base unit for time with an artifical "zero" point with a calculation in seconds.
|
static TimeUnit |
BASE_WEEK
The base unit for time with an artifical "zero" point with a calculation in weeks.
|
static TimeUnit |
EPOCH
The POSIX and Gregorian Epoch: January 1, 1970 at 00:00 UTC with a calculation in seconds.
|
static TimeUnit |
EPOCH_DAY
The POSIX and Gregorian Epoch: January 1, 1970 at 00:00 UTC with a calculation in days.
|
static TimeUnit |
EPOCH_HOUR
The POSIX and Gregorian Epoch: January 1, 1970 at 00:00 UTC with a calculation in hours.
|
static TimeUnit |
EPOCH_J2000_1
The Epoch with J2000.0 as the origin, which is The Gregorian date January 1, 2000 at 12:00 GMT (noon) with a calculation
in seconds.
|
static TimeUnit |
EPOCH_MICROSECOND
The POSIX and Gregorian Epoch: January 1, 1970 at 00:00 UTC with a calculation in microseconds.
|
static TimeUnit |
EPOCH_MILLISECOND
The POSIX and Gregorian Epoch: January 1, 1970 at 00:00 UTC with a calculation in milliseconds.
|
static TimeUnit |
EPOCH_MINUTE
The POSIX and Gregorian Epoch: January 1, 1970 at 00:00 UTC with a calculation in minutes.
|
static TimeUnit |
EPOCH_SECOND
The POSIX and Gregorian Epoch: January 1, 1970 at 00:00 UTC with a calculation in seconds.
|
static TimeUnit |
EPOCH_WEEK
The POSIX and Gregorian Epoch: January 1, 1970 at 00:00 UTC with a calculation in weeks.
|
static TimeUnit |
EPOCH_YEAR_1
The Epoch with 0001-01-01 AD at 00:00 as the origin with a calculation in seconds.
|
STANDARD_UNITS
Constructor and Description |
---|
TimeUnit(String name,
String abbreviation,
UnitSystem unitSystem,
double scaleFactor,
double offset,
DurationUnit relativeUnit)
Build a user-defined TimeUnit with a scale factor and offset to the base TimeUnit.
|
Modifier and Type | Method and Description |
---|---|
String |
getSICoefficientsString() |
TimeUnit |
getStandardUnit() |
equals, equalsIgnoreNaming, getOffset, getRelativeUnit, getScale, hashCode
getScaleFactor
generateHashCode, getAbbreviation, getAbbreviationKey, getAllUnitsOfThisType, getName, getNameKey, getSICoefficients, getUnits, getUnitSystem, isBaseSIUnit, isLocalizable, lookupOrCreateSIUnitWithSICoefficients, lookupOrCreateUnitWithSICoefficients, lookupUnitWithSICoefficients, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getScaleFactor
public static final TimeUnit BASE
public static final TimeUnit BASE_SECOND
public static final TimeUnit BASE_MICROSECOND
public static final TimeUnit BASE_MILLISECOND
public static final TimeUnit BASE_MINUTE
public static final TimeUnit BASE_HOUR
public static final TimeUnit BASE_DAY
public static final TimeUnit BASE_WEEK
public static final TimeUnit EPOCH
public static final TimeUnit EPOCH_SECOND
public static final TimeUnit EPOCH_MICROSECOND
public static final TimeUnit EPOCH_MILLISECOND
public static final TimeUnit EPOCH_MINUTE
public static final TimeUnit EPOCH_HOUR
public static final TimeUnit EPOCH_DAY
public static final TimeUnit EPOCH_WEEK
public static final TimeUnit EPOCH_YEAR_1
public static final TimeUnit EPOCH_J2000_1
public TimeUnit(String name, String abbreviation, UnitSystem unitSystem, double scaleFactor, double offset, DurationUnit relativeUnit)
name
- String; the long name of the unitabbreviation
- String; the abbreviation of the unitunitSystem
- UnitSystem; the unit system, e.g. SI or ImperialscaleFactor
- double; multiply a value in this unit by the factor to convert to the given reference unitoffset
- double; the offset to the reference unit to add to convert to the standard (e.g., BASE) unitrelativeUnit
- DurationUnit; the corresponding relative unit belonging to this absolute unitpublic final TimeUnit getStandardUnit()
getStandardUnit
in class Unit<TimeUnit>
public final String getSICoefficientsString()
getSICoefficientsString
in class Unit<TimeUnit>
Copyright © 2015–2019 Delft University of Technology. All rights reserved.