# Class JDXSource

java.lang.Object
jspecview.source.JDXHeader
jspecview.source.JDXSource

public class JDXSource extends JDXHeader
`JDXSource` is representation of all the data in the JCAMP-DX file or source. Note: All Jdx Source are viewed as having a set of Spectra

Author:
  Debbie-Ann Facey, Khari A. Bryan, Prof. Robert J. Lancashire

## Nested Class Summary

### Nested classes/interfaces inherited from class JDXHeader

`JDXHeader.DataLDRTable`

## Field Summary

Fields
Modifier and Type
Field
Description
`boolean`
`isCompoundSource`
`boolean`
`isView`
`int`
`peakCount`
`int`
`type`
`static final int`
`TYPE_BLOCK`
`static final int`
`TYPE_NTUPLE`
`static final int`
`TYPE_SIMPLE`
`static final int`
`TYPE_UNKNOWN`
`static final int`
`TYPE_VIEW`

### Fields inherited from class JDXHeader

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

## Constructor Summary

Constructors
Constructor
Description
`JDXSource(int type, String filePath)`

## Method Summary

Modifier and Type
Method
Description
`void`
`addJDXSpectrum(String filePath, Spectrum spectrum, boolean forceSub)`
Adds a Spectrum to the list
`static JDXSource`
`createView(Lst<Spectrum> specs)`
`void`
`dispose()`
`String`
`getErrorLog()`
Returns the error log for this source
`String`
`getFilePath()`
`String[][]`
`getHeaderRowDataAsArray(boolean addDataClass, String[][] rowData)`
`Spectrum`
`getJDXSpectrum(int index)`
Returns the Spectrum at a given index in the list
`int`
`getNumberOfSpectra()`
Returns the number of Spectra in this Source
`Lst<Spectrum>`
`getSpectra()`
Returns the Vector of Spectra
`Spectrum[]`
`getSpectraAsArray()`
Used in Android
`boolean`
`matchesFilePath(String filePath)`
`void`
`setErrorLog(String errors)`
Sets the error log for this source
`void`
`setFilePath(String filePath)`
`void`
`setID(String id)`
`void`
`setInlineData(String data)`

### 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

### TYPE_VIEW

public static final int TYPE_VIEW

See Also:
  - Constant Field Values

### TYPE_UNKNOWN

public static final int TYPE_UNKNOWN

See Also:
  - Constant Field Values

### TYPE_SIMPLE

public static final int TYPE_SIMPLE

See Also:
  - Constant Field Values

### TYPE_BLOCK

public static final int TYPE_BLOCK

See Also:
  - Constant Field Values

### TYPE_NTUPLE

public static final int TYPE_NTUPLE

See Also:
  - Constant Field Values

### type

public int type

### isCompoundSource

public boolean isCompoundSource

### peakCount

public int peakCount

### isView

public boolean isView

## Constructor Details

### JDXSource

public JDXSource(int type, String filePath)

## Method Details

### dispose

public void dispose()

### getJDXSpectrum

public Spectrum getJDXSpectrum(int index)
Returns the Spectrum at a given index in the list

Parameters:
  `index` - the spectrum index
Returns:
  the Spectrum at a given index in the list

### addJDXSpectrum

public void addJDXSpectrum(String filePath, Spectrum spectrum, boolean forceSub)
Adds a Spectrum to the list

Parameters:
  `filePath` -
  `spectrum` - the spectrum to be added
  `forceSub` -

### getNumberOfSpectra

public int getNumberOfSpectra()
Returns the number of Spectra in this Source

Returns:
  the number of Spectra in this Source

### getSpectra

public Lst<Spectrum> getSpectra()
Returns the Vector of Spectra

Returns:
  the Vector of Spectra

### getSpectraAsArray

public Spectrum[] getSpectraAsArray()
Used in Android

Returns:
  array of JDXpectrum

### getErrorLog

public String getErrorLog()
Returns the error log for this source

Returns:
  the error log for this source

### setErrorLog

public void setErrorLog(String errors)
Sets the error log for this source

Parameters:
  `errors` - error log for this source

### setFilePath

public void setFilePath(String filePath)

### getFilePath

public String getFilePath()

### createView

public static JDXSource createView(Lst<Spectrum> specs)

### getHeaderRowDataAsArray

public String[][] getHeaderRowDataAsArray(boolean addDataClass, String[][] rowData)

### setID

public void setID(String id)

### matchesFilePath

public boolean matchesFilePath(String filePath)

### setInlineData

public void setInlineData(String data)