|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openscience.cdk.io.ReaderFactory
public class ReaderFactory
A factory for creating ChemObjectReaders. The type of reader created is determined from the content of the input. Formats of GZiped files can be detected too. A typical example is:
StringReader stringReader = "<molecule/>"; ChemObjectReader reader = new ReaderFactory().createReader(stringReader);
| Constructor Summary | |
|---|---|
ReaderFactory()
Constructs a ReaderFactory which tries to detect the format in the first 65536 chars. |
|
ReaderFactory(int headerLength)
Constructs a ReaderFactory which tries to detect the format in the first given number of chars. |
|
| Method Summary | |
|---|---|
ISimpleChemObjectReader |
createReader(IChemFormat format)
Creates a new IChemObjectReader based on the given IChemFormat. |
ISimpleChemObjectReader |
createReader(InputStream input)
Detects the format of the Reader input, and if known, it will return a CDK Reader to read the format, or null when the reader is not implemented. |
ISimpleChemObjectReader |
createReader(Reader input)
Detects the format of the Reader input, and if known, it will return a CDK Reader to read the format. |
List<IChemFormatMatcher> |
getFormats()
|
void |
registerFormat(IChemFormatMatcher format)
Registers a format for detection. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ReaderFactory()
public ReaderFactory(int headerLength)
headerLength - length of the header in number of chars| Method Detail |
|---|
public void registerFormat(IChemFormatMatcher format)
public List<IChemFormatMatcher> getFormats()
public ISimpleChemObjectReader createReader(InputStream input)
throws IOException
IOExceptioncreateReader(Reader)public ISimpleChemObjectReader createReader(IChemFormat format)
createReader(InputStream)
public ISimpleChemObjectReader createReader(Reader input)
throws IOException
IOExceptioncreateReader(InputStream)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||