lib
Class PythonPrimitivesParser

java.lang.Object
  extended by lib.PythonPrimitivesParser
All Implemented Interfaces:
IPrimitiveReader

public class PythonPrimitivesParser
extends java.lang.Object
implements IPrimitiveReader

Provides a simple abstraction for loading primitives from a .py file.


Constructor Summary
PythonPrimitivesParser()
           
 
Method Summary
 boolean canRead(java.lang.String fileName)
          Can this reader process the given file?
 java.util.ArrayList getActions(java.lang.String fileName)
          Get the list of action primitives file
 java.lang.String getDescription()
          Get a description of this parser
private  java.lang.String getFileContents(java.lang.String strFile)
          Read the contents of a text file
 java.util.ArrayList getSenses(java.lang.String fileName)
          Get the list of sense primitives from this file
private  java.util.ArrayList Scan(java.lang.String patternText, java.lang.String text)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PythonPrimitivesParser

public PythonPrimitivesParser()
Method Detail

getFileContents

private java.lang.String getFileContents(java.lang.String strFile)
Read the contents of a text file

Parameters:
strFile - File to load
Returns:
Contents of file

canRead

public boolean canRead(java.lang.String fileName)
Description copied from interface: IPrimitiveReader
Can this reader process the given file?

Specified by:
canRead in interface IPrimitiveReader
Parameters:
fileName - Path to file to read
Returns:
True if file contains primitives, false if not

getSenses

public java.util.ArrayList getSenses(java.lang.String fileName)
Description copied from interface: IPrimitiveReader
Get the list of sense primitives from this file

Specified by:
getSenses in interface IPrimitiveReader
Parameters:
fileName - Path to file to read.
Returns:
Arraylist of sense primitives found in the file

getActions

public java.util.ArrayList getActions(java.lang.String fileName)
Description copied from interface: IPrimitiveReader
Get the list of action primitives file

Specified by:
getActions in interface IPrimitiveReader
Parameters:
fileName - Path to file to read.
Returns:
Arraylist of actions found in the file

Scan

private java.util.ArrayList Scan(java.lang.String patternText,
                                 java.lang.String text)

getDescription

public java.lang.String getDescription()
Get a description of this parser

Specified by:
getDescription in interface IPrimitiveReader
Returns:
Description of the types of file this parser can read.