messif.buckets.index
Interface ModifiableOrderedIndex<C,T>

Type Parameters:
C - the type keys this index is ordered by
T - the type of objects stored in this index
All Superinterfaces:
Addible<T>, Index<T>, ModifiableIndex<T>, OrderedIndex<C,T>
All Known Implementing Classes:
AbstractArrayIndex, AddressStorageIndex, IntStorageIndex, LongStorageIndex, LongStorageMemoryIndex

public interface ModifiableOrderedIndex<C,T>
extends OrderedIndex<C,T>, ModifiableIndex<T>, Addible<T>

Defines a modifiable ordered index interface on objects. This index allows to add objects and remove them using Removable.remove() method of the search results. Index's order is defined by IndexComparator that can be accessed via comparator() method.


Method Summary
 ModifiableSearch<T> search(C key, boolean restrictEqual)
          Returns a search for objects in this index using the internal OrderedIndex.comparator() of this index.
 ModifiableSearch<T> search(C from, C to)
          Returns a search for objects in this index using the internal OrderedIndex.comparator() of this index.
 ModifiableSearch<T> search(C startKey, C from, C to)
          Returns a search for objects in this index using the internal OrderedIndex.comparator() of this index.
 ModifiableSearch<T> search(java.util.Collection<? extends C> keys)
          Returns a search for objects in this index using the internal OrderedIndex.comparator() of this index.
 
Methods inherited from interface messif.buckets.index.OrderedIndex
comparator
 
Methods inherited from interface messif.buckets.index.ModifiableIndex
destroy, finalize, search, search, search, search
 
Methods inherited from interface messif.buckets.index.Index
size
 
Methods inherited from interface messif.buckets.Addible
add
 

Method Detail

search

ModifiableSearch<T> search(C key,
                           boolean restrictEqual)
                           throws java.lang.IllegalStateException
Description copied from interface: OrderedIndex
Returns a search for objects in this index using the internal OrderedIndex.comparator() of this index. If the restrictEqual is true, the search returns only objects that are comparator-equal to key.

Objects are returned in the order defined by this index.

Specified by:
search in interface OrderedIndex<C,T>
Parameters:
key - the key to search for
restrictEqual - if true, the search is restricted only to objects that are comparator-equal to key
Returns:
a search for objects in this index
Throws:
java.lang.IllegalStateException - if there was an error initializing the search on this index

search

ModifiableSearch<T> search(java.util.Collection<? extends C> keys)
                           throws java.lang.IllegalStateException
Description copied from interface: OrderedIndex
Returns a search for objects in this index using the internal OrderedIndex.comparator() of this index. All objects that are comparator-equal to any of the given keys are returned.

Objects are returned in the order defined by this index.

Specified by:
search in interface OrderedIndex<C,T>
Parameters:
keys - the keys to search for
Returns:
a search for objects in this index
Throws:
java.lang.IllegalStateException - if there was an error initializing the search on this index

search

ModifiableSearch<T> search(C from,
                           C to)
                           throws java.lang.IllegalStateException
Description copied from interface: OrderedIndex
Returns a search for objects in this index using the internal OrderedIndex.comparator() of this index. All objects from the interval [from, to] are returned. If a null value is specified as a boundary, that bound is not restricted. That means that search(x, null) will return all objects from this index that are bigger than or equal to x.

Objects are returned in the order defined by this index.

Specified by:
search in interface OrderedIndex<C,T>
Parameters:
from - the lower bound on the searched objects, i.e. objects greater or equal are returned
to - the upper bound on the searched objects, i.e. objects smaller or equal are returned
Returns:
a search for objects in this index
Throws:
java.lang.IllegalStateException - if there was an error initializing the search on this index

search

ModifiableSearch<T> search(C startKey,
                           C from,
                           C to)
                           throws java.lang.IllegalStateException
Description copied from interface: OrderedIndex
Returns a search for objects in this index using the internal OrderedIndex.comparator() of this index. All objects from the interval [from, to] are returned. Search starts at the object nearest to the given startKey. If a null value is specified as a boundary, that bound is not restricted. That means that search(start, x, null) will return all objects from this index that are bigger than or equal to x starting at object with key start.

Objects are returned in the order defined by this index.

Specified by:
search in interface OrderedIndex<C,T>
Parameters:
startKey - the key from which to start the search
from - the lower bound on the searched objects, i.e. objects greater or equal are returned
to - the upper bound on the searched objects, i.e. objects smaller or equal are returned
Returns:
a search for objects in this index
Throws:
java.lang.IllegalStateException - if there was an error initializing the search on this index