1 package com.quantum.model;
3 import java.util.Comparator;
7 * This class is used to compare two displayable objects.
11 public class DisplayableComparator implements Comparator {
13 public int compare(Object arg0, Object arg1) {
14 if (arg0 == null && arg1 == null) {
16 } else if (arg0 == null) {
18 } else if (arg1 == null) {
21 return compare((Displayable) arg0, (Displayable) arg1);
30 private int compare(Displayable displayable0, Displayable displayable1) {
31 if (displayable0.getDisplayName() == null && displayable1.getDisplayName() == null) {
33 } else if (displayable0.getDisplayName() == null) {
35 } else if (displayable1.getDisplayName() == null) {
38 return displayable0.getDisplayName().toLowerCase().compareTo(
39 displayable1.getDisplayName().toLowerCase());