Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 
 public class SC_Sample {
     public static final int T1 = 0;
     public static final int T2 = 1;
 
     int t = 0;
 
     class SampleComparator implements Comparator<SC_Sample> {
        public int compare(SC_Sample arg0SC_Sample arg1) {
            if (arg0.t == arg1.t)
                return 0;
            return -1;
        }
    }
    class SampleComparable implements Comparable<SC_Sample> {
        public int compareTo(SC_Sample arg0) {
            if ( == arg0.t)
                return 0;
            return 1;
        }
    }
    class FPComparator implements Comparable<FPComparator> {
        int i = 0;
        public int compareTo(FPComparator that) {
            return  < that.i ? -1 : ( == that.i) ? 0 : 1;
        }
    }
New to GrepCode? Check out our FAQ X