Class PHeadCompressor<T extends nl.tue.astar.Tail>
- java.lang.Object
-
- nl.tue.astar.impl.AbstractCompressor<PHead>
-
- org.processmining.lpm.adjustedalignments.PHeadCompressor<T>
-
- All Implemented Interfaces:
nl.tue.astar.impl.memefficient.HeadDeflater<PHead>,nl.tue.storage.Deflater<PHead>,nl.tue.storage.EqualOperation<nl.tue.astar.impl.State<PHead,T>>,nl.tue.storage.HashOperation<nl.tue.astar.impl.State<PHead,T>>,nl.tue.storage.Inflater<PHead>
public class PHeadCompressor<T extends nl.tue.astar.Tail> extends nl.tue.astar.impl.AbstractCompressor<PHead> implements nl.tue.storage.EqualOperation<nl.tue.astar.impl.State<PHead,T>>, nl.tue.storage.HashOperation<nl.tue.astar.impl.State<PHead,T>>, nl.tue.astar.impl.memefficient.HeadDeflater<PHead>
-
-
Field Summary
Fields Modifier and Type Field Description protected shortactivitiesprotected intbytesActivitiesprotected intbytesPlacesprotected intmaxBytesprotected shortplaces
-
Constructor Summary
Constructors Constructor Description PHeadCompressor(short places, short activities)Construct the compressor with a fixed length for all vectors.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddeflate(PHead object, java.io.OutputStream stream)deflate the given object into the provided stream.booleanequals(nl.tue.astar.impl.State<PHead,T> object, nl.tue.storage.CompressedStore<nl.tue.astar.impl.State<PHead,T>> store, long l)Check for equality between a given object and a location in the store.protected booleanequalsInflating(nl.tue.astar.impl.State<PHead,T> vector, nl.tue.storage.CompressedStore<nl.tue.astar.impl.State<PHead,T>> store, long l)intgetHashCode(nl.tue.astar.impl.State<PHead,T> object)Returns the hashCode of the given object.intgetHashCode(nl.tue.storage.CompressedStore<nl.tue.astar.impl.State<PHead,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.PHeadinflate(java.io.InputStream stream)read an object from a stream.nl.tue.astar.util.ShortShortMultisetinflateParikhVector(java.io.InputStream stream)voidskip(PHead head, nl.tue.storage.impl.SkippableOutputStream out)Skips as many bytes in the stream as are required to store the given headvoidskipMarking(java.io.InputStream stream)voidskipParikhVector(java.io.InputStream stream)-
Methods inherited from class nl.tue.astar.impl.AbstractCompressor
checkIntOnByteArray, checkShortOnByteArray, deflate, deflate, deflateWithCheck, equalsDeflating, getBitsPerVar, getBitsPerVar, inflateContent, inflateContentToArray, makeBitMask, makeBitMask, makeShortListBitMask, readBooleanFromStream, readDoubleFromStream, readIntFromStream, readInto, readInto, readLongFromStream, readMask, readShortFromStream, writeBooleanToByteArray, writeDoubleToByteArray, writeIntToByteArray, writeLongToByteArray, writeShortToByteArray, writeTo, writeTo
-
-
-
-
Method Detail
-
inflate
public PHead inflate(java.io.InputStream stream) throws java.io.IOException
Description copied from interface:nl.tue.storage.Inflaterread an object from a stream. The inflater should know when to stop reading and should NOT close the stream;- Specified by:
inflatein interfacenl.tue.storage.Inflater<T extends nl.tue.astar.Tail>- Returns:
- Throws:
java.io.IOException
-
deflate
public void deflate(PHead object, java.io.OutputStream stream) throws java.io.IOException
Description copied from interface:nl.tue.storage.Deflaterdeflate the given object into the provided stream. This method should NOT close the stream.- Specified by:
deflatein interfacenl.tue.storage.Deflater<T extends nl.tue.astar.Tail>- Throws:
java.io.IOException
-
equals
public boolean equals(nl.tue.astar.impl.State<PHead,T> object, nl.tue.storage.CompressedStore<nl.tue.astar.impl.State<PHead,T>> store, long l) throws nl.tue.storage.StorageException, java.io.IOException
Description copied from interface:nl.tue.storage.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 interfacenl.tue.storage.EqualOperation<T extends nl.tue.astar.Tail>- Returns:
- Throws:
nl.tue.storage.StorageExceptionjava.io.IOException
-
equalsInflating
protected boolean equalsInflating(nl.tue.astar.impl.State<PHead,T> vector, nl.tue.storage.CompressedStore<nl.tue.astar.impl.State<PHead,T>> store, long l) throws java.io.IOException
- Throws:
java.io.IOException
-
getHashCode
public int getHashCode(nl.tue.astar.impl.State<PHead,T> object)
Description copied from interface:nl.tue.storage.HashOperationReturns the hashCode of the given object.- Specified by:
getHashCodein interfacenl.tue.storage.HashOperation<T extends nl.tue.astar.Tail>- Returns:
-
getHashCode
public int getHashCode(nl.tue.storage.CompressedStore<nl.tue.astar.impl.State<PHead,T>> store, long l) throws nl.tue.storage.StorageException
Description copied from interface:nl.tue.storage.HashOperationReturns the hashCode of the object stored in the store at index l.- Specified by:
getHashCodein interfacenl.tue.storage.HashOperation<T extends nl.tue.astar.Tail>- Returns:
- Throws:
nl.tue.storage.StorageException
-
skipMarking
public void skipMarking(java.io.InputStream stream) throws java.io.IOException- Throws:
java.io.IOException
-
skipParikhVector
public void skipParikhVector(java.io.InputStream stream) throws java.io.IOException- Throws:
java.io.IOException
-
inflateParikhVector
public nl.tue.astar.util.ShortShortMultiset inflateParikhVector(java.io.InputStream stream) throws java.io.IOException- Throws:
java.io.IOException
-
getMaxByteCount
public int getMaxByteCount()
Description copied from interface:nl.tue.storage.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 interfacenl.tue.storage.Deflater<T extends nl.tue.astar.Tail>- Returns:
-
skip
public void skip(PHead head, nl.tue.storage.impl.SkippableOutputStream out) throws java.io.IOException
Description copied from interface:nl.tue.astar.impl.memefficient.HeadDeflaterSkips as many bytes in the stream as are required to store the given head- Specified by:
skipin interfacenl.tue.astar.impl.memefficient.HeadDeflater<T extends nl.tue.astar.Tail>- Throws:
java.io.IOException
-
-