uk.ac.man.bioinf.sequence.complex
Class AbstractComplexSequence
java.lang.Object
|
+--uk.ac.man.bioinf.sequence.AbstractSequence
|
+--uk.ac.man.bioinf.sequence.AbstractMutableSequence
|
+--uk.ac.man.bioinf.sequence.complex.AbstractComplexSequence
- All Implemented Interfaces:
- ComplexSequence, Identifiable, MutableSequence, Sequence, SequenceEventProvider
- Direct Known Subclasses:
- DefaultComplexSequence, DefaultGappedComplexSequence
- public abstract class AbstractComplexSequence
- extends AbstractMutableSequence
- implements ComplexSequence
AbstractComplexSequence.java
Created: Fri Nov 24 13:33:32 2000
- Version:
- $Id: AbstractComplexSequence.java,v 1.2 2001/04/11 17:04:43 lord Exp $
- Author:
- Phillip Lord
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractComplexSequence
public AbstractComplexSequence(ComplexSequenceType type)
getComplexType
public ComplexSequenceType getComplexType()
checkSequenceType
protected void checkSequenceType(Element[] element)
throws InvalidSequenceTypeException
- Description copied from class:
AbstractSequence
- Check if all these elements are of a valid type
- Overrides:
checkSequenceType
in class AbstractSequence
- Parameters:
element
- the elements
- Throws:
InvalidSequenceTypeException
- if an element is not of a
valid type
checkSequenceType
protected void checkSequenceType(Element element)
throws InvalidSequenceTypeException
- Overrides:
checkSequenceType
in class AbstractSequence
InvalidSequenceTypeException
checkComplexSequenceType
protected void checkComplexSequenceType(ComplexElement[] element)
throws InvalidSequenceTypeException
InvalidSequenceTypeException
checkComplexSequenceType
protected void checkComplexSequenceType(ComplexElement element)
throws InvalidSequenceTypeException
InvalidSequenceTypeException
getComplexSequenceTypeException
protected InvalidSequenceTypeException getComplexSequenceTypeException(Element element)
addModificationAt
public ComplexElement addModificationAt(Modification mod,
int index)
throws SequenceVetoException
- Specified by:
addModificationAt
in interface ComplexSequence
SequenceVetoException
setElementAtQuietly
protected abstract ComplexElement setElementAtQuietly(ComplexElement element,
int index)
removeModificationAt
public ComplexElement removeModificationAt(Modification mod,
int index)
throws SequenceVetoException
- Specified by:
removeModificationAt
in interface ComplexSequence
SequenceVetoException
getComplexElementAtAsChar
public char[] getComplexElementAtAsChar(int index)
- Description copied from interface:
ComplexSequence
- Representing a ComplexElement as a char is not a simple task. An
Element can have any number of Modifications each of which comes
with its own char representation. The following approach is
used. Each Element is represented first by its own char
representation, and then by its all of its modifications, and
then finally by an underscore _, which acts as a standard
terminator. Counting the number of underscores should show how
many Elements there are.
This is not meant to be a particular wonderfully parse-able
format.
- Specified by:
getComplexElementAtAsChar
in interface ComplexSequence
- Parameters:
index
-
- Returns:
- a
char[]
value
getComplexSequenceAsChars
public char[] getComplexSequenceAsChars()
- Specified by:
getComplexSequenceAsChars
in interface ComplexSequence