C
- Type of compound; must extend NucleotideCompound
public class BitSequenceReader<C extends Compound> extends Object implements ProxySequenceReader<C>
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:
Compound
s; 2 bit allows no N compoundsBitSequenceReader.BitArrayWorker
instanceModifier and Type | Class and Description |
---|---|
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 and Description |
---|
BitSequenceReader(BitSequenceReader.BitArrayWorker<C> worker,
AccessionID accession)
Instance which allows you to supply a different @{BitArrayWorker}
object.
|
Modifier and Type | Method and Description |
---|---|
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
|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public BitSequenceReader(BitSequenceReader.BitArrayWorker<C> worker, AccessionID accession)
public void setCompoundSet(CompoundSet<C> compoundSet)
setCompoundSet
in interface SequenceReader<C extends Compound>
public void setContents(String sequence) throws CompoundNotFoundException
setContents
in interface SequenceReader<C extends Compound>
CompoundNotFoundException
public int countCompounds(C... compounds)
countCompounds
in interface Sequence<C extends Compound>
compounds
- Vargs of the compounds to countpublic AccessionID getAccession()
Accessioned
getAccession
in interface Accessioned
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 forpublic int getLastIndexOf(C compound)
getLastIndexOf
in interface Sequence<C extends Compound>
compound
- Compounds to look forpublic int getLength()
public String getSequenceAsString()
getSequenceAsString
in interface Sequence<C extends Compound>
public SequenceView<C> getSubSequence(int start, int end)
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 + 1public SequenceView<C> getInverse()
Sequence
getInverse
in interface Sequence<C extends Compound>
Copyright © 2000–2018 BioJava. All rights reserved.