DerivationTree extends NimbleTree<Symbol> { String getGECodonValueLegacyFormat(String s, int codon) { int low = 0; int high = -1; int i = Constants.GE_CODON_VALUE_PARSING.length(); String codon_value; char currentChar = s.charAt(i); while(currentChar != '>'){ if(currentChar == '-'){ currentChar = s.charAt(i++); while((currentChar >= '0') && (currentChar <= '9')){ low = (low * 10) + (currentChar - '0'); currentChar = s.charAt(i++); } } else if(currentChar == '+'){ currentChar = s.charAt(i++); while((currentChar >= '0') && (currentChar <= '9')){ if(high == -1){ high = 0; } high = (high * 10) + (currentChar - '0'); currentChar = s.charAt(i++); } } else{ currentChar = s.charAt(i++); } } if(high == -1){ high = genny.getMaxCodonValue(); } if(high == low){ codon_value = String.valueOf(low); } else{ codon = (codon%(high-low+1))+low; codon_value = String.valueOf(codon); } return codon_value; } DerivationTree(GEGrammar gram, GEChromosome gen);  DerivationTree(DerivationTree copy); boolean buildDerivationTree(); int getWrapCount(); int getGeneCnt(); boolean derive();  }
@Test public void testGetGECodonValueLegacyFormat() { System.out.println("* DerivationTreeTest: getGECodonValueLegacyFormat"); String s = "<GECodonValue-3+5>"; int codon = 0; String expResult = "3"; String result = dt.getGECodonValueLegacyFormat(s, codon); assertEquals(expResult, result); }