|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.biojava3.core.sequence.storage.SingleCompoundSequenceReader<C>
public class SingleCompoundSequenceReader<C extends Compound>
An implementation of the SequenceReader interface which for every call will return only 1 compound (given to it during construction; a String is also valid but will require a CompoundSet). The idea is to represent large runs of a single compound without the memory footprint of storing these compounds e.g. a run of 10KB of Ns in a DNASequence.
| Constructor Summary | |
|---|---|
SingleCompoundSequenceReader(C compound,
CompoundSet<C> compoundSet,
int length)
Build the object with a compound rather than a String |
|
SingleCompoundSequenceReader(java.lang.String compound,
CompoundSet<C> compoundSet,
int length)
Public constructor to be used with String based constructor |
|
| Method Summary | |
|---|---|
int |
countCompounds(C... compounds)
Delegates to SequenceMixin#countCompounds(org.biojava3.core.sequence.template.Sequence, C[]) |
boolean |
equals(java.lang.Object o)
|
AccessionID |
getAccession()
Unsupoorted |
java.util.List<C> |
getAsList()
Delegates to SequenceMixin.toList(org.biojava3.core.sequence.template.Sequence) |
C |
getCompoundAt(int position)
Always returns the compound given at construction |
CompoundSet<C> |
getCompoundSet()
Returns the compound set given at construction |
int |
getIndexOf(C compound)
Returns 1 if the given compound is equal to the one given during construction; otherwise will return -1. |
SequenceView<C> |
getInverse()
Does the right thing to get the inverse of the current Sequence. |
int |
getLastIndexOf(C compound)
Returns the length of the Sequence if the given compound was equal to the one given during construction. |
int |
getLength()
Returns the length given during construction |
java.lang.String |
getSequenceAsString()
Delegates to SequenceMixin.toList(org.biojava3.core.sequence.template.Sequence) |
SequenceView<C> |
getSubSequence(java.lang.Integer start,
java.lang.Integer end)
Creates a SequenceProxyView for the given coordinates |
int |
hashCode()
|
java.util.Iterator<C> |
iterator()
Returns an instance of SequenceMixin.SequenceIterator |
void |
setCompoundSet(CompoundSet<C> compoundSet)
Unsupported |
void |
setContents(java.lang.String sequence)
Unsupported |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SingleCompoundSequenceReader(java.lang.String compound,
CompoundSet<C> compoundSet,
int length)
public SingleCompoundSequenceReader(C compound,
CompoundSet<C> compoundSet,
int length)
| Method Detail |
|---|
public void setCompoundSet(CompoundSet<C> compoundSet)
setCompoundSet in interface SequenceReader<C extends Compound>public void setContents(java.lang.String sequence)
setContents in interface SequenceReader<C extends Compound>public int getLength()
getLength 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 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 java.lang.String getSequenceAsString()
SequenceMixin.toList(org.biojava3.core.sequence.template.Sequence)
getSequenceAsString in interface Sequence<C extends Compound>public java.util.List<C> getAsList()
SequenceMixin.toList(org.biojava3.core.sequence.template.Sequence)
getAsList in interface Sequence<C extends Compound>
public SequenceView<C> getSubSequence(java.lang.Integer start,
java.lang.Integer end)
SequenceProxyView for the given coordinates
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 CompoundSet<C> getCompoundSet()
getCompoundSet in interface Sequence<C extends Compound>public AccessionID getAccession()
getAccession in interface Accessionedpublic int countCompounds(C... compounds)
SequenceMixin#countCompounds(org.biojava3.core.sequence.template.Sequence, C[])
countCompounds in interface Sequence<C extends Compound>compounds - Vargs of the compounds to count
public java.util.Iterator<C> iterator()
SequenceMixin.SequenceIterator
iterator in interface java.lang.Iterable<C extends Compound>public SequenceView<C> getInverse()
Sequence
getInverse in interface Sequence<C extends Compound>public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||