Changeset 10783


Ignore:
Timestamp:
2005-10-27T15:23:12+13:00 (19 years ago)
Author:
kjdon
Message:

a few more tests for string comparisons

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl3/src/java/org/greenstone/gsdl3/util/XSLTUtil.java

    r8824 r10783  
    1010public class XSLTUtil {
    1111
     12    /* some tests */
    1213    public static boolean equals(String s1, String s2) {
    1314    return s1.equals(s2);
    1415    }
    15 
     16    public static boolean notEquals(String s1, String s2) {
     17    return !s1.equals(s2);
     18    }
    1619    public static boolean exists(String s1, String s2) {
    1720    return !s1.equals("");
     
    2629    return s1.endsWith(s2);
    2730    }
    28    
     31    public static boolean lessThan(String s1, String s2) {
     32    return (s1.compareTo(s2) < 0);
     33    }
     34    public static boolean lessThanOrEquals(String s1, String s2) {
     35    return (s1.compareTo(s2) <= 0);
     36    }
     37    public static boolean greaterThan(String s1, String s2) {
     38    return (s1.compareTo(s2) > 0);
     39    }
     40    public static boolean greaterThanOrEquals(String s1, String s2) {
     41    return (s1.compareTo(s2) >= 0);
     42    }
     43
     44    /* some preprocessing functions */
    2945    public static String toLower(String orig) {
    3046    return orig.toLowerCase();
Note: See TracChangeset for help on using the changeset viewer.