TraceReaderBase

public abstract class TraceReaderBase extends TraceReaderAbstract

An abstract class providing additional features for subclasses implementing trace file readers for specific file formats.

Author:Manoel Campos da Silva Filho

Constructors

TraceReaderBase

protected TraceReaderBase(String filePath, InputStream reader)

Methods

getFieldDoubleValue

protected <T extends Enum> double getFieldDoubleValue(T field)

Gets a field’s value from the last parsed line as double.

Parameters:
  • field – a enum value representing the index of the field to get the value

getFieldDoubleValue

protected <T extends Enum> double getFieldDoubleValue(T field, double defaultValue)

Gets a field’s value from the last parsed line as double.

Parameters:
  • field – a enum value representing the index of the field to get the value
  • defaultValue – the default value to be returned if the field value is not a number

getFieldIntValue

protected <T extends Enum> int getFieldIntValue(T field)

Gets a field’s value from the last parsed line as an int.

Parameters:
  • field – a enum value representing the index of the field to get the value

getFieldIntValue

protected <T extends Enum> int getFieldIntValue(T field, int defaultValue)

Gets a field’s value from the last parsed line as an int.

Parameters:
  • field – a enum value representing the index of the field to get the value
  • defaultValue – the default value to be returned if the field value is not an int

getFieldLongValue

protected <T extends Enum> long getFieldLongValue(T field)

Gets a field’s value from the last parsed line as an int.

Parameters:
  • field – a enum value representing the index of the field to get the value

getFieldLongValue

protected <T extends Enum> long getFieldLongValue(T field, long defaultValue)

Gets a field’s value from the last parsed line as an int.

Parameters:
  • field – a enum value representing the index of the field to get the value
  • defaultValue – the default value to be returned if the field value is not an int

getFieldValue

protected <T extends Enum> String getFieldValue(T field)

Gets a field’s value from the last parsed line as String.

Parameters:
  • field – a enum value representing the index of the field to get the value

getLastParsedLineArray

protected String[] getLastParsedLineArray()

Gets an array containing the field values from the last parsed trace line.

setLastParsedLineArray

protected void setLastParsedLineArray(String[] lastParsedLineArray)

Sets an array containing the field values from the last parsed trace line.

Parameters:
  • lastParsedLineArray – the field values from the last parsed trace line