# Class JDXDataObject

java.lang.Object
jspecview.source.JDXHeader
jspecview.source.JDXDataObject

Direct Known Subclasses:
  `Spectrum`

public abstract class JDXDataObject extends JDXHeader
spectrum data AS READ FROM FILE

Author:
  Bob Hanson

## Nested Class Summary

### Nested classes/interfaces inherited from class JDXHeader

`JDXHeader.DataLDRTable`

## Field Summary

Fields
Modifier and Type
Field
Description
`protected double`
`blockID`
`static final double`
`ERROR`
Error number that is returned when a min value is undefined
`double`
`fileFirstX`
JDXReader only
`double`
`fileLastX`
JDXReader only
`int`
`fileNPoints`
JDXReader only
`double`
`freq2dX`
`double`
`freq2dY`
`boolean`
`isSimulation`
`String`
`nucleusX`
`String`
`nucleusY`
`protected Spectrum`
`parent`
`static final int`
`REF_TYPE_BRUKER`
`static final int`
`REF_TYPE_STANDARD`
`static final int`
`REF_TYPE_UNSPECIFIED`
`static final int`
`REF_TYPE_VARIAN`
`String`
`sourceID`
`double`
`xFactor`
Also used in JDXExport
`protected String`
`xLabel`
`protected String`
`xUnits`
`Coordinate[]`
`xyCoords`
array of x,y coordinates
`String`
`y2DUnits`
`double`
`yFactor`
Also used in JDXExport
`protected String`
`yLabel`
`protected String`
`yUnits`

### Fields inherited from class JDXHeader

`dataClass, dataType, date, headerTable, jcampdx, longDate, origin, owner, time, title`

## Constructor Summary

Constructors
Constructor
Description
`JDXDataObject()`

## Method Summary

