public abstract class SpectrumWriter
extends java.lang.Object
Constructor and Description |
---|
SpectrumWriter(java.io.OutputStream osIn,
int typeIn,
int headerIn)
Constructor.
|
SpectrumWriter(java.io.OutputStream osIn,
int typeIn,
int headerIn,
SPECCHIOClient specchio_client)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
endSpace()
Finish writing the current space.
|
void |
endSpace(java.lang.Boolean combine)
Finish writing the current space.
|
Space |
getCurrentSpace()
Get a reference to the Space object being written.
|
java.io.OutputStream |
getOutputStream()
Get a reference to the output stream.
|
int |
getTimeFormat()
Get the time format.
|
void |
setTimeFormat(int timeFormatIn)
Set the time format.
|
void |
setUseSpectrumUnits(boolean useSpectrumUnitsIn)
Set whether or not to use the units specified by the Spectrum objects.
|
void |
startSpace(Space spaceIn)
Start writing a new space.
|
boolean |
useSpectrumUnits()
Return whether or not to use the units specified by the Spectrum objects.
|
abstract void |
writeSpectrum(Spectrum s)
Write a spectrum to the output stream.
|
public SpectrumWriter(java.io.OutputStream osIn, int typeIn, int headerIn, SPECCHIOClient specchio_client)
osIn
- the output stream being written totypeIn
- the file typeheaderIn
- HeaderBody.Header or HeaderBody.Bodyspecchio_client
- reference to the specchio client (used for e.g. taxonomy translations)public SpectrumWriter(java.io.OutputStream osIn, int typeIn, int headerIn)
osIn
- the output stream being written totypeIn
- the file typeheaderIn
- HeaderBody.Header or HeaderBody.Bodypublic void endSpace() throws java.io.IOException
java.io.IOException
- could not write to outputpublic void endSpace(java.lang.Boolean combine) throws java.io.IOException
combine
- indicates if the measurement should be appended at the end of the metadata and attribute columnsjava.io.IOException
- could not write to outputpublic Space getCurrentSpace()
public java.io.OutputStream getOutputStream()
public int getTimeFormat()
public void startSpace(Space spaceIn) throws java.io.IOException
spaceIn
- the spacejava.io.IOException
- could not write to outputpublic void setTimeFormat(int timeFormatIn)
timeFormatIn
- TimeFormats.Seconds or TimeFormats.Formattedpublic void setUseSpectrumUnits(boolean useSpectrumUnitsIn)
useSpectrumUnitsIn
- true or falsepublic boolean useSpectrumUnits()
public abstract void writeSpectrum(Spectrum s) throws java.io.IOException
s
- the spectrum to be writtenjava.io.IOException
- could not write to the output stream