statecount = 1;
else if (element instanceof PatternGroup)
{
statecount = 2;
PatternGroup group = (PatternGroup)element;
for (int i = 0; i<group.getPatternCount(); i++)
statecount += getStateCount(group.getPattern(i));
}
else if (element instanceof UniversalCharacter)
statecount = 1;
else
throw new IllegalArgumentException("Pattern element not recognized");