compare


Description:

public abstract int compare (Item a, Item b)

Should return a negative integer, zero, or a positive integer if a sorts before b, a sorts with b, or a sorts after b respectively. If two items compare as equal, their order in the sorted source list is undefined.

In order to ensure that the source list behaves as expected, this method must define a partial order on the source list tree; i.e. it must be reflexive, antisymmetric and transitive. Not complying with those requirements could make the program fall into an infinite loop and freeze the user interface.

Should return 0 to allow any pair of items to be sortable via DnD.

Parameters:

a

First item.

b

Second item.

Returns:

A negative integer if a sorts before b, zero if a equals b, or a positive integer if a sorts after b.

Since:

0.3