Package io.deephaven.engine.table.impl
Class ColumnComparatorFactory
java.lang.Object
io.deephaven.engine.table.impl.ColumnComparatorFactory
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncreateComparator
(ColumnSource lcs, ColumnSource rcs) Produce anColumnComparatorFactory.IComparator
specialized for a given left and rightColumnSource
.Produce anColumnComparatorFactory.IComparator
specialized for a given left and rightColumnSource
.
-
Constructor Details
-
ColumnComparatorFactory
public ColumnComparatorFactory()
-
-
Method Details
-
createComparator
public static ColumnComparatorFactory.IComparator createComparator(ColumnSource lcs, ColumnSource rcs) Produce anColumnComparatorFactory.IComparator
specialized for a given left and rightColumnSource
. To do this we look at the underlying types of the column sources (actually we require those underlying types to be the same) and we use this information to call the specific primitive type getter method (whetherElementSource.getDouble(long)
,ElementSource.getLong(long)
and so on). This approach allows us to avoid boxing on these calls. We use a similar approach in order to test the null-ness of a given element. This method is not especially efficient, but (because we are typically not being called from an inner loop), that fact is probably not relevant for performance. The point is that the returned IComparator *is* rather efficient.- Parameters:
lcs
- The left-hand ColumnSource (uses current values)rcs
- The right-hand ColumnSource (uses current values)- Returns:
- An AbstractColumnSource.IComparator designed to compare elements from the two column sources.
-
createComparatorLeftCurrRightPrev
public static ColumnComparatorFactory.IComparator createComparatorLeftCurrRightPrev(ColumnSource lcs, ColumnSource rcs) Produce anColumnComparatorFactory.IComparator
specialized for a given left and rightColumnSource
. To do this we look at the underlying types of the column sources (actually we require those underlying types to be the same) and we use this information to call the specific primitive type getter method (whetherElementSource.getDouble(long)
,ElementSource.getLong(long)
and so on). This approach allows us to avoid boxing on these calls. We use a similar approach in order to test the null-ness of a given element. This method is not especially efficient, but (because we are typically not being called from an inner loop), that fact is probably not relevant for performance. The point is that the returned IComparatorEnhanced *is* rather efficient.- Parameters:
lcs
- The left-hand ColumnSource (uses current values)rcs
- The right-hand ColumnSource (uses previous values)- Returns:
- An AbstractColumnSource.IComparator designed to compare elements from the two column sources.
-