dip.judge.parser
Class JudgeParser

java.lang.Object
  extended bydip.judge.parser.JudgeParser

public class JudgeParser
extends java.lang.Object

First stage of Judge output parsing. Looks for the "::" line, determines game name, judge name, and variant type.

Then, looks to see (if present) the list of players and their email addresses.

Then, determines if input is a game listing or a game history. Sets flags, and if it is a game listing, returns the rest of the text. Determines if it is a game history by looking for a consecutive Date: / Subject: line pair

Parses the rest of the file into a String for sub-parsing.


Field Summary
static java.lang.String JP_TYPE_GAMESTART
           
static java.lang.String JP_TYPE_HISTORY
           
static java.lang.String JP_TYPE_LISTING
           
static java.lang.String JP_TYPE_RESULTS
           
static java.lang.String JP_TYPE_UNDEFINED
           
 
Constructor Summary
JudgeParser(OrderFactory orderFactory, java.io.Reader r)
          Create a JudgeParser, and start parsing.
 
Method Summary
 java.lang.String getGameName()
          Get the name of the Game
 java.lang.String getInitialText()
          For Listings, this is null.
 java.lang.String getJudgeName()
          Get the name of the Judge
 Phase getPhase()
          Get the phase of the game
 java.lang.String[] getPlayerEmails()
          Returns the email address for each player in the game, or a zero-length array
 java.lang.String[] getPlayerPowerNames()
          Returns the list of players in the game, or a zero-length-array
 java.lang.String getText()
          Returns the rest of the text for further parsing.
 java.lang.String getType()
          Returns the type of this input
 java.lang.String getVariantName()
          Get the name of the Variant
 java.lang.String prependText(java.lang.String s)
          Prepend the given string in front of the stored text
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

JP_TYPE_LISTING

public static final java.lang.String JP_TYPE_LISTING
See Also:
Constant Field Values

JP_TYPE_HISTORY

public static final java.lang.String JP_TYPE_HISTORY
See Also:
Constant Field Values

JP_TYPE_RESULTS

public static final java.lang.String JP_TYPE_RESULTS
See Also:
Constant Field Values

JP_TYPE_GAMESTART

public static final java.lang.String JP_TYPE_GAMESTART
See Also:
Constant Field Values

JP_TYPE_UNDEFINED

public static final java.lang.String JP_TYPE_UNDEFINED
See Also:
Constant Field Values
Constructor Detail

JudgeParser

public JudgeParser(OrderFactory orderFactory,
                   java.io.Reader r)
            throws java.io.IOException,
                   java.util.regex.PatternSyntaxException
Create a JudgeParser, and start parsing.

Method Detail

getJudgeName

public java.lang.String getJudgeName()
Get the name of the Judge


getVariantName

public java.lang.String getVariantName()
Get the name of the Variant


getGameName

public java.lang.String getGameName()
Get the name of the Game


getPhase

public Phase getPhase()
Get the phase of the game


getPlayerPowerNames

public java.lang.String[] getPlayerPowerNames()
Returns the list of players in the game, or a zero-length-array


getPlayerEmails

public java.lang.String[] getPlayerEmails()
Returns the email address for each player in the game, or a zero-length array


getType

public java.lang.String getType()
Returns the type of this input


getText

public java.lang.String getText()
Returns the rest of the text for further parsing.

This the "rest" of the text after parsing judge/player info;
if it is a history, it is every line INCLUDING and AFTER the first Date: line.


prependText

public java.lang.String prependText(java.lang.String s)
Prepend the given string in front of the stored text


getInitialText

public java.lang.String getInitialText()
For Listings, this is null. For Histories, this is the text after parsing game & player information but PRIOR to parsing Date: lines and turns. It is useful for some judges, where it will contain starting positions.



Copyright 2002-2004 Zachary DelProposto / jDip Development Team. All Rights Reserved.