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 Stringm_IDan optional ID.protected HashMap<String,Object>m_MetaDatathe meta-data.protected doublem_Xthe X value.protected doublem_Ythe 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 voidassign(DataPoint other)Obtains the stored variables from the other data point.intcompareTo(Object o)Compares this object with the specified object for order.StringgetID()Returns the ID.doublegetMaxX()Returns the maximum for X.doublegetMaxY()Returns the maximum for Y.HashMap<String,Object>getMetaData()Returns the stored meta-data.doublegetMinX()Returns the minimum for X.doublegetMinY()Returns the minimum for Y.doublegetX()Returns the X value.doublegetY()Returns the Y value.booleanhasID()Checks whether an ID is set.booleanhasMetaData()Checks if any meta-data is available.voidsetID(String value)Sets the ID.voidsetMetaData(HashMap<String,Object> value)Sets the meta-data to use.voidsetX(double value)Sets the X value.voidsetY(double value)Sets the Y value.StringtoString()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:
compareToin interfaceComparable- Specified by:
compareToin 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:
assignin interfaceDataPoint- Overrides:
assignin 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:
setMetaDatain interfaceDataPointWithMetaData- Parameters:
value- the meta-data
-
getMetaData
public HashMap<String,Object> getMetaData()
Returns the stored meta-data.- Specified by:
getMetaDatain interfaceDataPointWithMetaData- Returns:
- the meta-data, null if none available
-
hasMetaData
public boolean hasMetaData()
Checks if any meta-data is available.- Specified by:
hasMetaDatain interfaceDataPointWithMetaData- Returns:
- true if meta-data available
-
toString
public String toString()
Returns a string representation of the point.- Specified by:
toStringin classAbstractDataPoint- Returns:
- the string representation
-
-