Class TextToken
- java.lang.Object
-
- com.barrybecker4.ca.dj.jigo.sgf.tokens.SGFToken
-
- com.barrybecker4.ca.dj.jigo.sgf.tokens.TextToken
-
- Direct Known Subclasses:
CommentToken,DateToken,EventToken,FigureToken,GameCommentToken,GameIDToken,GameNameToken,NameToken,NodeNameToken,NumberToken,PlaceToken,RankToken,ResultToken,RoundToken,RuleSetToken,SourceToken,SystemToken,UserToken
public class TextToken extends SGFToken
A generic token. This class is responsible for parsing simple text -- nearly all SGFTokens subclass TextToken to get their content parsed. The subclasses then need only interpret the text read by parseContent.
-
-
Constructor Summary
Constructors Constructor Description TextToken()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetText()Returns the entire text between the opening '[' and closing ']'.protected booleanparseContent(java.io.StreamTokenizer st)Reads the text in between the first opening '[' and closing ']'.
-
-
-
Method Detail
-
parseContent
protected boolean parseContent(java.io.StreamTokenizer st) throws java.io.IOException, SGFExceptionReads the text in between the first opening '[' and closing ']'. This takes into consideration carriage returns, new lines, escaping ('\'), and special punctuation.- Specified by:
parseContentin classSGFToken- Parameters:
st- - The stream which contains characters from an SGF file.- Returns:
- true - The content was parsed successfully.
- Throws:
SGFException- - Something quite nasty happened.java.io.IOException
-
getText
public java.lang.String getText()
Returns the entire text between the opening '[' and closing ']'.
-
-