Package org.rcsb.cif.binary.data
Interface EncodedData<D>
-
- Type Parameters:
D- the array type this class wraps
- All Known Subinterfaces:
FloatArray,IntArray,NumberArray<D>,SignedIntArray,UnsignedIntArray
- All Known Implementing Classes:
AbstractEncodedData,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
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default EncodedData<?>decode()Request decoding of this EncodedData instance.DgetData()Access to the underlying array of information.Deque<Encoding<?>>getEncoding()All encodings registered for this piece of EncodedData.booleanhasNextDecodingStep()Convenience method to state whether the List returned bygetEncoding()is not empty.intlength()The number of elements in the wrapped array.voidsetEncoding(Deque<Encoding<?>> encoding)Replace this encoding chain with a different one.
-
-
-
Method Detail
-
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()
Request decoding of this EncodedData instance. Will automatically resolve its decoding chain, starting from a ByteArray until 'raw' data represented by Int32Array, Float64Array, or StringArray classes is achieved which is then ready to use.- Returns:
- the decoded data
-
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 bygetEncoding()is not empty.- Returns:
- true if encoding steps are registered and need to be resolved to access decoded data
-
-