Class Rank
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:
- Serialized Form
-
Field Summary
Fields Modifier and Type Field Description int
length
The length. -
Constructor Summary
-
Method Summary
Modifier and Type Method Description int
getAllocatedBytes()
Returns the number of bytes for the allocated arrays.int
getRank(int index, boolean zeros)
Returns the rank.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 oneboolean
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.
-
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
-