summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Sawicki2011-04-11 16:57:25 (EDT)
committerChris Aniszczyk2011-04-12 09:07:46 (EDT)
commite7ee811bf6a32569ed2a75627b1c0215a84c67c1 (patch)
tree7bda23e4a53e7fce31630f5420959c8a6ac3b31d
parentc37f28095ef7ab6a17c8097cd9e638c48f3cf2e7 (diff)
downloadegit-github-e7ee811bf6a32569ed2a75627b1c0215a84c67c1.zip
egit-github-e7ee811bf6a32569ed2a75627b1c0215a84c67c1.tar.gz
egit-github-e7ee811bf6a32569ed2a75627b1c0215a84c67c1.tar.bz2
Add issue label comparator used for sorting in listsrefs/changes/58/3058/2
Change-Id: Idb584baad24d10ae6c4ca527c9bb9748a75c7532 Signed-off-by: Kevin Sawicki <kevin@github.com> Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
-rw-r--r--org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/LabelComparator.java27
1 files changed, 27 insertions, 0 deletions
diff --git a/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/LabelComparator.java b/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/LabelComparator.java
new file mode 100644
index 0000000..4c6ea99
--- /dev/null
+++ b/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/LabelComparator.java
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2011 GitHub Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Kevin Sawicki (GitHub Inc.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.mylyn.github.internal;
+
+import java.util.Comparator;
+
+/**
+ * Label comparator using case-insensitive name comparisons.
+ */
+public class LabelComparator implements Comparator<Label> {
+
+ /**
+ * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
+ */
+ public int compare(Label label1, Label label2) {
+ return label1.getName().compareToIgnoreCase(label2.getName());
+ }
+
+}