com.miginfocom.calendar.datearea
Class DefaultDateArea.StateOrderComparator

java.lang.Object
  extended by com.miginfocom.calendar.datearea.DefaultDateArea.StateOrderComparator
All Implemented Interfaces:
java.util.Comparator
Enclosing class:
DefaultDateArea

public static class DefaultDateArea.StateOrderComparator
extends java.lang.Object
implements java.util.Comparator

A class that compares ActivityViews and sorts the accoring to states (mouse over, selected). If both activity view's states are same the activity view's natural order will be used.


Constructor Summary
DefaultDateArea.StateOrderComparator(int mouseOverBoost, int selectedBoost)
          Constructor.
 
Method Summary
 int compare(java.lang.Object o1, java.lang.Object o2)
          Accumulates the value for the states set and if the total value of the two objects differ return the difference.
 int getMouseOverBoost()
           
 int getSelectedBoost()
           
 
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

DefaultDateArea.StateOrderComparator

public DefaultDateArea.StateOrderComparator(int mouseOverBoost,
                                            int selectedBoost)
Constructor.

Parameters:
mouseOverBoost - The value to use i the mouse over state is set. Normally 2.
selectedBoost - The value to use i the selected state is set. Normally 1.
Method Detail

getMouseOverBoost

public int getMouseOverBoost()

getSelectedBoost

public int getSelectedBoost()

compare

public int compare(java.lang.Object o1,
                   java.lang.Object o2)
Accumulates the value for the states set and if the total value of the two objects differ return the difference. If they are same, as they would if both are selected or no states are set for example, the natural ordering of the activity views are used.

Specified by:
compare in interface java.util.Comparator
Parameters:
o1 - Activity view 1.
o2 - Activity view 2.
Returns:
A negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.


Copyright © 2009 MiG InfoCom AB. All Rights Reserved.