Class Rank
java.lang.Object
com.compomics.util.experiment.identification.protein_inference.fm_index.Rank
- All Implemented Interfaces:
Serializable
Rank as used in the FM index.
- Author:
- Dominik Kopczynski
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintReturns the number of bytes for the allocated arrays.intgetRank(int index, boolean zeros) Returns the rank.final intgetRankOne(int index) Returns the rank of ones.intgetRankZero(int index) Returns the rank of zeros.intgetSelect(int index) Returns the position of the i-th onebooleanisOne(int index) Returns true if the value is equal to one.intisOneInt(int index) Returns true if the value is equal to one.
-
Field Details
-
length
public final int lengthThe length.
-
-
Constructor Details
-
Rank
public Rank()Empty default constructor. -
Rank
public Rank(byte[] text, long[] aAlphabet) Constructor.- Parameters:
text- the textaAlphabet- the alphabet
-
Rank
public Rank(long[] originalBitfield, int length) Constructor.- Parameters:
originalBitfield- an original bitfieldlength- length of original bitfield
-
-
Method Details
-
getRank
public int getRank(int index, boolean zeros) Returns the rank.- Parameters:
index- the valuezeros- 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
-