# Class JcampdxReader

java.lang.Object
org.jmol.adapter.smarter.AtomSetCollectionReader
org.jmol.adapter.readers.molxyz.MolReader
org.jmol.adapter.readers.more.JcampdxReader

All Implemented Interfaces:
  `GenericLineReader, JmolJDXMOLReader`

public class JcampdxReader extends MolReader implements JmolJDXMOLReader
A preliminary reader for JCAMP-DX files having ##$MODELS= and ##$PEAKS= records Designed by Robert Lancashire and Bob Hanson specifications (by example here): ##$MODELS= <Models> acetophenone DSViewer 3D 0 17 17 0 0 0 0 0 0 0 0999 V2000 ... 17 14 1 0 0 0 M END 17 1 Energy: -1454.38826 Freq: 3199.35852 C -1.693100 0.007800 0.000000 -0.000980 0.000120 0.000000 ... </Models> -- All XML data should be line-oriented in the above fashion. Leading spaces will be ignored. -- Any number of <ModelData> segments can be present -- The first model is referred to as the "base" model -- The base model: -- will generally be of type MOL, but any known type is acceptable -- will be used to generate bonding for later models that have no bonding information -- will be the only model for NMR -- Additional models can represent vibrations (XYZ format) or MS fragmentation (MOL format, probably) ##$PEAKS= ... -- peak record must be a single line of information because Jmol will use line.trim() as a key to pass information to JSpecView.

## Field Summary

### Fields inherited from class MolReader

`allow2D, bsDeleted`

### Fields inherited from class AtomSetCollectionReader

`addedData, addedDataKey, addVibrations, allow_a_len_1, allowPDBFilter, ANGSTROMS_PER_BOHR, applySymmetryToBonds, asc, baseAtomIndex, baseBondIndex, binaryDoc, bsFilter, bsModels, calculationType, CELL_TYPE_CONVENTIONAL, CELL_TYPE_PRIMITIVE, CELL_TYPE_SUPER, cellSlop, centroidPacked, checkNearAtoms, continuing, debugging, desiredModelNumber, desiredSpaceGroupIndex, desiredVibrationNumber, doApplySymmetry, doCentralize, doCentroidUnitCell, doCheckUnitCell, doConvertToFractional, doPackUnitCell, doProcessLines, doReadMolecularOrbitals, dssr, fileName, fileOffset, filePath, fileScaling, fillRange, filter, filterAllHetero, filterCased, filteredPrecision, filterHetero, floatifyJavaDouble, forcePacked, getHeader, haveAtomFilter, haveModel, havePartialChargeFilter, htParams, ignoreFileSpaceGroupName, ignoreFileSymmetryOperators, ignoreFileUnitCell, ignoreStructure, iHaveFractionalCoordinates, iHaveSymmetryOperators, iHaveUnitCell, is2D, isBinary, isConcatenated, isDSSP1, isFinalized, isMolecular, isPrimitive, isSequential, isSUPERCELL, isTrajectory, latticeCells, latticeScaling, latticeType, line, lowPrecision, lstNCS, matUnitCellOrientation, merging, modDim, modelNumber, ms, mustFinalizeModelSet, next, noHydrogens, noMinimize, noPack, optimize2D, out, paramsCentroid, paramsLattice, precision, prevline, primitiveToCrystal, ptLine, ptSupercell, reader, readerName, requiresBSFilter, reverseModels, rotateHexCell, sgName, slabXY, stateScriptVersionInt, strSupercell, symmetry, templateAtomCount, thisBiomolecule, trajectorySteps, ucItems, unitCellOffset, unitCellParams, useAltNames, useFileModelNumbers, validation, vibrationNumber, vibsFractional, vwr`

## Constructor Summary

Constructors
Constructor
Description
`JcampdxReader()`

## Method Summary

