|
||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||
java.lang.ObjectdRegAut.Alphabet
public class Alphabet
Representation of an alphabet.
An alphabet is represented by a non-empty set of Character objects.
For simplificy, alphabets should not contain the characters
'#', '%', '+', '*', '(', or ')',
which have special meaning in RegExp regular expresions.
(The character \uFFFF, which we use for representation of
, is also forbidden.)
| Field Summary | |
|---|---|
Set<Character> |
symbols
Set of Character objects. |
| Constructor Summary | |
|---|---|
Alphabet(char min,
char max)
Constructs an alphabet consisting of the symbols in the given Unicode character interval. |
|
Alphabet(String symbols)
Constructs an alphabet consisting of the given symbols. |
|
| Method Summary | |
|---|---|
boolean |
equals(Object obj)
Checks whether the given alphabet is the same as this one. |
int |
getNumberOfSymbols()
Returns number of symbols in this alphabet. |
int |
hashCode()
Computes hash code for this object. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public Set<Character> symbols
Character objects.
The set should not be changed when the alphabet is being used in instances
of RegExp, FA, or NFA.
| Constructor Detail |
|---|
public Alphabet(char min,
char max)
throws IllegalArgumentException
min - begin charactermax - end character (included)
IllegalArgumentException - if min>max
public Alphabet(String symbols)
throws IllegalArgumentException
symbols - non-empty string of symbols
IllegalArgumentException - if symbols is empty| Method Detail |
|---|
public boolean equals(Object obj)
equals in class Objectpublic int getNumberOfSymbols()
public int hashCode()
equals(Object) is implemented, hashCode must also be there.)
hashCode in class Object
|
||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||