Oracle Data-aware Controls Reference

oracle.dacf.util
Class AbstractSort

java.lang.Object
  extended byoracle.dacf.util.AbstractSort
All Implemented Interfaces:
Sortter
Direct Known Subclasses:
BiDirBubbleSort, BubbleSort, QuickSort

public abstract class AbstractSort
extends java.lang.Object
implements Sortter

The abstract base class for the generic sorting routines. You will need to define a comparison method using the Compare interface and set the comparer before calling sort. If this is not done, then an IllegalArgumentException will be thrown. A default swapper is implemented so that it is not necessary to define an instance of the Swapper interface.

See Also:
Compare, Swapper

Field Summary
protected  Compare comparer
           
protected  Swapper swapper
           
 
Method Summary
 Compare getComparer()
           
 Swapper getSwapper()
           
 void setComparer(Compare comp)
           
 void setSwapper(Swapper swap)
           
abstract  void sort(java.lang.Object[] a)
          Sorts the items.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

comparer

protected Compare comparer

swapper

protected Swapper swapper
Method Detail

sort

public abstract void sort(java.lang.Object[] a)
Sorts the items.

Specified by:
sort in interface Sortter
Parameters:
a - the array of objects to be sorted.
Throws:
java.lang.IllegalArgumentException - if the comparer is not defined

setComparer

public void setComparer(Compare comp)
Specified by:
setComparer in interface Sortter

getComparer

public Compare getComparer()
Specified by:
getComparer in interface Sortter

setSwapper

public void setSwapper(Swapper swap)
Specified by:
setSwapper in interface Sortter

getSwapper

public Swapper getSwapper()
Specified by:
getSwapper in interface Sortter

Oracle Data-aware Controls Reference

 

Copyright © 1997, 2003, Oracle. All rights reserved.