Cumulus4j API
(1.1.0)

org.cumulus4j.store.model
Class IndexValue

java.lang.Object
  extended by org.cumulus4j.store.model.IndexValue

public class IndexValue
extends Object

Helper for en- & decoding the decrypted (plain) contents of IndexEntry.indexValue. This byte-array holds references to DataEntry.dataEntryIDs.

Author:
Marco หงุ่ยตระกูล-Schulze - marco at nightlabs dot de

Constructor Summary
IndexValue()
          Create an empty instance of IndexValue.
IndexValue(byte[] indexValueByteArray)
          Create an IndexValue instance from the decrypted (plain) byte-array which is stored in IndexEntry.indexValue.
 
Method Summary
 boolean addDataEntryID(long dataEntryID)
           
 boolean equals(Object obj)
           
 Set<Long> getDataEntryIDs()
          Get dataEntryIDs referencing those DataEntrys which this IndexValue (or more precisely the IndexEntry from which this IndexValue was created) points to.
 int hashCode()
           
 boolean isDataEntryIDsEmpty()
           
 boolean removeDataEntryID(long dataEntryID)
           
 byte[] toByteArray()
          Get a byte-array with all dataEntryIDs.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IndexValue

public IndexValue()
Create an empty instance of IndexValue. This is equivalent to calling IndexValue(byte[]) with a null or an empty argument.


IndexValue

public IndexValue(byte[] indexValueByteArray)
Create an IndexValue instance from the decrypted (plain) byte-array which is stored in IndexEntry.indexValue.

Parameters:
indexValueByteArray - the plain (decrypted) byte-array of IndexEntry.getIndexValue() or null (null is equivalent to an empty byte-array). This byte-array is what is created by toByteArray().
Method Detail

toByteArray

public byte[] toByteArray()
Get a byte-array with all dataEntryIDs. It can be passed to IndexValue(byte[]) later (e.g. after encrypting, persisting, loading & decrypting).

Returns:
a byte-array holding all dataEntryIDs managed by this instance.

getDataEntryIDs

public Set<Long> getDataEntryIDs()
Get dataEntryIDs referencing those DataEntrys which this IndexValue (or more precisely the IndexEntry from which this IndexValue was created) points to.

Returns:
the object-IDs of the DataEntry instances that are referenced by this index entry.

isDataEntryIDsEmpty

public boolean isDataEntryIDsEmpty()

addDataEntryID

public boolean addDataEntryID(long dataEntryID)

removeDataEntryID

public boolean removeDataEntryID(long dataEntryID)

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

Cumulus4j API
(1.1.0)

Copyright © 2013 NightLabs Consulting GmbH. All Rights Reserved.