Skip to content

SortableAccount

albarivas edited this page Nov 30, 2021 · 8 revisions

layout: default

SortableAccount class

Wrapper class around Account that provides an implementation of Comparable based on the ShippingCountry field and an 'in place' sort method.


Constructors

SortableAccount(Account account)


Properties

accountAccount


Methods

compareTo(Object otherObject)Integer

compares accounts based on ShippingCountry

Parameters

Param Description
otherObject object used for comparision with this instance

Return

Type

Integer

Description

s 0 if objects are equal, 1 this object is "greater" than otherObject or 2 otherwise.

sort(List<Account> accounts)void

sorts a list of Account records using SortableAccount.compareTo

Parameters

Param Description
accounts list of account to sort

Inner Classes

SortableAccount.SortException class

Exception thrown when SortableAccount.compareTo fails


Clone this wiki locally