Modifier and Type
Method
Description
`void`
`addPeakData(String info)`
`boolean`
`checkLine()`
`void`
`finalizeSubclassReader()`
`void`
`initializeReader()`
`void`
`processModelData(String data, String id, String type, String base, String last, float modelScale, float vibScale, boolean isFirst)`
`void`
`setSpectrumPeaks(int nH, String piUnitsX, String piUnitsY)`

### Methods inherited from class MolReader

`addMolAtom, addMolBond, deleteAtom, finalizeReaderMR`

### Methods inherited from class AtomSetCollectionReader

`addAtomXYZSymName, addExplicitLatticeVector, addJmolScript, addMoreUnitCellInfo, addSites, addSiteScript, appendLoadNote, applySymmetryAndSetTrajectory, applySymTrajASCR, checkAndRemoveFilterKey, checkCurrentLineForScript, checkFilterKey, checkLastModel, checkLineForScript, clearUnitCell, cloneLastAtomSet, discardLinesUntilBlank, discardLinesUntilContains, discardLinesUntilContains2, discardLinesUntilNonBlank, discardLinesUntilStartsWith, discardPreviousAtoms, doGetModel, doGetVibration, doPreSymmetry, fill3x3, fillDataBlock, fillDataBlockFixed, fillFloatArray, fillFrequencyData, filterAtom, filterReject, finalizeMOData, finalizeModelSet, finalizeReaderASCR, finalizeSubclassSymmetry, fixDoubleA, fixFloatA, fixFloatPt, forceSymmetry, fractionalizeCoordinates, getElementSymbol, getFilter, getFilterWithCase, getFortranFormatLengths, getInterface, getPackingRangeValue, getStrings, getSymmetry, getTokens, getTokensFloat, initializeSymmetry, initializeSymmetryOptions, initializeTrajectoryFile, isLastModel, newAtomSet, parseFloat, parseFloatRange, parseFloatStr, parseInt, parseIntAt, parseIntRange, parseIntStr, parsePrecision, parseToken, parseTokenNext, parseTokenRange, parseTokenStr, processBinaryDocument, processDOM, rd, read3Vectors, readDataObject, readLines, readNextLine, rejectAtomName, RL, set2D, setAtomCoord, setAtomCoordScaled, setAtomCoordTokens, setAtomCoordXYZ, setChainID, setElementAndIsotope, setFilter, setFilterAtomTypeStr, setFractionalCoordinates, setIsPDB, setLoadNote, setModelPDB, setPrecision, setSpaceGroupName, setSymmetryOperator, setTransform, setUnitCell, setUnitCellItem, setup, setupASCR, warnSkippingOperation`

### Methods inherited from class Object

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

### Methods inherited from interface JmolJDXMOLReader

`discardLinesUntilContains, discardLinesUntilContains2, discardLinesUntilNonBlank, rd`

## Constructor Details

### JcampdxReader

public JcampdxReader()

## Method Details

### initializeReader

public void initializeReader() throws Exception

Overrides:
  `initializeReader` in class `MolReader`
Throws:
  `Exception`

### checkLine

public boolean checkLine() throws Exception

Overrides:
  `checkLine` in class `MolReader`
Returns:
  true if need to read new line
Throws:
  `Exception`

### finalizeSubclassReader

public void finalizeSubclassReader() throws Exception

Overrides:
  `finalizeSubclassReader` in class `MolReader`
Throws:
  `Exception`

### processModelData

public void processModelData(String data, String id, String type, String base, String last, float modelScale, float vibScale, boolean isFirst) throws Exception

Specified by:
  `processModelData` in interface `JmolJDXMOLReader`
Throws:
  `Exception`

### addPeakData

public void addPeakData(String info)

Specified by:
  `addPeakData` in interface `JmolJDXMOLReader`

### setSpectrumPeaks

public void setSpectrumPeaks(int nH, String piUnitsX, String piUnitsY)

Specified by:
  `setSpectrumPeaks` in interface `JmolJDXMOLReader`