Package adams.data.container
Class AbstractDataPoint
- java.lang.Object
-
- adams.data.container.AbstractDataPoint
-
- All Implemented Interfaces:
CloneHandler,DataPoint,Serializable,Comparable
- Direct Known Subclasses:
InstancePoint,SpreadSheetRowPoint,TimeseriesPoint,XYSequencePoint
public abstract class AbstractDataPoint extends Object implements DataPoint
Superclass for data points.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected DataContainerm_Parentthe container this data point belongs to.
-
Constructor Summary
Constructors Constructor Description AbstractDataPoint()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidassign(DataPoint other)Obtains the stored variables from the other data point.abstract intcompareTo(Object o)Compares this object with the specified object for order.booleanequals(Object obj)Indicates whether some other object is "equal to" this one.ObjectgetClone()Returns a clone of itself.DataContainergetParent()Returns the spectrum this point belongs to.booleanhasParent()Returns whether the point belongs to a spectrum.voidsetParent(DataContainer value)Sets the spectrum this point belongs to.static DoubletoDouble(Byte value)Turns the Byte object into a double.static DoubletoDouble(Double value)Turns the Double object into a double.static DoubletoDouble(Float value)Turns the Float object into a double.static DoubletoDouble(Integer value)Turns the Integer object into a double.static DoubletoDouble(Long value)Turns the Long object into a double.static DoubletoDouble(Number value)Turns the Number object into a double.static DoubletoDouble(Object value)Turns the Short into a double, if possible.static DoubletoDouble(Short value)Turns the Short object into a double.abstract StringtoString()Returns a string representation of the point.
-
-
-
Field Detail
-
m_Parent
protected DataContainer m_Parent
the container this data point belongs to.
-
-
Method Detail
-
setParent
public void setParent(DataContainer value)
Sets the spectrum this point belongs to.
-
getParent
public DataContainer getParent()
Returns the spectrum this point belongs to.
-
hasParent
public boolean hasParent()
Returns whether the point belongs to a spectrum.
-
compareTo
public abstract int compareTo(Object o)
Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.- Specified by:
compareToin interfaceComparable- Parameters:
o- the object to be compared.- Returns:
- a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
- Throws:
ClassCastException- if the specified object's type prevents it from being compared to this object.
-
equals
public boolean equals(Object obj)
Indicates whether some other object is "equal to" this one.
-
getClone
public Object getClone()
Returns a clone of itself. Parent gets set to null!- Specified by:
getClonein interfaceCloneHandler- Specified by:
getClonein interfaceDataPoint- Returns:
- the clone
-
assign
public void assign(DataPoint other)
Obtains the stored variables from the other data point.
-
toString
public abstract String toString()
Returns a string representation of the point.
-
toDouble
public static Double toDouble(Object value)
Turns the Short into a double, if possible.- Parameters:
value- the value to convert- Returns:
- the double or null if not a number
-
toDouble
public static Double toDouble(Number value)
Turns the Number object into a double.- Parameters:
value- the value to convert- Returns:
- the double
-
toDouble
public static Double toDouble(Byte value)
Turns the Byte object into a double.- Parameters:
value- the value to convert- Returns:
- the double
-
toDouble
public static Double toDouble(Short value)
Turns the Short object into a double.- Parameters:
value- the value to convert- Returns:
- the double
-
toDouble
public static Double toDouble(Integer value)
Turns the Integer object into a double.- Parameters:
value- the value to convert- Returns:
- the double
-
toDouble
public static Double toDouble(Long value)
Turns the Long object into a double.- Parameters:
value- the value to convert- Returns:
- the double
-
toDouble
public static Double toDouble(Float value)
Turns the Float object into a double.- Parameters:
value- the value to convert- Returns:
- the double
-
-