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>
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
-
-
Constructor Summary
Constructors Constructor Description ReversedSequenceView(Sequence<C> sequence)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description C
getCompoundAt(int position)
Returns the Compound at the given biological indexString
getSequenceAsString()
Returns the String representation of the Sequenceprotected int
toIndex(int index)
-
Methods inherited from class org.biojava.nbio.core.sequence.template.SequenceProxyView
countCompounds, equals, getAccession, getAsList, getBioEnd, getBioStart, getCompoundSet, getIndexOf, getInverse, getLastIndexOf, getLength, getSubSequence, getViewedSequence, hashCode, iterator, setBioEnd, setBioStart
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Constructor Detail
-
ReversedSequenceView
public ReversedSequenceView(Sequence<C> sequence)
-
-
Method Detail
-
getSequenceAsString
public String 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
public C getCompoundAt(int position)
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
-
-