# Class Measurement

java.lang.Object
jspecview.common.Coordinate
jspecview.common.Annotation
jspecview.common.Measurement

Direct Known Subclasses:
  `Integral`

public class Measurement extends Annotation
The `Measurement` class stores an annotation that is a measurement

Author:
  Bob Hanson hansonr@stolaf.edu

## Nested Class Summary

### Nested classes/interfaces inherited from class Annotation

`Annotation.AType`

## Field Summary

Fields
Modifier and Type
Field
Description
`static final int`
`PT_INT_LABEL`
`static final int`
`PT_ON_LINE`
`static final int`
`PT_ON_LINE1`
`static final int`
`PT_ON_LINE2`
`static final int`
`PT_XY1`
`static final int`
`PT_XY2`
`protected double`
`value`

### Fields inherited from class Annotation

`isPixels, text`

## Constructor Summary

Constructors
Constructor
Description
`Measurement()`

## Method Summary

Modifier and Type
Method
Description
`void`
`addSpecShift(double dx)`
`Measurement`
`copyM()`
`Spectrum`
`getSpectrum()`
`double`
`getValue()`
`double`
`getXVal2()`
`double`
`getYVal2()`
`boolean`
`overlaps(double x1, double x2)`
`Measurement`
`setM1(double x, double y, Spectrum spec)`
`void`
`setPt2(double x, double y)`
`Measurement`
`setPt2(Spectrum spec, boolean doSetPt2)`
`void`
`setValue(double value)`
`void`
`setYVal2(double y2)`
`String`
`toString()`
Overrides Objects toString() method

### Methods inherited from class Annotation

`getColoredAnnotation, setA`

### Methods inherited from class Coordinate

`applyScale, copy, deltaX, equals, findXForPeakNearest, getMaxX, getMaxX, getMaxY, getMaxYUser, getMinX, getMinX, getMinY, getMinYUser, getNearestIndexForX, getNearestXWithYAbove, getXVal, getYVal, getYValueAt, isYInRange, normalise, parabolicInterpolation, parseDSV, removeScale, reverse, set, setXVal, setYVal, shiftX`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Field Details

### PT_XY1

public static final int PT_XY1

See Also:
  - Constant Field Values

### PT_XY2

public static final int PT_XY2

See Also:
  - Constant Field Values

### PT_INT_LABEL

public static final int PT_INT_LABEL

See Also:
  - Constant Field Values

### PT_ON_LINE1

public static final int PT_ON_LINE1

See Also:
  - Constant Field Values

### PT_ON_LINE2

public static final int PT_ON_LINE2

See Also:
  - Constant Field Values

### PT_ON_LINE

public static final int PT_ON_LINE

See Also:
  - Constant Field Values

### value

protected double value

## Constructor Details

### Measurement

public Measurement()

## Method Details

### setM1

public Measurement setM1(double x, double y, Spectrum spec)

### copyM

public Measurement copyM()

### setPt2

public Measurement setPt2(Spectrum spec, boolean doSetPt2)

### setPt2

public void setPt2(double x, double y)

### getSpectrum

public Spectrum getSpectrum()

### setValue

public void setValue(double value)

### getValue

public double getValue()

### getXVal2

public double getXVal2()

### getYVal2

public double getYVal2()

### addSpecShift

public void addSpecShift(double dx)

### setYVal2

public void setYVal2(double y2)

### overlaps

public boolean overlaps(double x1, double x2)

### toString

public String toString()
Overrides Objects toString() method

Overrides:
  `toString` in class `Annotation`
Returns:
  the String representation of this coordinate