Class GraphPath.Section<L>

java.lang.Object
org.opentrafficsim.draw.graphs.GraphPath.Section<L>
Type Parameters:
L - underlying type
All Implemented Interfaces:
Iterable<L>
Enclosing class:
GraphPath<S>

public static class GraphPath.Section<L> extends Object implements Iterable<L>
Class for sections.

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

    • Section

      public Section(Length length, Speed speedLimit, List<L> sections)
      Constructor.
      Parameters:
      length - Length; length of the section
      speedLimit - Speed; speed limit on the section
      sections - List<S>; list of underlying objects
  • Method Details

    • getLength

      public Length getLength()
      Returns the section length.
      Returns:
      Length; section length
    • getSpeedLimit

      public Speed getSpeedLimit()
      Returns the speed limit on the section.
      Returns:
      Speed; speed limit on the section
    • getSource

      public L getSource(int series)
      Returns the source object.
      Parameters:
      series - int; number
      Returns:
      S; underlying object of the series
    • iterator

      public Iterator<L> iterator()
      Specified by:
      iterator in interface Iterable<L>