public final class ContainsInComparator extends Object implements Comparator<ClonePart>
Comparator
,
however it allows to use SortedListsUtils
for efficient filtering.Modifier and Type | Field and Description |
---|---|
static Comparator<ClonePart> |
CLONEPART_COMPARATOR
Defines order by resourceId and by unitStart.
|
static Comparator<ClonePart> |
RESOURCE_ID_COMPARATOR
Defines order by resourceId.
|
Constructor and Description |
---|
ContainsInComparator(int l1,
int l2)
Constructs new comparator for two parts with lengths
l1 and l2 respectively. |
Modifier and Type | Method and Description |
---|---|
int |
compare(ClonePart part1,
ClonePart part2)
Compares two parts on inclusion.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
equals
public static final Comparator<ClonePart> RESOURCE_ID_COMPARATOR
public static final Comparator<ClonePart> CLONEPART_COMPARATOR
public ContainsInComparator(int l1, int l2)
l1
and l2
respectively.public int compare(ClonePart part1, ClonePart part2)
(part1.resourceId == part2.resourceId) && (part1.unitStart <= part2.unitStart) && (part2.unitEnd <= part1.unitEnd)
.compare
in interface Comparator<ClonePart>
Copyright © 2009-2012 SonarSource. All Rights Reserved.