|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.biojava3.core.sequence.storage.BitSequenceReader<C>
C - Type of compound; must extend NucleotideCompoundpublic class BitSequenceReader<C extends Compound>
An implementation of the popular bit encodings. This class provides the
Sequence view over what is actually carried out in the BitSequenceReader.BitArrayWorker
instances. These are the objects that carry out array storage as well as
indexing into those arrays. New bit encodings can be written by extending
this class and a worker class. There are a number of issues with this
type of storage engine:
Compounds; 2 bit allows no N compoundsBitSequenceReader.BitArrayWorker instance
| Nested Class Summary | |
|---|---|
static class |
BitSequenceReader.BitArrayWorker<C extends Compound>
The logic of working with a bit has been separated out into this class to help developers create the bit data structures without having to put the code into an intermediate format and to also use the format without the need to copy this code. |
| Constructor Summary | |
|---|---|
BitSequenceReader(BitSequenceReader.BitArrayWorker<C> worker,
AccessionID accession)
Instance which allows you to supply a different @{BitArrayWorker} object. |
|
| Method Summary | |
|---|---|
int |
countCompounds(C... compounds)
Counts the number of times a compound appears in this sequence store |
boolean |
equals(Object o)
|
AccessionID |
getAccession()
Returns the AccessionID this location is currently bound with |
List<C> |
getAsList()
Returns this Sequence store as a List |
C |
getCompoundAt(int position)
Returns the compound at the specified biological index |
CompoundSet<C> |
getCompoundSet()
Returns the compound set backing this store |
int |
getIndexOf(C compound)
Returns the first occurrence of the given compound in this store; performs a linear search |
SequenceView<C> |
getInverse()
Does the right thing to get the inverse of the current Sequence. |
int |
getLastIndexOf(C compound)
Returns the last occurrence of the given compound in this store; performs a linear search |
int |
getLength()
Returns the length of the sequence |
String |
getSequenceAsString()
Returns the sequence as a String |
SequenceView<C> |
getSubSequence(Integer start,
Integer end)
Returns a portion of the sequence from the different positions. |
SequenceView<C> |
getSubSequence(int start,
int end)
Returns a sub sequence view |
int |
hashCode()
|
Iterator<C> |
iterator()
Provides basic iterable access to this class |
void |
setCompoundSet(CompoundSet<C> compoundSet)
Class is immutable & so this is unsupported |
void |
setContents(String sequence)
Class is immutable & so this is unsupported |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BitSequenceReader(BitSequenceReader.BitArrayWorker<C> worker,
AccessionID accession)
| Method Detail |
|---|
public void setCompoundSet(CompoundSet<C> compoundSet)
setCompoundSet in interface SequenceReader<C extends Compound>public void setContents(String sequence)
setContents in interface SequenceReader<C extends Compound>public int countCompounds(C... compounds)
countCompounds in interface Sequence<C extends Compound>compounds - Vargs of the compounds to count
public AccessionID getAccession()
Accessioned
getAccession in interface Accessionedpublic List<C> getAsList()
getAsList in interface Sequence<C extends Compound>public C getCompoundAt(int position)
getCompoundAt in interface Sequence<C extends Compound>position - Biological index (1 to n)
public CompoundSet<C> getCompoundSet()
getCompoundSet in interface Sequence<C extends Compound>public int getIndexOf(C compound)
getIndexOf in interface Sequence<C extends Compound>compound - Compounds to look for
public int getLastIndexOf(C compound)
getLastIndexOf in interface Sequence<C extends Compound>compound - Compounds to look for
public int getLength()
getLength in interface Sequence<C extends Compound>public String getSequenceAsString()
getSequenceAsString in interface Sequence<C extends Compound>
public SequenceView<C> getSubSequence(int start,
int end)
public Iterator<C> iterator()
iterator in interface Iterable<C extends Compound>
public SequenceView<C> getSubSequence(Integer start,
Integer end)
Sequence
getSubSequence in interface Sequence<C extends Compound>start - Biological index start; must be greater than 0end - Biological end; must be less than length + 1
public SequenceView<C> getInverse()
Sequence
getInverse in interface Sequence<C extends Compound>public int hashCode()
hashCode in class Objectpublic boolean equals(Object o)
equals in class Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||