Skip to main content
summaryrefslogtreecommitdiffstats
blob: 4cef28272b2e3ddee0620c79524574894680830c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package org.eclipse.linuxtools.rpm.ui.editor.parser;

import java.util.Comparator;

public class SourceComparator implements Comparator {
	public int compare(Object arg0, Object arg1) {
		SpecfileSource source0 = (SpecfileSource) arg0;
		SpecfileSource source1 = (SpecfileSource) arg1;
		if (source0 == null)
			return -1;
		if (source1 == null)
			return 1;
		if (source0.getNumber() < source1.getNumber())
			return -1;
		else if (source0.getNumber() == source1.getNumber())
			return 0;
		else
			return 1;
	}
}

Back to the top