Class MinVisitor.MinResult

    • Constructor Detail

      • MinResult

        public MinResult​(Comparable newMinValue)
    • Method Detail

      • isCompatible

        public boolean isCompatible​(CalcResult targetResults)
        Description copied from interface: CalcResult
        Returns true if the target results is a compatible type with the current results, with compatible meaning that the two results may be merged.
        Specified by:
        isCompatible in interface CalcResult
        isCompatible in class AbstractCalcResult
        targetResults - the second CalcResult Object
        true if the targetResults can be merged with the current results
      • merge

        public CalcResult merge​(CalcResult resultsToAdd)
        Description copied from interface: CalcResult
        Returns the merged results of two CalcResult. The way in which the results are merged is dependent on the type of the results added. A new instance is created containing the merged results.

        For example: merging two min functions would return the smaller of the two values; merging a count and a sum would return an average.

        Specified by:
        merge in interface CalcResult
        merge in class AbstractCalcResult
        the merged results