Package org.djunits.quantity
Class Time.Reference
java.lang.Object
org.djunits.quantity.def.AbstractReference<Time.Reference,Duration>
org.djunits.quantity.Time.Reference
- All Implemented Interfaces:
org.djutils.base.Identifiable
- Enclosing class:
- Time
The reference class to define a reference point for the time. Note that built-in time references are independent; DJUNITS
does not embed calendar calculations.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Time.ReferenceGPS.static final Time.ReferenceGregorian.static final Time.ReferenceUnix.Fields inherited from class org.djunits.quantity.def.AbstractReference
REFERENCES -
Constructor Summary
ConstructorsConstructorDescriptionDefine a new reference point for the time without an offset to a base reference.Reference(String id, String name, Duration offset, Time.Reference offsetReference) Define a new reference point for the time, with an offset value to another reference. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidDefine a new reference point for the time without an offset to a base reference.static voidadd(String id, String name, Duration offset, Time.Reference offsetReference) Define a new reference point for the time, with an offset value to another reference.static Time.ReferenceGet a reference point for the time, based on its id.Methods inherited from class org.djunits.quantity.def.AbstractReference
containsId, equals, get, getId, getName, getOffset, getOffsetReference, getReferenceMap, hashCode, mapFor, snapshotMap, toString, unregister
-
Field Details
-
GREGORIAN
Gregorian. -
UNIX
Unix. -
GPS
GPS.
-
-
Constructor Details
-
Reference
Define a new reference point for the time, with an offset value to another reference.- Parameters:
id- the idname- the name or explanationoffset- the offset w.r.t. offsetReferenceoffsetReference- the reference to which the offset is relative
-
Reference
Define a new reference point for the time without an offset to a base reference.- Parameters:
id- the idname- the name or explanation
-
-
Method Details
-
add
Define a new reference point for the time, with an offset value to another reference.- Parameters:
id- the idname- the name or explanationoffset- the offset w.r.t. offsetReferenceoffsetReference- the reference to which the offset is relative
-
add
Define a new reference point for the time without an offset to a base reference.- Parameters:
id- the idname- the name or explanation
-
get
Get a reference point for the time, based on its id. Return null when the id could not be found.- Parameters:
id- the id- Returns:
- the TimeReference object
-