Class DataPoint

  • Direct Known Subclasses:
    BooleanDataPoint, DoubleDataPoint, FloatDataPoint, IntDataPoint, LongDataPoint, StringDataPoint

    public abstract class DataPoint
    extends java.lang.Object
    This is a abstract class representing a data point. DataPoint consists of a measurement id and a data type. subclass of DataPoint need override method write(long time, IChunkWriter writer) .Every subclass has its data type and overrides a setting method for its data type.
    • 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 DataPoint
        measurementId - 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 type
        measurementId - measurement id
        value - value in string format
        Returns:
        data point class according to data type
      • writeTo

        public abstract void writeTo​(long time,
                                     ChunkWriterImpl writer)
                              throws java.io.IOException
        write this DataPoint by a SeriesWriter.
        Parameters:
        time - timestamp
        writer - writer
        Throws:
        java.io.IOException - exception in IO
      • getMeasurementId

        public java.lang.String getMeasurementId()
      • getValue

        public abstract java.lang.Object getValue()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.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)