Interface EncodedData<D>

Type Parameters:
D - the array type this class wraps
All Known Subinterfaces:
FloatArray, IntArray, NumberArray<D>, SignedIntArray<T>, UnsignedIntArray
All Known Implementing Classes:
ByteArray, Float32Array, Float64Array, Int16Array, Int32Array, Int8Array, StringArray, Uint16Array, Uint32Array, Uint8Array

public interface EncodedData<D>
Data is always bundled with encoding information to handle de- and encoding.
  • Method Summary

    Modifier and Type Method Description
    default EncodedData<?> decode()  
    D getData()
    Access to the underlying array of information.
    Deque<Encoding<?,​?>> getEncoding()
    All encodings registered for this piece of EncodedData.
    boolean hasNextDecodingStep()
    Convenience method to state whether the List returned by getEncoding() is not empty.
    int length()
    The number of elements in the wrapped array.
    void setEncoding​(Deque<Encoding<?,​?>> encoding)
    Replace this encoding chain with a different one.
  • Method Details

    • getData

      D getData()
      Access to the underlying array of information.
      Returns:
      an int[], double[], byte[], or String[]
    • length

      int length()
      The number of elements in the wrapped array.
      Returns:
      results of array.length
    • getEncoding

      Deque<Encoding<?,​?>> getEncoding()
      All encodings registered for this piece of EncodedData. May be empty. May contain only partial data: e.g. adding a ByteArrayEncoding to the list will request encoding by ByteArrayCodec, this method call will subsequently fill all fields of the requested Encoding to allow for decoding.
      Returns:
      all associated Encoding instances
    • decode

      default EncodedData<?> decode()
    • setEncoding

      void setEncoding​(Deque<Encoding<?,​?>> encoding)
      Replace this encoding chain with a different one.
      Parameters:
      encoding - the new encoding chain for this instance
    • hasNextDecodingStep

      boolean hasNextDecodingStep()
      Convenience method to state whether the List returned by getEncoding() is not empty.
      Returns:
      true if encoding steps are registered and need to be resolved to access decoded data