sort class by several date-fields
===

i have a class "entry" which has several date fields:

1. creationDate (always available)
2. manualSetDate (not always)
3. meetingDate (not always)

Now id like to sort the entries by first meetingdate (to have all entries of a meeting together), then or if not available at one entry by manualSetDate, and if they have the same meeting or if one entry has no manualdate also by the creation date.

the difficulty is that many entries dont have a meeting- or a manualSetDate. so i have iterated all (i hope so) possible combinations like:

Date relevant1; //at the end i compare both relevant dates
Date relevant2;
if e1.creationdate != null && e2.creationdate == null) {relevant2 = e2.creationdate}...
if e1.creationdate == null && e2.creationdate != null) {relevant2 = e2.creationdate}...
...

Which leads to high complexity

**Sort order:**

 1. Meeting Date (if both have one)
 2. ManualSetDate (if both have one)
 3. CreationDate


i traversed all combinations, but it seems to make mistakes...

is there a better way to do the sorting? any ideas?

thanks very much!