Class StateCompressor<H extends nl.tue.astar.Head,​T extends nl.tue.astar.Tail>

  • All Implemented Interfaces:
    nl.tue.storage.Deflater<nl.tue.astar.impl.State<H,​T>>, nl.tue.storage.EqualOperation<nl.tue.astar.impl.State<H,​T>>, nl.tue.storage.HashOperation<nl.tue.astar.impl.State<H,​T>>, nl.tue.storage.Inflater<nl.tue.astar.impl.State<H,​T>>

    public class StateCompressor<H extends nl.tue.astar.Head,​T extends nl.tue.astar.Tail>
    extends java.lang.Object
    implements nl.tue.storage.Inflater<nl.tue.astar.impl.State<H,​T>>, nl.tue.storage.Deflater<nl.tue.astar.impl.State<H,​T>>, nl.tue.storage.EqualOperation<nl.tue.astar.impl.State<H,​T>>, nl.tue.storage.HashOperation<nl.tue.astar.impl.State<H,​T>>
    • 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>
    • Constructor Summary

      Constructors 
      Constructor Description
      StateCompressor​(nl.tue.astar.impl.memefficient.StorageAwareDelegate<H,​T> delegate)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void deflate​(nl.tue.astar.impl.State<H,​T> object, java.io.OutputStream stream)
      deflate the given object into the provided stream.
      boolean equals​(nl.tue.astar.impl.State<H,​T> object, nl.tue.storage.CompressedStore<nl.tue.astar.impl.State<H,​T>> store, long l)
      Check for equality between a given object and a location in the store.
      int getHashCode​(nl.tue.astar.impl.State<H,​T> state)
      Returns the hashCode of the given object.
      int getHashCode​(nl.tue.storage.CompressedStore<nl.tue.astar.impl.State<H,​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.
      nl.tue.astar.impl.State<H,​T> inflate​(java.io.InputStream stream)
      read an object from a stream.
      • Methods inherited from class java.lang.Object

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

      • StateCompressor

        public StateCompressor​(nl.tue.astar.impl.memefficient.StorageAwareDelegate<H,​T> delegate)
    • Method Detail

      • getHashCode

        public int getHashCode​(nl.tue.astar.impl.State<H,​T> state)
        Description copied from interface: nl.tue.storage.HashOperation
        Returns the hashCode of the given object.
        Specified by:
        getHashCode in interface nl.tue.storage.HashOperation<H extends nl.tue.astar.Head>
        Returns:
      • getHashCode

        public int getHashCode​(nl.tue.storage.CompressedStore<nl.tue.astar.impl.State<H,​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<H extends nl.tue.astar.Head>
        Returns:
        Throws:
        nl.tue.storage.StorageException
      • equals

        public boolean equals​(nl.tue.astar.impl.State<H,​T> object,
                              nl.tue.storage.CompressedStore<nl.tue.astar.impl.State<H,​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<H extends nl.tue.astar.Head>
        Returns:
        Throws:
        nl.tue.storage.StorageException
        java.io.IOException
      • deflate

        public void deflate​(nl.tue.astar.impl.State<H,​T> 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<H extends nl.tue.astar.Head>
        Throws:
        java.io.IOException
      • inflate

        public nl.tue.astar.impl.State<H,​T> 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<H extends nl.tue.astar.Head>
        Returns:
        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<H extends nl.tue.astar.Head>
        Returns: