uk.ac.man.bioinf.sequence.alignment
Class AbstractGappedSequence

java.lang.Object
  |
  +--uk.ac.man.bioinf.sequence.AbstractSequence
        |
        +--uk.ac.man.bioinf.sequence.AbstractMutableSequence
              |
              +--uk.ac.man.bioinf.sequence.alignment.AbstractGappedSequence
All Implemented Interfaces:
GappedSequence, Identifiable, MutableSequence, Sequence, SequenceEventProvider
Direct Known Subclasses:
DefaultConsensusSequence, DefaultGappedSequence

public abstract class AbstractGappedSequence
extends AbstractMutableSequence
implements GappedSequence

AbstractGappedSequence.java Created: Sat Mar 4 12:17:02 2000

Version:
$Id: AbstractGappedSequence.java,v 1.5 2001/04/11 17:04:43 lord Exp $
Author:
Phillip Lord

Constructor Summary
AbstractGappedSequence(SequenceType type)
           
 
Method Summary
protected  void checkGappedRange(int index)
           
protected  void checkGappedRangeForInsert(int index)
           
 void deleteGapAt(int index)
          Delete the element at index.
 void deleteGapAt(int index, int length)
          Delete the elements starting at index for the specified length
protected abstract  void deleteGapAtQuietly(int index)
           
 char getGappedElementAtAsChar(int index)
           
 char[] getGappedSequenceAsChars()
           
protected  NoSuchSequenceElementException getGappedSequenceIndexException(int index)
           
 void insertGapAt(int index)
           
 void insertGapAt(int index, int length)
          Inserts the elements at this position.
protected abstract  void insertGapAtQuietly(int index)
           
 
Methods inherited from class uk.ac.man.bioinf.sequence.AbstractMutableSequence
addSequenceListener, addVetoableSequenceListener, fireSequenceEvent, fireVetoableSequenceEvent, hasListeners, removeSequenceListener, removeVetoableSequenceListener
 
Methods inherited from class uk.ac.man.bioinf.sequence.AbstractSequence
checkRange, checkSequenceType, checkSequenceType, getElementAtAsChar, getSequenceAsChars, getSequenceIndexException, getSequenceType, getSequenceTypeException, getSubSequence
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface uk.ac.man.bioinf.sequence.alignment.GappedSequence
getGappedElementAt, getGappedLength, getGappedPositionOf, getGappedSequenceAsElements, getGappedSubSequence, getUngappedPositionOf
 
Methods inherited from interface uk.ac.man.bioinf.sequence.Sequence
getElementAt, getElementAtAsChar, getLength, getSequenceAsChars, getSequenceAsElements, getSequenceType, getSubSequence
 
Methods inherited from interface uk.ac.man.bioinf.sequence.identifier.Identifiable
getIdentifier
 
Methods inherited from interface uk.ac.man.bioinf.sequence.event.SequenceEventProvider
addSequenceListener, addVetoableSequenceListener, removeSequenceListener, removeVetoableSequenceListener
 

Constructor Detail

AbstractGappedSequence

public AbstractGappedSequence(SequenceType type)
Method Detail

insertGapAtQuietly

protected abstract void insertGapAtQuietly(int index)

insertGapAt

public void insertGapAt(int index)
                 throws SequenceVetoException
Specified by:
insertGapAt in interface GappedSequence
SequenceVetoException

insertGapAt

public void insertGapAt(int index,
                        int length)
                 throws SequenceVetoException
Description copied from interface: GappedSequence
Inserts the elements at this position. If the index is one longer than the length of the sequence the sequence will be extended.

Specified by:
insertGapAt in interface GappedSequence
Parameters:
index - the index at which to insert
SequenceVetoException

deleteGapAtQuietly

protected abstract void deleteGapAtQuietly(int index)

deleteGapAt

public void deleteGapAt(int index)
                 throws SequenceVetoException
Description copied from interface: GappedSequence
Delete the element at index.

Specified by:
deleteGapAt in interface GappedSequence
Parameters:
index - the index to delete
Returns:
the element which has just been deleted
SequenceVetoException

deleteGapAt

public void deleteGapAt(int index,
                        int length)
                 throws SequenceVetoException
Description copied from interface: GappedSequence
Delete the elements starting at index for the specified length

Specified by:
deleteGapAt in interface GappedSequence
Parameters:
index - the index to start at
length - the length to delete
Returns:
the elements just deleted
SequenceVetoException

getGappedElementAtAsChar

public char getGappedElementAtAsChar(int index)
Specified by:
getGappedElementAtAsChar in interface GappedSequence

getGappedSequenceAsChars

public char[] getGappedSequenceAsChars()
Specified by:
getGappedSequenceAsChars in interface GappedSequence

checkGappedRange

protected void checkGappedRange(int index)

checkGappedRangeForInsert

protected void checkGappedRangeForInsert(int index)

getGappedSequenceIndexException

protected NoSuchSequenceElementException getGappedSequenceIndexException(int index)