org.mmbase.applications.media.filters
Class PreferenceSorter

java.lang.Object
  extended byorg.mmbase.applications.media.filters.Sorter
      extended byorg.mmbase.applications.media.filters.PreferenceSorter
All Implemented Interfaces:
Comparator, Filter
Direct Known Subclasses:
AvailableSorter, ClientFormatSorter, RealSorter.ChannelsSorter, RealSorter.RealFormatSorter, RealSorter.SpeedSorter, ServerFormatSorter

public abstract class PreferenceSorter
extends Sorter

Facilitates implementing Sorter by defining the 'preference' of one object. A preference is just an int. The higher, the better. Only for ease of implementation of descendants.

Author:
Michiel Meeuwissen

Constructor Summary
PreferenceSorter()
           
 
Method Summary
protected  int compareURLComposer(URLComposer o1, URLComposer o2)
          Implement this.
protected abstract  int getPreference(URLComposer o)
          Implement a preference for this URLComposer
 
Methods inherited from class org.mmbase.applications.media.filters.Sorter
compare, configure, filter
 
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

PreferenceSorter

public PreferenceSorter()
Method Detail

getPreference

protected abstract int getPreference(URLComposer o)
Implement a preference for this URLComposer


compareURLComposer

protected final int compareURLComposer(URLComposer o1,
                                       URLComposer o2)
Description copied from class: Sorter
Implement this.

Specified by:
compareURLComposer in class Sorter


MMBase build 1.8.1.20060716