toolbox.parsers
Class TextEvent

Package class diagram package TextEvent
java.lang.Object
  extended by toolbox.parsers.TextEvent

public class TextEvent
extends java.lang.Object

Wrapper for a single record in a text delimited data source.

A record can consist of many fields. This class acts as a wrapper for all the fields in the record. The class also provides some metadata regarding the data source.


Constructor Summary
TextEvent()
          Default constructor.
 
Method Summary
 void add(java.lang.String data)
          Adds a field to this event.
 java.lang.String getAt(int index)
          Returns the element at the given index.
 int getFieldCount()
          Returns the number of fields in this event.
 int getLineNumber()
          Returns the line number of the record that this event denotes.
 void setLineNumber(int lineNo)
          Sets the line number of the record that this event denotes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextEvent

public TextEvent()
Default constructor.

Method Detail

add

public void add(java.lang.String data)
Adds a field to this event.

Parameters:
data - String containing the field value.

getAt

public java.lang.String getAt(int index)
Returns the element at the given index.

Parameters:
index - int pointing the the required field data.
Returns:
String containing the field data.

getFieldCount

public int getFieldCount()
Returns the number of fields in this event.

Returns:
int indicating how many fields are contained in this event.

getLineNumber

public int getLineNumber()
Returns the line number of the record that this event denotes.

Returns:
int containing the line number of the record that this event denotes.

setLineNumber

public void setLineNumber(int lineNo)
Sets the line number of the record that this event denotes.

Parameters:
lineNo - int containing the line number of the record that this event denotes.