org.netbeans.mdr.persistence
Interface MultivaluedOrderedIndex

All Superinterfaces:
Index, MultivaluedIndex
All Known Implementing Classes:
MultivaluedOrderedBtree

public interface MultivaluedOrderedIndex
extends MultivaluedIndex

Representation of non-unique index. Sorted list of values is associated with each key.

Version:
Author:
Pavel Buzek

Method Summary
 void add(java.lang.Object key, int index, java.lang.Object value)
          Inserts the specified element at the specified position in the list of values associated with the specified key.
 java.util.List getItemsOrdered(java.lang.Object key)
          Returns a list view of the values assosiated in the index with specified key.
 java.util.Collection getObjectsOrdered(java.lang.Object key, SinglevaluedIndex repos)
          Like getItemsOrdered, but if the index contains keys, this returns the objects corresponding to the key
 boolean remove(java.lang.Object key, int index)
          Removes the element at the specified position in the list of values associated with the specified key.
 void replace(java.lang.Object key, int index, java.lang.Object element)
          Replaces the element at the specified position in the list of values associated with the specified key with the specified element.
 
Methods inherited from interface org.netbeans.mdr.persistence.MultivaluedIndex
getItems, getObjects, isUnique, queryByKeyPrefix, remove
 
Methods inherited from interface org.netbeans.mdr.persistence.Index
add, getKeyType, getName, getValueType, keySet, remove
 

Method Detail

getItemsOrdered

java.util.List getItemsOrdered(java.lang.Object key)
                               throws StorageException
Returns a list view of the values assosiated in the index with specified key. Returned collection is live and modifiable. If there are no values associated with the key empty collection is returned.

Parameters:
key -
Returns:
Throws:
StorageException

getObjectsOrdered

java.util.Collection getObjectsOrdered(java.lang.Object key,
                                       SinglevaluedIndex repos)
                                       throws StorageException
Like getItemsOrdered, but if the index contains keys, this returns the objects corresponding to the key

Parameters:
key -
Returns:
Throws:
StorageException

add

void add(java.lang.Object key,
         int index,
         java.lang.Object value)
         throws StorageException
Inserts the specified element at the specified position in the list of values associated with the specified key. Throws StorageBadRequestException if the index is out of range.

Parameters:
key -
index -
value -
Throws:
StorageException

remove

boolean remove(java.lang.Object key,
               int index)
               throws StorageException
Removes the element at the specified position in the list of values associated with the specified key.

Parameters:
key -
index -
Returns:
true if this index changed as a result of this call
Throws:
StorageException

replace

void replace(java.lang.Object key,
             int index,
             java.lang.Object element)
             throws StorageException
Replaces the element at the specified position in the list of values associated with the specified key with the specified element. Throws StorageBadRequestException if the index is out of range.

Parameters:
key -
index -
element -
Throws:
StorageException


Copyright © 2005-2012 Apache Software Foundation. All Rights Reserved.