proper.database
Class JoinComparator

java.lang.Object
  extended by proper.database.JoinComparator
All Implemented Interfaces:
java.util.Comparator

public class JoinComparator
extends java.lang.Object
implements java.util.Comparator

Compares Join instances based on their size member or the join string.

Version:
$Revision: 1.2 $
Author:
fracpete (fracpete at waikato dot ac dot nz)

Constructor Summary
JoinComparator()
          initializes the comparator with the comparison based on the join string
JoinComparator(boolean useSize)
          initializes the comparator with the comparison based either on the join string (false) or on the size (true)
 
Method Summary
 int compare(java.lang.Object o1, java.lang.Object o2)
          compares the given two joins, either on the size or on the join string
 boolean getUseSize()
          returns whether the size is used for comparison or the name
 void setUseSize(boolean value)
          sets whether to use the size for comparison or not
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

JoinComparator

public JoinComparator()
initializes the comparator with the comparison based on the join string


JoinComparator

public JoinComparator(boolean useSize)
initializes the comparator with the comparison based either on the join string (false) or on the size (true)

Parameters:
useSize - whether to use the size for comparison
Method Detail

setUseSize

public void setUseSize(boolean value)
sets whether to use the size for comparison or not


getUseSize

public boolean getUseSize()
returns whether the size is used for comparison or the name


compare

public int compare(java.lang.Object o1,
                   java.lang.Object o2)
compares the given two joins, either on the size or on the join string

Specified by:
compare in interface java.util.Comparator
Parameters:
o1 - the first join to test with
o2 - the second join to test with
See Also:
Comparator.compare(java.lang.Object, java.lang.Object), m_UseSize