sjm.parse.chars
Class SpecificChar
java.lang.Object
|
+--sjm.parse.Parser
|
+--sjm.parse.Terminal
|
+--sjm.parse.chars.SpecificChar
- public class SpecificChar
- extends Terminal
A SpecificChar matches a specified character from a character
assembly.
|
Field Summary |
protected java.lang.Character |
character
the character to match |
|
Constructor Summary |
SpecificChar(char c)
Constructs a SpecificChar to match the specified char. |
SpecificChar(java.lang.Character character)
Constructs a SpecificChar to match the specified character. |
|
Method Summary |
boolean |
qualifies(java.lang.Object o)
Returns true if an assembly's next element is equal to the
character this object was constructed with. |
java.lang.String |
unvisitedString(java.util.Vector visited)
Returns a textual description of this parser. |
| Methods inherited from class sjm.parse.Parser |
accept,
add,
best,
bestMatch,
completeMatch,
elementClone,
getName,
matchAndAssemble,
randomInput,
setAssembler,
toString,
toString |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
character
protected java.lang.Character character
- the character to match
SpecificChar
public SpecificChar(char c)
- Constructs a SpecificChar to match the specified char.
- Parameters:
char - the character to match
SpecificChar
public SpecificChar(java.lang.Character character)
- Constructs a SpecificChar to match the specified character.
- Parameters:
character - the character to match
qualifies
public boolean qualifies(java.lang.Object o)
- Returns true if an assembly's next element is equal to the
character this object was constructed with.
- Overrides:
- qualifies in class Terminal
- Parameters:
object - an element from an assembly- Returns:
- true, if an assembly's next element is equal to
the character this object was constructed with
unvisitedString
public java.lang.String unvisitedString(java.util.Vector visited)
- Returns a textual description of this parser.
- Overrides:
- unvisitedString in class Terminal
- Parameters:
vector - a list of parsers already printed in
this description- Returns:
- string a textual description of this parser
- See Also:
Parser.toString()