Package org.rcsb.cif.binary.encoding
Class FixedPointEncoding
java.lang.Object
org.rcsb.cif.binary.encoding.FixedPointEncoding
- All Implemented Interfaces:
Encoding<FloatArray,Int32Array>
public class FixedPointEncoding extends Object implements Encoding<FloatArray,Int32Array>
Converts an array of floating point numbers to a Int32Array multiplied by a given factor.
FixedPoint {
kind = "FixedPoint"
factor: number
srcType: Float32 | Float64
}
Example
[1.2, 1.23, 0.123]
---FixedPoint--->
{ factor = 100 } [120, 123, 12]
-
Constructor Summary
Constructors Constructor Description FixedPointEncoding(int factor)FixedPointEncoding(int factor, int srcType) -
Method Summary
Modifier and Type Method Description FloatArraydecode(Int32Array data)Move one step up the encoding deque.Int32Arrayencode(FloatArray data)Move one step down the encoding deque.Map<String,Object>getMapRepresentation()Converts this encoding to its map representation that can be serialized as BinaryCif.StringtoString()
-
Constructor Details
-
FixedPointEncoding
public FixedPointEncoding(int factor) -
FixedPointEncoding
public FixedPointEncoding(int factor, int srcType)
-
-
Method Details
-
getMapRepresentation
Description copied from interface:EncodingConverts this encoding to its map representation that can be serialized as BinaryCif.- Specified by:
getMapRepresentationin interfaceEncoding<FloatArray,Int32Array>- Returns:
- a Map that contains all encoding information
-
decode
Description copied from interface:EncodingMove one step up the encoding deque. One step closer to the original representation of the data.- Specified by:
decodein interfaceEncoding<FloatArray,Int32Array>- Parameters:
data- the container to decode- Returns:
- the decoded information
-
encode
Description copied from interface:EncodingMove one step down the encoding deque. One step closer to aByteArrayrepresentation.- Specified by:
encodein interfaceEncoding<FloatArray,Int32Array>- Parameters:
data- the container to encode- Returns:
- the decoded information
-
toString
-