org.openscience.cdk.io
Class RGroupQueryWriter

java.lang.Object
  extended by org.openscience.cdk.io.ChemObjectIO
      extended by org.openscience.cdk.io.DefaultChemObjectWriter
          extended by org.openscience.cdk.io.RGroupQueryWriter
All Implemented Interfaces:
Closeable, IChemObjectIO, IChemObjectWriter

public class RGroupQueryWriter
extends DefaultChemObjectWriter

A writer for Symyx' Rgroup files (RGFiles).
An RGfile describes a single molecular query with Rgroups. Each RGfile is a combination of Ctabs defining the root molecule and each member of each Rgroup in the query.
This class relies on the MDLV2000Writer to create CTAB data blocks.

Author:
Mark Rijnbeek
Keywords:
Rgroup, R group, R-group
Belongs to CDK module:
io
Source code:
cdk-1.4.x

Constructor Summary
RGroupQueryWriter()
          Zero argument constructor.
RGroupQueryWriter(Writer out)
          Constructs a new writer that can write an IRGroupQuery to the Symx RGFile format.
 
Method Summary
 boolean accepts(Class classObject)
          Returns true for accepted input types.
 void close()
          Flushes the output and closes this object.
 IResourceFormat getFormat()
          Returns output format.
 void setWriter(OutputStream output)
          Sets the writer to given output stream.
 void setWriter(Writer out)
          Sets the writer.
 void write(IChemObject object)
          The actual writing of the output.
 
Methods inherited from class org.openscience.cdk.io.ChemObjectIO
addChemObjectIOListener, addSetting, addSettings, getIOSettings, getListeners, getSetting, getSetting, getSettings, hasSetting, removeChemObjectIOListener
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.openscience.cdk.io.IChemObjectIO
addChemObjectIOListener, addSetting, addSettings, getIOSettings, getListeners, getSetting, getSetting, getSettings, hasSetting, removeChemObjectIOListener
 

Constructor Detail

RGroupQueryWriter

public RGroupQueryWriter(Writer out)
Constructs a new writer that can write an IRGroupQuery to the Symx RGFile format.

Parameters:
out - The Writer to write to

RGroupQueryWriter

public RGroupQueryWriter()
Zero argument constructor.

Method Detail

accepts

@TestMethod(value="testAccepts")
public boolean accepts(Class classObject)
Returns true for accepted input types.

Parameters:
classObject - IChemObject of which is tested if it can be handled.
Returns:
true, if the IChemObject can be handled.

close

@TestMethod(value="testClose")
public void close()
           throws IOException
Flushes the output and closes this object.

Throws:
IOException

getFormat

@TestMethod(value="testGetFormat")
public IResourceFormat getFormat()
Returns output format.


setWriter

public void setWriter(OutputStream output)
               throws CDKException
Sets the writer to given output stream.

Throws:
CDKException

setWriter

public void setWriter(Writer out)
               throws CDKException
Sets the writer.

Throws:
CDKException

write

public void write(IChemObject object)
           throws CDKException
The actual writing of the output.

Parameters:
object - the object of which the content is outputed
Throws:
CDKException
IOException