Class ExtendedDataTypeNumber<G extends GtuDataInterface>

    • Constructor Summary

      Constructors 
      Constructor Description
      ExtendedDataTypeNumber​(java.lang.String id)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      float[] convert​(float[] storage, int size)
      Convert storage type to output type.
      java.lang.String formatValue​(java.lang.String format, java.lang.Float value)
      Formats the value into a string.
      java.lang.Float getOutputValue​(float[] output, int index)
      Returns a specific output value.
      java.lang.Float getStorageValue​(float[] storage, int index)
      Returns a specific storage value.
      float[] initializeStorage()
      Returns an initial storage object.
      java.lang.Float parseValue​(java.lang.String string)
      Parses a stored string representation to original type.
      float[] setValue​(float[] storage, int index, java.lang.Float value)
      Returns an updated list/array/vector of the storage type, including a new value at given index.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ExtendedDataTypeNumber

        public ExtendedDataTypeNumber​(java.lang.String id)
        Constructor.
        Parameters:
        id - String; id
    • Method Detail

      • setValue

        public float[] setValue​(float[] storage,
                                int index,
                                java.lang.Float value)
        Returns an updated list/array/vector of the storage type, including a new value at given index.
        Specified by:
        setValue in class ExtendedDataType<java.lang.Float,​float[],​float[],​G extends GtuDataInterface>
        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
      • getOutputValue

        public java.lang.Float getOutputValue​(float[] output,
                                              int index)
                                       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<java.lang.Float,​float[],​float[],​G extends GtuDataInterface>
        Parameters:
        output - O; output
        index - int; index of value to return
        Returns:
        the i'th output value
        Throws:
        SamplingException - when i is out of bounds.
      • getStorageValue

        public java.lang.Float getStorageValue​(float[] storage,
                                               int index)
                                        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<java.lang.Float,​float[],​float[],​G extends GtuDataInterface>
        Parameters:
        storage - S; storage
        index - int; index of value to return
        Returns:
        the i'th output value
        Throws:
        SamplingException - when i is out of bounds.
      • initializeStorage

        public float[] initializeStorage()
        Returns an initial storage object.
        Specified by:
        initializeStorage in class ExtendedDataType<java.lang.Float,​float[],​float[],​G extends GtuDataInterface>
        Returns:
        initial storage object.
      • convert

        public float[] convert​(float[] storage,
                               int size)
        Convert storage type to output type.
        Specified by:
        convert in class ExtendedDataType<java.lang.Float,​float[],​float[],​G extends GtuDataInterface>
        Parameters:
        storage - S; stored data
        size - int; size of trajectory
        Returns:
        converted output
      • formatValue

        public java.lang.String formatValue​(java.lang.String format,
                                            java.lang.Float value)
        Formats the value into a string. If the value is numeric, the default implementation is:
         String.format(format, value.si);
         
        Specified by:
        formatValue in class ExtendedDataType<java.lang.Float,​float[],​float[],​G extends GtuDataInterface>
        Parameters:
        format - String; format
        value - T; value
        Returns:
        formatted value
      • parseValue

        public java.lang.Float parseValue​(java.lang.String string)
        Parses a stored string representation to original type.
        Specified by:
        parseValue in class ExtendedDataType<java.lang.Float,​float[],​float[],​G extends GtuDataInterface>
        Parameters:
        string - String; stored string representation
        Returns:
        T; value in original type