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.AnnotationForwarderFeatureHolder.EmptyFeatureHolderEDIT, EMPTY_LISTANNOTATIONEMPTY_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, toListaddChangeListener, addChangeListener, addForwarder, getForwarders, getListeners, isUnchanging, removeChangeListener, removeChangeListener, removeForwarderclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListenerpublic 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 SymbolListsymbolAt in class ViewSequenceindex - 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 SymbolListsubStr in class ViewSequencestart - the index of the fist baseend - the index of the last baseString representation of the tokenized Symbolspublic Feature createFeature(Feature.Template template) throws ChangeVetoException, BioException
createFeature in interface FeatureHoldercreateFeature in class ViewSequencetemplate - 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 SymbolListsubList in class ViewSequencestart - 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.