com.miginfocom.util
Class FirstOrLastComparator

java.lang.Object
  extended by com.miginfocom.util.FirstOrLastComparator
All Implemented Interfaces:
java.io.Serializable, java.util.Comparator

public final class FirstOrLastComparator
extends java.lang.Object
implements java.util.Comparator, java.io.Serializable

A comparator that moves one object to the head or tail of the list. All other object will be in the same place.

See Also:
Serialized Form

Constructor Summary
FirstOrLastComparator(java.lang.Object o, boolean toHead)
          Constructor.
 
Method Summary
 int compare(java.lang.Object o1, java.lang.Object o2)
           
 java.lang.Object getObject()
           
 boolean getToHead()
           
 boolean isToHead()
           
 
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

FirstOrLastComparator

public FirstOrLastComparator(java.lang.Object o,
                             boolean toHead)
Constructor.

Parameters:
o - The object to move to first or last postition (head or tail).
toHead - If true o will be moved to
Method Detail

compare

public final int compare(java.lang.Object o1,
                         java.lang.Object o2)
Specified by:
compare in interface java.util.Comparator

getObject

public java.lang.Object getObject()

isToHead

public boolean isToHead()

getToHead

public boolean getToHead()


Copyright © 2009 MiG InfoCom AB. All Rights Reserved.