dip.judge.parser
Class PositionParser

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

public class PositionParser
extends java.lang.Object

Parses static position list, if present. This is in game listings and also sometimes in history files (if from the start).


Nested Class Summary
static class PositionParser.PositionInfo
          Details the position information
 
Field Summary
static java.lang.String HEADER_REGEX_1
          Header phrase 1
Capture groups: 1:season 2:year
PhaseType is assumed to be movement.
static java.lang.String HEADER_REGEX_2
          Header phrase 2
Capture groups: 1:PhaseType 2:SeasonType 3:year
static java.lang.String PARSE_REGEX
          Capture groups: 1:power, 2:unit, 3:province
Note: a space is not always present between the colon and the unit type.
 
Constructor Summary
PositionParser(java.lang.String input)
          Parses the input for Position information, if any is present.
 
Method Summary
 Phase getPhase()
          Returns the Phase; this will be null if getPositionInfo() is a zero-length array
 PositionParser.PositionInfo[] getPositionInfo()
          Returns PositionInfo, or a zero-length array
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HEADER_REGEX_1

public static final java.lang.String HEADER_REGEX_1
Header phrase 1
Capture groups: 1:season 2:year
PhaseType is assumed to be movement.

See Also:
Constant Field Values

HEADER_REGEX_2

public static final java.lang.String HEADER_REGEX_2
Header phrase 2
Capture groups: 1:PhaseType 2:SeasonType 3:year

See Also:
Constant Field Values

PARSE_REGEX

public static final java.lang.String PARSE_REGEX
Capture groups: 1:power, 2:unit, 3:province
Note: a space is not always present between the colon and the unit type.

See Also:
Constant Field Values
Constructor Detail

PositionParser

public PositionParser(java.lang.String input)
               throws java.io.IOException,
                      java.util.regex.PatternSyntaxException
Parses the input for Position information, if any is present.

Method Detail

getPositionInfo

public PositionParser.PositionInfo[] getPositionInfo()
Returns PositionInfo, or a zero-length array


getPhase

public Phase getPhase()
Returns the Phase; this will be null if getPositionInfo() is a zero-length array



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