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-2023 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 Details

    • Entry

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

      public Entry(Set<U> set, C counter, 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