Class RollingColumn

  • Direct Known Subclasses:
    NumberRollingColumn

    public class RollingColumn
    extends Object
    Does a calculation on a rolling basis (e.g. mean for last 20 days)
    • Field Detail

      • column

        protected final Column<?> column
        The column providing the data for the rolling calculation
      • window

        protected final int window
        The size of the rolling window
    • Constructor Detail

      • RollingColumn

        public RollingColumn​(Column<?> column,
                             int window)
        Constructs a rolling column based on calculations on a sliding window of window rows of data from the given column
    • Method Detail

      • generateNewColumnName

        protected String generateNewColumnName​(AggregateFunction<?,​?> function)
        Generates a name for the column based on the name of the original column and the function used in the calculation
      • calc

        public <INCOL extends Column<?>,​OUT> Column<?> calc​(AggregateFunction<INCOL,​OUT> function)
        Performs the calculation and returns a new column containing the results