org.hd.d.pg2k.webSvr.exhibit
Class DataSourceBean.SortByEPCMRecalcUrgency

java.lang.Object
  extended by org.hd.d.pg2k.webSvr.exhibit.DataSourceBean.SortByEPCMRecalcUrgency
All Implemented Interfaces:
java.util.Comparator<Name.ExhibitFull>
Enclosing class:
DataSourceBean

public static final class DataSourceBean.SortByEPCMRecalcUrgency
extends java.lang.Object
implements java.util.Comparator<Name.ExhibitFull>

Sorts first those exhibits whose EPCM recalculation/check is most urgent. Null (uncomputed) values first, then trivially stale, then stale, then ties are broken in a stable way to ensure a total ordering (other than in the case of completely-uncalculated values, where the original ordering is left intact, in part for speed).

This sort may misbehave if underlying EPCM values are recomputed while this works.

Public visibility primarily to allow testing.


Field Summary
private  AllExhibitProperties aep
          AEP that we work with; never null.
 
Constructor Summary
private DataSourceBean.SortByEPCMRecalcUrgency(AllExhibitProperties aep)
          Construct with (non-null) AEP whose EPCM values we will be sorting on the basis of.
 
Method Summary
 int compare(Name.ExhibitFull ex1, Name.ExhibitFull ex2)
          Sort in most-urgent-first 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
 

Field Detail

aep

private final AllExhibitProperties aep
AEP that we work with; never null.

Constructor Detail

DataSourceBean.SortByEPCMRecalcUrgency

private DataSourceBean.SortByEPCMRecalcUrgency(AllExhibitProperties aep)
Construct with (non-null) AEP whose EPCM values we will be sorting on the basis of.

Method Detail

compare

public int compare(Name.ExhibitFull ex1,
                   Name.ExhibitFull ex2)
Sort in most-urgent-first order. Null (uncomputed) values first, then trivially stale, then stale, then ties broken in some reasonably stable way.

Specified by:
compare in interface java.util.Comparator<Name.ExhibitFull>

DHD Multimedia Gallery V1.60.69

Copyright (c) 1996-2012, Damon Hart-Davis. All rights reserved.