Package org.pepstock.charba.client.items
Class DataItem
- java.lang.Object
-
- org.pepstock.charba.client.items.DataItem
-
public final class DataItem extends Object
This object is wrapping the value of data set which can be used in the plugins (extensions) callbacks.
The value could be a double, string or aFloatingDataif the data set is a BAR data set and uses floating bars data.- Author:
- Andrea "Stock" Stocchero
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T extends NativeObjectContainer>
TcreateDataPoint(NativeObjectContainerFactory<T> factory)Returns a data point to be mapped for customization, like for out of the box controllers.DataTypegetDataType()Returns the data type of value.doublegetValue()Returns the value for the data set if it is orUndefined.DOUBLE.DataPointgetValueAsDataPoint()Returns the value for the data set asDataPointif it is ornull.FloatingDatagetValueAsFloatingData()Returns the value for the data set asFloatingDataif it is ornull.StringgetValueAsString()Returns the value for the data set as string if it is orUndefined.STRING.
-
-
-
Constructor Detail
-
DataItem
public DataItem(Object object)
Creates the object with object which represents the value.- Parameters:
object- object which represents the value.
-
-
Method Detail
-
getDataType
public DataType getDataType()
Returns the data type of value.- Returns:
- the data type of value
-
getValue
public double getValue()
Returns the value for the data set if it is orUndefined.DOUBLE.- Returns:
- the value for the data set if it is or
Undefined.DOUBLE
-
getValueAsFloatingData
public FloatingData getValueAsFloatingData()
Returns the value for the data set asFloatingDataif it is ornull.- Returns:
- the value for the data set as
FloatingDataif it is ornull
-
getValueAsString
public String getValueAsString()
Returns the value for the data set as string if it is orUndefined.STRING.- Returns:
- the value for the data set as string if it is or
Undefined.STRING.
-
getValueAsDataPoint
public DataPoint getValueAsDataPoint()
Returns the value for the data set asDataPointif it is ornull.- Returns:
- the value for the data set as
DataPointif it is ornull.
-
createDataPoint
public final <T extends NativeObjectContainer> T createDataPoint(NativeObjectContainerFactory<T> factory)
Returns a data point to be mapped for customization, like for out of the box controllers. It uses a factory instance to create a data point.
If factory argument is not consistent,nullis returned.- Type Parameters:
T- type of data point to return- Parameters:
factory- factory instance to create a data point- Returns:
- data point to be mapped for customization. If factory argument is not consistent,
nullis returned.
-
-