public class MeterDataPoint extends DataPoint
Modifier and Type | Class and Description |
---|---|
protected static class |
MeterDataPoint.MeterIndices
Indices used for storing
MeterDataPoint contents in a file. |
DataPoint.Indices
ENCODING_CHAR_SET
Constructor and Description |
---|
MeterDataPoint(InputStream is)
Constructs a
MeterDataPoint from the specified stream contents. |
MeterDataPoint(long lastUpdatedTimeStamp,
long msSpanned,
long count,
double rate)
Constructs a
MeterDataPoint using the specified values. |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object toCompare) |
long |
getCount()
Gets the count value.
|
int |
getExpectedFieldCount()
Gets the expected CSV field count for the data type.
|
double |
getRate()
Gets the rate value.
|
int |
hashCode() |
protected String[] |
prepareArrayFieldsForWriting(String[] fields)
Prepares the provided
String array with values to be written for
this DataPoint . |
void |
set(String[] fields)
Reads the
DataPoint contents from the specified String
array. |
void |
setCount(long toSet)
Sets the count value.
|
void |
setRate(double toSet)
Sets the rate value.
|
String |
toDebugString()
Gets a detailed representation of this object to facilitate debugging.
|
String |
toString() |
getLastUpdatedTimeStamp, getMsSpanned, read, setLastUpdatedTimeStamp, setMsSpanned, write
public MeterDataPoint(long lastUpdatedTimeStamp, long msSpanned, long count, double rate)
MeterDataPoint
using the specified values.lastUpdatedTimeStamp
- last updated time stampmsSpanned
- milliseconds spannedcount
- count valuerate
- rate valuepublic MeterDataPoint(InputStream is) throws DataFormatException, IOException
MeterDataPoint
from the specified stream contents.is
- InputStream
to read fromDataFormatException
- if the expected content cannot be readIOException
- if an error occurs while reading from the streampublic long getCount()
public double getRate()
public int getExpectedFieldCount()
DataPoint
getExpectedFieldCount
in class DataPoint
protected String[] prepareArrayFieldsForWriting(String[] fields)
DataPoint
String
array with values to be written for
this DataPoint
.prepareArrayFieldsForWriting
in class DataPoint
fields
- a String
array that will be set with the field
values, in order, to be writtenpublic void set(String[] fields) throws DataFormatException
DataPoint
DataPoint
contents from the specified String
array.set
in class DataPoint
fields
- String
array to read fromDataFormatException
- if the expected file content cannot be readpublic void setCount(long toSet)
toSet
- count valuepublic void setRate(double toSet)
toSet
- rate valuepublic String toDebugString()
DataPoint
toDebugString
in class DataPoint
Copyright © 2016. All Rights Reserved.