com.amazon.carbonado.cursor
Interface SortBuffer<S>

All Superinterfaces:
Collection<S>, Iterable<S>
All Known Implementing Classes:
ArraySortBuffer, MergeSortBuffer

public interface SortBuffer<S>
extends Collection<S>

Buffers up Storable instances allowing them to be sorted. Should any method need to throw an undeclared exception, wrap it with an UndeclaredThrowableException.

Author:
Brian S O'Neill
See Also:
SortedCursor

Method Summary
 void close()
          Clear and close buffer.
 void prepare(Comparator<S> comparator)
          Clears buffer and assigns a comparator for sorting.
 void sort()
          Finish sorting buffer.
 
Methods inherited from interface java.util.Collection
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
 

Method Detail

prepare

void prepare(Comparator<S> comparator)
Clears buffer and assigns a comparator for sorting.

Throws:
IllegalArgumentException - if comparator is null

sort

void sort()
          throws FetchException
Finish sorting buffer.

Throws:
IllegalStateException - if prepare was never called
FetchException

close

void close()
           throws FetchException
Clear and close buffer.

Throws:
FetchException


Copyright © 2006-2009 Amazon Technologies, Inc.. All Rights Reserved.