This class attribute is a dictionary that relates the
various encounter codes to the methods that process each
type of encounter line. The method that uses this
dictionary is Section 74.6, “BaseEncounter.scanLine(): Scan a raw
encounter record”.
Each method in this table must conform to this generic intended function:
#--
# Generic intended function for all encounter-line parsers:
# [ scan is a Scan object ->
# if (self.captureCode) + (line in scan) is a valid
# encounter line in the context of self.compiler ->
# scan := scan advanced to the end of the line
# self := self with all fields from that line added
# using names in self.OUT_FIELD_LIST
# else ->
# Log() +:= error messages
# scan := scan advanced no further than end of line
# raise SyntaxError ]
#--
For the various methods for each encounter type, see:
Section 74.7, “BaseEncounter.scanShort(): Scan lost or
destroyed encounter line”.
Section 74.8, “BaseEncounter.scanUnbanded(): Scan
unbanded encounter line”.
Section 74.9, “BaseEncounter.scanNewBand(): Scan short
new-band line”.
Section 74.10, “BaseEncounter.scanLongNew(): Scan long
new-band line”.
Section 74.11, “BaseEncounter.scanRecap(): Scan recapture
encounter line”.
#--
# Methods for processing each encounter code
#--
dispatchMap = {
CAPTURE_DESTROYED: scanShort,
CAPTURE_LOST: scanShort,
CAPTURE_UNBANDED: scanUnbanded,
CAPTURE_NEW_BAND: scanNewBand,
CAPTURE_LONG_NEW: scanLongNew,
CAPTURE_CHANGED: scanRecap,
CAPTURE_ADDED: scanRecap,
CAPTURE_RESIGHT: scanRecap,
CAPTURE_RECAP: scanRecap }
The resight code (CAPTURE_RESIGHT) is
allowed only in MAWS data. Assuming that it never occurs
on the originals (and does not occur as a typo), there is
no reason to check it. However, implementing it here,
instead of in Maws2007Encounter, will save
effort if the MAPS program ever starts using resighted
records.