Package org.neo4j.gds.core.loading
Class NoopDoubleCodec
- java.lang.Object
-
- org.neo4j.gds.core.loading.DoubleCodec
-
- org.neo4j.gds.core.loading.NoopDoubleCodec
-
public final class NoopDoubleCodec extends DoubleCodec
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.neo4j.gds.core.loading.DoubleCodec
DoubleCodec.CompressionInfo
-
-
Field Summary
-
Fields inherited from class org.neo4j.gds.core.loading.DoubleCodec
EXP_BIAS, EXP_BIT_MASK, SIGNIFICAND_BITS, SIGNIFICANT_BIT_MASK, SUPER_NORMAL_EXPONENT
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compressDouble(long doubleBits, byte[] out, int outPos)
Compress the double from its bit representation and write result into out.int
compressedSize(byte[] data, int pos)
Return the number of bytes used to compress the current value.int
decompressDouble(byte[] data, int pos, org.apache.commons.lang3.mutable.MutableDouble out)
Decompress a single double from the given byte array and write the result into out.DoubleCodec.CompressionInfo
describeCompressedValue(byte[] data, int pos, double originalInput)
Return debug info about how the current value is compressed.java.lang.String
describeCompression(int type)
Return some string description on how the data is compressed.static DoubleCodec
instance()
-
Methods inherited from class org.neo4j.gds.core.loading.DoubleCodec
compressDouble, compressDoubles, decompressDouble, decompressDoubles, getSign, getSignificand, getUnbiasedExponent, supportedSignificandWith
-
-
-
-
Method Detail
-
instance
public static DoubleCodec instance()
-
compressDouble
public int compressDouble(long doubleBits, byte[] out, int outPos)
Description copied from class:DoubleCodec
Compress the double from its bit representation and write result into out.- Specified by:
compressDouble
in classDoubleCodec
- Parameters:
doubleBits
- the double value as converted byDouble.doubleToRawLongBits(double)
.out
- the output buffer where the compressed value is written to.outPos
- at which position to write the compressed value inout
.- Returns:
- the new value of
outPos
(NOT the number of bytes written).
-
decompressDouble
public int decompressDouble(byte[] data, int pos, org.apache.commons.lang3.mutable.MutableDouble out)
Description copied from class:DoubleCodec
Decompress a single double from the given byte array and write the result into out.- Specified by:
decompressDouble
in classDoubleCodec
- Parameters:
data
- the compressed data.pos
- start reading fromdata
at this position.out
- output value, the result should be written usingMutableDouble.doubleValue()
.- Returns:
- the new value of
pos
after reading the compressed value.
-
compressedSize
public int compressedSize(byte[] data, int pos)
Description copied from class:DoubleCodec
Return the number of bytes used to compress the current value.- Specified by:
compressedSize
in classDoubleCodec
- Parameters:
data
- the compressed data.pos
- start reading fromdata
at this position.- Returns:
- the number of bytes that the compressed value at
pos
is.
-
describeCompression
public java.lang.String describeCompression(int type)
Description copied from class:DoubleCodec
Return some string description on how the data is compressed. For debugging or testing.- Specified by:
describeCompression
in classDoubleCodec
- Parameters:
type
- a type identifier.- Returns:
- some string for describing how the data is compressed.
-
describeCompressedValue
public DoubleCodec.CompressionInfo describeCompressedValue(byte[] data, int pos, double originalInput)
Description copied from class:DoubleCodec
Return debug info about how the current value is compressed. For debugging or testing.- Specified by:
describeCompressedValue
in classDoubleCodec
- Parameters:
data
- the compressed data.pos
- start reading fromdata
at this position.- Returns:
- info object describing the current compressed value.
-
-