public class CharClass extends CharTerminal
equals(Object) only determines whether the
two character class terminals have the same structure (that is, are
both exclusive or non-exclusive and have the same list of character
ranges), but does not determine whether the two character class
terminals recognize the same characters.| Modifier and Type | Class and Description |
|---|---|
static class |
CharClass.Parser
Parser for a character class specification.
|
Element.Tag| Modifier and Type | Field and Description |
|---|---|
boolean |
exclusive
The flag for whether the character class is exclusive.
|
java.util.List<CharRange> |
ranges
The list of character ranges.
|
| Constructor and Description |
|---|
CharClass(boolean exclusive,
java.util.List<CharRange> ranges)
Create a new character class.
|
CharClass(char c)
Create a new, non-exclusive character class for the specified
character.
|
CharClass(java.util.List<CharRange> ranges)
Create a new, non-exclusive character class.
|
CharClass(java.lang.String s)
Create a new, non-exclusive character class based on the supplied
character class specification.
|
| Modifier and Type | Method and Description |
|---|---|
int |
count()
Determine the number of characters covered by this character
class.
|
boolean |
equals(java.lang.Object o) |
int |
hashCode() |
CharClass |
normalize()
Normalize this character class.
|
boolean |
overlaps(CharClass klass)
Determine whether this character class overlaps the specified
character class.
|
Element.Tag |
tag()
Get this element's tag.
|
void |
write(java.lang.Appendable out)
Write a human readable representation to the specified
appendable.
|
add, add, addAll, addAll, addAll, addAll, addAllTo, addNode, contains, get, getBoolean, getBooleanProperty, getGeneric, getList, getLocation, getName, getNode, getProperty, getString, getStringProperty, getTokenText, hasLocation, hasName, hasProperty, hasTraversal, hasVariable, indexOf, isAnnotation, isEmpty, isGeneric, isList, isToken, iterator, lastIndexOf, properties, remove, removeProperty, set, setLocation, setLocation, setProperty, size, strip, toAnnotation, toList, toString, toTokenpublic boolean exclusive
public java.util.List<CharRange> ranges
public CharClass(java.util.List<CharRange> ranges)
ranges - The list of character ranges.public CharClass(boolean exclusive,
java.util.List<CharRange> ranges)
exclusive - The exclusive flag.ranges - The list of character ranges.public CharClass(char c)
c - The character.public CharClass(java.lang.String s)
[' and
trailing ']' characters.s - The character class specification.public Element.Tag tag()
Elementpublic CharClass normalize()
public boolean overlaps(CharClass klass)
klass - The other character class.true if the two character classes overlap.java.lang.IllegalStateException - Signals that either this or the specified class is exclusive.public int count()
public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic void write(java.lang.Appendable out)
throws java.io.IOException
NodeObject.toString().Copyright © 2014. All Rights Reserved.