Package adams.data.spectrum
Class SpectrumPoint
- java.lang.Object
-
- adams.data.container.AbstractDataPoint
-
- adams.data.spectrum.SpectrumPoint
-
- All Implemented Interfaces:
adams.core.CloneHandler
,adams.data.container.DataPoint
,Serializable
,Comparable
public class SpectrumPoint extends adams.data.container.AbstractDataPoint
Abstract superclass for sequence points.- Version:
- $Revision: 11831 $
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected float
m_Amplitude
the amplitude.protected float
m_WaveNumber
the wave number.
-
Constructor Summary
Constructors Constructor Description SpectrumPoint()
Initializes the point with wave number and amplitude as -1.SpectrumPoint(float waveno, float amplitude)
Initializes the point with no ID.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
assign(adams.data.container.DataPoint other)
Obtains the stored variables from the other data point.int
compareTo(Object o)
Compares this object with the specified object for order.float
getAmplitude()
Returns the amplitude.float
getWaveNumber()
Returns the wave number.SpectrumPoint
parse(String s)
Parses a string and instantiates a sequence point of it.void
setAmplitude(float value)
Sets the amplitude.void
setWaveNumber(float value)
Sets the wave number value.String
toString()
Returns a string representation of the point.
-
-
-
Method Detail
-
assign
public void assign(adams.data.container.DataPoint other)
Obtains the stored variables from the other data point.- Specified by:
assign
in interfaceadams.data.container.DataPoint
- Overrides:
assign
in classadams.data.container.AbstractDataPoint
- Parameters:
other
- the data point to get the values from
-
setWaveNumber
public void setWaveNumber(float value)
Sets the wave number value.- Parameters:
value
- the new wave number
-
getWaveNumber
public float getWaveNumber()
Returns the wave number.- Returns:
- the wave number
-
setAmplitude
public void setAmplitude(float value)
Sets the amplitude.- Parameters:
value
- the new amplitude
-
getAmplitude
public float getAmplitude()
Returns the amplitude.- Returns:
- the amplitude
-
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 classadams.data.container.AbstractDataPoint
- 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.
-
parse
public SpectrumPoint parse(String s)
Parses a string and instantiates a sequence point of it.- Parameters:
s
- the string to parse- Returns:
- the instantiated point, null in case of an error
-
toString
public String toString()
Returns a string representation of the point.- Specified by:
toString
in classadams.data.container.AbstractDataPoint
- Returns:
- the string representation
-
-