Class ExtendedDataList<T,​G extends GtuData>

    • Constructor Detail

      • ExtendedDataList

        public ExtendedDataList​(String id,
                                String description,
                                Class<T> type)
        Constructor setting the id.
        Parameters:
        id - String; id
        description - String; description
        type - Class<T>; type class
    • Method Detail

      • getOutputValue

        public T getOutputValue​(List<T> output,
                                int i)
                         throws SamplingException
        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 - O; output
        i - int; index of value to return
        Returns:
        the i'th output value
        Throws:
        SamplingException - when i is out of bounds.
      • getStorageValue

        public T getStorageValue​(List<T> output,
                                 int i)
                          throws SamplingException
        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 - S; storage
        i - int; index of value to return
        Returns:
        the i'th output value
        Throws:
        SamplingException - when i is out of bounds.
      • setValue

        public List<T> setValue​(List<T> storage,
                                int index,
                                T value)
        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 - S; storage
        index - int; index to store next value
        value - T; value to add
        Returns:
        updated list/array/vector of the storage type, including a new value at given index
      • convert

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