Class ExtendedDataList<T,G extends GtuData>
java.lang.Object
org.opentrafficsim.kpi.sampling.DataType<T,G>
org.opentrafficsim.kpi.sampling.data.ExtendedDataType<T,List<T>,List<T>,G>
org.opentrafficsim.kpi.sampling.data.ExtendedDataList<T,G>
- Type Parameters:
T
- type of valueG
- gtu data type
- All Implemented Interfaces:
org.djutils.base.Identifiable
- Direct Known Subclasses:
ExtendedDataString
public abstract class ExtendedDataList<T,G extends GtuData>
extends ExtendedDataType<T,List<T>,List<T>,G>
Extended data type for anything that can be captured in a list. Typically, these are non-numeric objects.
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
ConstructorDescriptionExtendedDataList
(String id, String description, Class<T> type) Constructor setting the id. -
Method Summary
Modifier and TypeMethodDescriptionConvert storage type to output type.getOutputValue
(List<T> output, int i) Returns a specific output value.getStorageValue
(List<T> output, int i) Returns a specific storage value.Returns an initial storage object.Returns an updated list/array/vector of the storage type, including a new value at given index.Methods inherited from class org.opentrafficsim.kpi.sampling.data.ExtendedDataType
getValue, interpolate, parseValue, toString
-
Constructor Details
-
ExtendedDataList
Constructor setting the id.- Parameters:
id
- String; iddescription
- String; descriptiontype
- Class<T>; type class
-
-
Method Details
-
getOutputValue
Returns a specific output value. This is used to store extended data types as generic file, i.e. text file.- Specified by:
getOutputValue
in classExtendedDataType<T,
List<T>, List<T>, G extends GtuData> - Parameters:
output
- O; outputi
- int; index of value to return- Returns:
- the i'th output value
- Throws:
SamplingException
- wheni
is out of bounds.
-
getStorageValue
Returns a specific storage value. This is used to bypass conversion to the output type when trajectories are cut.- Specified by:
getStorageValue
in classExtendedDataType<T,
List<T>, List<T>, G extends GtuData> - Parameters:
output
- S; storagei
- int; index of value to return- Returns:
- the i'th output value
- Throws:
SamplingException
- wheni
is out of bounds.
-
setValue
Returns an updated list/array/vector of the storage type, including a new value at given index. -
initializeStorage
Returns an initial storage object.- Specified by:
initializeStorage
in classExtendedDataType<T,
List<T>, List<T>, G extends GtuData> - Returns:
- initial storage object.
-
convert
Convert storage type to output type.
-