org.fusesource.hawtdb.api
Interface SortedIndex<Key,Value>

All Superinterfaces:
Index<Key,Value>, java.lang.Iterable<java.util.Map.Entry<Key,Value>>

public interface SortedIndex<Key,Value>
extends Index<Key,Value>, java.lang.Iterable<java.util.Map.Entry<Key,Value>>

Provides Key/Value storage and retrieval.

Author:
Hiram Chirino

Method Summary
 java.util.Map.Entry<Key,Value> getFirst()
           
 java.util.Map.Entry<Key,Value> getLast()
           
 java.util.Iterator<java.util.Map.Entry<Key,Value>> iterator()
           
 java.util.Iterator<java.util.Map.Entry<Key,Value>> iterator(Key initialKey)
           
 java.util.Iterator<java.util.Map.Entry<Key,Value>> iterator(Predicate<Key> predicate)
           
 void visit(IndexVisitor<Key,Value> visitor)
          Traverses the visitor over the stored entries in this index.
 
Methods inherited from interface org.fusesource.hawtdb.api.Index
clear, containsKey, destroy, get, getIndexLocation, isEmpty, put, putIfAbsent, remove, size
 

Method Detail

iterator

java.util.Iterator<java.util.Map.Entry<Key,Value>> iterator()
Specified by:
iterator in interface java.lang.Iterable<java.util.Map.Entry<Key,Value>>
Returns:
Throws:
java.io.IOException

iterator

java.util.Iterator<java.util.Map.Entry<Key,Value>> iterator(Predicate<Key> predicate)
Returns:
Throws:
java.io.IOException

iterator

java.util.Iterator<java.util.Map.Entry<Key,Value>> iterator(Key initialKey)
Parameters:
initialKey -
Returns:

visit

void visit(IndexVisitor<Key,Value> visitor)
Traverses the visitor over the stored entries in this index. The visitor can control which keys and values are visited.

Parameters:
visitor -

getFirst

java.util.Map.Entry<Key,Value> getFirst()
Returns:
the first key/value pair in the index or null if empty.

getLast

java.util.Map.Entry<Key,Value> getLast()
Returns:
the last key/value pair in the index or null if empty.


Copyright © 2009-2011 FuseSource, Corp.. All Rights Reserved.