Source code: com/obinary/cms/util/URIStringComparator.java
1 /**
2 *
3 * Magnolia and its source-code is licensed under the LGPL.
4 * You may copy, adapt, and redistribute this file for commercial or non-commercial use.
5 * When copying, adapting, or redistributing this document in keeping with the guidelines above,
6 * you are required to provide proper attribution to obinary.
7 * If you reproduce or distribute the document without making any substantive modifications to its content,
8 * please use the following attribution line:
9 *
10 * Copyright 1993-2003 obinary Ltd. (http://www.obinary.com) All rights reserved.
11 *
12 * */
13
14
15
16
17 package com.obinary.cms.util;
18
19
20 import jdsl.core.ref.ComparableComparator;
21 import com.obinary.cms.core.Container;
22
23
24 /**
25 * Date: Apr 28, 2003
26 * Time: 11:20:59 AM
27 * @author Sameer Charles
28 * @version 1.0
29 */
30
31
32
33 public class URIStringComparator extends ComparableComparator {
34
35
36 public int compare(Object o, Object o1) throws ClassCastException {
37 String URI1 = ((Container)o).getAtom("fromURI").getString();
38 String URI2 = ((Container)o1).getAtom("fromURI").getString();
39 return super.compare(URI1, URI2);
40 }
41
42 public boolean isComparable(Object o) {
43 return true;
44 }
45
46 }