Modifier and Type
Method
Description
`boolean`
`canConvertTransAbs()`
`boolean`
`canIntegrate()`
`boolean`
`canSaveAsJDX()`
`boolean`
`canShowSolutionColor()`
`void`
`checkJDXRequiredTokens()`
for JDXReader only
`void`
`copyTo(JDXDataObject newObj)`
`Object[]`
`getDefaultAnnotationInfo(Annotation.AType type)`
`int`
`getDefaultUnitPrecision()`
`double`
`getDeltaX()`
Returns the delta X
`String`
`getFilePath()`
The path to the file
`String`
`getFilePathForwardSlash()`
`double`
`getFirstX()`
Returns the first X value
`double`
`getFirstY()`
Returns the first Y value
`static double`
`getGyromagneticRatio(String nuc)`
`String[][]`
`getHeaderRowDataAsArray()`
`int`
`getHydrogenCount()`
`String`
`getInlineData()`
`double`
`getLastX()`
Returns the last X value
`double`
`getLastY()`
Returns the last Y value
`double`
`getMaxX()`
Calculates and returns the maximum x value in the list of coordinates Fairly expensive operation
`double`
`getMaxY()`
Calculates and returns the maximum y value in the list of coordinates Fairly expensive operation
`double`
`getMinX()`
Calculates and returns the minimum x value in the list of coordinates Fairly expensive operation
`double`
`getMinY()`
Calculates and returns the minimum y value in the list of coordinates Fairly expensive operation
`static int`
`getNominalSpecFreq(String nuc, double freq)`
`int`
`getNumDim()`
`double`
`getObservedFreq()`
Returns the observed frequency (for NMR Spectra)
`String`
`getObservedNucleus()`
^1H, ^13C, for example
`double[]`
`getPeakListArray(Measurement m, double[] last, double maxY)`
`static double`
`getSpecFreq(String nuc, double freq)`
`String`
`getTypeLabel()`
`double`
`getXFactor()`
Returns the original x factor
`String`
`getXUnits()`
Returns the units for x-axis when spectrum is displayed
`double`
`getY2D()`
`double`
`getY2DPPM()`
`double`
`getYFactor()`
Returns the original y factor
`double`
`getYRef()`
`String`
`getYUnits()`
Returns the units for y-axis when spectrum is displayed
`JDXDataObject`
`invertYAxis()`
`boolean`
`is1D()`
`boolean`
`isAbsorbance()`
`boolean`
`isAutoOverlayFromJmolClick()`
`boolean`
`isContinuous()`
Returns true if spectrum is continuous
`boolean`
`isGC()`
`boolean`
`isHNMR()`
Determines if a spectrum is an HNMR spectrum
`boolean`
`isHZtoPPM()`
Determines if the spectrum should be displayed with abscissa unit of Part Per Million (PPM) instead of Hertz (HZ)
`boolean`
`isImaginary()`
`boolean`
`isInverted()`
`boolean`
`isMS()`
`boolean`
`isNMR()`
`boolean`
`isScalable()`
`boolean`
`isStackable()`
`boolean`
`isTransmittance()`
///////////// derived info /////////////
`boolean`
`isXIncreasing()`
Returns true if the spectrum is increasing; used by SVGExporter only
`void`
`normalizeSimulation(double max)`
`void`
`setBlockID(double id)`
`void`
`setContinuous(boolean val)`
Sets value to true if spectrum is continuous
`void`
`setFilePath(String filePath)`
`void`
`setHydrogenCount(int nH)`
`void`
`setHZtoPPM(boolean val)`
Sets the value to true if the spectrum should be displayed with abscissa unit of Part Per Million (PPM) instead of Hertz (HZ)
`void`
`setIncreasing(boolean val)`
Sets value to true if spectrum is increasing
`void`
`setInlineData(String data)`
`String`
`setMeasurementText(Measurement m)`
`void`
`setNucleusAndFreq(String nuc, boolean isX)`
`void`
`setNumDim(int n)`
`void`
`setObservedFreq(double observedFreq)`
Sets the Observed Frequency (for NMR Spectra)
`void`
`setObservedNucleus(String value)`
`void`
`setVarName(String name)`
From ##VARNAME
`void`
`setXFactor(double xFactor)`
Sets the original xfactor, from JDXReader and XMLReader
`void`
`setXLabel(String value)`
`void`
`setXUnits(String xUnits)`
Sets the units for the x axis
`void`
`setXYCoords(Coordinate[] coords)`
Sets the array of coordinates
`void`
`setY2D(double d)`
`void`
`setY2DUnits(String units)`
`void`
`setYFactor(double yFactor)`
Sets the original y factor, from JDXReader and XMLReader
`void`
`setYLabel(String value)`
`void`
`setYUnits(String yUnits)`
Sets the units for the y axis
`boolean`
`shouldDisplayXAxisIncreasing()`
Determines if the plot should be displayed decreasing by default

### Methods inherited from class JDXHeader

`getDataClass, getDataType, getDate, getHeaderRowDataAsArray, getHeaderTable, getJcampdx, getLongDate, getOrigin, getOwner, getQualifiedDataType, getTime, getTitle, setDataClass, setDataType, setDate, setHeaderTable, setJcampdx, setLongDate, setOrigin, setOwner, setTime, setTitle`

### Methods inherited from class Object

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

## Field Details

### ERROR

public static final double ERROR
Error number that is returned when a min value is undefined

See Also:
  - Constant Field Values

### REF_TYPE_UNSPECIFIED

public static final int REF_TYPE_UNSPECIFIED

See Also:
  - Constant Field Values

### REF_TYPE_STANDARD

public static final int REF_TYPE_STANDARD

See Also:
  - Constant Field Values

### REF_TYPE_BRUKER

public static final int REF_TYPE_BRUKER

See Also:
  - Constant Field Values

### REF_TYPE_VARIAN

public static final int REF_TYPE_VARIAN

See Also:
  - Constant Field Values

### sourceID

public String sourceID

### isSimulation

public boolean isSimulation

### blockID

protected double blockID

### xyCoords

public Coordinate[] xyCoords
array of x,y coordinates

