lapisx.sort
Class SortableArray

java.lang.Object
  extended bylapisx.sort.SortableArray
All Implemented Interfaces:
Sortable

public class SortableArray
extends Object
implements Sortable


Field Summary
protected  Object[] array
           
protected  int n
           
 
Constructor Summary
SortableArray(Object[] array)
           
SortableArray(Object[] array, int n)
           
 
Method Summary
 int compare(Object o1, Object o2)
           
 Object get(int i)
           
 void set(int i, Object o)
           
 int size()
           
 void swap(int i, int j)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

array

protected Object[] array

n

protected int n
Constructor Detail

SortableArray

public SortableArray(Object[] array)

SortableArray

public SortableArray(Object[] array,
                     int n)
Method Detail

get

public Object get(int i)
Specified by:
get in interface Sortable

set

public void set(int i,
                Object o)
Specified by:
set in interface Sortable

size

public int size()
Specified by:
size in interface Sortable

swap

public void swap(int i,
                 int j)
Specified by:
swap in interface Sortable

compare

public int compare(Object o1,
                   Object o2)
Specified by:
compare in interface Sortable