xml2fol
Class OLEngine

java.lang.Object
  extended by xml2fol.OLEngine

public class OLEngine
extends java.lang.Object

A class that abstractly handles the processing of passages within documents The class is able to load information from the tables on disk regardless of the type of table saved.


Constructor Summary
OLEngine(java.lang.String fxolFilename, java.lang.String tableFlag)
          Produces a OLEngine with the specified table filename, table flag and stores values both in the map and list.
OLEngine(java.lang.String fxolFilename, java.lang.String idxFilename, java.lang.String tableFlag)
          Produces a OLEngine with the specified table filename, index filename, table flag and stores values both in the map and list
OLEngine(java.lang.String fxolFilename, java.lang.String idxFilename, java.lang.String tableFlag, boolean storeMap, boolean storeList)
          Produces a OLEngine with the specified table filename, index filename, table flag and store map/list values
 
Method Summary
 void ClearIndex()
          Clears the index
 void ClearList()
          Clears the table
 void Close()
          Clears the table and index files
 boolean FilesExist()
           
 java.lang.String GetListToString()
          Returns the entire list as a string
 OLStruct getRecordUsingTable(java.lang.String file, java.lang.String xpath)
          Gets the offset and length for a particular element
 void LoadIndex()
          Loads the index
 void LoadList()
          Loads the table into memory
 void LoadSingleList(java.lang.String file)
          Loads the table for a single file into memory NB Index needs to be loaded for the function to be able to load the details of a single document
 void Open()
          Opens the table and index files
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OLEngine

public OLEngine(java.lang.String fxolFilename,
                java.lang.String tableFlag)
Produces a OLEngine with the specified table filename, table flag and stores values both in the map and list. This OLEngine does not use an index (hopefully because the whole table is read into memory)

Parameters:
fxolFilename - - the filename of the table
tableFlag - - a flag indicating the type of table to be saved/loaded

OLEngine

public OLEngine(java.lang.String fxolFilename,
                java.lang.String idxFilename,
                java.lang.String tableFlag)
Produces a OLEngine with the specified table filename, index filename, table flag and stores values both in the map and list

Parameters:
fxolFilename - - the filename of the table
idxFilename - - the filename of the index
tableFlag - - a flag indicating the type of table to be saved/loaded

OLEngine

public OLEngine(java.lang.String fxolFilename,
                java.lang.String idxFilename,
                java.lang.String tableFlag,
                boolean storeMap,
                boolean storeList)
Produces a OLEngine with the specified table filename, index filename, table flag and store map/list values

Parameters:
fxolFilename - - the filename of the table
idxFilename - - the filename of the index
tableFlag - - a flag indicating the type of table to be saved/loaded
storeMap - - a flag indicating if values should be stored in the Map
storeList - - a flag indicating if values should be stored in the List
Method Detail

Open

public void Open()
Opens the table and index files


Close

public void Close()
Clears the table and index files


ClearList

public void ClearList()
Clears the table


ClearIndex

public void ClearIndex()
Clears the index


LoadIndex

public void LoadIndex()
Loads the index


LoadList

public void LoadList()
Loads the table into memory


FilesExist

public boolean FilesExist()

LoadSingleList

public void LoadSingleList(java.lang.String file)
Loads the table for a single file into memory NB Index needs to be loaded for the function to be able to load the details of a single document

Parameters:
file - - the filename of the XML document to load

getRecordUsingTable

public OLStruct getRecordUsingTable(java.lang.String file,
                                    java.lang.String xpath)
Gets the offset and length for a particular element

Parameters:
file - - The element's filename
xpath - - The element's xpath

GetListToString

public java.lang.String GetListToString()
Returns the entire list as a string

Returns:
- The collection as a stirng