Package nl.tue.astar.impl
Class StateCompressor<H extends Head,T extends Tail>
- java.lang.Object
-
- nl.tue.astar.impl.StateCompressor<H,T>
-
- All Implemented Interfaces:
Deflater<State<H,T>>,EqualOperation<State<H,T>>,HashOperation<State<H,T>>,Inflater<State<H,T>>
public class StateCompressor<H extends Head,T extends Tail> extends java.lang.Object implements Inflater<State<H,T>>, Deflater<State<H,T>>, EqualOperation<State<H,T>>, HashOperation<State<H,T>>
-
-
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>
-
-
Constructor Summary
Constructors Constructor Description StateCompressor(StorageAwareDelegate<H,T> delegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddeflate(State<H,T> object, java.io.OutputStream stream)deflate the given object into the provided stream.booleanequals(State<H,T> object, CompressedStore<State<H,T>> store, long l)Check for equality between a given object and a location in the store.intgetHashCode(State<H,T> state)Returns the hashCode of the given object.intgetHashCode(CompressedStore<State<H,T>> store, long l)Returns the hashCode of the object stored in the store at index l.intgetMaxByteCount()the method is called before each call to deflate.State<H,T>inflate(java.io.InputStream stream)read an object from a stream.
-
-
-
Constructor Detail
-
StateCompressor
public StateCompressor(StorageAwareDelegate<H,T> delegate)
-
-
Method Detail
-
getHashCode
public int getHashCode(State<H,T> state)
Description copied from interface:HashOperationReturns the hashCode of the given object.- Specified by:
getHashCodein interfaceHashOperation<H extends Head>- Returns:
-
getHashCode
public int getHashCode(CompressedStore<State<H,T>> store, long l) throws StorageException
Description copied from interface:HashOperationReturns the hashCode of the object stored in the store at index l.- Specified by:
getHashCodein interfaceHashOperation<H extends Head>- Returns:
- Throws:
StorageException
-
equals
public boolean equals(State<H,T> object, CompressedStore<State<H,T>> store, long l) throws StorageException, java.io.IOException
Description copied from interface:EqualOperationCheck for equality between a given object and a location in the store. Should return true, if and only if the given object is indeed stored at index l in the store.- Specified by:
equalsin interfaceEqualOperation<H extends Head>- Returns:
- Throws:
StorageExceptionjava.io.IOException
-
deflate
public void deflate(State<H,T> object, java.io.OutputStream stream) throws java.io.IOException
Description copied from interface:Deflaterdeflate the given object into the provided stream. This method should NOT close the stream.
-
inflate
public State<H,T> inflate(java.io.InputStream stream) throws java.io.IOException
Description copied from interface:Inflaterread an object from a stream. The inflater should know when to stop reading and should NOT close the stream;
-
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- Specified by:
getMaxByteCountin interfaceDeflater<H extends Head>- Returns:
-
-