KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mmbase > applications > media > filters > AvailableSorter


1  /*
2  
3 This software is OSI Certified Open Source Software.
4 OSI Certified is a certification mark of the Open Source Initiative.
5  
6 The license (Mozilla version 1.0) can be read at the MMBase site.
7 See http://www.MMBase.org/license
8  
9  */

10
11 package org.mmbase.applications.media.filters;
12
13 import org.mmbase.applications.media.urlcomposers.URLComposer;
14
15 /**
16  * This can sort a list of URLComposers with the available ones on top.
17  * @author Michiel Meeuwissen
18  * @version $Id: AvailableSorter.java,v 1.1 2003/02/05 16:31:36 michiel Exp $
19  */

20 public class AvailableSorter extends PreferenceSorter {
21
22     public AvailableSorter() {
23     }
24     
25     public int getPreference(URLComposer ri) {
26         if (! ri.isAvailable()) {
27             return -1; // very bad choice.
28
} else {
29             return 0;
30         }
31     }
32 }
33
34
Popular Tags