Package org.cloudsimplus.traces
Class TraceReaderBase
java.lang.Object
org.cloudbus.cloudsim.util.TraceReaderAbstract
org.cloudsimplus.traces.TraceReaderBase
- All Implemented Interfaces:
TraceReader
- Direct Known Subclasses:
GoogleMachineEventsTraceReader
,GoogleTaskEventsTraceReader
,GoogleTaskUsageTraceReader
public abstract class TraceReaderBase extends TraceReaderAbstract
An abstract class providing additional features for subclasses implementing trace file
readers for specific file formats.
Check important details at TraceReaderAbstract
.
- Since:
- CloudSim Plus 4.0.0
- Author:
- Manoel Campos da Silva Filho
-
Constructor Summary
Constructors Modifier Constructor Description protected
TraceReaderBase(String filePath, InputStream reader)
-
Method Summary
Modifier and Type Method Description protected <T extends Enum>
doublegetFieldDoubleValue(T field)
Gets a field's value from thelast parsed line
as double.protected <T extends Enum>
doublegetFieldDoubleValue(T field, double defaultValue)
Gets a field's value from thelast parsed line
as double.protected <T extends Enum>
intgetFieldIntValue(T field)
Gets a field's value from thelast parsed line
as an int.protected <T extends Enum>
intgetFieldIntValue(T field, int defaultValue)
Gets a field's value from thelast parsed line
as an int.protected <T extends Enum>
longgetFieldLongValue(T field)
Gets a field's value from thelast parsed line
as an int.protected <T extends Enum>
longgetFieldLongValue(T field, long defaultValue)
Gets a field's value from thelast parsed line
as an int.protected <T extends Enum>
StringgetFieldValue(T field)
Gets a field's value from thelast parsed line
as String.protected String[]
getLastParsedLineArray()
Gets an array containing the field values from the last parsed trace line.protected void
setLastParsedLineArray(String[] lastParsedLineArray)
Sets an array containing the field values from the last parsed trace line.Methods inherited from class org.cloudbus.cloudsim.util.TraceReaderAbstract
getCommentString, getFieldDelimiterRegex, getFilePath, getInputStream, getLastLineNumber, getMaxLinesToRead, parseTraceLine, readFile, readGZIPFile, readTextFile, readZipFile, setCommentString, setFieldDelimiterRegex, setMaxLinesToRead
-
Constructor Details
-
TraceReaderBase
-
-
Method Details
-
getFieldValue
Gets a field's value from thelast parsed line
as String.- Parameters:
field
- a enum value representing the index of the field to get the value- Returns:
-
getFieldDoubleValue
Gets a field's value from thelast parsed line
as double.- Parameters:
field
- a enum value representing the index of the field to get the value- Returns:
-
getFieldDoubleValue
Gets a field's value from thelast parsed line
as double.- Parameters:
field
- a enum value representing the index of the field to get the valuedefaultValue
- the default value to be returned if the field value is not a number- Returns:
-
getFieldIntValue
Gets a field's value from thelast parsed line
as an int.- Parameters:
field
- a enum value representing the index of the field to get the value- Returns:
-
getFieldIntValue
Gets a field's value from thelast parsed line
as an int.- Parameters:
field
- a enum value representing the index of the field to get the valuedefaultValue
- the default value to be returned if the field value is not an int- Returns:
-
getFieldLongValue
Gets a field's value from thelast parsed line
as an int.- Parameters:
field
- a enum value representing the index of the field to get the value- Returns:
-
getFieldLongValue
Gets a field's value from thelast parsed line
as an int.- Parameters:
field
- a enum value representing the index of the field to get the valuedefaultValue
- the default value to be returned if the field value is not an int- Returns:
-
getLastParsedLineArray
Gets an array containing the field values from the last parsed trace line.- Returns:
-
setLastParsedLineArray
Sets an array containing the field values from the last parsed trace line.- Parameters:
lastParsedLineArray
- the field values from the last parsed trace line
-