Class TableComparator
java.lang.Object
org.eclipse.jface.viewers.ViewerComparator
org.eclipse.ui.views.markers.internal.TableComparator
- All Implemented Interfaces:
Comparator<TableComparator>
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionTableComparator(IField[] properties, int[] defaultPriorities, int[] defaultDirections) TableComparator(TableComparator other) -
Method Summary
Modifier and TypeMethodDescriptionprotected intCompare obj1 and obj2 at depth.intReturns a negative, zero, or positive number depending on whether the first element is less than, equal to, or greater than the second element.intcompare(TableComparator o1, TableComparator o2) int[]int[]int[]IField[]int[]Return the field at the top priority.intintprotected voidvoidrestoreState(IDialogSettings dialogSettings) voidvoidsaveState(IDialogSettings dialogSettings) voidsetTopPriority(int priority) voidsetTopPriority(IField property) voidsetTopPriorityDirection(int direction) voidSorts 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, sortMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:ViewerComparatorReturns 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
categoryframework 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 theirtoStringvalues in other cases. Subclasses may override.- Overrides:
comparein 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
0if 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:
comparein interfaceComparator<TableComparator>
-
saveState
-
restoreState
-
sort
Sorts the given elements in-place, modifying the given array from index start to index end.
-