Package org.opentrafficsim.draw.graphs
Enum FundamentalDiagram.Quantity
- java.lang.Object
-
- java.lang.Enum<FundamentalDiagram.Quantity>
-
- org.opentrafficsim.draw.graphs.FundamentalDiagram.Quantity
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<FundamentalDiagram.Quantity>
- Enclosing class:
- FundamentalDiagram
public static enum FundamentalDiagram.Quantity extends java.lang.Enum<FundamentalDiagram.Quantity>
Quantity enum defining density, flow and speed.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 16 okt. 2018
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract double
computeOther(FundamentalDiagram.Quantity pairing, double thisValue, double pairedValue)
Compute the value of the 3rd quantity.abstract java.lang.String
format(double value)
Formats a value for status display.abstract double
getValue(FundamentalDiagram.FdSource src, int series, int item)
Get scaled value in presentation unit.abstract java.lang.String
label()
Returns an axis label of the quantity.static FundamentalDiagram.Quantity
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static FundamentalDiagram.Quantity[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
DENSITY
public static final FundamentalDiagram.Quantity DENSITY
Density.
-
FLOW
public static final FundamentalDiagram.Quantity FLOW
Flow.
-
SPEED
public static final FundamentalDiagram.Quantity SPEED
Speed.
-
-
Method Detail
-
values
public static FundamentalDiagram.Quantity[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (FundamentalDiagram.Quantity c : FundamentalDiagram.Quantity.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static FundamentalDiagram.Quantity valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
label
public abstract java.lang.String label()
Returns an axis label of the quantity.- Returns:
- String; axis label of the quantity
-
format
public abstract java.lang.String format(double value)
Formats a value for status display.- Parameters:
value
- double; value- Returns:
- String; formatted string including quantity
-
getValue
public abstract double getValue(FundamentalDiagram.FdSource src, int series, int item)
Get scaled value in presentation unit.- Parameters:
src
- FdSource; the data sourceseries
- int; series numberitem
- int; item number in series- Returns:
- double; scaled value in presentation unit
-
computeOther
public abstract double computeOther(FundamentalDiagram.Quantity pairing, double thisValue, double pairedValue)
Compute the value of the 3rd quantity.- Parameters:
pairing
- Quantity; quantity on other axisthisValue
- double; value of this quantitypairedValue
- double; value of the paired quantity on the other axis- Returns:
- double; value of the 3rd quantity
-
-