Package org.opentrafficsim.core.egtf
Class Quantity<T extends Number,K>
java.lang.Object
org.opentrafficsim.core.egtf.Quantity<T,K>
- Type Parameters:
T- data typeK- grid output format
- Direct Known Subclasses:
TypedQuantity
Defines a quantity that data sources can provide, such as speed, flow, etc.
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:
- Wouter Schakel
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) final Kconvert(double[][] data) Converts the filtered data to an output format.booleanfinal StringgetName()Returns the name.inthashCode()(package private) final booleanisSpeed()Returns whether this quantity is speed.static Quantity<?,double[][]> Returns a quantity withdouble[][]containing SI values as output format.toString()
-
Field Details
-
SPEED_SI
Standard quantity for speed. -
FLOW_SI
Standard quantity for flow. -
DENSITY_SI
Standard quantity for density.
-
-
Constructor Details
-
Quantity
Constructor.- Parameters:
name- String; nameconverter- Converter<K>; converter for output format
-
Quantity
Constructor. Protected so only the default SPEED_SI quantity is speed.- Parameters:
name- String; namespeed- boolean; whether this quantity is speedconverter- Converter<K>; converter for output format
-
-
Method Details
-
si
Returns a quantity withdouble[][]containing SI values as output format.- Parameters:
name- String; name- Returns:
- quantity with
double[][]containing SI values as output format
-
getName
Returns the name.- Returns:
- String; name
-
isSpeed
final boolean isSpeed()Returns whether this quantity is speed.- Returns:
- boolean; whether this quantity is speed
-
convert
Converts the filtered data to an output format.- Parameters:
data- double[][]; filtered data- Returns:
- K; output data
-
hashCode
public int hashCode() -
equals
-
toString
-