Package org.openrefine.sorting
Class BaseSorter<T>
- java.lang.Object
-
- org.openrefine.sorting.BaseSorter<T>
-
- Type Parameters:
T
- the type of objects to compare
- All Implemented Interfaces:
Serializable
,Comparator<T>
- Direct Known Subclasses:
RecordSorter
,RowSorter
public abstract class BaseSorter<T> extends Object implements Comparator<T>, Serializable
Instantiates a sorting configuration on a particular grid, to allow comparison of rows or records- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
BaseSorter.ComparatorWrapper
-
Field Summary
Fields Modifier and Type Field Description protected List<BaseSorter.ComparatorWrapper>
_comparatorWrappers
protected List<Criterion>
_criteria
protected Criterion.KeyMaker[]
_keyMakers
-
Constructor Summary
Constructors Constructor Description BaseSorter(Grid state, SortingConfig config)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description int
compare(T o1, T o2)
boolean
hasCriteria()
protected abstract Serializable
makeKey(Criterion.KeyMaker keyMaker, Criterion c, T o)
protected Serializable[]
makeKeys(T o)
-
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 Detail
-
_keyMakers
protected Criterion.KeyMaker[] _keyMakers
-
_comparatorWrappers
protected List<BaseSorter.ComparatorWrapper> _comparatorWrappers
-
-
Constructor Detail
-
BaseSorter
public BaseSorter(Grid state, SortingConfig config)
-
-
Method Detail
-
hasCriteria
public boolean hasCriteria()
-
makeKey
protected abstract Serializable makeKey(Criterion.KeyMaker keyMaker, Criterion c, T o)
-
makeKeys
protected Serializable[] makeKeys(T o)
-
compare
public int compare(T o1, T o2)
- Specified by:
compare
in interfaceComparator<T>
-
-