Package org.opentrafficsim.draw.graphs
Class GraphCrossSection<S>
- java.lang.Object
-
- org.opentrafficsim.draw.graphs.AbstractGraphSpace<S>
-
- org.opentrafficsim.draw.graphs.GraphCrossSection<S>
-
- Type Parameters:
S
- underlying type of path sections
- All Implemented Interfaces:
java.lang.Iterable<S>
public class GraphCrossSection<S> extends AbstractGraphSpace<S>
AGraphCrossSection
defines the location of graphs. It has one section having one or more source objects depending on the number of series. For example, a 3-lane road may result in a section with 3 series. Graphs can aggregate the series, or show multiple series.Copyright (c) 2013-2020 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 22 okt. 2018
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
-
-
Constructor Summary
Constructors Constructor Description GraphCrossSection(java.lang.String seriesName, GraphPath.Section<S> section, Length position)
Constructor for a one-series cross section.GraphCrossSection(java.util.List<java.lang.String> seriesNames, GraphPath.Section<S> section, java.util.List<Length> positions)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description S
getSource(int series)
Returns the underlying source of the series.java.util.Iterator<S>
iterator()
java.util.Iterator<S>
iterator(int series)
Length
position(int series)
Returns the position on the underlying source of the series.java.lang.String
toString()
-
Methods inherited from class org.opentrafficsim.draw.graphs.AbstractGraphSpace
getName, getNumberOfSeries
-
-
-
-
Constructor Detail
-
GraphCrossSection
public GraphCrossSection(java.lang.String seriesName, GraphPath.Section<S> section, Length position)
Constructor for a one-series cross section.- Parameters:
seriesName
- String; name of seriessection
- Section<S>; sectionposition
- Length; position on the section
-
GraphCrossSection
public GraphCrossSection(java.util.List<java.lang.String> seriesNames, GraphPath.Section<S> section, java.util.List<Length> positions)
Constructor.- Parameters:
seriesNames
- List<String>; names of seriessection
- Section<S>; sectionpositions
- List<Length>; position on the section
-
-
Method Detail
-
getSource
public S getSource(int series)
Returns the underlying source of the series.- Parameters:
series
- int; series number- Returns:
- S; underlying source of the series
-
iterator
public java.util.Iterator<S> iterator(int series)
-
position
public Length position(int series)
Returns the position on the underlying source of the series.- Parameters:
series
- int; series number- Returns:
- Length; position on the underlying source of the series
-
iterator
public java.util.Iterator<S> iterator()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-