package com.onaro.sanscreen.client.view.tabular.value; import com.onaro.sanscreen.client.view.tabular.NumberColumn; /** * Sum the number values in a {@link NumberColumn} for the rows in a group. Multiple values that * are equal in terms of {@link NumberValue#equals(Object)} and {@link NumberValue#hashCode()} * are summed only once. *

If all children of a group are equal (not in value, but when testing the equals and hashcode methods), * then one of the values becomes the summary. *

If any of the children isn't a {@link NumberValue}, the summary will be empty. *

Usage example: Summing the capacity of volumes in a group where the capacicty value is * identified by the volume name. */ public class SumUniqueNumberColumnSummarizer extends ConditionalSumUniqueNumberColumnSummarizer { /** * Initialize a summarizer for the given column. * @param column the column to put the sum in */ public SumUniqueNumberColumnSummarizer(int column) { this(column, "default"); //$NON-NLS-1$ } /** * Initialize a summarizer for the given column. * @param column the column to put the sum in */ public SumUniqueNumberColumnSummarizer(int column, String format) { super(null, column, format); } }