Class AbstractPerceptionIterable.Entry

java.lang.Object
org.opentrafficsim.road.gtu.lane.perception.AbstractPerceptionIterable.Entry
Enclosing class:
AbstractPerceptionIterable<H extends Headway,U,C>

protected class AbstractPerceptionIterable.Entry extends Object
Class of objects for subclasses to return. This can contain either a single object, or a set if there are multiple objects at a single location.

Copyright (c) 2013-2024 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.

Author:
Alexander Verbraeck, Peter Knoppers, Wouter Schakel
  • Constructor Summary

    Constructors
    Constructor
    Description
    Entry(Set<U> set, C counter, org.djunits.value.vdouble.scalar.Length position)
    Constructor.
    Entry(U object, C counter, org.djunits.value.vdouble.scalar.Length position)
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the underlying object.
    Returns the underlying set.
    (package private) final boolean
    Returns whether this entry contains a set.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Entry

      public Entry(U object, C counter, org.djunits.value.vdouble.scalar.Length position)
      Constructor.
      Parameters:
      object - U; object
      counter - C; counter, may be null
      position - Length; position
    • Entry

      public Entry(Set<U> set, C counter, org.djunits.value.vdouble.scalar.Length position)
      Constructor.
      Parameters:
      set - Set<U>; set
      counter - C; counter, may be null
      position - Length; position
  • Method Details

    • isSet

      final boolean isSet()
      Returns whether this entry contains a set.
      Returns:
      whether this entry contains a set
    • getObject

      public U getObject()
      Returns the underlying object. Use !isSet() to check whether there is an object.
      Returns:
      U; underlying set
    • getSet

      public Set<U> getSet()
      Returns the underlying set. Use isSet() to check whether there is a set.
      Returns:
      Set<U>; underlying set