chesspresso.pgn
Class PGNReader

java.lang.Object
  |
  +--chesspresso.pgn.PGN
        |
        +--chesspresso.pgn.PGNReader

public final class PGNReader
extends PGN

Reader for PGN files.

Version:
$Revision: 1.1 $
Author:
Bernhard Seybold

Field Summary
(package private) static int TOK_EOF
           
(package private) static int TOK_EOL
           
(package private) static int TOK_IDENT
           
(package private) static int TOK_NO_TOKEN
           
(package private) static int TOK_STRING
           
 
Fields inherited from class chesspresso.pgn.PGN
TAG_BLACK, TAG_BLACK_ELO, TAG_DATE, TAG_ECO, TAG_EVENT, TAG_EVENT_DATE, TAG_FEN, TAG_RESULT, TAG_ROUND, TAG_SITE, TAG_WHITE, TAG_WHITE_ELO, TOK_ASTERISK, TOK_COMMENT_BEGIN, TOK_COMMENT_END, TOK_LBRACKET, TOK_LINE_BEGIN, TOK_LINE_COMMENT, TOK_LINE_END, TOK_NAG_BEGIN, TOK_PERIOD, TOK_PGN_ESCAPE, TOK_QUOTE, TOK_RBRACKET, TOK_TAG_BEGIN, TOK_TAG_END
 
Constructor Summary
protected PGNReader()
           
  PGNReader(java.io.InputStream in, java.lang.String name)
           
  PGNReader(java.io.Reader reader, java.lang.String name)
          Deprecated.  
  PGNReader(java.lang.String filename)
          Deprecated.  
  PGNReader(java.net.URL url)
          Deprecated.  
 
Method Summary
 void completeGame(Game game)
           
static javax.swing.filechooser.FileFilter getFileFilter()
           
static boolean isPGNFile(java.lang.String filename)
           
static boolean isPGNFileOrZipped(java.lang.String filename)
           
static void main(java.lang.String[] args)
           
 Game parseGame()
          Returns the next game in the current pgn file.
 void setErrorHandler(PGNErrorHandler handler)
           
protected  void setInput(java.io.Reader reader, java.lang.String name)
           
 void setUseSemicolonComments(boolean flag)
           
 
Methods inherited from class chesspresso.pgn.PGN
dateToPGNDate, getYearOfPGNDate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TOK_EOF

static final int TOK_EOF
See Also:
Constant Field Values

TOK_EOL

static final int TOK_EOL
See Also:
Constant Field Values

TOK_IDENT

static final int TOK_IDENT
See Also:
Constant Field Values

TOK_STRING

static final int TOK_STRING
See Also:
Constant Field Values

TOK_NO_TOKEN

static final int TOK_NO_TOKEN
See Also:
Constant Field Values
Constructor Detail

PGNReader

protected PGNReader()

PGNReader

public PGNReader(java.io.InputStream in,
                 java.lang.String name)

PGNReader

public PGNReader(java.lang.String filename)
          throws java.io.IOException
Deprecated.  


PGNReader

public PGNReader(java.net.URL url)
          throws java.net.MalformedURLException,
                 java.io.IOException
Deprecated.  


PGNReader

public PGNReader(java.io.Reader reader,
                 java.lang.String name)
Deprecated.  

Method Detail

isPGNFile

public static boolean isPGNFile(java.lang.String filename)

isPGNFileOrZipped

public static boolean isPGNFileOrZipped(java.lang.String filename)

getFileFilter

public static javax.swing.filechooser.FileFilter getFileFilter()

setInput

protected void setInput(java.io.Reader reader,
                        java.lang.String name)

setUseSemicolonComments

public void setUseSemicolonComments(boolean flag)

setErrorHandler

public void setErrorHandler(PGNErrorHandler handler)

parseGame

public Game parseGame()
               throws PGNSyntaxError,
                      java.io.IOException
Returns the next game in the current pgn file.

Returns:
the next game
PGNSyntaxError
java.io.IOException

completeGame

public void completeGame(Game game)

main

public static void main(java.lang.String[] args)