com.ricebridge.xmlman
Class StringListRecordListener

java.lang.Object
  extended bycom.ricebridge.xmlman.RecordListenerSupport
      extended bycom.ricebridge.xmlman.StringListRecordListener
All Implemented Interfaces:
RecordListener
Direct Known Subclasses:
BackgroundTest.DelayedStringListRecordListener, PerformanceTest.MeasureStringListRecordListener

public class StringListRecordListener
extends RecordListenerSupport

Implementation of RecordListener that stores data records as a List of Lists ofStrings.

This class is used to implement the loadAsLists(*,RecordSpec) methods in XmlManager. It simply stores the data records as Strings in an ArrayList, and stores each ArrayList in ArrayList of records.

StringListRecordListener is designed to be subclassed. You can change the default implementation by calling the setStringListRecordListenerClass method of XmlManagerStore, and providing a subclass of StringListRecordListener. XmlManagerStore can be accessed using XmlManager.getXmlManagerStore().

The Source Code of this Java class is available under a BSD-style license.


Field Summary
protected  ArrayList iRecords
          List of Lists of Strings containing record data.
 
Fields inherited from class com.ricebridge.xmlman.RecordListenerSupport
iFieldNames
 
Constructor Summary
StringListRecordListener()
          Constructor with no parameters required for creating new objects in XmlManagerStore.newStringListRecordListener.
 
Method Summary
 List getRecords()
          Get the stored list of data records.
protected  BadRecord handleRecordImpl(String[] pRecord, long pRecordNumber)
          Store the data record String[].
 String toString()
          Return a textual description suitable for debugging.
 
Methods inherited from class com.ricebridge.xmlman.RecordListenerSupport
endProcess, endProcessImpl, handleRecord, setFieldNames, setFieldNamesImpl, setXmlSpec, setXmlSpecImpl, startProcess, startProcessImpl
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

iRecords

protected ArrayList iRecords
List of Lists of Strings containing record data.

Constructor Detail

StringListRecordListener

public StringListRecordListener()
Constructor with no parameters required for creating new objects in XmlManagerStore.newStringListRecordListener.

Method Detail

getRecords

public List getRecords()
Get the stored list of data records.

Returns:
List of Lists of Strings

toString

public String toString()
Return a textual description suitable for debugging.


handleRecordImpl

protected BadRecord handleRecordImpl(String[] pRecord,
                                     long pRecordNumber)
Store the data record String[].

Specified by:
handleRecordImpl in class RecordListenerSupport
Parameters:
pRecord - record data as a String[]
pRecordNumber - current count of records
See Also:
RecordListener.handleRecord(java.lang.String[], long)


Copyright © 2004-2005 Ricebridge