|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.unister.semweb.drums.bucket.Bucket<Data>
Data - an implementation of AbstractKVStorable, e.g. GeneralStorablepublic class Bucket<Data extends AbstractKVStorable>
An instance of this class is a container of AbstractKVStorables.
| Field Summary | |
|---|---|
int |
elementsInBucket
the number of elements in this bucket. |
| Constructor Summary | |
|---|---|
Bucket(int bucketId,
DRUMSParameterSet<Data> gp)
Constructor. |
|
| Method Summary | |
|---|---|
boolean |
add(AbstractKVStorable toAdd)
Adds one AbstractKVStorable-object. |
boolean |
contains(Data element)
|
int |
freeMemory()
This method frees the allocated memory. |
Data[] |
getBackend()
Returns the in backend stored AbstractKVStorables. |
int |
getBucketId()
|
long |
getCreationTime()
|
java.nio.ByteBuffer |
getElementAt(int index)
|
Bucket<Data> |
getEmptyBucketWithSameProperties()
returns a new empty Bucket with the same properties of this bucket |
int |
size()
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public int elementsInBucket
| Constructor Detail |
|---|
public Bucket(int bucketId,
DRUMSParameterSet<Data> gp)
Bucket and the maximum size of the Bucket.
bucketId - the identification number of this bucket. Used in BucketContainer and other classesgp - a pointer to the DRUMSParameterSet| Method Detail |
|---|
public Bucket<Data> getEmptyBucketWithSameProperties()
throws FileLockException,
java.io.IOException
Bucket with the same bucketId
java.io.IOException
FileLockExceptionpublic int getBucketId()
BucketContainer)public boolean add(AbstractKVStorable toAdd)
AbstractKVStorable-object. This method have to be synchronized, because it is possible to access
the backend in the same moment with the function getBackend().
toAdd - the Data to add
public boolean contains(Data element)
element - the element to look for
public java.nio.ByteBuffer getElementAt(int index)
index - the index of the element in the bucket
public Data[] getBackend()
backend stored AbstractKVStorables. First it rebuilds all objects from their
byte-arrays and then sorts them.
AbstractKVStorable[] all AbstractKVStorables ascending sortedpublic int size()
public int freeMemory()
public long getCreationTime()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||