uk.ac.man.bioinf.sequence.complex
Class DefaultComplexSequenceType

java.lang.Object
  |
  +--uk.ac.man.bioinf.sequence.complex.DefaultComplexSequenceType
All Implemented Interfaces:
ComplexSequenceType, SequenceType

public class DefaultComplexSequenceType
extends Object
implements ComplexSequenceType

DefaultComplexSequenceType.java Created: Mon Nov 27 16:05:27 2000

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

Constructor Summary
DefaultComplexSequenceType(SequenceType type, Modification[] mods, String name)
           
 
Method Summary
 Element getElementForInt(int param1)
          The inverse of the method getIntForElement.
 Element[] getElements()
          Returns all the elements available in this sequence type.
 int getIntForElement(Element param1)
          This method is present as a performance enhancement.
 Modification[] getModifications()
          Gets all of the Modifications which are allowable in this sequence type.
 String getName()
          Returns the human readable form of this sequence type.
 boolean isAllowableElement(ComplexElement element)
          Is this given element allowable in this sequence type.
 boolean isElement(char param1)
          Returns a boolean as to whether the specified element is part of this sequence type.
 boolean isElement(char[] param1)
          Returns a boolean as to whether the specified elements are part of this sequence type.
 boolean isElement(Element param1)
          Returns a boolean as to whether the specified element is part of this sequence type.
 boolean isElement(Element[] param1)
          Returns a boolean as to whether the specified elements are part of this sequence type.
 boolean isModification(Modification mod)
          Is this modification one which is allowable in this sequence type.
 boolean isModification(Modification[] mods)
          Are these modifications allowable in this sequence type.
 int size()
          Returns the number of elements in this sequence type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultComplexSequenceType

public DefaultComplexSequenceType(SequenceType type,
                                  Modification[] mods,
                                  String name)
Method Detail

getName

public String getName()
Description copied from interface: SequenceType
Returns the human readable form of this sequence type.

Specified by:
getName in interface SequenceType
Returns:
the name

getModifications

public Modification[] getModifications()
Description copied from interface: ComplexSequenceType
Gets all of the Modifications which are allowable in this sequence type. This should be immutable for a given instance of this.

Specified by:
getModifications in interface ComplexSequenceType
Returns:
the modifications

isModification

public boolean isModification(Modification mod)
Description copied from interface: ComplexSequenceType
Is this modification one which is allowable in this sequence type. This should be immutable for a given instance of this.

Specified by:
isModification in interface ComplexSequenceType
Parameters:
mod - the modification
Returns:
true if the modification is allowable

isModification

public boolean isModification(Modification[] mods)
Description copied from interface: ComplexSequenceType
Are these modifications allowable in this sequence type. This should be immutable.

Specified by:
isModification in interface ComplexSequenceType
Parameters:
mods - the modifications
Returns:
true if all the modifications are allowable

isAllowableElement

public boolean isAllowableElement(ComplexElement element)
Description copied from interface: ComplexSequenceType
Is this given element allowable in this sequence type. A trivial implementation of this would simply check if the ComplexElement Residue is allowable, and all of the Modifications for this ComplexElement are allowable. However there are other possibilties if for instance not all Residues in a given sequence type are Modifiable by all the allowable modifications

Specified by:
isAllowableElement in interface ComplexSequenceType
Parameters:
element -
Returns:

isElement

public boolean isElement(Element[] param1)
Description copied from interface: SequenceType
Returns a boolean as to whether the specified elements are part of this sequence type.

Specified by:
isElement in interface SequenceType
Parameters:
param1 - the elements
Returns:
whether elements

isElement

public boolean isElement(char[] param1)
Description copied from interface: SequenceType
Returns a boolean as to whether the specified elements are part of this sequence type.

Specified by:
isElement in interface SequenceType
Parameters:
param1 - the elements
Returns:
whether elements

isElement

public boolean isElement(Element param1)
Description copied from interface: SequenceType
Returns a boolean as to whether the specified element is part of this sequence type.

Specified by:
isElement in interface SequenceType
Parameters:
param1 - the element
Returns:
whether an element

isElement

public boolean isElement(char param1)
Description copied from interface: SequenceType
Returns a boolean as to whether the specified element is part of this sequence type.

Specified by:
isElement in interface SequenceType
Parameters:
param1 - the element
Returns:
whether an element

getElements

public Element[] getElements()
Description copied from interface: SequenceType
Returns all the elements available in this sequence type. This array should be freely modifiable, and changes should not percolate backwards iunto the internal data of the sequence type.

Specified by:
getElements in interface SequenceType
Returns:
the elements

getElementForInt

public Element getElementForInt(int param1)
Description copied from interface: SequenceType
The inverse of the method getIntForElement.

Specified by:
getElementForInt in interface SequenceType
Parameters:
param1 - a value of type 'int'
Returns:
a value of type 'Element'

getIntForElement

public int getIntForElement(Element param1)
Description copied from interface: SequenceType
This method is present as a performance enhancement. For every Element this method should return a unique and repeatable int, starting at 0 and ending at size() - 1 for all possible Elements. This enables the Element to be used as an index for an array which in turn allows implementation of efficient look up tables, rather than using a hashtable.

Specified by:
getIntForElement in interface SequenceType
Parameters:
param1 - the element
Returns:
a int

size

public int size()
Description copied from interface: SequenceType
Returns the number of elements in this sequence type.

Specified by:
size in interface SequenceType
Returns:
the number of elements