uk.ac.man.bioinf.sequence.types
Class AbstractEnumeratedSequenceType
java.lang.Object
|
+--uk.ac.man.bioinf.sequence.types.AbstractSequenceType
|
+--uk.ac.man.bioinf.sequence.types.AbstractEnumeratedSequenceType
- All Implemented Interfaces:
- SequenceType
- Direct Known Subclasses:
- DNASequenceType, ProteinSequenceType, RNASequenceType
- public class AbstractEnumeratedSequenceType
- extends AbstractSequenceType
AbstractEnumeratedSequenceType.java
Created: Tue Jun 13 13:20:11 2000
- Version:
- $Id: AbstractEnumeratedSequenceType.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 |
AbstractEnumeratedSequenceType
public AbstractEnumeratedSequenceType(Element[] elements,
String name)
AbstractEnumeratedSequenceType
public AbstractEnumeratedSequenceType(Element[][] elements,
String name)
getIntForElement
public int getIntForElement(Element element)
- 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.
- Parameters:
element
- the element
- Returns:
- a int
getElementForInt
public Element getElementForInt(int index)
- Description copied from interface:
SequenceType
- The inverse of the method getIntForElement.
- Parameters:
index
- a value of type 'int'
- Returns:
- a value of type 'Element'