boolean (RegExpClassElement classElement) { if (classElement instanceof RegExpSimpleClass) { return ((RegExpSimpleClass)classElement).getKind().equals(DIGIT); } if (classElement instanceof RegExpPosixBracketExpression) { String className = ((RegExpPosixBracketExpression)classElement).getClassName(); return className != null && className.equals("digit"); } return false; }