org.netbeans.mdr.persistence
Interface MultivaluedIndex

All Superinterfaces:
Index
All Known Subinterfaces:
MultivaluedOrderedIndex
All Known Implementing Classes:
MultivaluedBtree, MultivaluedOrderedBtree

public interface MultivaluedIndex
extends Index

Version:
Author:
Pavel Buzek

Method Summary
 java.util.Collection getItems(java.lang.Object key)
          Returns a collection view of the values associated in the index with specified key.
 java.util.Collection getObjects(java.lang.Object key, SinglevaluedIndex repos)
          Like getItems, but if the index contains keys, this returns the objects corresponding to the key
 boolean isUnique()
          If true, the collection of values is contrained to hold no more than one of any value.
 java.util.Collection queryByKeyPrefix(java.lang.Object prefix, SinglevaluedIndex repos)
          Returns a collection of Map.Entry key-value pairs in the index, where key matches the queried prefix.
 boolean remove(java.lang.Object key, java.lang.Object value)
          Removes the first occurrence of the specified element in the list of values associated with the specified key.
 
Methods inherited from interface org.netbeans.mdr.persistence.Index
add, getKeyType, getName, getValueType, keySet, remove
 

Method Detail

getItems

java.util.Collection getItems(java.lang.Object key)
                              throws StorageException
Returns a collection view of the values associated 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

getObjects

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

Parameters:
key -
Returns:
Throws:
StorageException

isUnique

boolean isUnique()
                 throws StorageException
If true, the collection of values is contrained to hold no more than one of any value.

Parameters:
key -
repos - where to fetch objects from
Returns:
Throws:
StorageException

remove

boolean remove(java.lang.Object key,
               java.lang.Object value)
               throws StorageException
Removes the first occurrence of the specified element in the list of values associated with the specified key.

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

queryByKeyPrefix

java.util.Collection queryByKeyPrefix(java.lang.Object prefix,
                                      SinglevaluedIndex repos)
                                      throws StorageException
Returns a collection of Map.Entry key-value pairs in the index, where key matches the queried prefix. Values are live and modifiable collection, as in case of getObjects(java.lang.Object, org.netbeans.mdr.persistence.SinglevaluedIndex) method.

Parameters:
prefix - queried prefix
repos - primary index
Returns:
Throws:
StorageException
java.lang.UnsupportedOperationException - thrown if the index does not support quries on prefixes (due to unsuitable key entry type, etc.)


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