org.apache.datasketches.tuple

## Interface SummarySetOperations<S extends Summary>

Type Parameters:
  `S` - type of Summary

All Known Implementing Classes:
  ArrayOfStringsSummarySetOperations, DoubleSummarySetOperations, IntegerSummarySetOperations

    public interface SummarySetOperations<S extends Summary>

This is to provide methods of producing unions and intersections of two Summary objects.

### Method Summary

All Methods Instance Methods Abstract Methods
`S` `intersection(S a, S b)` This is called by the intersection operator when both sketches have the same hash value.
`S` `union(S a, S b)` This is called by the union operator when both sketches have the same hash value.

### Method Detail

#### union

    S union(S a,
            S b)

This is called by the union operator when both sketches have the same hash value.

Caution: Do not modify the input Summary objects. Also do not return them directly, unless they are immutable (most Summary objects are not). For mutable Summary objects, it is important to create a new Summary object with the correct contents to be returned. Do not return null summaries.

Parameters:
  `a` - Summary from sketch A
  `b` - Summary from sketch B
Returns:
  union of Summary A and Summary B

#### intersection

    S intersection(S a,
                   S b)

This is called by the intersection operator when both sketches have the same hash value.

Caution: Do not modify the input Summary objects. Also do not return them directly, unless they are immutable (most Summary objects are not). For mutable Summary objects, it is important to create a new Summary object with the correct contents to be returned. Do not return null summaries.

Parameters:
  `a` - Summary from sketch A
  `b` - Summary from sketch B
Returns:
  intersection of Summary A and Summary B