Package nl.tue.storage.compressor
Class ShortListCompressor
- java.lang.Object
-
- nl.tue.storage.compressor.AbstractFixedLengthListCompressor<java.lang.Short>
-
- nl.tue.storage.compressor.ShortListCompressor
-
- All Implemented Interfaces:
Deflater<java.util.List<java.lang.Short>>,EqualOperation<java.util.List<java.lang.Short>>,HashOperation<java.util.List<java.lang.Short>>,Inflater<java.util.List<java.lang.Short>>
public class ShortListCompressor extends AbstractFixedLengthListCompressor<java.lang.Short>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface nl.tue.storage.EqualOperation
EqualOperation.Default<K>
-
Nested classes/interfaces inherited from interface nl.tue.storage.HashOperation
HashOperation.Default<K>
-
-
Field Summary
-
Fields inherited from class nl.tue.storage.compressor.AbstractFixedLengthListCompressor
length
-
-
Constructor Summary
Constructors Constructor Description ShortListCompressor(int length)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.ShortfromByteArray(byte[] bytes)reads an object of type K from an array of bytes of size numBytes()intgetMaxByteCount()the method is called before each call to deflate.protected booleanisZero(java.lang.Short number)Indicates if the given number equals 0protected java.lang.Short[]newEmptyArray(int length)Instantiates a new array of the given length, such that for all elements, isZero() returns true.protected intnumBytes()returns the number of bytes for storing one object of type Kprotected byte[]toByteArray(java.lang.Short i)writes an object of type K to an array of bytes, of size numBytes();-
Methods inherited from class nl.tue.storage.compressor.AbstractFixedLengthListCompressor
deflate, deflateHead, equals, getBitMask, getHashCode, getHashCode, inflate, inflateContent, readMask
-
-
-
-
Method Detail
-
isZero
protected boolean isZero(java.lang.Short number)
Description copied from class:AbstractFixedLengthListCompressorIndicates if the given number equals 0- Specified by:
isZeroin classAbstractFixedLengthListCompressor<java.lang.Short>- Returns:
-
numBytes
protected int numBytes()
Description copied from class:AbstractFixedLengthListCompressorreturns the number of bytes for storing one object of type K- Specified by:
numBytesin classAbstractFixedLengthListCompressor<java.lang.Short>- Returns:
-
toByteArray
protected byte[] toByteArray(java.lang.Short i)
Description copied from class:AbstractFixedLengthListCompressorwrites an object of type K to an array of bytes, of size numBytes();- Specified by:
toByteArrayin classAbstractFixedLengthListCompressor<java.lang.Short>- Returns:
-
fromByteArray
protected java.lang.Short fromByteArray(byte[] bytes)
Description copied from class:AbstractFixedLengthListCompressorreads an object of type K from an array of bytes of size numBytes()- Specified by:
fromByteArrayin classAbstractFixedLengthListCompressor<java.lang.Short>- Returns:
-
newEmptyArray
protected java.lang.Short[] newEmptyArray(int length)
Description copied from class:AbstractFixedLengthListCompressorInstantiates a new array of the given length, such that for all elements, isZero() returns true.- Specified by:
newEmptyArrayin classAbstractFixedLengthListCompressor<java.lang.Short>- Returns:
-
getMaxByteCount
public int getMaxByteCount()
Description copied from interface:Deflaterthe method is called before each call to deflate. The call to deflate should not write more than the number of bytes returned by this method! It may write less. If a negative value is returned, then a resizeable buffer is used- Returns:
-
-