Class ReversedSequenceView<C extends Compound>
java.lang.Object
org.biojava.nbio.core.sequence.template.SequenceProxyView<C>
org.biojava.nbio.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>
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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetCompoundAt
(int position) Returns the Compound at the given biological indexReturns the String representation of the Sequenceprotected int
toIndex
(int index) Methods inherited from class org.biojava.nbio.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
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
ReversedSequenceView
-
-
Method Details
-
getSequenceAsString
Description copied from interface:Sequence
Returns the String representation of the Sequence- Specified by:
getSequenceAsString
in interfaceSequence<C extends Compound>
- Overrides:
getSequenceAsString
in classSequenceProxyView<C extends Compound>
-
toIndex
protected int toIndex(int index) -
getCompoundAt
Description copied from interface:Sequence
Returns the Compound at the given biological index- Specified by:
getCompoundAt
in interfaceSequence<C extends Compound>
- Overrides:
getCompoundAt
in classSequenceProxyView<C extends Compound>
- Parameters:
position
- Biological index (1 to n)- Returns:
- Compound at the specified position
-