org.biojava3.core.sequence.views
Class ReversedSequenceView<C extends Compound>
java.lang.Object
org.biojava3.core.sequence.template.SequenceProxyView<C>
org.biojava3.core.sequence.views.ReversedSequenceView<C>
- Type Parameters:
C
- Must be a subtype of @{link Compound}
- All Implemented Interfaces:
- Iterable<C>, Accessioned, Sequence<C>, SequenceView<C>
public class ReversedSequenceView<C extends Compound>
- extends SequenceProxyView<C>
For a given sequence this class will return the base at the reversed
position i.e. in a sequence of size 10, if you request base 2 you will get
back the base at position 9. Sub-views can be made of this class which
also respect the reversed calls.
- Author:
- Andy Yates
Methods inherited from class org.biojava3.core.sequence.template.SequenceProxyView |
countCompounds, getAccession, getAsList, getBioEnd, getBioStart, getCompoundSet, getIndexOf, getInverse, getLastIndexOf, getLength, getSubSequence, getViewedSequence, iterator, setBioEnd, setBioStart |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ReversedSequenceView
public ReversedSequenceView(Sequence<C> sequence)
getSequenceAsString
public String getSequenceAsString()
- Description copied from interface:
Sequence
- Returns the String representation of the Sequence
- Specified by:
getSequenceAsString
in interface Sequence<C extends Compound>
- Overrides:
getSequenceAsString
in class SequenceProxyView<C extends Compound>
toIndex
protected int toIndex(int index)
getCompoundAt
public C getCompoundAt(int position)
- Description copied from interface:
Sequence
- Returns the Compound at the given biological index
- Specified by:
getCompoundAt
in interface Sequence<C extends Compound>
- Overrides:
getCompoundAt
in class SequenceProxyView<C extends Compound>
- Parameters:
position
- Biological index (1 to n)
- Returns:
- Compound at the specified position