org.ujac.util.table
Class RowComparator

java.lang.Object
  extended by org.ujac.util.table.RowComparator
All Implemented Interfaces:
Comparator

public class RowComparator
extends Object
implements Comparator

Name: RowComparator
Description: Class which compares two rows according to the given compare items.

Author:
lauerc

Constructor Summary
RowComparator(CompareItem[] compareColumns)
          Constructs a RowComparator instance with specific attributes.
 
Method Summary
 int compare(Object a, Object b)
          Compares its two arguments for order.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

RowComparator

public RowComparator(CompareItem[] compareColumns)
Constructs a RowComparator instance with specific attributes.

Parameters:
compareColumns - The column definition for the sort process.
Method Detail

compare

public int compare(Object a,
                   Object b)
            throws ClassCastException
Compares its two arguments for order. Returns a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.

Specified by:
compare in interface Comparator
Parameters:
a - the first object to be compared.
b - the second object to be compared.
Returns:
a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.
Throws:
ClassCastException - if the arguments' types prevent them from being compared by this Comparator.


Copyright © 2003-2004 UJAC.org. All Rights Reserved.