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:
Iterable<S>
A
GraphCrossSection
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-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
ConstructorDescriptionGraphCrossSection
(String seriesName, GraphPath.Section<S> section, org.djunits.value.vdouble.scalar.Length position) Constructor for a one-series cross section.GraphCrossSection
(List<String> seriesNames, GraphPath.Section<S> section, List<org.djunits.value.vdouble.scalar.Length> positions) Constructor. -
Method Summary
Modifier and TypeMethodDescriptiongetSource
(int series) Returns the underlying source of the series.iterator()
iterator
(int series) Returns an iterator over the sources on the given series.org.djunits.value.vdouble.scalar.Length
position
(int series) Returns the position on the underlying source of the series.toString()
Methods inherited from class org.opentrafficsim.draw.graphs.AbstractGraphSpace
getName, getNumberOfSeries
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
GraphCrossSection
public GraphCrossSection(String seriesName, GraphPath.Section<S> section, org.djunits.value.vdouble.scalar.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(List<String> seriesNames, GraphPath.Section<S> section, List<org.djunits.value.vdouble.scalar.Length> positions) Constructor.- Parameters:
seriesNames
- List<String>; names of seriessection
- Section<S>; sectionpositions
- List<Length>; position on the section
-
-
Method Details
-
getSource
Returns the underlying source of the series.- Parameters:
series
- int; series number- Returns:
- S; underlying source of the series
-
iterator
Returns an iterator over the sources on the given series.- Specified by:
iterator
in classAbstractGraphSpace<S>
- Parameters:
series
- int; number of the series- Returns:
- Iterator<S>; iterator over the sources on the given series
-
position
public org.djunits.value.vdouble.scalar.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
-
toString
-