[Biojava-l] SymbolList

step1b@cyberspace.org step1b@cyberspace.org
Wed, 17 Apr 2002 13:14:43 -0400


Hi
How do I create a SymbolList of the symbol set: {A, B, C, D, E, F} (ordered)?
The following program produces a ClassCastException when run:

 
 import org.biojava.bio.symbol.*;
 import java.util.*;
  
  public class TestSuffixTree {
   
       public static void main (String[] args) {

			SimpleAlphabet sa = getAlphabet ();
			DummySymbolList dsl = new DummySymbolList (sa, 6);
			SuffixTree st = new SuffixTree (sa);
			st.addSymbols (dsl, 1);

	   }
	   public static SimpleAlphabet getAlphabet () {
			HashSet hs = new HashSet ();
			hs.add (new String("A"));
			hs.add (new String("B"));
			hs.add (new String("C"));
			hs.add (new String("D"));
			hs.add (new String("E"));
			hs.add (new String("F"));
			return new SimpleAlphabet (hs, "alpha");
	   }
	}




    thanks.
	--st.
																	  
																	  }