Class Sample
java.lang.Object
org.eclipse.nebula.visualization.xygraph.dataprovider.Sample
public class Sample extends java.lang.Object implements ISample, IMetaData
An (x,y) sample data with error.
The error values are absolute, positive numbers. For example, a Sample with Y=5, negative Y error 1 and positive Y error 2 represents a number of 5 that could also be anywhere in 4 .. 7. The errors are not percentages. The 'negative' error is actually a positive number.
Note: Only the x/y value is used in equals()! Error ranges and info texts are ignored when determining equality with another Sample.
-
Constructor Summary
Constructors Constructor Description Sample(double xdata, double ydata)
Initialize with x/y valueSample(double xValue, double yValue, double yPlusError, double yMinusError, double xPlusError, double xMinusError)
Initialize with value and error rangeSample(double xValue, double yValue, double yPlusError, double yMinusError, double xPlusError, double xMinusError, java.lang.String info)
Initialize with value, error ranges and info text -
Method Summary
Modifier and Type Method Description boolean
equals(java.lang.Object obj)
java.lang.Object
getData()
Get meta data stored with the object.java.lang.Object
getData(java.lang.String key)
Returns the value to which the specified key is mapped, ornull
if this map contains no mapping for the key.java.util.Map<java.lang.String,java.lang.Object>
getDataCollection()
Get the available meta data entries as a immutable#Map
.java.lang.String
getInfo()
double
getXMinusError()
double
getXPlusError()
double
getXValue()
double
getYMinusError()
double
getYPlusError()
double
getYValue()
int
hashCode()
void
setData(java.lang.Object metaData)
Store meta data with the object.void
setData(java.lang.String key, java.lang.Object data)
Store meta data mapped with the key.java.lang.String
toString()
-
Constructor Details
-
Sample
public Sample(double xdata, double ydata)Initialize with x/y value- Parameters:
xdata
-ydata
-
-
Sample
public Sample(double xValue, double yValue, double yPlusError, double yMinusError, double xPlusError, double xMinusError)Initialize with value and error range- Parameters:
xValue
-yValue
-yPlusError
-yMinusError
-xPlusError
-xMinusError
-
-
Sample
public Sample(double xValue, double yValue, double yPlusError, double yMinusError, double xPlusError, double xMinusError, java.lang.String info)Initialize with value, error ranges and info text- Parameters:
xValue
-yValue
-yPlusError
-yMinusError
-xPlusError
-xMinusError
-info
-
-
-
Method Details
-
getXValue
public double getXValue() -
getYValue
public double getYValue() -
getXMinusError
public double getXMinusError()- Specified by:
getXMinusError
in interfaceISample
- Returns:
- Negative X error.
-
getXPlusError
public double getXPlusError()- Specified by:
getXPlusError
in interfaceISample
- Returns:
- Positive X error.
-
getYMinusError
public double getYMinusError()- Specified by:
getYMinusError
in interfaceISample
- Returns:
- Negative Y error.
-
getYPlusError
public double getYPlusError()- Specified by:
getYPlusError
in interfaceISample
- Returns:
- Positive Y error.
-
getInfo
public java.lang.String getInfo() -
hashCode
public int hashCode()- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()- Overrides:
toString
in classjava.lang.Object
- Returns:
- String representation, mostly for debugging
-
setData
public void setData(java.lang.Object metaData)Description copied from interface:IMetaData
Store meta data with the object. -
getData
public java.lang.Object getData()Description copied from interface:IMetaData
Get meta data stored with the object. -
getData
public java.lang.Object getData(java.lang.String key)Description copied from interface:IMetaData
Returns the value to which the specified key is mapped, ornull
if this map contains no mapping for the key. -
setData
public void setData(java.lang.String key, java.lang.Object data)Description copied from interface:IMetaData
Store meta data mapped with the key. To remove an existing entry, set the data tonull
. -
getDataCollection
public java.util.Map<java.lang.String,java.lang.Object> getDataCollection()Description copied from interface:IMetaData
Get the available meta data entries as a immutable#Map
.- Specified by:
getDataCollection
in interfaceIMetaData
- Returns:
- immutable map of the stored data
-