Package org.rcsb.cif.binary
Class Classifier
java.lang.Object
org.rcsb.cif.binary.Classifier
public class Classifier extends Object
Classifies
Int32Array and Float64Array instances, i.e. for the given information find the most
efficient encoding strategy which results in the most compact storage of the data.-
Constructor Summary
Constructors Constructor Description Classifier() -
Method Summary
Modifier and Type Method Description static EncodingStrategyHintclassify(Float64Array data)Auto-encodes thisFloatArrayby the encoding strategy with the minimal size.static EncodingStrategyHintclassify(Int32Array data)Auto-encodes thisInt32Arrayby the encoding strategy with the minimal size.static EncodingStrategyHintclassifyPrecision(Float64Array data)Determines the precision needed to encode this column in a lossless fashion.static ByteArrayencode(Int32Array column, String encoding)Encode anInt32Arrayusing the given encoding strategy.
-
Constructor Details
-
Classifier
public Classifier()
-
-
Method Details
-
classify
Auto-encodes thisInt32Arrayby the encoding strategy with the minimal size.- Parameters:
data- the data to encode- Returns:
- the
EncodingStrategyHintinstance which provides all information needed to encode/decode it
-
encode
Encode anInt32Arrayusing the given encoding strategy.- Parameters:
column- the data to encodeencoding- how to encode- Returns:
- encoded data
-
classify
Auto-encodes thisFloatArrayby the encoding strategy with the minimal size. AllFloat64Arrayinstances are encoded asInt32Arrayafter finding a reasonableFixedPointEncoding.- Parameters:
data- the data to encode- Returns:
- the
EncodingStrategyHintproviding all information needed to encode/decode it
-
classifyPrecision
Determines the precision needed to encode this column in a lossless fashion.- Parameters:
data- the data to handle- Returns:
- an
EncodingStrategyHintinstance with the determined precision stored in the precision field
-