java.lang.Object
com.compomics.util.experiment.identification.protein_inference.fm_index.Rank
All Implemented Interfaces:
Serializable

public class Rank extends Object implements Serializable
Rank as used in the FM index.
Author:
Dominik Kopczynski
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final int
    The length.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Empty default constructor.
    Rank(byte[] text, long[] aAlphabet)
    Constructor.
    Rank(long[] originalBitfield, int length)
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the number of bytes for the allocated arrays.
    int
    getRank(int index, boolean zeros)
    Returns the rank.
    final int
    getRankOne(int index)
    Returns the rank of ones.
    int
    getRankZero(int index)
    Returns the rank of zeros.
    int
    getSelect(int index)
    Returns the position of the i-th one
    boolean
    isOne(int index)
    Returns true if the value is equal to one.
    int
    isOneInt(int index)
    Returns true if the value is equal to one.

    Methods inherited from class java.lang.Object

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

    • length

      public final int length
      The length.
  • Constructor Details

    • Rank

      public Rank()
      Empty default constructor.
    • Rank

      public Rank(byte[] text, long[] aAlphabet)
      Constructor.
      Parameters:
      text - the text
      aAlphabet - the alphabet
    • Rank

      public Rank(long[] originalBitfield, int length)
      Constructor.
      Parameters:
      originalBitfield - an original bitfield
      length - length of original bitfield
  • Method Details

    • getRank

      public int getRank(int index, boolean zeros)
      Returns the rank.
      Parameters:
      index - the value
      zeros - the zeros
      Returns:
      the rank
    • getRankOne

      public final int getRankOne(int index)
      Returns the rank of ones.
      Parameters:
      index - the value
      Returns:
      the rank
    • getRankZero

      public int getRankZero(int index)
      Returns the rank of zeros.
      Parameters:
      index - the value
      Returns:
      the rank
    • isOne

      public boolean isOne(int index)
      Returns true if the value is equal to one.
      Parameters:
      index - the value
      Returns:
      true if the value is equal to one
    • getSelect

      public int getSelect(int index)
      Returns the position of the i-th one
      Parameters:
      index - of the i-th one
      Returns:
      position of the i-th one
    • isOneInt

      public int isOneInt(int index)
      Returns true if the value is equal to one.
      Parameters:
      index - the value
      Returns:
      the bit
    • getAllocatedBytes

      public int getAllocatedBytes()
      Returns the number of bytes for the allocated arrays.
      Returns:
      the number of bytes for the allocated arrays