|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.argouml.util.CustomSeparator
org.argouml.util.LineSeparator
A descendent of CustomSeparator that recognizes "the tree line ends":
This is in fact the class currently used LINE_SEPARATOR in MyTokenizer.
Field Summary | |
private boolean |
hasCr
|
private boolean |
hasLf
|
private boolean |
hasPeeked
|
Fields inherited from class org.argouml.util.CustomSeparator |
|
Constructor Summary | |
LineSeparator()
Creates a LineSeparator. |
Method Summary | |
boolean |
addChar(char c)
Called to allow you to decide if you want to capure control of the matching process. If you return true, then hasFreePart will be checked to see if you
expect more things to follow.
The default behaviour is to return false until the character or String given as parameter to the constructor has been matched. Overridden to find the start of a line-end. |
boolean |
endChar(char c)
Called to check if more characters are expected in the free part of the token. Overridden to find the end of a line-end. |
int |
getPeekCount()
Called to how many characters the CustomSeparator read after the end of the separator. This allows them to see beyond the end, but these characters will be fed to the separators again when looking for the next token so be careful. |
boolean |
hasFreePart()
Called to check if more characters are expected to follow after addChar has returned true. If true, then any following characters will be fed to endChar until endChar returns true. The default behaviour is to return false. |
void |
reset()
Called to reset the separator before staring to look for a new token. |
int |
tokenLength()
Returns the length of the matched token. It is not required to be meaningful unless addChar has returned true and hasFreePart returned false or endChar returned true. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private boolean hasCr
private boolean hasLf
private boolean hasPeeked
Constructor Detail |
public LineSeparator()
Method Detail |
public void reset()
CustomSeparator
reset
in class CustomSeparator
public int tokenLength()
tokenLength
in class CustomSeparator
public int getPeekCount()
getPeekCount
in class CustomSeparator
public boolean hasFreePart()
The default behaviour is to return false.
hasFreePart
in class CustomSeparator
public boolean addChar(char c)
hasFreePart
will be checked to see if you
expect more things to follow.
The default behaviour is to return false until the character or String given as parameter to the constructor has been matched. Overridden to find the start of a line-end.
addChar
in class CustomSeparator
c
- The next character in the sequence being tokenized.
public boolean endChar(char c)
endChar
in class CustomSeparator
c
- The next character in the sequence being tokenized.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ArgoUML © 1996-2004 (20050222) | ArgoUML Homepage | ArgoUML Developers' page | ArgoUML Cookbook |