Package org.rcsb.cif.binary.codec
Class Classifier
- java.lang.Object
-
- org.rcsb.cif.binary.codec.Classifier
-
public class Classifier extends Object
ClassifiesInt32ArrayandFloat64Arrayinstances, 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
All Methods Static Methods Concrete Methods 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.
-
-
-
Method Detail
-
classify
public static EncodingStrategyHint classify(Int32Array data)
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
public static ByteArray encode(Int32Array column, String encoding)
Encode anInt32Arrayusing the given encoding strategy.- Parameters:
column- the data to encodeencoding- how to encode- Returns:
- encoded data
-
classify
public static EncodingStrategyHint classify(Float64Array data)
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
public static EncodingStrategyHint classifyPrecision(Float64Array data)
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
-
-