jklustor-overlap-0.0.2-20140619012940 (ChemAxon)


com.chemaxon.overlap.io
Class MasterMoleculeStorage

Object
  extended by com.chemaxon.overlap.io.MasterMoleculeStorage
All Implemented Interfaces:
MasterStorage<chemaxon.struc.Molecule>, Serializable

public final class MasterMoleculeStorage
extends Object
implements MasterStorage<chemaxon.struc.Molecule>, Serializable

Master molecule storage is a space efficient storage for Molecules.

This class is immutable, thread safe and Serializable.

Author:
Gabor Imre
See Also:
Serialized Form

Field Summary
(package private) static String[] FORMATS
          Formats to try to represent structure.
 
Constructor Summary
MasterMoleculeStorage(CompactStringStorage sources)
          Construct over valid sources
 
Method Summary
static String bestEffortConvert(chemaxon.struc.Molecule mol)
          Convert Molecule to String multiple formats.
static MasterMoleculeStorage deserialize(ObjectInputStream ois, com.chemaxon.calculations.common.SubProgressObserver po)
          Deserialize from an object input stream.
 Optional<chemaxon.struc.Molecule> get(int index)
          Get given structure identified with an index.
 int getAbsentCount()
          Number of absent structures.
 void serialize(ObjectOutputStream oos, com.chemaxon.calculations.common.SubProgressObserver po)
          Write into serialized format.
 int size()
          Number of structures in the storage.
 String toString()
           
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

FORMATS

static final String[] FORMATS
Formats to try to represent structure.

Constructor Detail

MasterMoleculeStorage

MasterMoleculeStorage(CompactStringStorage sources)
Construct over valid sources

Parameters:
sources - Sources to construct
Method Detail

size

public int size()
Description copied from interface: MasterStorage
Number of structures in the storage.

Specified by:
size in interface MasterStorage<chemaxon.struc.Molecule>
Returns:
Number of structures in the storage

getAbsentCount

public int getAbsentCount()
Description copied from interface: MasterStorage
Number of absent structures.

Specified by:
getAbsentCount in interface MasterStorage<chemaxon.struc.Molecule>
Returns:
Number of absent structures.

get

public Optional<chemaxon.struc.Molecule> get(int index)
Description copied from interface: MasterStorage
Get given structure identified with an index.

Specified by:
get in interface MasterStorage<chemaxon.struc.Molecule>
Parameters:
index - Structure index
Returns:
Structure if present

bestEffortConvert

public static String bestEffortConvert(chemaxon.struc.Molecule mol)
Convert Molecule to String multiple formats.

Parameters:
mol - Molecule to represent
Returns:
First format structure possible to represent

toString

public String toString()
Overrides:
toString in class Object

serialize

public void serialize(ObjectOutputStream oos,
                      com.chemaxon.calculations.common.SubProgressObserver po)
               throws IOException
Write into serialized format.

Parameters:
oos - Stream to write to
po - Progress observer to track progress. Work units reflect non-skipped stored entities. Will be closed upon completion.
Throws:
IOException - re-thrown

deserialize

public static MasterMoleculeStorage deserialize(ObjectInputStream ois,
                                                com.chemaxon.calculations.common.SubProgressObserver po)
                                         throws IOException,
                                                ClassNotFoundException
Deserialize from an object input stream.

Parameters:
ois - Stream to read from
po - Progress observer to track progress. Work units reflect non-skipped stored entities. Will be closed upon completion.
Returns:
deserialized instance
Throws:
IOException
ClassNotFoundException

jklustor-overlap-0.0.2-20140619012940 (ChemAxon)