Class PHeadCompressor<T extends nl.tue.astar.Tail>

  • 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>
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface nl.tue.storage.EqualOperation

        nl.tue.storage.EqualOperation.Default<K>
      • Nested classes/interfaces inherited from interface nl.tue.storage.HashOperation

        nl.tue.storage.HashOperation.Default<K>
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected short activities  
      protected int bytesActivities  
      protected int bytesPlaces  
      protected int maxBytes  
      protected short places  
      • Fields inherited from class nl.tue.astar.impl.AbstractCompressor

        POWER
    • 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
      void deflate​(PHead object, java.io.OutputStream stream)
      deflate the given object into the provided stream.
      boolean equals​(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 boolean equalsInflating​(nl.tue.astar.impl.State<PHead,​T> vector, nl.tue.storage.CompressedStore<nl.tue.astar.impl.State<PHead,​T>> store, long l)  
      int getHashCode​(nl.tue.astar.impl.State<PHead,​T> object)
      Returns the hashCode of the given object.
      int getHashCode​(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.
      int getMaxByteCount()
      the method is called before each call to deflate.
      PHead inflate​(java.io.InputStream stream)
      read an object from a stream.
      nl.tue.astar.util.ShortShortMultiset inflateParikhVector​(java.io.InputStream stream)  
      void skip​(PHead head, nl.tue.storage.impl.SkippableOutputStream out)
      Skips as many bytes in the stream as are required to store the given head
      void skipMarking​(java.io.InputStream stream)  
      void skipParikhVector​(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
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • activities

        protected final short activities
      • places

        protected final short places
      • bytesPlaces

        protected final int bytesPlaces
      • bytesActivities

        protected final int bytesActivities
      • maxBytes

        protected int maxBytes
    • Constructor Detail

      • PHeadCompressor

        public PHeadCompressor​(short places,
                               short activities)
        Construct the compressor with a fixed length for all vectors.
        Parameters:
        length -
    • Method Detail

      • inflate

        public PHead inflate​(java.io.InputStream stream)
                      throws java.io.IOException
        Description copied from interface: nl.tue.storage.Inflater
        read an object from a stream. The inflater should know when to stop reading and should NOT close the stream;
        Specified by:
        inflate in interface nl.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.Deflater
        deflate the given object into the provided stream. This method should NOT close the stream.
        Specified by:
        deflate in interface nl.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.EqualOperation
        Check 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:
        equals in interface nl.tue.storage.EqualOperation<T extends nl.tue.astar.Tail>
        Returns:
        Throws:
        nl.tue.storage.StorageException
        java.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.HashOperation
        Returns the hashCode of the given object.
        Specified by:
        getHashCode in interface nl.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.HashOperation
        Returns the hashCode of the object stored in the store at index l.
        Specified by:
        getHashCode in interface nl.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.Deflater
        the 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:
        getMaxByteCount in interface nl.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.HeadDeflater
        Skips as many bytes in the stream as are required to store the given head
        Specified by:
        skip in interface nl.tue.astar.impl.memefficient.HeadDeflater<T extends nl.tue.astar.Tail>
        Throws:
        java.io.IOException