public static final class Nucleotide.Counter
extends java.lang.Object
Constructor and Description |
---|
Counter()
Creates a new counter with all counts set to 0.
|
Modifier and Type | Method and Description |
---|---|
void |
add(byte base)
Increases the nucleotide that corresponds to the input base own count by 1.
|
void |
add(char base) |
void |
add(Nucleotide nucleotide)
Increases by 1 the count for a nucleotide.
|
void |
addAll(byte... bases)
Increase by one the count for a nucleotide for each
occurrence of such in the input byte array base codes.
|
void |
addAll(char... bases)
Increase by one the count for a nucleotide for each
occurrence of such in the input char array base codes.
|
void |
addAll(java.lang.CharSequence bases)
Increase by one the count for a nucleotide for each
occurrence of such in the input
CharSequence . |
void |
clear()
Reset all the counts to 0.
|
long |
get(Nucleotide nucleotide)
Returns the current count for a given nucleotide.
|
long |
sum()
Return the total count of all nucleotide constants.
|
public void add(Nucleotide nucleotide)
nucleotide
- the target nucleotide.java.lang.IllegalArgumentException
- if nucleotide is null
.public void add(byte base)
base
- the base code.java.lang.IllegalArgumentException
- if base
is negative
.public void add(char base)
public long get(Nucleotide nucleotide)
nucleotide
- the query nucleotide.java.lang.IllegalArgumentException
- if nucleotide
is null
.public final void addAll(byte... bases)
bases
- the input base codes.java.lang.IllegalArgumentException
- if bases
is null.public final void addAll(char... bases)
bases
- the input base codes.java.lang.IllegalArgumentException
- if bases
is null.public final void addAll(java.lang.CharSequence bases)
CharSequence
.bases
- the input bases sequence.java.lang.IllegalArgumentException
- if the input is null
.public void clear()
public long sum()