org.netbeans.mdr.persistence.btreeimpl.btreeindex
Class MultivaluedOrderedBtree

java.lang.Object
  extended byorg.netbeans.mdr.persistence.btreeimpl.btreeindex.Btree
      extended byorg.netbeans.mdr.persistence.btreeimpl.btreeindex.MultivaluedBtree
          extended byorg.netbeans.mdr.persistence.btreeimpl.btreeindex.MultivaluedOrderedBtree
All Implemented Interfaces:
Index, MultivaluedIndex, MultivaluedOrderedIndex, StorageClient, Streamable

public class MultivaluedOrderedBtree
extends MultivaluedBtree
implements MultivaluedOrderedIndex

Btree implementation of the MultivaluedOrderedIndex interface.

Version:
1.0
Author:
Dana Bergen

Field Summary
 
Fields inherited from class org.netbeans.mdr.persistence.btreeimpl.btreeindex.Btree
dataInfo, dataLength, dataType, hasBigKeys, keyInfo, keyType, name, pageIdLength, pageSize, pageSource, rootPageId, storage, uniqueKeys, uniqueValues
 
Constructor Summary
MultivaluedOrderedBtree()
           
MultivaluedOrderedBtree(java.lang.String name, Storage.EntryType keyType, Storage.EntryType dataType, boolean uniqueValues, BtreePageSource pageSource)
           
 
Method Summary
 void add(java.lang.Object key, int index, java.lang.Object data)
          Inserts the specified element at the specified position in the list of values associated with the specified key.
 void add(java.lang.Object key, java.lang.Object data)
          Add an item to the end of the list of values for this key.
 java.util.List getItemsOrdered(java.lang.Object key)
          Returns a list view of the values associated 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 data)
          Replaces the element at the specified position in the list of values associated with the specified key with the specified element.
 
Methods inherited from class org.netbeans.mdr.persistence.btreeimpl.btreeindex.MultivaluedBtree
getItems, getObjects, init, isUnique, queryByKeyPrefix, remove, remove, updateKeyModCount
 
Methods inherited from class org.netbeans.mdr.persistence.btreeimpl.btreeindex.Btree
beginRead, beginWrite, btreePut, consistencyCheck, dumpTree, endRead, endWrite, getKeyType, getName, getValueType, keySet, pageFactory, read, setStorage, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.netbeans.mdr.persistence.MultivaluedIndex
getItems, getObjects, isUnique, queryByKeyPrefix, remove
 
Methods inherited from interface org.netbeans.mdr.persistence.Index
getKeyType, getName, getValueType, keySet, remove
 

Constructor Detail

MultivaluedOrderedBtree

public MultivaluedOrderedBtree(java.lang.String name,
                               Storage.EntryType keyType,
                               Storage.EntryType dataType,
                               boolean uniqueValues,
                               BtreePageSource pageSource)
                        throws StorageException

MultivaluedOrderedBtree

public MultivaluedOrderedBtree()
Method Detail

getItemsOrdered

public java.util.List getItemsOrdered(java.lang.Object key)
                               throws StorageException
Returns a list view of the values associated in the index with specified key. Returned collection is read only and may not be modified. If there are no values associated with the key empty collection is returned.

Specified by:
getItemsOrdered in interface MultivaluedOrderedIndex
Parameters:
key -
Returns:
Throws:
StorageException

getObjectsOrdered

public 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

Specified by:
getObjectsOrdered in interface MultivaluedOrderedIndex
Parameters:
key -
Returns:
Throws:
StorageException

add

public void add(java.lang.Object key,
                int index,
                java.lang.Object data)
         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.

Specified by:
add in interface MultivaluedOrderedIndex
Parameters:
key -
index -
data -
Throws:
StorageException

add

public void add(java.lang.Object key,
                java.lang.Object data)
         throws StorageException
Add an item to the end of the list of values for this key.

Specified by:
add in interface Index
Overrides:
add in class MultivaluedBtree
Parameters:
key -
Throws:
StorageException

remove

public 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.

Specified by:
remove in interface MultivaluedOrderedIndex
Parameters:
key -
index -
Returns:
true if this index changed as a result of this call
Throws:
StorageException

replace

public void replace(java.lang.Object key,
                    int index,
                    java.lang.Object data)
             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.

Specified by:
replace in interface MultivaluedOrderedIndex
Parameters:
key -
index -
data -
Throws:
StorageException


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