public abstract class DataPoint extends Object
Modifier and Type | Class and Description |
---|---|
protected static class |
DataPoint.Indices
Indices used for storing
DataPoint contents in a file. |
Modifier and Type | Field and Description |
---|---|
protected static String |
ENCODING_CHAR_SET
Character set used to encode
DataPoint contents in a file. |
Constructor and Description |
---|
DataPoint(InputStream is)
Constructs a
DataPoint from the specified stream contents. |
DataPoint(long lastUpdatedTimeStamp,
long msSpanned)
Constructs a
DataPoint using the specified values. |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object toCompare) |
int |
getExpectedFieldCount()
Gets the expected CSV field count for the data type.
|
long |
getLastUpdatedTimeStamp()
Gets the last updated time stamp.
|
long |
getMsSpanned()
Gets the number of milliseconds spanned by the data point, presumably
ending with the last update time stamp.
|
int |
hashCode() |
protected String[] |
prepareArrayFieldsForWriting(String[] fields)
Prepares the provided
String array with values to be written for
this DataPoint . |
protected String[] |
read(InputStream is)
Reads the
DataPoint contents from the specified InputStream . |
void |
set(String[] fields)
Reads the
DataPoint contents from the specified String
array. |
void |
setLastUpdatedTimeStamp(long time)
Sets the last updated time stamp.
|
void |
setMsSpanned(long ms)
Sets the number of milliseconds spanned by the data point, presumably
ending with the last update time stamp.
|
String |
toDebugString()
Gets a detailed representation of this object to facilitate debugging.
|
String |
toString() |
void |
write(OutputStream os)
Writes the
DataPoint contents to the specified OutputStream . |
protected static final String ENCODING_CHAR_SET
DataPoint
contents in a file.public DataPoint(long lastUpdatedTimeStamp, long msSpanned)
DataPoint
using the specified values.lastUpdatedTimeStamp
- last updated time stampmsSpanned
- milliseconds spannedpublic DataPoint(InputStream is) throws DataFormatException, IOException
DataPoint
from the specified stream contents.is
- InputStream
to read fromDataFormatException
- if the expected file content cannot be readIOException
- if an error occurs while reading from the streampublic int getExpectedFieldCount()
public long getLastUpdatedTimeStamp()
public long getMsSpanned()
protected String[] prepareArrayFieldsForWriting(String[] fields)
String
array with values to be written for
this DataPoint
.fields
- a String
array that will be set with the field
values, in order, to be writtenIllegalArgumentException
- if the provided array is too small to
hold the number of fields to be writtenprotected String[] read(InputStream is) throws DataFormatException, IOException
DataPoint
contents from the specified InputStream
.is
- InputStream
to read fromString
s from streamDataFormatException
- if the expected file content cannot be readIOException
- if an error occurs while reading from the streampublic void set(String[] fields) throws DataFormatException
DataPoint
contents from the specified String
array.fields
- String
array to read fromDataFormatException
- if the expected file content cannot be readpublic void setLastUpdatedTimeStamp(long time)
time
- last updated time stamppublic void setMsSpanned(long ms)
ms
- milliseconds spannedpublic String toDebugString()
public void write(OutputStream os) throws IOException
DataPoint
contents to the specified OutputStream
.os
- OutputStream
to write toIOException
- if a ZIP file or other I/O error occursCopyright © 2016. All Rights Reserved.