org.jboss.cache.eviction
Class ElementSizeQueue.MaxElementComparator

java.lang.Object
  extended by org.jboss.cache.eviction.ElementSizeQueue.MaxElementComparator
All Implemented Interfaces:
Comparator<NodeEntry>
Enclosing class:
ElementSizeQueue

protected static class ElementSizeQueue.MaxElementComparator
extends Object
implements Comparator<NodeEntry>

Comparator class for Max Elements.

This class will sort the eviction queue in the correct eviction order. The top of the list should evict before the bottom of the list.

The sort is based on descending order of numElements.

Note: this class has a natural ordering that is inconsistent with equals as defined by the java.lang.Comparator contract.


Constructor Summary
protected ElementSizeQueue.MaxElementComparator()
           
 
Method Summary
 int compare(NodeEntry ne1, NodeEntry ne2)
           
 
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

ElementSizeQueue.MaxElementComparator

protected ElementSizeQueue.MaxElementComparator()
Method Detail

compare

public int compare(NodeEntry ne1,
                   NodeEntry ne2)
Specified by:
compare in interface Comparator<NodeEntry>


Copyright © 2009 JBoss, a division of Red Hat. All Rights Reserved.