Package nl.tue.storage.impl
Class CompressedStoreHashSetImpl<K>
- java.lang.Object
-
- nl.tue.storage.impl.CompressedStoreHashSetImpl<K>
-
- All Implemented Interfaces:
CompressedHashSet<K>
- Direct Known Subclasses:
CompressedStoreHashSetImpl.Int32G,CompressedStoreHashSetImpl.Int4G,CompressedStoreHashSetImpl.Int8G,CompressedStoreHashSetImpl.IntCustomAlignment,CompressedStoreHashSetImpl.Long
public abstract class CompressedStoreHashSetImpl<K> extends java.lang.Object implements CompressedHashSet<K>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCompressedStoreHashSetImpl.Int32G<K>static classCompressedStoreHashSetImpl.Int4G<K>static classCompressedStoreHashSetImpl.Int8G<K>static classCompressedStoreHashSetImpl.IntCustomAlignment<K>static classCompressedStoreHashSetImpl.Long<K>static classCompressedStoreHashSetImpl.Result<K>
-
Constructor Summary
Constructors Constructor Description CompressedStoreHashSetImpl(nl.tue.storage.impl.AbstractBackedHashSet<K> backingSet)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CompressedStoreHashSetImpl.Result<K>add(K val)Returns the index of the given object in the backing store.longcontains(K val)The contains method is not synchronized.CompressedStore<K>getBackingStore()Returns the CompressedStore used by this Set.longgetMemory()returns the memory use of the backing store plus the size of the backingSet.KgetObject(long l)Return the original object stored at index l in the backing storage.voidremoveAll()clears the storage space and removes all elements in the backing set.intsize()return the number of objects stored in this set
-
-
-
Constructor Detail
-
CompressedStoreHashSetImpl
public CompressedStoreHashSetImpl(nl.tue.storage.impl.AbstractBackedHashSet<K> backingSet)
-
-
Method Detail
-
add
public CompressedStoreHashSetImpl.Result<K> add(K val) throws StorageException
Description copied from interface:CompressedHashSetReturns the index of the given object in the backing store. If the object existed before the call to add, a negative index is returned, otherwise a positive index is returned.- Specified by:
addin interfaceCompressedHashSet<K>- Returns:
- Throws:
StorageException
-
contains
public long contains(K val) throws StorageException
The contains method is not synchronized. It may therefore produce false negatives, i.e. it may say that an object is not in the storage, while the object is already scheduled for storage. Therefore, any calls to contains that require a true answer should synchronize on this object.- Specified by:
containsin interfaceCompressedHashSet<K>- Returns:
- Throws:
StorageException
-
getMemory
public long getMemory()
Description copied from interface:CompressedHashSetreturns the memory use of the backing store plus the size of the backingSet.- Specified by:
getMemoryin interfaceCompressedHashSet<K>- Returns:
-
getObject
public K getObject(long l) throws StorageException
Description copied from interface:CompressedHashSetReturn the original object stored at index l in the backing storage.- Specified by:
getObjectin interfaceCompressedHashSet<K>- Returns:
- Throws:
StorageException
-
getBackingStore
public CompressedStore<K> getBackingStore()
Description copied from interface:CompressedHashSetReturns the CompressedStore used by this Set.- Specified by:
getBackingStorein interfaceCompressedHashSet<K>- Returns:
-
size
public int size()
Description copied from interface:CompressedHashSetreturn the number of objects stored in this set- Specified by:
sizein interfaceCompressedHashSet<K>- Returns:
-
removeAll
public void removeAll()
clears the storage space and removes all elements in the backing set.- Specified by:
removeAllin interfaceCompressedHashSet<K>
-
-