Class ColumnComparatorFactory

java.lang.Object
io.deephaven.engine.table.impl.ColumnComparatorFactory

public class ColumnComparatorFactory extends Object
  • Constructor Details

    • ColumnComparatorFactory

      public ColumnComparatorFactory()
  • Method Details

    • createComparator

      public static ColumnComparatorFactory.IComparator createComparator(ColumnSource lcs, ColumnSource rcs)
      Produce an ColumnComparatorFactory.IComparator specialized for a given left and right ColumnSource. 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 (whether ElementSource.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 an ColumnComparatorFactory.IComparator specialized for a given left and right ColumnSource. 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 (whether ElementSource.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.