org.alicebot.server.core.targeting
Class TargetsReader

java.lang.Object
  extended by org.alicebot.server.core.parser.GenericReader
      extended by org.alicebot.server.core.targeting.TargetsReader
All Implemented Interfaces:
java.lang.Runnable

public class TargetsReader
extends GenericReader
implements java.lang.Runnable

Reads a targets data file. This version is based on AIMLReader. Obviously this and its companion TargetsReaderListener duplicate a lot from AIMLReader and AIMLLoader, so once this is stabilized these should all be combined.

Author:
Noel Bush

Nested Class Summary
 
Nested classes/interfaces inherited from class org.alicebot.server.core.parser.GenericReader
GenericReader.TransitionMade
 
Field Summary
 java.lang.String inputText
          The most recently collected input text contents.
 java.lang.String inputThat
          The most recently collected input <that></that> contents.
 java.lang.String inputTopic
          The most recently collected input <topic></topic> contents.
 java.lang.String matchPattern
          The most recently collected match <pattern></pattern> contents.
 java.lang.String matchTemplate
          The most recently collected match <template></template> contents.
 java.lang.String matchThat
          The most recently collected match <that></that> contents.
 java.lang.String matchTopic
          The most recently collected match <topic></topic> contents.
 java.lang.reflect.Field patternField
          A reference to some pattern/text field.
 java.lang.String reply
          The most recently collected <reply></reply> contents.
 java.lang.reflect.Field templateField
          A reference to some template/reply field.
 java.lang.reflect.Field thatField
          A reference to some that field.
 java.lang.reflect.Field topicField
          A reference to some topic field.
 
Fields inherited from class org.alicebot.server.core.parser.GenericReader
ASTERISK, buffer, bufferStartCapacity, bufferString, buffReader, byteCount, COLON, COMMENT_MARK, done, EMPTY_STRING, encoding, fileName, LINE_SEPARATOR, lineNumber, listener, MARKER_END, MARKER_START, QUOTE_MARK, readerInstance, searching, searchStart, SLASH, SPACE, state, tagLength, tagStart, TRANSITION_MADE
 
Constructor Summary
TargetsReader(java.lang.String fileName, java.io.BufferedReader buffReader, TargetsReaderListener targetsListener, java.lang.String encoding, long length, java.awt.Component parent)
          Initializes a TargetsReader with a parent component, indicating that a ProgressMonitor should be created and updated for that component.
 
Method Summary
 void closeMonitor()
          Closes the progress monitor (if it is in use).
protected  void initialize()
           
 void run()
           
protected  void tryStates()
           
 
Methods inherited from class org.alicebot.server.core.parser.GenericReader
read, succeed, transition, transition, transition
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

matchPattern

public java.lang.String matchPattern
The most recently collected match <pattern></pattern> contents.


matchThat

public java.lang.String matchThat
The most recently collected match <that></that> contents.


matchTopic

public java.lang.String matchTopic
The most recently collected match <topic></topic> contents.


matchTemplate

public java.lang.String matchTemplate
The most recently collected match <template></template> contents.


inputText

public java.lang.String inputText
The most recently collected input text contents.


inputThat

public java.lang.String inputThat
The most recently collected input <that></that> contents.


inputTopic

public java.lang.String inputTopic
The most recently collected input <topic></topic> contents.


reply

public java.lang.String reply
The most recently collected <reply></reply> contents.


patternField

public java.lang.reflect.Field patternField
A reference to some pattern/text field.


thatField

public java.lang.reflect.Field thatField
A reference to some that field.


topicField

public java.lang.reflect.Field topicField
A reference to some topic field.


templateField

public java.lang.reflect.Field templateField
A reference to some template/reply field.

Constructor Detail

TargetsReader

public TargetsReader(java.lang.String fileName,
                     java.io.BufferedReader buffReader,
                     TargetsReaderListener targetsListener,
                     java.lang.String encoding,
                     long length,
                     java.awt.Component parent)
Initializes a TargetsReader with a parent component, indicating that a ProgressMonitor should be created and updated for that component.

Parameters:
parent - the parent component
length - the length of the file to be read
Method Detail

run

public void run()
Specified by:
run in interface java.lang.Runnable

initialize

protected void initialize()
Specified by:
initialize in class GenericReader

tryStates

protected void tryStates()
                  throws GenericReader.TransitionMade
Specified by:
tryStates in class GenericReader
Throws:
GenericReader.TransitionMade

closeMonitor

public void closeMonitor()
Closes the progress monitor (if it is in use).