public final class MasterMoleculeStorageImpl extends Object implements MasterMoleculeStorage
This class is immutable, thread safe and Serializable.
| Constructor and Description |
|---|
MasterMoleculeStorageImpl(CompactStringStorage sources)
Construct over valid sources.
|
MasterMoleculeStorageImpl(CompactStringStorage sources,
String importOptsOrNull)
Construct over valid sources.
|
| Modifier and Type | Method and Description |
|---|---|
static String |
bestEffortConvert(Molecule mol)
Convert Molecule to String multiple formats.
|
static MasterMoleculeStorageImpl |
deserialize(ObjectInputStream ois,
SubProgressObserver po)
Deserialize from an object input stream.
|
Optional<Molecule> |
get(int index)
Get given structure identified with an index.
|
int |
getAbsentCount()
Number of absent structures.
|
Optional<String> |
getSource(int index)
Return given structure source as stored.
|
Class<Molecule> |
getStoredType()
Represented type.
|
boolean |
isPresent(int index)
Check if given entity is present.
|
void |
serialize(ObjectOutputStream oos,
SubProgressObserver po)
Write into serialized format.
|
int |
size()
Number of structures in the storage.
|
String |
toString() |
void |
writeIndirected(ObjectOutputStream oos,
SubProgressObserver po)
Write
Deserializer conform representation. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitareAllAbsentpublic MasterMoleculeStorageImpl(CompactStringStorage sources)
MolImporter.importMol(java.lang.String).sources - Sources to constructpublic MasterMoleculeStorageImpl(CompactStringStorage sources, String importOptsOrNull)
MolImporter.importMol(java.lang.String).sources - Sources to constructimportOptsOrNull - Options to pass to MolImporter.importMol(java.lang.String, java.lang.String).public Class<Molecule> getStoredType()
MasterStoragegetStoredType in interface MasterStorage<Molecule>public int size()
MasterStoragesize in interface MasterStorage<Molecule>public int getAbsentCount()
MasterStoragegetAbsentCount in interface MasterStorage<Molecule>public Optional<Molecule> get(int index)
MasterStorageget in interface MasterStorage<Molecule>index - Structure indexpublic static String bestEffortConvert(Molecule mol)
mol - Molecule to representIllegalArgumentException - When none of the formats were applicablepublic void serialize(ObjectOutputStream oos, SubProgressObserver po) throws IOException
oos - Stream to write topo - Progress observer to track progress. Work units reflect non-skipped stored entities. Will be closed
upon completion.IOException - re-thrownpublic static MasterMoleculeStorageImpl deserialize(ObjectInputStream ois, SubProgressObserver po) throws IOException, ClassNotFoundException
ois - Stream to read frompo - Progress observer to track progress. Work units reflect non-skipped stored entities. Will be closed
upon completion.IOException - propagated from underlying deserializationClassNotFoundException - propagated from underlying deserializationpublic Optional<String> getSource(int index) throws IndexOutOfBoundsException
MasterMoleculeStoragegetSource in interface MasterMoleculeStorageindex - Structure indexIndexOutOfBoundsException - in case of errorpublic boolean isPresent(int index)
throws IndexOutOfBoundsException
MasterStorageisPresent in interface MasterStorage<Molecule>index - Structure indextrue when structure is presentIndexOutOfBoundsException - when index is less than 0 or greater or equal than MasterStorage.size()public void writeIndirected(ObjectOutputStream oos, SubProgressObserver po) throws IOException
IndirectSerializableDeserializer conform representation.
First a Deserializer instance is written to the stream using
ObjectOutputStream.writeObject(java.lang.Object). This instance is capable of deserializing the content
written next.writeIndirected in interface IndirectSerializable<MasterMoleculeStorage>oos - Stream to write topo - Observer to track progress; will be closed upon finishingIOException - delegated from underlying ObjectOutputStream accesses