diff options
| author | Kevin Sawicki | 2011-04-11 20:57:25 +0000 |
|---|---|---|
| committer | Chris Aniszczyk | 2011-04-12 13:07:46 +0000 |
| commit | e7ee811bf6a32569ed2a75627b1c0215a84c67c1 (patch) | |
| tree | 7bda23e4a53e7fce31630f5420959c8a6ac3b31d | |
| parent | c37f28095ef7ab6a17c8097cd9e638c48f3cf2e7 (diff) | |
| download | egit-github-e7ee811bf6a32569ed2a75627b1c0215a84c67c1.tar.gz egit-github-e7ee811bf6a32569ed2a75627b1c0215a84c67c1.tar.xz egit-github-e7ee811bf6a32569ed2a75627b1c0215a84c67c1.zip | |
Add issue label comparator used for sorting in lists
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.java | 27 |
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 00000000..4c6ea991 --- /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()); + } + +} |
