Class 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-2022 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
    BSD-style license. See OpenTrafficSim License.

    Version:
    $Revision$, $LastChangedDate$, by $Author$, initial version 16 feb. 2018
    Author:
    Alexander Verbraeck, Peter Knoppers, Wouter Schakel
    • Constructor Detail

      • 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 Detail

      • 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