### fileFirstX

public double fileFirstX
JDXReader only

### fileLastX

public double fileLastX
JDXReader only

### fileNPoints

public int fileNPoints
JDXReader only

### xFactor

public double xFactor
Also used in JDXExport

### yFactor

public double yFactor
Also used in JDXExport

### nucleusX

public String nucleusX

### nucleusY

public String nucleusY

### freq2dX

public double freq2dX

### freq2dY

public double freq2dY

### y2DUnits

public String y2DUnits

### parent

protected Spectrum parent

### xUnits

protected String xUnits

### yUnits

protected String yUnits

### xLabel

protected String xLabel

### yLabel

protected String yLabel

## Constructor Details

### JDXDataObject

public JDXDataObject()

## Method Details

### setInlineData

public void setInlineData(String data)

### getInlineData

public String getInlineData()

### setFilePath

public void setFilePath(String filePath)

### getFilePath

public String getFilePath()
The path to the file

Returns:
  path to file or [inline] (if loaded inline)

### getFilePathForwardSlash

public String getFilePathForwardSlash()

### setBlockID

public void setBlockID(double id)

### checkJDXRequiredTokens

public void checkJDXRequiredTokens() throws JSVException
for JDXReader only

Throws:
  `JSVException`

### setXFactor

public void setXFactor(double xFactor)
Sets the original xfactor, from JDXReader and XMLReader

Parameters:
  `xFactor` - the x factor

### getXFactor

public double getXFactor()
Returns the original x factor

Returns:
  the original x factor

### setYFactor

public void setYFactor(double yFactor)
Sets the original y factor, from JDXReader and XMLReader

Parameters:
  `yFactor` - the y factor

### getYFactor

public double getYFactor()
Returns the original y factor

Returns:
  the original y factor

### setVarName

public void setVarName(String name)
From ##VARNAME

Parameters:
  `name` -

### isImaginary

public boolean isImaginary()

### setXUnits

public void setXUnits(String xUnits)
Sets the units for the x axis

Parameters:
  `xUnits` - the x units

### getXUnits

public String getXUnits()
Returns the units for x-axis when spectrum is displayed

Returns:
  the units for x-axis when spectrum is displayed

### setYUnits

public void setYUnits(String yUnits)
Sets the units for the y axis

Parameters:
  `yUnits` - the y units

### getYUnits

public String getYUnits()
Returns the units for y-axis when spectrum is displayed

Returns:
  the units for y-axis when spectrum is displayed

### setXLabel

public void setXLabel(String value)

### setYLabel

public void setYLabel(String value)

### setObservedNucleus

public void setObservedNucleus(String value)

### getObservedNucleus

public String getObservedNucleus()
^1H, ^13C, for example

Returns:
  observedNucl

### setObservedFreq

public void setObservedFreq(double observedFreq)
Sets the Observed Frequency (for NMR Spectra)

Parameters:
  `observedFreq` - the observed frequency

### getObservedFreq

public double getObservedFreq()
Returns the observed frequency (for NMR Spectra)

Returns:
  the observed frequency (for NMR Spectra)

### setHydrogenCount

public void setHydrogenCount(int nH)

### getHydrogenCount

public int getHydrogenCount()

### is1D

public boolean is1D()

### getNumDim

public int getNumDim()

### setNumDim

public void setNumDim(int n)

### setY2D

public void setY2D(double d)

### getY2D

public double getY2D()

### setY2DUnits

public void setY2DUnits(String units)

### getY2DPPM

public double getY2DPPM()

### setNucleusAndFreq

public void setNucleusAndFreq(String nuc, boolean isX)

### getNominalSpecFreq

public static int getNominalSpecFreq(String nuc, double freq)

### getSpecFreq

public static double getSpecFreq(String nuc, double freq)

### getGyromagneticRatio

public static double getGyromagneticRatio(String nuc)

### isTransmittance

public boolean isTransmittance()
///////////// derived info /////////////

### isAbsorbance

