dip.judge.parser
Class DislodgedParser

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

public class DislodgedParser
extends java.lang.Object

Parses the Dislodged block


Nested Class Summary
static class DislodgedParser.DislodgedInfo
          A DislodgedInfo object is created for each dislodged unit.
 
Field Summary
static java.lang.String DESTROYED_REGEX
          capture groups: 1:power, 2:unit, 3:unit location (may be multi-word, needs to be trim()'d)
NOTE: this may span >1 line; it ends with the period ('.')
static java.lang.String DISLODGED_LINE_START
          Dislodged line start text; all dislodged lines must start with this.
static java.lang.String DISLODGED_REGEX
          capture groups: 1:power, 2:unit, 3:unit location, 4:retreat list predicate (example: "xxx or yyy or zzz") w/o trailing '.'
static java.lang.String DISLODGED_SPLIT_REGEX
          splits the retreat list predicate; must be suitable for String.split()
static java.lang.String HEADER_END_REGEX
          End of header text to look for
static java.lang.String HEADER_REGEX
          Header text to look for
 
Constructor Summary
DislodgedParser(Phase phase, java.lang.String input)
          Creates a DislodgedParser object, which parses the given input for a Dislodged (retreat) information block
 
Method Summary
 DislodgedParser.DislodgedInfo[] getDislodgedInfo()
          Returns the dislodged units, or a zero-length array if no units were dislodged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HEADER_REGEX

public static final java.lang.String HEADER_REGEX
Header text to look for

See Also:
Constant Field Values

HEADER_END_REGEX

public static final java.lang.String HEADER_END_REGEX
End of header text to look for

See Also:
Constant Field Values

DISLODGED_LINE_START

public static final java.lang.String DISLODGED_LINE_START
Dislodged line start text; all dislodged lines must start with this. Lowercase. NOT a REGEX!.

See Also:
Constant Field Values

DISLODGED_REGEX

public static final java.lang.String DISLODGED_REGEX
capture groups: 1:power, 2:unit, 3:unit location, 4:retreat list predicate (example: "xxx or yyy or zzz") w/o trailing '.'
the location list predicate is split by the DISLODGED_SPLIT_REGEX
Lines are trimmed prior to parsing.
"in" or "over" used (Wing units are "over" provinces; armies/fleets "in")

See Also:
Constant Field Values

DISLODGED_SPLIT_REGEX

public static final java.lang.String DISLODGED_SPLIT_REGEX
splits the retreat list predicate; must be suitable for String.split()

See Also:
Constant Field Values

DESTROYED_REGEX

public static final java.lang.String DESTROYED_REGEX
capture groups: 1:power, 2:unit, 3:unit location (may be multi-word, needs to be trim()'d)
NOTE: this may span >1 line; it ends with the period ('.')
Lines are trimmed prior to parsing.
"in" or "over" used (Wing units are "over" provinces; armies/fleets "in")

See Also:
Constant Field Values
Constructor Detail

DislodgedParser

public DislodgedParser(Phase phase,
                       java.lang.String input)
                throws java.io.IOException
Creates a DislodgedParser object, which parses the given input for a Dislodged (retreat) information block

Method Detail

getDislodgedInfo

public DislodgedParser.DislodgedInfo[] getDislodgedInfo()
Returns the dislodged units, or a zero-length array if no units were dislodged



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