@TestClass(value="org.openscience.cdk.inchi.InChIGeneratorFactoryTest") public class InChIGeneratorFactory extends Object
Factory providing access to InChIGenerator
and InChIToStructure
.
See those classes for examples of use. These methods make use of the
JNI-InChI library.
The InChIGeneratorFactory
is a singleton class, which means that there
exists only one instance of the class. An instance of this class is obtained
with:
InChIGeneratorFactory factory = InChIGeneratorFactory.getInstance();
InChI/Structure interconversion is implemented in this way so that we can
check whether or not the native code required is available. If the native
code cannot be loaded during the first call to getInstance
method (when the instance is created) a CDKException
will be thrown. The
most common problem is that the native code is not in the * the correct
location. Java searches the locations in the PATH environmental
variable, under Windows, and LD_LIBRARY_PATH under Linux, so the JNI-InChI
native libraries must be in one of these locations. If the JNI-InChI jar file
is being used and either the current working directory, or '.' are contained
in PATH of LD_LIBRARY_PATH then the native code should be placed
automatically. If the native files are in the correct location but fail to
load, then they may need to be recompiled for your system. See:
Modifier and Type | Method and Description |
---|---|
InChIGenerator |
getInChIGenerator(IAtomContainer container)
Gets an Standard InChI generator for a
IAtomContainer . |
InChIGenerator |
getInChIGenerator(IAtomContainer container,
List<net.sf.jniinchi.INCHI_OPTION> options)
Gets InChI generator for CDK IAtomContainer.
|
InChIGenerator |
getInChIGenerator(IAtomContainer container,
String options)
Gets InChI generator for CDK IAtomContainer.
|
InChIToStructure |
getInChIToStructure(String inchi,
IChemObjectBuilder builder)
Gets structure generator for an InChI string.
|
InChIToStructure |
getInChIToStructure(String inchi,
IChemObjectBuilder builder,
List<String> options)
Gets structure generator for an InChI string.
|
InChIToStructure |
getInChIToStructure(String inchi,
IChemObjectBuilder builder,
String options)
Gets structure generator for an InChI string.
|
static InChIGeneratorFactory |
getInstance()
Gives the one
InChIGeneratorFactory instance,
if needed also creates it. |
@TestMethod(value="testGetInstance") public static InChIGeneratorFactory getInstance() throws CDKException
InChIGeneratorFactory
instance,
if needed also creates it.InChIGeneratorFactory
instanceCDKException
- if unable to load native code when attempting
to create the factory@TestMethod(value="testGetInChIGenerator_IAtomContainer") public InChIGenerator getInChIGenerator(IAtomContainer container) throws CDKException
IAtomContainer
.container
- AtomContainer to generate InChI for.CDKException
- if the generator cannot be instantiated@TestMethod(value="testGetInChIGenerator_IAtomContainer_String") public InChIGenerator getInChIGenerator(IAtomContainer container, String options) throws CDKException
container
- AtomContainer to generate InChI for.options
- String of options for InChI generation.CDKException
- if the generator cannot be instantiated@TestMethod(value="testGetInChIGenerator_IAtomContainer_List") public InChIGenerator getInChIGenerator(IAtomContainer container, List<net.sf.jniinchi.INCHI_OPTION> options) throws CDKException
container
- AtomContainer to generate InChI for.options
- List of options (net.sf.jniinchi.INCHI_OPTION) for InChI generation.CDKException
- if the generator cannot be instantiated@TestMethod(value="testGetInChIToStructure_String_IChemObjectBuilder") public InChIToStructure getInChIToStructure(String inchi, IChemObjectBuilder builder) throws CDKException
inchi
- InChI to generate structure from.builder
- the builder to useCDKException
- if the generator cannot be instantiated@TestMethod(value="testGetInChIToStructure_String_IChemObjectBuilder_NullString") public InChIToStructure getInChIToStructure(String inchi, IChemObjectBuilder builder, String options) throws CDKException
Gets structure generator for an InChI string.
inchi
- InChI to generate structure from.builder
- the builder to employoptions
- String of options for structure generation.CDKException
- if the generator cannot be instantiated@TestMethod(value="testGetInChIToStructure_String_IChemObjectBuilder_List") public InChIToStructure getInChIToStructure(String inchi, IChemObjectBuilder builder, List<String> options) throws CDKException
Gets structure generator for an InChI string.
inchi
- InChI to generate structure from.options
- List of options (net.sf.jniinchi.INCHI_OPTION) for structure generation.builder
- the builder to employCDKException
- if the generator cannot be instantiated