[Biojava-l] anger error

Ben Good ben at schoolid.com
Tue Nov 25 03:42:35 EST 2003


  Trying to implement this bit from biojava in anger ("How do count the 
residues in a sequence").

Count counts = new IndexedCount ((FiniteAlphabet)seq.getAlphabet());
					//iterate through the Symbols in seq
						for (Iterator i = seq.iterator(); i.hasNext();){
						AtomicSymbol sym = (AtomicSymbol)i.next();
						counts.increaseCount (sym,1.0);

It compiles but gives a class cast exception when I try to run it.  
Won't accept (AtomicSymbol)i.next();

It seems that seq.iterator() returns an iterator over Symbols and not 

any ideas?


More information about the Biojava-l mailing list