    All Packages  Class Hierarchy  This Package  Previous  Next  Index

# Class jclass.util.JCqsort

    java.lang.Object
       |
       +----jclass.util.JCqsort

public class JCqsort
extends Object

Sorts in descending or ascending order, using string or numeric comparison as applicable.

##

ASCENDING
DESCENDING

##

JCqsort(Vector, JCSortInterface)
  Constructs the JCqsort object.

##

getDirection()
  Gets the current sorting direction
gt(Object, Object, JCSortInterface)
  Returns true if o1 > o2, using String, Number or Date comparisons as appropriate.
lt(Object, Object, JCSortInterface)
  Returns true if o1 < o2, using String, Number or Date comparisons as appropriate.
sort(int)
  Initate ascending sort.
sort(int, int)
  Initates sort.

##

ASCENDING

     public static final int ASCENDING

DESCENDING

     public static final int DESCENDING

##

JCqsort

     public JCqsort(Vector base,
                    JCSortInterface sort_if)

  Constructs the JCqsort object.

  Parameters:
    base - Vector of vectors representing table data
    sort_if - object implementing the sort interface; if non-null, it is called during sorting

##

gt

     public static boolean gt(Object o1,
                              Object o2,
                              JCSortInterface sort_if)

  Returns true if o1 > o2, using String, Number or Date comparisons as appropriate.

  Parameters:
    sort_if - Called if not null, and neither object is null

lt

     public static boolean lt(Object o1,
                              Object o2,
                              JCSortInterface sort_if)

  Returns true if o1 < o2, using String, Number or Date comparisons as appropriate.

  Parameters:
    sort_if - Called if not null, and neither object is null

sort

     public int[] sort(int column)

  Initate ascending sort.

  Returns:
    the new sorted order (element i's value is moved to row i)

getDirection

     public int getDirection()

  Gets the current sorting direction

  See Also:
    sort

sort

     public int[] sort(int column,
                       int direction)

  Initates sort.

  Parameters:
    direction - ASCENDING or DESCENDING
  Returns:
    the new sorted order (element i's value is moved to row i)

    All Packages  Class Hierarchy  This Package  Previous  Next  Index