Package org.djunits.quantity
Class Position.Reference
java.lang.Object
org.djunits.quantity.def.AbstractReference<Position.Reference,Position,Length>
org.djunits.quantity.Position.Reference
- All Implemented Interfaces:
Reference<Position.Reference,,Position, Length> org.djutils.base.Identifiable
- Enclosing class:
- Position
public static final class Position.Reference
extends AbstractReference<Position.Reference,Position,Length>
The reference class to define a reference point for the position. No references have been defined yet, since there is no
"natural" origin for a position that we can include here. User-defined origins van be easily added and used.
-
Field Summary
Fields inherited from class org.djunits.quantity.def.AbstractReference
REFERENCES -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidDefine a new reference point for the position.static voidadd(String id, String name, Length offset, Position.Reference offsetReference) Define a new reference point for the position.static Position.ReferenceGet a reference point for the position, based on its id.instantiate(Length length) Return a strongly typed absolute quantity belonging to this reference.Methods inherited from class org.djunits.quantity.def.AbstractReference
containsId, equals, get, getId, getName, getOffset, getOffsetReference, getReferenceMap, hashCode, mapFor, snapshotMap, toString, unregister
-
Constructor Details
-
Reference
Define a new reference point for the position.- Parameters:
id- the idname- the name or explanationoffset- the offset w.r.t. the offsetReferenceoffsetReference- the reference to which the offset is relative
-
Reference
Define a new reference point for the position.- Parameters:
id- the idname- the name or explanation
-
-
Method Details
-
add
Define a new reference point for the position.- Parameters:
id- the idname- the name or explanationoffset- the offset w.r.t. the offsetReferenceoffsetReference- the reference to which the offset is relative
-
add
Define a new reference point for the position.- Parameters:
id- the idname- the name or explanation
-
get
Get a reference point for the position, based on its id. Return null when the id could not be found.- Parameters:
id- the id- Returns:
- the PositionReference object
-
instantiate
Description copied from class:AbstractReferenceReturn a strongly typed absolute quantity belonging to this reference.- Specified by:
instantiatein interfaceReference<Position.Reference,Position, Length> - Specified by:
instantiatein classAbstractReference<Position.Reference,Position, Length> - Parameters:
length- the relative quantity that indicates the 'distance' to this reference point- Returns:
- a strongly typed absolute quantity belonging to this reference
-