Class TableComparator
java.lang.Object
org.eclipse.jface.viewers.ViewerComparator
org.eclipse.ui.views.markers.internal.TableComparator
- All Implemented Interfaces:
Comparator<TableComparator>
-
Field Summary
-
Constructor Summary
ConstructorDescriptionTableComparator
(IField[] properties, int[] defaultPriorities, int[] defaultDirections) TableComparator
(TableComparator other) -
Method Summary
Modifier and TypeMethodDescriptionprotected int
Compare obj1 and obj2 at depth.int
Returns a negative, zero, or positive number depending on whether the first element is less than, equal to, or greater than the second element.int
compare
(TableComparator o1, TableComparator o2) int[]
int[]
int[]
IField[]
int[]
Return the field at the top priority.int
int
protected void
void
restoreState
(IDialogSettings dialogSettings) void
void
saveState
(IDialogSettings dialogSettings) void
setTopPriority
(int priority) void
setTopPriority
(IField property) void
setTopPriorityDirection
(int direction) void
Sorts the given elements in-place, modifying the given array from index start to index end.Methods inherited from class org.eclipse.jface.viewers.ViewerComparator
category, getComparator, isSorterProperty, sort
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Field Details
-
MAX_DEPTH
public static final int MAX_DEPTH- See Also:
-
ASCENDING
public static final int ASCENDING- See Also:
-
DESCENDING
public static final int DESCENDING- See Also:
-
fields
-
priorities
protected int[] priorities -
directions
protected int[] directions -
defaultPriorities
protected int[] defaultPriorities -
defaultDirections
protected int[] defaultDirections -
TAG_DIALOG_SECTION
- See Also:
-
-
Constructor Details
-
TableComparator
-
TableComparator
-
-
Method Details
-
resetState
protected void resetState() -
reverseTopPriority
public void reverseTopPriority() -
setTopPriority
-
setTopPriority
public void setTopPriority(int priority) -
setTopPriorityDirection
public void setTopPriorityDirection(int direction) -
getTopPriorityDirection
public int getTopPriorityDirection() -
getTopPriority
public int getTopPriority() -
getTopField
Return the field at the top priority.- Returns:
- IField
-
getPriorities
public int[] getPriorities() -
getDirections
public int[] getDirections() -
getDefaultPriorities
public int[] getDefaultPriorities() -
getDefaultDirections
public int[] getDefaultDirections() -
compare
Description copied from class:ViewerComparator
Returns a negative, zero, or positive number depending on whether the first element is less than, equal to, or greater than the second element.The default implementation of this method is based on comparing the elements' categories as computed by the
category
framework method. Elements within the same category are further subjected to a case insensitive compare of their label strings, either as computed by the content viewer's label provider, or theirtoString
values in other cases. Subclasses may override.- Overrides:
compare
in classViewerComparator
- Parameters:
viewer
- the viewere1
- the first elemente2
- the second element- Returns:
- a negative number if the first element is less than the
second element; the value
0
if the first element is equal to the second element; and a positive number if the first element is greater than the second element
-
compare
Compare obj1 and obj2 at depth. If continueSearching continue searching below depth to continue the comparison.- Returns:
- int
-
getFields
- Returns:
- IField[] an array of fields
-
compare
- Specified by:
compare
in interfaceComparator<TableComparator>
-
saveState
-
restoreState
-
sort
Sorts the given elements in-place, modifying the given array from index start to index end.
-