public class CircularView extends ViewSequence
A circular view onto another Sequence object. The class allows for reinterpretation of locations and indices onto the sequence to allow for overlapping of the origin. The origin is assumed to be the first symbol. Future versions may support changing the origin.
In biojavaxRichSequences
intrinsicly know about
circularity. No view is required. We strongly recommend using RichSequence
if possible.RichSequence
,
Serialized FormAnnotatable.AnnotationForwarder
FeatureHolder.EmptyFeatureHolder
EDIT, EMPTY_LIST
ANNOTATION
EMPTY_FEATURE_HOLDER, FEATURES, SCHEMA
Constructor and Description |
---|
CircularView(Sequence seq) |
CircularView(Sequence seq,
FeatureRealizer fr) |
Modifier and Type | Method and Description |
---|---|
Feature |
createFeature(Feature.Template template)
Over rides ViewSequence to allow the use of locations that have
coordinates outside of the sequence length (which are needed to
describe locations that overlap the origin of a circular sequence).
|
SymbolList |
subList(int start,
int end)
Over rides ViewSequence.
|
String |
subStr(int start,
int end)
Over rides ViewSequence.
|
Symbol |
symbolAt(int index)
Over rides ViewSequence.
|
containsFeature, countFeatures, edit, features, filter, filter, getAddedFeatures, getAlphabet, getAnnotation, getName, getSchema, getURN, iterator, length, realizeFeature, removeFeature, seqString, toList
addChangeListener, addChangeListener, addForwarder, getForwarders, getListeners, isUnchanging, removeChangeListener, removeChangeListener, removeForwarder
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListener
public CircularView(Sequence seq, FeatureRealizer fr)
public CircularView(Sequence seq)
public Symbol symbolAt(int index)
Over rides ViewSequence. Allows any integer index, positive or negative
to return a symbol via the equation
val = (val % length);
Note that base zero is the base immediately before base 1 which is of course
the last base of the sequence.
symbolAt
in interface SymbolList
symbolAt
in class ViewSequence
index
- the index of the Symbol
requested.Symbol
specified by the index.
public String subStr(int start, int end)
Over rides ViewSequence. Allows any integer index, positive or negative
to return a symbol via the equation
val = (val % length);
Will return a linear String which can, if nescessary, span the origin.
subStr
in interface SymbolList
subStr
in class ViewSequence
start
- the index of the fist baseend
- the index of the last baseString
representation of the tokenized Symbol
spublic Feature createFeature(Feature.Template template) throws ChangeVetoException, BioException
createFeature
in interface FeatureHolder
createFeature
in class ViewSequence
template
- the template of the feature to be created.BioException
- if a non circular location is added that exceeds the
'boundaries' of the sequence.ChangeVetoException
- if the sequence is locked.public SymbolList subList(int start, int end)
Over rides ViewSequence. Allows any integer index, positive or negative
to return a symbol via the equation
index = ((index -1) % length)+1
Will return a linear SymbolList which can ,if nescessary, span the origin.
subList
in interface SymbolList
subList
in class ViewSequence
start
- the first base of the sublistend
- the last base of the sublistSymbolList
containing the Symbols
from
start
to end
inclusiveCopyright © 2014 BioJava. All rights reserved.