}
else if (element instanceof BeginOfLine)
statecount = 1;
else if (element instanceof CharacterClass)
{
CharacterClass characterclass = (CharacterClass)element;
for (int i = 0; i<characterclass.getCharacterClassElementCount(); i++)
{
if (characterclass.getCharacterClassElement(i) instanceof CharacterInterval)
statecount++;
else if (characterclass.getCharacterClassElement(i) instanceof CharacterSet)
{
CharacterSet set = (CharacterSet)characterclass.getCharacterClassElement(i);
statecount += set.getCharacters().length();
}
}