|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Thread
chemaxon.jchem.db.Importer
Tool for importing molecules to database tables from a File or InputStream object.
| Field Summary |
| Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Fields inherited from interface chemaxon.jchem.db.Transfer |
JTF, MOLFILE, MRV, RDFILE, RXNFILE, SDFILE, SMILES |
| Constructor Summary | |
Importer()
|
|
| Method Summary | |
void |
cancel()
Stops the importing progress. |
static java.io.InputStream |
decompress(java.io.InputStream is)
Detects if the InputStream is compressed with Gzip, returns with GZIPInputStream if necessary. |
ConnectionHandler |
getConnectionHandler()
Getter for property connectionHandler. |
java.lang.String |
getConnections()
Deprecated. since 2.2 replaced by getFieldConnections(). |
java.util.ArrayList |
getDuplicateIDs()
Returns the IDs (cd_id column in database table) of duplicate structures. |
int |
getDuplicates()
Returns the number of molecules that were not imported, because they are duplicates. |
int |
getEmptyStructures()
Returns the number of molecules that were not imported, because they are empty strucures. |
boolean |
getEmptyStructuresAllowed()
Gets whether empty structures are allowed. |
java.lang.String |
getErrorMessage()
If error occures this function returns the error message; |
java.lang.String |
getFieldConnections()
Returns the specified table field - file field pairs. |
java.util.Vector |
getFieldNames()
Returns field names in an SDfile. |
static java.util.Vector |
getFieldNames(java.io.InputStream is,
int linesToCheck)
Returns field names in an SDfile. |
IntArray |
getImportedIDs()
Returns the IDs (cd_id column in database table) of imported structures. |
int |
getImportedNumber()
Returns the number of imported molecules. |
java.lang.Object |
getInput()
Gets the source object. |
int |
getLinesToCheck()
Gets the number of lines to check for file format. |
java.lang.String |
getNote()
Returns the note of the progresswriter. |
long |
getProgress()
Gets the status of the importing progress. |
ProgressWriter |
getProgressWriter()
Gets the ProgressWriter object used for monitoring. |
boolean |
getSetChiralFlag()
Gets whether chiral flag is set on import. |
int |
getSkip()
Gets the number of molecules to skip from the beginning ogf file. |
int |
getStructCount()
Returns the current count of structures which were examined by the import process. |
java.lang.String |
getTableName()
Gets the name of the table to import into. |
int |
importMols()
Imports molecules. |
void |
init()
Initialization, checking given number of lines for file format and fields. |
boolean |
isDuplicateImportAllowed()
Gets whether duplicate structures are allowed. |
boolean |
isFinished()
Returns true if importing has finished, else returns false. |
boolean |
isHaltOnError()
Gets if import should stop when an error occures. |
void |
run()
Starts execution as a thread. |
void |
setConnectionHandler(ConnectionHandler conh)
Setter for property connectionHandler. |
void |
setConnections(java.lang.String connections)
Deprecated. since 2.2 replaced by setFieldConnections(String). |
void |
setDuplicateImportAllowed(boolean b)
If set to false does not import molecules
that already exist in the table with the same topology. |
void |
setEmptyStructuresAllowed(boolean b)
If set to false does not import empty molecules. |
void |
setFieldConnections(java.lang.String connections)
Specifies which data fields correspond to which table fieds. |
void |
setHaltOnError(boolean b)
Sets if import should stop when an error occures. |
void |
setInfoStream(java.io.PrintStream st)
Sets the stream where information about the import prorcess will be written (e.g. skipped duplicates and empty structures). |
void |
setInput(java.io.File inputFile)
Sets the source object as a file. |
void |
setInput(java.io.InputStream is)
Sets the source object as a stream. |
void |
setInput(java.lang.String fileName)
Sets the source object as a file, specifying the name of the file. |
void |
setLinesToCheck(int linesToCheck)
Sets the number of lines to check for file format. |
void |
setOutputOptions(boolean printDuplicates,
boolean printNonDuplicates,
java.io.OutputStream os,
boolean doNotImport)
With this option one can print duplicate or non-duplicate molecules to a stream. |
void |
setProgressWriter(ProgressWriter pwriter)
Sets the ProgressWriter
object to track the progress the actual importing.
|
void |
setSetChiralFlag(boolean setChiralFlag)
Sets if chiral flag should be set to true during import. |
void |
setSkip(int skip)
Sets the number of molecules to skip from the beginning ogf file. |
void |
setStoreDuplicates(boolean value)
Specifies whether the ID's of duplicate structures should be stored. |
void |
setStoreImportedIDs(boolean value)
Specifies whether the ID's of imported structures should be stored. |
void |
setTableName(java.lang.String tname)
Sets the name of the table to import into. |
void |
skip(int offset)
Skips the given number of molecules. |
| Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public Importer()
| Method Detail |
public void setConnectionHandler(ConnectionHandler conh)
public ConnectionHandler getConnectionHandler()
public void setInput(java.io.File inputFile)
public void setInput(java.io.InputStream is)
public void setInput(java.lang.String fileName)
public java.lang.Object getInput()
public void setTableName(java.lang.String tname)
public java.lang.String getTableName()
public void setConnections(java.lang.String connections)
setFieldConnections(String).
The fields are given in pair in the following format: "databaseField1=dataField1;databaseField2=dataField2"
null, the fields are automatically connected by
equal names (default).
public void setFieldConnections(java.lang.String connections)
The fields are given in pair in the following format: "databaseField1=dataField1;databaseField2=dataField2"
null, the fields are automatically connected by
equal names (default).
public java.lang.String getConnections()
getFieldConnections().
public java.lang.String getFieldConnections()
public void setLinesToCheck(int linesToCheck)
public int getLinesToCheck()
public void setProgressWriter(ProgressWriter pwriter)
ProgressWriter
object to track the progress the actual importing.
(Format checking and skipping not monitored by this object.)
null if no
monitoring is necessary.
public ProgressWriter getProgressWriter()
public void setHaltOnError(boolean b)
public boolean isHaltOnError()
public void setDuplicateImportAllowed(boolean b)
false does not import molecules
that already exist in the table with the same topology. This checking
may slow down the import progress.
public boolean isDuplicateImportAllowed()
public void setEmptyStructuresAllowed(boolean b)
false does not import empty molecules.
public boolean getEmptyStructuresAllowed()
public void setSetChiralFlag(boolean setChiralFlag)
true during import.
setChiralFlag - if set to true, chiral flag is
set to true for imported molecules.
The default setting is false.
since 2.3public boolean getSetChiralFlag()
public boolean isFinished()
true if importing has finished, else returns false.
public java.lang.String getErrorMessage()
public int getStructCount()
public int getImportedNumber()
public int getDuplicates()
public int getEmptyStructures()
public java.lang.String getNote()
public void setSkip(int skip)
public int getSkip()
public long getProgress()
public void run()
run in interface java.lang.Runnablepublic void setInfoStream(java.io.PrintStream st)
st - the stream.
The default is null (no info is written).
public void setOutputOptions(boolean printDuplicates,
boolean printNonDuplicates,
java.io.OutputStream os,
boolean doNotImport)
public void setStoreDuplicates(boolean value)
public void setStoreImportedIDs(boolean value)
getImportedIDs()public java.util.ArrayList getDuplicateIDs()
public IntArray getImportedIDs()
setStoreImportedIDs(boolean)
public int importMols()
throws TransferException
TransferExceptionpublic void cancel()
public void skip(int offset)
throws TransferException
offset - the number of molecules to be skipped
TransferException
public void init()
throws TransferException
skip or importMols if necessary.
TransferException
public static java.io.InputStream decompress(java.io.InputStream is)
throws java.io.IOException
java.io.IOException
public java.util.Vector getFieldNames()
throws TransferException,
java.io.IOException
int if initialization is necessary.
TransferException
java.io.IOException
public static java.util.Vector getFieldNames(java.io.InputStream is,
int linesToCheck)
throws java.io.IOException,
MRecordParseException
java.io.IOException
MRecordParseException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||