Mobios v0.91

mobios.type
Class Alphabet

java.lang.Object
  extended by mobios.type.Alphabet
All Implemented Interfaces:
Serializable

public class Alphabet
extends Object
implements Serializable

An alphabet represents a collection of Symbols for a specific Sequence type.

Author:
Willard
See Also:
Serialized Form

Constructor Summary
Alphabet(Symbol[] alphabet, int distinctSize)
          Main constructor.
 
Method Summary
 int distinctSize()
          Two Symbols may map to the same byteValue; this is used to determine the number of distinct byteValues that an Alphabet has.
 Symbol get(int index)
           
 int size()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Alphabet

public Alphabet(Symbol[] alphabet,
                int distinctSize)
Main constructor.

Parameters:
alphabet - An array of Symbol objects that this alphabet is defined over.
distinctSize - the number of distinct byteValues that the symbols in the alphabet link to.
Method Detail

size

public int size()
Returns:
the size of the alphabet. May be greater than or equal to the distinctSize, but not smaller.

get

public Symbol get(int index)
Parameters:
index - the index of the desired Symbol in the Symbol array.
Returns:
the desired Symbol.

distinctSize

public int distinctSize()
Two Symbols may map to the same byteValue; this is used to determine the number of distinct byteValues that an Alphabet has. See Symbol for more info.

Returns:

Mobios v0.91

(C) 2002 - 2006 The MoBIoS Group