public boolean isAbsorbance()

### canSaveAsJDX

public boolean canSaveAsJDX()

### canIntegrate

public boolean canIntegrate()

### isAutoOverlayFromJmolClick

public boolean isAutoOverlayFromJmolClick()

### isGC

public boolean isGC()

### isMS

public boolean isMS()

### isStackable

public boolean isStackable()

### isScalable

public boolean isScalable()

### getYRef

public double getYRef()

### isInverted

public boolean isInverted()

### canConvertTransAbs

public boolean canConvertTransAbs()

### canShowSolutionColor

public boolean canShowSolutionColor()

### isHZtoPPM

public boolean isHZtoPPM()
Determines if the spectrum should be displayed with abscissa unit of Part Per Million (PPM) instead of Hertz (HZ)

Returns:
  true if abscissa unit should be PPM

### setHZtoPPM

public void setHZtoPPM(boolean val)
Sets the value to true if the spectrum should be displayed with abscissa unit of Part Per Million (PPM) instead of Hertz (HZ)

Parameters:
  `val` - true or false

### setIncreasing

public void setIncreasing(boolean val)
Sets value to true if spectrum is increasing

Parameters:
  `val` - true if spectrum is increasing

### isXIncreasing

public boolean isXIncreasing()
Returns true if the spectrum is increasing; used by SVGExporter only

Returns:
  true if the spectrum is increasing

### shouldDisplayXAxisIncreasing

public boolean shouldDisplayXAxisIncreasing()
Determines if the plot should be displayed decreasing by default

Returns:
  true or false

### setContinuous

public void setContinuous(boolean val)
Sets value to true if spectrum is continuous

Parameters:
  `val` - true if spectrum is continuous

### isContinuous

public boolean isContinuous()
Returns true if spectrum is continuous

Returns:
  true if spectrum is continuous

### getHeaderRowDataAsArray

public String[][] getHeaderRowDataAsArray()

### getDefaultUnitPrecision

public int getDefaultUnitPrecision()

### setMeasurementText

public String setMeasurementText(Measurement m)

### isNMR

public boolean isNMR()

### isHNMR

public boolean isHNMR()
Determines if a spectrum is an HNMR spectrum

Returns:
  true if an HNMR, false otherwise

### setXYCoords

public void setXYCoords(Coordinate[] coords)
Sets the array of coordinates

Parameters:
  `coords` - the array of Coordinates

### invertYAxis

public JDXDataObject invertYAxis()

### getFirstX

public double getFirstX()
Returns the first X value

Returns:
  the first X value

### getFirstY

public double getFirstY()
Returns the first Y value

Returns:
  the first Y value

### getLastX

public double getLastX()
Returns the last X value

Returns:
  the last X value

### getLastY

public double getLastY()
Returns the last Y value

Returns:
  the last Y value

### getMinX

public double getMinX()
Calculates and returns the minimum x value in the list of coordinates Fairly expensive operation

Returns:
  the minimum x value in the list of coordinates

### getMinY

public double getMinY()
Calculates and returns the minimum y value in the list of coordinates Fairly expensive operation

Returns:
  the minimum x value in the list of coordinates

### getMaxX

public double getMaxX()
Calculates and returns the maximum x value in the list of coordinates Fairly expensive operation

Returns:
  the maximum x value in the list of coordinates

### getMaxY

public double getMaxY()
Calculates and returns the maximum y value in the list of coordinates Fairly expensive operation

Returns:
  the maximum y value in the list of coordinates

### normalizeSimulation

public void normalizeSimulation(double max)

### getDeltaX

public double getDeltaX()
Returns the delta X

Returns:
  the delta X

### copyTo

public void copyTo(JDXDataObject newObj)

### getTypeLabel

public String getTypeLabel()

### getDefaultAnnotationInfo

public Object[] getDefaultAnnotationInfo(Annotation.AType type)

### getPeakListArray

public double[] getPeakListArray(Measurement m, double[] last, double maxY)