Package org.djunits.quantity.def
Interface Reference<R extends Reference<R,A,Q>,A extends AbsQuantity<A,Q,R>,Q extends Quantity<Q>>
- Type Parameters:
R- the reference type itselfA- the absolute quantity type for generics instantiationQ- the relative quantity type for the offset
- All Superinterfaces:
org.djutils.base.Identifiable
- All Known Implementing Classes:
AbstractReference,Direction.Reference,Position.Reference,Temperature.Reference,Time.Reference
public interface Reference<R extends Reference<R,A,Q>,A extends AbsQuantity<A,Q,R>,Q extends Quantity<Q>>
extends org.djutils.base.Identifiable
Reference contains information about the reference point or origin / zero point of an absolute quantity.
Copyright (c) 2025-2026 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See for project information https://djunits.org. The DJUNITS project is distributed under a three-clause BSD-style license.
- Author:
- Alexander Verbraeck
-
Method Summary
Modifier and TypeMethodDescriptiongetName()Return the description of this reference point.Return the offset w.r.t. the offset reference, or zero when the offset is not defined.Return the offset reference for the offset, or null when the offset reference is not defined.Return a safe copy of the static reference map for this Reference subclass.instantiate(Q quantity) Return a strongly typed absolute quantity belonging to this reference.booleanInstance-level unregister; removes this reference from the per-class registry.Methods inherited from interface org.djutils.base.Identifiable
getId
-
Method Details
-
getReferenceMap
Return a safe copy of the static reference map for this Reference subclass.- Returns:
- a safe copy of the static reference map for this subclass
-
unregister
boolean unregister()Instance-level unregister; removes this reference from the per-class registry. Intended primarily for unit tests to clean up temporary references. Existing objects that hold a direct pointer to this instance continue to work.- Returns:
- true if this reference was removed from the registry; false if it was not present
-
instantiate
Return a strongly typed absolute quantity belonging to this reference.- Parameters:
quantity- the relative quantity that indicates the 'distance' to this reference point- Returns:
- a strongly typed absolute quantity belonging to this reference
-
getOffset
Q getOffset()Return the offset w.r.t. the offset reference, or zero when the offset is not defined.- Returns:
- the offset expressed in the relative quantity
-
getOffsetReference
R getOffsetReference()Return the offset reference for the offset, or null when the offset reference is not defined.- Returns:
- the offset reference
-
getName
String getName()Return the description of this reference point.- Returns:
- description of this reference point
-