/**
 * Copyright (C) 2011 WRML.org <mark@wrml.org>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *         http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.wrml;

import java.util.Date;

/**
 * Simple utility class that provides a clean, consistent syntax for
 * comparisons.
 */
public abstract class Compare {

    public static int twoComparables(Comparable easy, Comparable peasy) {
        return easy.compareTo(peasy);
    }

    public static int twoDates(Date me, Date you) {
        return me.compareTo(you);
    }

    public static int twoDoubles(double me, double you) {
        return Double.compare(me, you);
    }

    public static int twoEnums(Enum me, Enum you) {
        return me.compareTo(you);
    }

    public static int twoFloats(float me, float you) {
        return Float.compare(me, you);
    }

    public static int twoInsensitiveStrings(String jerk, String meanie) {
        return String.CASE_INSENSITIVE_ORDER.compare(jerk, meanie);
    }

    public static int twoInts(int me, int you) {
        return Integer.compare(me, you);
    }

    public static int twoLongs(long me, long you) {
        return Long.compare(me, you);
    }

    public static int twoStrings(String me, String you) {
        return me.compareTo(you);
    }

}

@@ -1,16 +1,15 @@
 /**
-%0D
 %0A * Copyrigh
@@ -43,21 +43,19 @@
 rml.org%3E
-%0D
 %0A *
-%0D
 %0A * Lice
@@ -113,17 +113,16 @@
 cense%22);
-%0D
 %0A * you 
@@ -181,17 +181,16 @@
 License.
-%0D
 %0A * You 
@@ -224,21 +224,19 @@
 cense at
-%0D
 %0A *
-%0D
 %0A *     
@@ -285,13 +285,11 @@
 -2.0
-%0D
 %0A *
-%0D
 %0A * 
@@ -355,17 +355,16 @@
 software
-%0D
 %0A * dist
@@ -424,17 +424,16 @@
 %22 BASIS,
-%0D
 %0A * WITH
@@ -500,17 +500,16 @@
 implied.
-%0D
 %0A * See 
@@ -571,17 +571,16 @@
 ions and
-%0D
 %0A * limi
@@ -609,16 +609,13 @@
 nse.
-%0D
 %0A */
-%0D%0A%0D
+%0A
 %0Apac
@@ -628,19 +628,17 @@
 rg.wrml;
-%0D%0A%0D
+%0A
 %0Aimport 
@@ -656,16 +656,13 @@
 ate;
-%0D%0A%0D
+%0A
 %0A/**
-%0D
 %0A * 
@@ -726,17 +726,16 @@
 ntax for
-%0D
 %0A * comp
@@ -746,14 +746,12 @@
 ons.
-%0D
 %0A */
-%0D
 %0Apub
@@ -778,19 +778,17 @@
 ompare %7B
-%0D%0A%0D
+%0A
 %0A    pub
@@ -853,17 +853,16 @@
 peasy) %7B
-%0D
 %0A       
@@ -891,26 +891,23 @@
 (peasy);
-%0D
 %0A    %7D
-%0D%0A%0D
+%0A
 %0A    pub
@@ -942,33 +942,32 @@
  me, Date you) %7B
-%0D
 %0A        return 
@@ -980,34 +980,31 @@
 pareTo(you);
-%0D
 %0A    %7D
-%0D%0A%0D
+%0A
 %0A    public 
@@ -1045,25 +1045,24 @@
 ouble you) %7B
-%0D
 %0A        ret
@@ -1085,34 +1085,31 @@
 re(me, you);
-%0D
 %0A    %7D
-%0D%0A%0D
+%0A
 %0A    public 
@@ -1144,25 +1144,24 @@
  Enum you) %7B
-%0D
 %0A        ret
@@ -1178,34 +1178,31 @@
 pareTo(you);
-%0D
 %0A    %7D
-%0D%0A%0D
+%0A
 %0A    public 
@@ -1236,33 +1236,32 @@
 me, float you) %7B
-%0D
 %0A        return 
@@ -1279,34 +1279,31 @@
 re(me, you);
-%0D
 %0A    %7D
-%0D%0A%0D
+%0A
 %0A    public 
@@ -1364,17 +1364,16 @@
 eanie) %7B
-%0D
 %0A       
@@ -1432,26 +1432,23 @@
 meanie);
-%0D
 %0A    %7D
-%0D%0A%0D
+%0A
 %0A    pub
@@ -1484,25 +1484,24 @@
 , int you) %7B
-%0D
 %0A        ret
@@ -1516,35 +1516,32 @@
 ger.
-compare(me,
+signum(me -
  you);
-%0D
 %0A    %7D
-%0D%0A%0D
+%0A
 %0A   
@@ -1580,33 +1580,32 @@
  me, long you) %7B
-%0D
 %0A        return 
@@ -1613,35 +1613,32 @@
 ong.
-compare(me,
+signum(me -
  you);
-%0D
 %0A    %7D
-%0D%0A%0D
+%0A
 %0A   
@@ -1691,17 +1691,16 @@
 g you) %7B
-%0D
 %0A       
@@ -1729,18 +1729,14 @@
 ou);
-%0D
 %0A    %7D
-%0D%0A%0D
+%0A
 %0A%7D
-%0D
 %0A

Fix compilation errors in Compare