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.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.ObjectfMetaDataprivate java.util.Map<java.lang.String,java.lang.Object>fMetaDataMapprivate java.lang.Stringinfoprivate doublexMinusErrorprivate doublexPlusErrorprivate doublexValueprivate doubleyMinusErrorprivate doubleyPlusErrorprivate doubleyValue
-
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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)java.lang.ObjectgetData()Get meta data stored with the object.java.lang.ObjectgetData(java.lang.String key)Returns the value to which the specified key is mapped, ornullif 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.StringgetInfo()doublegetXMinusError()doublegetXPlusError()doublegetXValue()doublegetYMinusError()doublegetYPlusError()doublegetYValue()inthashCode()voidsetData(java.lang.Object metaData)Store meta data with the object.voidsetData(java.lang.String key, java.lang.Object data)Store meta data mapped with the key.java.lang.StringtoString()
-
-
-
Field Detail
-
xValue
private final double xValue
-
yValue
private final double yValue
-
xPlusError
private final double xPlusError
-
yPlusError
private final double yPlusError
-
xMinusError
private final double xMinusError
-
yMinusError
private final double yMinusError
-
info
private final java.lang.String info
-
fMetaData
private java.lang.Object fMetaData
-
fMetaDataMap
private java.util.Map<java.lang.String,java.lang.Object> fMetaDataMap
-
-
Constructor Detail
-
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 Detail
-
getXMinusError
public double getXMinusError()
- Specified by:
getXMinusErrorin interfaceISample- Returns:
- Negative X error.
-
getXPlusError
public double getXPlusError()
- Specified by:
getXPlusErrorin interfaceISample- Returns:
- Positive X error.
-
getYMinusError
public double getYMinusError()
- Specified by:
getYMinusErrorin interfaceISample- Returns:
- Negative Y error.
-
getYPlusError
public double getYPlusError()
- Specified by:
getYPlusErrorin interfaceISample- Returns:
- Positive Y error.
-
getInfo
public java.lang.String getInfo()
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object- Returns:
- String representation, mostly for debugging
-
setData
public void setData(java.lang.Object metaData)
Description copied from interface:IMetaDataStore meta data with the object.
-
getData
public java.lang.Object getData()
Description copied from interface:IMetaDataGet meta data stored with the object.
-
getData
public java.lang.Object getData(java.lang.String key)
Description copied from interface:IMetaDataReturns the value to which the specified key is mapped, ornullif this map contains no mapping for the key.
-
setData
public void setData(java.lang.String key, java.lang.Object data)Description copied from interface:IMetaDataStore 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:IMetaDataGet the available meta data entries as a immutable#Map.- Specified by:
getDataCollectionin interfaceIMetaData- Returns:
- immutable map of the stored data
-
-