/** * {@inheritDoc} */ @Override public int compareTo(GroupedLabelsComposite other) { if ((null != exampleLabel) && (null != other.exampleLabel)) { return exampleLabel.compareTo(other.exampleLabel); } else if (null == exampleLabel) { return 1; } else if (null == other.exampleLabel) { return -1; } else { return 0; } }
/** * {@inheritDoc} */ @Override public int compareTo(AbstractStorageLabel<?> other) { int typeCompare = storageLabelType.compareTo(other.getStorageLabelType()); if (0 != typeCompare) { return typeCompare; } else { if (!DateStorageLabel.class.isAssignableFrom(other.getClass())) { return super.compareTo(other); } else { DateStorageLabel otherLabel = (DateStorageLabel) other; return dateValue.compareTo(otherLabel.dateValue); } } }
/** * {@inheritDoc} */ @Override public int compareTo(AbstractStorageLabel<?> other) { int typeCompare = storageLabelType.compareTo(other.getStorageLabelType()); if (0 != typeCompare) { return typeCompare; } else { if (!StringStorageLabel.class.isAssignableFrom(other.getClass())) { return super.compareTo(other); } else { StringStorageLabel otherLabel = (StringStorageLabel) other; return stringValue.compareToIgnoreCase(otherLabel.stringValue); } } }
/** * {@inheritDoc} */ @Override public int compareTo(AbstractStorageLabel<?> other) { int typeCompare = storageLabelType.compareTo(other.getStorageLabelType()); if (0 != typeCompare) { return typeCompare; } else { if (!BooleanStorageLabel.class.isAssignableFrom(other.getClass())) { return super.compareTo(other); } else { BooleanStorageLabel otherLabel = (BooleanStorageLabel) other; return booleanValue.compareTo(otherLabel.booleanValue); } } }
/** * {@inheritDoc} */ @Override public int compareTo(AbstractStorageLabel<?> other) { int typeCompare = storageLabelType.compareTo(other.getStorageLabelType()); if (0 != typeCompare) { return typeCompare; } else { if (!NumberStorageLabel.class.isAssignableFrom(other.getClass())) { return super.compareTo(other); } else { NumberStorageLabel otherLabel = (NumberStorageLabel) other; double res = numberValue.doubleValue() - otherLabel.numberValue.doubleValue(); if (res > 0) { return 1; } else if (res < 0) { return -1; } else { return 0; } } } } }
/** * {@inheritDoc} */ @Override @SuppressWarnings("unchecked") public int compareTo(AbstractStorageLabel<?> other) { int typeCompare = storageLabelType.compareTo(other.getStorageLabelType()); if (0 != typeCompare) { return typeCompare; } else { if (!ObjectStorageLabel.class.isAssignableFrom(other.getClass())) { return super.compareTo(other); } else { ObjectStorageLabel<T> otherLabel = (ObjectStorageLabel<T>) other; return value.compareTo(otherLabel.getValue()); } } } }