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 value
G - 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 Details

    • ExtendedDataList

      public ExtendedDataList(String id, String description, Class<T> type)
      Constructor.
      Parameters:
      id - id
      description - description
      type - type class
  • Method Details

    • getOutputValue

      public T getOutputValue(List<T> output, int i)
      Description copied from class: ExtendedDataType
      Returns a specific output value. This is used to store extended data types as generic file, i.e. text file.
      Specified by:
      getOutputValue in class ExtendedDataType<T,List<T>,List<T>,G extends GtuData>
      Parameters:
      output - output
      i - index of value to return
      Returns:
      the i'th output value o
    • getStorageValue

      public T getStorageValue(List<T> output, int i)
      Description copied from class: ExtendedDataType
      Returns a specific storage value. This is used to bypass conversion to the output type when trajectories are cut.
      Specified by:
      getStorageValue in class ExtendedDataType<T,List<T>,List<T>,G extends GtuData>
      Parameters:
      output - storage
      i - index of value to return
      Returns:
      the i'th output value
    • setValue

      public List<T> setValue(List<T> storage, int index, T value)
      Description copied from class: ExtendedDataType
      Returns an updated list/array/vector of the storage type, including a new value at given index.
      Specified by:
      setValue in class ExtendedDataType<T,List<T>,List<T>,G extends GtuData>
      Parameters:
      storage - storage
      index - index to store next value
      value - value to add
      Returns:
      updated list/array/vector of the storage type, including a new value at given index
    • initializeStorage

      public List<T> initializeStorage()
      Description copied from class: ExtendedDataType
      Returns an initial storage object.
      Specified by:
      initializeStorage in class ExtendedDataType<T,List<T>,List<T>,G extends GtuData>
      Returns:
      initial storage object
    • convert

      public List<T> convert(List<T> storage, int size)
      Description copied from class: ExtendedDataType
      Convert storage type to output type.
      Specified by:
      convert in class ExtendedDataType<T,List<T>,List<T>,G extends GtuData>
      Parameters:
      storage - stored data
      size - size of trajectory
      Returns:
      converted output