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<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()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 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
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
-
setEncoding
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
-