org.biojava3.core.sequence.edits
Class Edit.AbstractEdit<C extends Compound>

java.lang.Object
  extended by org.biojava3.core.sequence.edits.Edit.AbstractEdit<C>
All Implemented Interfaces:
Edit<C>
Direct Known Subclasses:
Edit.Delete, Edit.Insert, Edit.Substitute
Enclosing interface:
Edit<C extends Compound>

public abstract static class Edit.AbstractEdit<C extends Compound>
extends Object
implements Edit<C>

Abstract class which defines all edit operations as a call to discover what 5' and 3' ends of an editing Sequence should be joined together with a target Sequence. These ends can be of 0 length but conceptionally they can still exist.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.biojava3.core.sequence.edits.Edit
Edit.AbstractEdit<C extends Compound>, Edit.Delete<C extends Compound>, Edit.Insert<C extends Compound>, Edit.Substitute<C extends Compound>
 
Constructor Summary
Edit.AbstractEdit(int start)
           
Edit.AbstractEdit(int start, int end)
           
 
Method Summary
 Sequence<C> edit(Sequence<C> editingSequence)
           
protected  Sequence<C> getEmptySequence(Sequence<C> editingSequence)
          Returns an empty sequence with the given compound set of the editing sequence
 int getEnd()
           
protected abstract  Sequence<C> getFivePrime(Sequence<C> editingSequence)
          Should return the 5-prime end of the given Sequence according to the edit.
 int getStart()
           
 Sequence<C> getTargetSequence(Sequence<C> editingSequence)
          Returns the Sequence which is our edit.
protected abstract  Sequence<C> getThreePrime(Sequence<C> editingSequence)
          Should return the 3-prime end of the given Sequence according to the edit.
protected  void setSequence(Sequence<C> sequence)
           
protected  void setStringSequence(String stringSequence)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Edit.AbstractEdit

public Edit.AbstractEdit(int start)

Edit.AbstractEdit

public Edit.AbstractEdit(int start,
                         int end)
Method Detail

getFivePrime

protected abstract Sequence<C> getFivePrime(Sequence<C> editingSequence)
Should return the 5-prime end of the given Sequence according to the edit. An empty Sequence is valid.


getThreePrime

protected abstract Sequence<C> getThreePrime(Sequence<C> editingSequence)
Should return the 3-prime end of the given Sequence according to the edit. An empty Sequence is valid.


edit

public Sequence<C> edit(Sequence<C> editingSequence)
Specified by:
edit in interface Edit<C extends Compound>

setStringSequence

protected void setStringSequence(String stringSequence)

setSequence

protected void setSequence(Sequence<C> sequence)

getTargetSequence

public Sequence<C> getTargetSequence(Sequence<C> editingSequence)
Returns the Sequence which is our edit.

Parameters:
editingSequence - Asked for in-case we need to do String to Sequence conversion so we need a CompoundSet which is given by the Sequence we are editing
Returns:
The Sequence object we wish to insert

getEmptySequence

protected Sequence<C> getEmptySequence(Sequence<C> editingSequence)
Returns an empty sequence with the given compound set of the editing sequence


getStart

public int getStart()

getEnd

public int getEnd()