Java



Features & Limitations

Download & Installation

Acquire the dayjava-483.tar.gz or dayjava-491.tar.gz archive.
% gzip -dc dayjava-491.tar.gz | tar xf -
% cd dayjava-491/
% more README
% vi makefile
<uncomment the JAVAC and JFLAGS for your platform >
% make install
% setenv CLASSPATH ".:`pwd`:`pwd`/demo"
OR
% export CLASSPATH=".:`pwd`:`pwd`/demo"

Example Code Compilation & Execution

DayJava
cansmi.java
import java.io.*;
import com.daylight.Smiles;

class cansmi extends Smiles {
    public static void main(String[] args) throws IOException {
        BufferedReader in = new BufferedReader
            (new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(System.out, true);
        String line, smiles;
        int molecule;

        while (null != (line=in.readLine())) {
            if (NULL_OB == (molecule = Smiles.dt_smilin(line))) {
                System.err.println("ERROR: invalid SMILES (" + line + ")");
                continue;
            }
            if (null == (smiles = Smiles.dt_cansmiles(molecule, true))) {
                System.err.println("ERROR: invalid molecule (" + line + ")");
                continue;
            }
            out.println(smiles);
            Smiles.dt_dealloc(molecule);
            Thread.yield();
        }
        out.close();
        in.close();
    }
}
% javac cansmi.java
% echo "OCC" | java cansmi
CCO