Class Position.Reference

All Implemented Interfaces:
org.djutils.base.Identifiable
Enclosing class:
Position

public static final class Position.Reference extends AbstractReference<Position.Reference,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.
  • Constructor Details

    • Reference

      public Reference(String id, String name, Length offset, Position.Reference offsetReference)
      Define a new reference point for the position.
      Parameters:
      id - the id
      name - the name or explanation
      offset - the offset w.r.t. the offsetReference
      offsetReference - the reference to which the offset is relative
    • Reference

      public Reference(String id, String name)
      Define a new reference point for the position.
      Parameters:
      id - the id
      name - the name or explanation
  • Method Details

    • add

      public static void add(String id, String name, Length offset, Position.Reference offsetReference)
      Define a new reference point for the position.
      Parameters:
      id - the id
      name - the name or explanation
      offset - the offset w.r.t. the offsetReference
      offsetReference - the reference to which the offset is relative
    • add

      public static void add(String id, String name)
      Define a new reference point for the position.
      Parameters:
      id - the id
      name - the name or explanation
    • get

      public static Position.Reference get(String id)
      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