com.amazon.carbonado.cursor
Class ArraySortBuffer<S>

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.ArrayList<S>
              extended by com.amazon.carbonado.cursor.ArraySortBuffer<S>
All Implemented Interfaces:
SortBuffer<S>, Serializable, Cloneable, Iterable<S>, Collection<S>, List<S>, RandomAccess

public class ArraySortBuffer<S>
extends ArrayList<S>
implements SortBuffer<S>

Sort buffer implementation backed by an ArrayList.

Author:
Brian S O'Neill
See Also:
SortedCursor, Serialized Form

Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
ArraySortBuffer()
           
ArraySortBuffer(int initialCapacity)
           
 
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 class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, removeRange, set, size, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
equals, hashCode, iterator, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, removeAll, retainAll, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Collection
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList
 

Constructor Detail

ArraySortBuffer

public ArraySortBuffer()

ArraySortBuffer

public ArraySortBuffer(int initialCapacity)
Method Detail

prepare

public void prepare(Comparator<S> comparator)
Description copied from interface: SortBuffer
Clears buffer and assigns a comparator for sorting.

Specified by:
prepare in interface SortBuffer<S>

sort

public void sort()
Description copied from interface: SortBuffer
Finish sorting buffer.

Specified by:
sort in interface SortBuffer<S>

close

public void close()
Description copied from interface: SortBuffer
Clear and close buffer.

Specified by:
close in interface SortBuffer<S>


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