java.lang.Iterable<C>
, Accessioned
, ProxySequenceReader<C>
, Sequence<C>
, SequenceReader<C>
public class SingleCompoundSequenceReader<C extends Compound> extends java.lang.Object implements ProxySequenceReader<C>
Constructor | Description |
---|---|
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
|
Modifier and Type | Method | Description |
---|---|---|
int |
countCompounds(C... compounds) |
Delegates to
SequenceMixin#countCompounds(org.biojava.nbio.core.sequence.template.Sequence, C[]) |
boolean |
equals(java.lang.Object o) |
|
AccessionID |
getAccession() |
Unsupoorted
|
java.util.List<C> |
getAsList() |
|
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() |
|
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
|
public SingleCompoundSequenceReader(java.lang.String compound, CompoundSet<C> compoundSet, int length)
public SingleCompoundSequenceReader(C compound, CompoundSet<C> compoundSet, int length)
public void setCompoundSet(CompoundSet<C> compoundSet)
setCompoundSet
in interface SequenceReader<C extends Compound>
public void setContents(java.lang.String sequence) throws CompoundNotFoundException
setContents
in interface SequenceReader<C extends Compound>
CompoundNotFoundException
public int getLength()
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 forpublic int getLastIndexOf(C compound)
getLastIndexOf
in interface Sequence<C extends Compound>
compound
- Compounds to look forpublic java.lang.String getSequenceAsString()
getSequenceAsString
in interface Sequence<C extends Compound>
public java.util.List<C> getAsList()
public SequenceView<C> getSubSequence(java.lang.Integer start, java.lang.Integer end)
SequenceProxyView
for the given coordinatesgetSubSequence
in interface Sequence<C extends Compound>
start
- Biological index start; must be greater than 0end
- Biological end; must be less than length + 1public CompoundSet<C> getCompoundSet()
getCompoundSet
in interface Sequence<C extends Compound>
public AccessionID getAccession()
getAccession
in interface Accessioned
public int countCompounds(C... compounds)
SequenceMixin#countCompounds(org.biojava.nbio.core.sequence.template.Sequence, C[])
countCompounds
in interface Sequence<C extends Compound>
compounds
- Vargs of the compounds to countpublic java.util.Iterator<C> iterator()
SequenceMixin.SequenceIterator
public SequenceView<C> getInverse()
Sequence
getInverse
in interface Sequence<C extends Compound>
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object