public class CompactStringStorage extends Object implements MasterStringStorage
Note that this implementation treats empty Strings as absent.
Modifier and Type | Class and Description |
---|---|
static class |
CompactStringStorage.Builder
Builder class.
|
Modifier and Type | Method and Description |
---|---|
static CompactStringStorage |
deserialize(ObjectInputStream ois,
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.
|
Class<String> |
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, wait
areAllAbsent
public Class<String> getStoredType()
MasterStorage
getStoredType
in interface MasterStorage<String>
public int size()
MasterStorage
size
in interface MasterStorage<String>
public int getAbsentCount()
MasterStorage
getAbsentCount
in interface MasterStorage<String>
public boolean isPresent(int index) throws IndexOutOfBoundsException
MasterStorage
isPresent
in interface MasterStorage<String>
index
- Structure indextrue
when structure is presentIndexOutOfBoundsException
- when index is less than 0
or greater or equal than MasterStorage.size()
public Optional<String> get(int index)
MasterStorage
get
in interface MasterStorage<String>
index
- Structure indexpublic 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 CompactStringStorage 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.ClassNotFoundException
- propagatedIOException
- propagatedpublic void writeIndirected(ObjectOutputStream oos, SubProgressObserver po) throws IOException
IndirectSerializable
Deserializer
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<MasterStringStorage>
oos
- Stream to write topo
- Observer to track progress; will be closed upon finishingIOException
- delegated from underlying ObjectOutputStream
accesses