org.hd.d.pg2k.webSvr.exhibit
Class BuiltInFilters.sortByGoodness

java.lang.Object
  extended by org.hd.d.pg2k.webSvr.exhibit.BuiltInFilters.sortByGoodness
All Implemented Interfaces:
java.io.Serializable, ExprIF, SortIF
Enclosing class:
BuiltInFilters

public static final class BuiltInFilters.sortByGoodness
extends java.lang.Object
implements SortIF

Sorts exhibits by (descending) goodness, ie best first. Takes no parameters, so all instances of this class are equal.

Cannot supply all the data needed to recompute a full version, so works with what has already been computed or may force an approximate ("fast") computation.

This permits 'stale' values since forcing full recomputation may be very slow or simply be impossible for some exhibits.

See Also:
Serialized Form

Field Summary
private static int MIN_SIZE_FOR_CONCURRENCY
          Minimum number of values worth attempting to filter in parallel; strictly positive.
private  int nMax
          If positive, is the maximum number of exhibits returned.
 
Constructor Summary
BuiltInFilters.sortByGoodness(int nMax)
          Programmatic constructor.
BuiltInFilters.sortByGoodness(java.lang.String[] args)
          Ignores its arguments.
 
Method Summary
 boolean equals(java.lang.Object obj)
          All instances of this class are identical where their nMax is.
 int hashCode()
          Hash is constant.
 Name.ExhibitFull[] sort(AllExhibitProperties aep, Name.ExhibitFull[] exhibitNames)
          Sorts its arguments in situ by descending goodness.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nMax

private final int nMax
If positive, is the maximum number of exhibits returned.


MIN_SIZE_FOR_CONCURRENCY

private static final int MIN_SIZE_FOR_CONCURRENCY
Minimum number of values worth attempting to filter in parallel; strictly positive. This plays off parallelism overhead vs available concurrency but should not be especially critical an order of magnitude either way.

See Also:
Constant Field Values
Constructor Detail

BuiltInFilters.sortByGoodness

public BuiltInFilters.sortByGoodness(java.lang.String[] args)
Ignores its arguments.


BuiltInFilters.sortByGoodness

public BuiltInFilters.sortByGoodness(int nMax)
Programmatic constructor.

Parameters:
nMax - if positive, is the maximum number of exhibits returned
Method Detail

sort

public Name.ExhibitFull[] sort(AllExhibitProperties aep,
                               Name.ExhibitFull[] exhibitNames)
Sorts its arguments in situ by descending goodness. Ties are broken by full name.

Specified by:
sort in interface SortIF

equals

public boolean equals(java.lang.Object obj)
All instances of this class are identical where their nMax is.

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Hash is constant.

Overrides:
hashCode in class java.lang.Object

DHD Multimedia Gallery V1.53.0

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