Class DataPoint
- java.lang.Object
-
- org.apache.iotdb.tsfile.write.record.datapoint.DataPoint
-
- Direct Known Subclasses:
BooleanDataPoint,DoubleDataPoint,FloatDataPoint,IntDataPoint,LongDataPoint,StringDataPoint
public abstract class DataPoint extends java.lang.ObjectThis is a abstract class representing a data point. DataPoint consists of a measurement id and a data type. subclass of DataPoint need override methodwrite(long time, IChunkWriter writer).Every subclass has its data type and overrides a setting method for its data type.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.StringmeasurementIdmeasurementId of this DataPoint.protected TSDataTypetypevalue type of this DataPoint.
-
Constructor Summary
Constructors Modifier Constructor Description protectedDataPoint(TSDataType type, java.lang.String measurementId)constructor of DataPoint.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static DataPointgetDataPoint(TSDataType dataType, java.lang.String measurementId, java.lang.String value)Construct one data point with data type and value.java.lang.StringgetMeasurementId()TSDataTypegetType()abstract java.lang.ObjectgetValue()voidsetBoolean(boolean value)voidsetDouble(double value)voidsetFloat(float value)voidsetInteger(int value)voidsetLong(long value)voidsetString(Binary value)java.lang.StringtoString()abstract voidwriteTo(long time, ChunkWriterImpl writer)write this DataPoint by a SeriesWriter.
-
-
-
Field Detail
-
type
protected final TSDataType type
value type of this DataPoint.
-
measurementId
protected final java.lang.String measurementId
measurementId of this DataPoint.
-
-
Constructor Detail
-
DataPoint
protected DataPoint(TSDataType type, java.lang.String measurementId)
constructor of DataPoint.- Parameters:
type- value type of this DataPointmeasurementId- measurementId of this DataPoint
-
-
Method Detail
-
getDataPoint
public static DataPoint getDataPoint(TSDataType dataType, java.lang.String measurementId, java.lang.String value)
Construct one data point with data type and value.- Parameters:
dataType- data typemeasurementId- measurement idvalue- value in string format- Returns:
- data point class according to data type
-
writeTo
public abstract void writeTo(long time, ChunkWriterImpl writer) throws java.io.IOExceptionwrite this DataPoint by a SeriesWriter.- Parameters:
time- timestampwriter- writer- Throws:
java.io.IOException- exception in IO
-
getMeasurementId
public java.lang.String getMeasurementId()
-
getValue
public abstract java.lang.Object getValue()
-
getType
public TSDataType getType()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
setInteger
public void setInteger(int value)
-
setLong
public void setLong(long value)
-
setBoolean
public void setBoolean(boolean value)
-
setFloat
public void setFloat(float value)
-
setDouble
public void setDouble(double value)
-
setString
public void setString(Binary value)
-
-