jklustor-overlap-0.0.2-20140619012940 (ChemAxon)


com.chemaxon.overlap.io
Class CompactStringStorage

Object
  extended by com.chemaxon.overlap.io.CompactStringStorage
All Implemented Interfaces:
MasterStorage<String>, Serializable

public class CompactStringStorage
extends Object
implements MasterStorage<String>, Serializable

Concatenated UTF-8 byte array backed master String storage.

Note that this implementation treats empty Strings as absent.

Author:
Gabor Imre
See Also:
Serialized Form

Nested Class Summary
static class CompactStringStorage.Builder
          Builder class.
 
Constructor Summary
CompactStringStorage(int pagesize, int skips, List<int[]> starts, List<byte[]> pages)
          Construct.
 
Method Summary
static CompactStringStorage deserialize(ObjectInputStream ois, com.chemaxon.calculations.common.SubProgressObserver po)
          Deserialize from an object input stream.
 Optional<String> 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
 

Constructor Detail

CompactStringStorage

CompactStringStorage(int pagesize,
                     int skips,
                     List<int[]> starts,
                     List<byte[]> pages)
Construct.

Parameters:
pagesize - Page size
skips - Number of initial skips
starts - Start positions
pages - Data pages
Method Detail

toString

public String toString()
Overrides:
toString in class Object

size

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

Specified by:
size in interface MasterStorage<String>
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<String>
Returns:
Number of absent structures.

get

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

Specified by:
get in interface MasterStorage<String>
Parameters:
index - Structure index
Returns:
Structure if present

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 CompactStringStorage 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)