org.openmobileis.common.util.collection
Class Sort

java.lang.Object
  extended byorg.openmobileis.common.util.collection.Sort

public class Sort
extends java.lang.Object

Title: OpenMobileIS project source
Description: sort algorythms

Since:
JDK 1.1
Version:
1.0.
Author:
Philippe Delrieu

Method Summary
static java.lang.Object[] returnANotInB(java.lang.Object[] A, java.lang.Object[] B, Orderable order)
          Order A and B array and return all element in A that are not in B.
static void shellsort(Array array, Orderable op)
          Sort a CyberArray of Object references according to the ordering specified by the Orderable object instance method compareTo().
static void shellsort(java.lang.Object[] data, Orderable op)
           
static void shellsort(java.util.Vector vec, Orderable op)
          Sort a Vector of Object references according to the ordering specified by the Orderable object instance method compareTo().
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

shellsort

public static void shellsort(java.util.Vector vec,
                             Orderable op)
Sort a Vector of Object references according to the ordering specified by the Orderable object instance method compareTo().

Parameters:
vec - the vector of Objects
op - a reference to an Orderable object instance
Throws:
java.lang.IllegalArgumentException - for null arguments
See Also:
Orderable

shellsort

public static void shellsort(Array array,
                             Orderable op)
Sort a CyberArray of Object references according to the ordering specified by the Orderable object instance method compareTo(). use shellSort

Parameters:
op - a reference to an Orderable object instance
Throws:
java.lang.IllegalArgumentException - for null arguments
See Also:
Orderable

shellsort

public static void shellsort(java.lang.Object[] data,
                             Orderable op)

returnANotInB

public static java.lang.Object[] returnANotInB(java.lang.Object[] A,
                                               java.lang.Object[] B,
                                               Orderable order)
Order A and B array and return all element in A that are not in B. If A is null return null, if B is not return A sorted. Use the order to sort and compare.

Parameters:
A - : element to keep
B - : element to remove.
order - :use to order and compare.
Returns:
all element in A that are not in B.


Copyright 2006 OpenMobileIS. All Rights Reserved.