Class Bzip2MoveToFrontTable


  • final class Bzip2MoveToFrontTable
    extends java.lang.Object
    A 256 entry Move To Front transform.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private byte[] mtf
      The Move To Front list.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) byte indexToFront​(int index)
      Gets the value from a given index and moves it to the front of the MTF list (inverse Move To Front transform).
      (package private) int valueToFront​(byte value)
      Moves a value to the head of the MTF list (forward Move To Front transform).
      • Methods inherited from class java.lang.Object

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

      • mtf

        private final byte[] mtf
        The Move To Front list.
    • Constructor Detail

      • Bzip2MoveToFrontTable

        Bzip2MoveToFrontTable()
    • Method Detail

      • valueToFront

        int valueToFront​(byte value)
        Moves a value to the head of the MTF list (forward Move To Front transform).
        Parameters:
        value - The value to move
        Returns:
        The position the value moved from
      • indexToFront

        byte indexToFront​(int index)
        Gets the value from a given index and moves it to the front of the MTF list (inverse Move To Front transform).
        Parameters:
        index - The index to move
        Returns:
        The value at the given index