APIdia Launch Partner
Top Description Inners Fields Constructors Methods
jdk.jfr.internal.query

pack-priv final Class TableSorter

extends Object
Class Inheritance
Imports
java.math.BigDecimal, java.util.Comparator, java.util.function.Predicate, jdk.jfr.internal.query.Query.OrderElement, .Query.SortOrder

Class responsible for sorting a table according to an ORDER BY statement or a heuristics.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private final Query
private final Table

Constructor Summary

AccessConstructor and Description
public
TableSorter(Table table, Query query)

Method Summary

Modifier and TypeMethod and Description
private Query.SortOrder
public void
sort()

private void
sort(Field field, Query.SortOrder order)

private boolean
private void
private boolean
private void
private void
private boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

queryback to summary
private final Query query
tableback to summary
private final Table table

Constructor Detail

TableSorterback to summary
public TableSorter(Table table, Query query)

Method Detail

determineSortOrderback to summary
private Query.SortOrder determineSortOrder(Field field)
sortback to summary
public void sort()
sortback to summary
private void sort(Field field, Query.SortOrder order)
sortAggregatorsback to summary
private boolean sortAggregators()
sortDefaultback to summary
private void sortDefault()
sortGroupByback to summary
private boolean sortGroupBy()
sortLeftMostback to summary
private void sortLeftMost()
sortOrderByback to summary
private void sortOrderBy()
sortPredicateback to summary
private boolean sortPredicate(Predicate<Field> predicate)
jdk.jfr.internal.query back to summary

private Class TableSorter.ColumnComparator

extends Object
implements Comparator<Row>
Class Inheritance
All Implemented Interfaces
java.util.Comparator
Annotations
@SuppressWarnings:rawtypes, unchecked

Field Summary

Modifier and TypeField and Description
private final int
private final int
private final boolean

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public int
compare(Row rowA, Row rowB)

Implements java.util.Comparator.compare.

Compares its two arguments for order.

private static int
compare(long integral, double fractional)

Implements java.util.Comparator.compare.

Compares its two arguments for order.

private static int
private Query.SortOrder
private static boolean
private static boolean
pack-priv int
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

factorback to summary
private final int factor
indexback to summary
private final int index
lexicalback to summary
private final boolean lexical

Constructor Detail

ColumnComparatorback to summary
public ColumnComparator(Field field, Query.SortOrder order)

Method Detail

compareback to summary
public int compare(Row rowA, Row rowB)

Implements java.util.Comparator.compare.

Doc from java.util.Comparator.compare.

Compares its two arguments for order. Returns a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.

The implementor must ensure that signum(compare(x, y)) == -signum(compare(y, x)) for all x and y. (This implies that compare(x, y) must throw an exception if and only if compare(y, x) throws an exception.)

The implementor must also ensure that the relation is transitive: ((compare(x, y)>0) && (compare(y, z)>0)) implies compare(x, z)>0.

Finally, the implementor must ensure that compare(x, y)==0 implies that signum(compare(x, z))==signum(compare(y, z)) for all z.

Annotations
@Override
compareback to summary
private static int compare(long integral, double fractional)

Implements java.util.Comparator.compare.

Doc from java.util.Comparator.compare.

Compares its two arguments for order. Returns a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.

The implementor must ensure that signum(compare(x, y)) == -signum(compare(y, x)) for all x and y. (This implies that compare(x, y) must throw an exception if and only if compare(y, x) throws an exception.)

The implementor must also ensure that the relation is transitive: ((compare(x, y)>0) && (compare(y, z)>0)) implies compare(x, z)>0.

Finally, the implementor must ensure that compare(x, y)==0 implies that signum(compare(x, z))==signum(compare(y, z)) for all z.

compareObjectsback to summary
private static int compareObjects(Object a, Object b)
determineSortOrderback to summary
private Query.SortOrder determineSortOrder(Field field, Query.SortOrder order)
isFractionalTypeback to summary
private static boolean isFractionalType(Number number)
isIntegralTypeback to summary
private static boolean isIntegralType(Number value)
sortOrderToFactorback to summary
pack-priv int sortOrderToFactor(Query.SortOrder order)