Created
April 8, 2018 04:45
-
-
Save Sunil02kumar/0c67923332148a417e820c8fb0d7e408 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SK_sortUtilityTestWrapper implements Comparable{ | |
public string category{get;set;} | |
public decimal count{get;set;} | |
public SK_sortUtilityTestWrapper(string ss,decimal sk){ | |
this.category=ss; | |
this.count=sk; | |
} | |
// Compare wrapper based on the count value. | |
public Integer compareTo(Object compareTo) { | |
// type cast object to wrapper | |
SK_sortUtilityTestWrapper recs = (SK_sortUtilityTestWrapper)compareTo; | |
// The return value of 0 indicates that both elements are equal. | |
Integer returnValue = 0; | |
if (count > recs.count) { | |
// Set return value to a positive value. | |
returnValue = 1; | |
} else if (count < recs.count) { | |
// Set return value to a negative value. | |
returnValue = -1; | |
} | |
return returnValue; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment