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 aFloatingData
if 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.DataType
getDataType()
Returns the data type of value.double
getValue()
Returns the value for the data set if it is orUndefined.DOUBLE
.DataPoint
getValueAsDataPoint()
Returns the value for the data set asDataPoint
if it is ornull
.FloatingData
getValueAsFloatingData()
Returns the value for the data set asFloatingData
if it is ornull
.String
getValueAsString()
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 asFloatingData
if it is ornull
.- Returns:
- the value for the data set as
FloatingData
if 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 asDataPoint
if it is ornull
.- Returns:
- the value for the data set as
DataPoint
if 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,null
is 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,
null
is returned.
-
-