Package nl.tue.storage.compressor
Class IntListCompressor
- java.lang.Object
-
- nl.tue.storage.compressor.AbstractFixedLengthListCompressor<java.lang.Integer>
-
- nl.tue.storage.compressor.IntListCompressor
-
- All Implemented Interfaces:
Deflater<java.util.List<java.lang.Integer>>,EqualOperation<java.util.List<java.lang.Integer>>,HashOperation<java.util.List<java.lang.Integer>>,Inflater<java.util.List<java.lang.Integer>>
public class IntListCompressor extends AbstractFixedLengthListCompressor<java.lang.Integer>
-
-
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 IntListCompressor(int length)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.IntegerfromByteArray(byte[] b)reads an object of type K from an array of bytes of size numBytes()protected intfromStream(java.io.InputStream stream)intgetMaxByteCount()the method is called before each call to deflate.protected booleanisZero(java.lang.Integer number)Indicates if the given number equals 0protected java.lang.Integer[]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.Integer 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.Integer number)
Description copied from class:AbstractFixedLengthListCompressorIndicates if the given number equals 0- Specified by:
isZeroin classAbstractFixedLengthListCompressor<java.lang.Integer>- 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.Integer>- Returns:
-
toByteArray
protected byte[] toByteArray(java.lang.Integer 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.Integer>- Returns:
-
fromByteArray
protected java.lang.Integer fromByteArray(byte[] b)
Description copied from class:AbstractFixedLengthListCompressorreads an object of type K from an array of bytes of size numBytes()- Specified by:
fromByteArrayin classAbstractFixedLengthListCompressor<java.lang.Integer>- Returns:
-
fromStream
protected int fromStream(java.io.InputStream stream) throws java.io.IOException- Throws:
java.io.IOException
-
newEmptyArray
protected java.lang.Integer[] 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.Integer>- 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:
-
-