Package adams.data.sequence
Class XYSequencePoint
- java.lang.Object
-
- adams.data.container.AbstractDataPoint
-
- adams.data.sequence.XYSequencePoint
-
- All Implemented Interfaces:
CloneHandler
,DataPoint
,DataPointWithMetaData
,Serializable
,Comparable
- Direct Known Subclasses:
SequencePlotPoint
public class XYSequencePoint extends AbstractDataPoint implements DataPointWithMetaData
A 2-dimensional point. With an optional ID string and meta-data attached to it.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected String
m_ID
an optional ID.protected HashMap<String,Object>
m_MetaData
the meta-data.protected double
m_X
the X value.protected double
m_Y
the Y value.-
Fields inherited from class adams.data.container.AbstractDataPoint
m_Parent
-
-
Constructor Summary
Constructors Constructor Description XYSequencePoint()
Initializes the point with no points and no ID.XYSequencePoint(double x)
Initializes the point with no ID and no y.XYSequencePoint(double x, double y)
Initializes the point with no ID.XYSequencePoint(String id, double x)
Initializes the point.XYSequencePoint(String id, double x, double y)
Initializes the point.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
assign(DataPoint other)
Obtains the stored variables from the other data point.int
compareTo(Object o)
Compares this object with the specified object for order.String
getID()
Returns the ID.double
getMaxX()
Returns the maximum for X.double
getMaxY()
Returns the maximum for Y.HashMap<String,Object>
getMetaData()
Returns the stored meta-data.double
getMinX()
Returns the minimum for X.double
getMinY()
Returns the minimum for Y.double
getX()
Returns the X value.double
getY()
Returns the Y value.boolean
hasID()
Checks whether an ID is set.boolean
hasMetaData()
Checks if any meta-data is available.void
setID(String value)
Sets the ID.void
setMetaData(HashMap<String,Object> value)
Sets the meta-data to use.void
setX(double value)
Sets the X value.void
setY(double value)
Sets the Y value.String
toString()
Returns a string representation of the point.-
Methods inherited from class adams.data.container.AbstractDataPoint
equals, getClone, getParent, hasParent, setParent, toDouble, toDouble, toDouble, toDouble, toDouble, toDouble, toDouble, toDouble
-
-
-
-
Constructor Detail
-
XYSequencePoint
public XYSequencePoint()
Initializes the point with no points and no ID.
-
XYSequencePoint
public XYSequencePoint(double x)
Initializes the point with no ID and no y.- Parameters:
x
- the X value
-
XYSequencePoint
public XYSequencePoint(double x, double y)
Initializes the point with no ID.- Parameters:
x
- the X valuey
- the Y value
-
XYSequencePoint
public XYSequencePoint(String id, double x)
Initializes the point.- Parameters:
id
- the ID, use null to ignorex
- the X value
-
XYSequencePoint
public XYSequencePoint(String id, double x, double y)
Initializes the point.- Parameters:
id
- the ID, use null to ignorex
- the X valuey
- the Y value
-
-
Method Detail
-
setX
public void setX(double value)
Sets the X value.- Parameters:
value
- the new X value
-
getX
public double getX()
Returns the X value.- Returns:
- the X value
-
getMinX
public double getMinX()
Returns the minimum for X.- Returns:
- the minimum
-
getMaxX
public double getMaxX()
Returns the maximum for X.- Returns:
- the maximum
-
setY
public void setY(double value)
Sets the Y value.- Parameters:
value
- the new Y value
-
getY
public double getY()
Returns the Y value.- Returns:
- the Y value
-
getMinY
public double getMinY()
Returns the minimum for Y.- Returns:
- the minimum
-
getMaxY
public double getMaxY()
Returns the maximum for Y.- Returns:
- the maximum
-
setID
public void setID(String value)
Sets the ID.- Parameters:
value
- the new ID
-
getID
public String getID()
Returns the ID.- Returns:
- the ID
-
hasID
public boolean hasID()
Checks whether an ID is set.- Returns:
- true if an ID is available
-
compareTo
public 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:
compareTo
in interfaceComparable
- Specified by:
compareTo
in classAbstractDataPoint
- 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.
-
assign
public void assign(DataPoint other)
Obtains the stored variables from the other data point.- Specified by:
assign
in interfaceDataPoint
- Overrides:
assign
in classAbstractDataPoint
- Parameters:
other
- the data point to get the values from
-
setMetaData
public void setMetaData(HashMap<String,Object> value)
Sets the meta-data to use.- Specified by:
setMetaData
in interfaceDataPointWithMetaData
- Parameters:
value
- the meta-data
-
getMetaData
public HashMap<String,Object> getMetaData()
Returns the stored meta-data.- Specified by:
getMetaData
in interfaceDataPointWithMetaData
- Returns:
- the meta-data, null if none available
-
hasMetaData
public boolean hasMetaData()
Checks if any meta-data is available.- Specified by:
hasMetaData
in interfaceDataPointWithMetaData
- Returns:
- true if meta-data available
-
toString
public String toString()
Returns a string representation of the point.- Specified by:
toString
in classAbstractDataPoint
- Returns:
- the string representation
-
-