Comparable Interface in Salesforce - InfallibleTechie
文章推薦指數: 80 %
To add List sorting support for your Apex class, you must implement the Comparable interface with its compareTo method in your class.
PagesHomeAboutMeContactUsComparableInterfaceinSalesforceTheComparableinterfaceaddssortingsupportforListsthatcontainnon-primitivetypes,thatis,Listsofuser-definedtypes.ToaddListsortingsupportforyourApexclass,youmustimplementtheComparableinterfacewithitscompareTomethodinyourclass.WhenaclassimplementstheComparableinterfaceithastoimplementamethodcalledcompareTo().Inthatmethodthecodehastobewrittentodecideiftwoobjectsmatchorifoneislargerthantheother.Formoreinfo,visitthebelowlinkhttp://www.salesforce.com/us/developer/docs/apexcode/Content/apex_comparable.htmSampleCode:Visualforcepage:
延伸文章資訊
- 1Comparable Interface in Salesforce | MST Solutions
Salesforce provides an Interface called Comparable to implement a custom sort order for SObjects ...
- 2Comparable: Sorting Objects in Salesforce - Deadlypenguin
Like most Object Oriented languages, Apex will allow you to make an order List of objects that yo...
- 3Comparable Interface | Apex Reference Guide - Salesforce ...
Comparable Interface. Adds sorting support for Lists that contain non-primitive types, that is, L...
- 4Comparable Interface in Salesforce - InfallibleTechie
To add List sorting support for your Apex class, you must implement the Comparable interface with...
- 5Comparable Interface in Salesforce
To add List sorting support for your Apex class, you must implement the Comparable interface with...