Package org.apache.datasketches.tuple.aninteger

# Class IntegerSummarySetOperations

java.lang.Object
org.apache.datasketches.tuple.aninteger.IntegerSummarySetOperations

All Implemented Interfaces:
  `SummarySetOperations<IntegerSummary>`

public class IntegerSummarySetOperations extends Object implements SummarySetOperations<IntegerSummary>
Methods for defining how unions and intersections of two objects of type IntegerSummary are performed.

Author:
  Lee Rhodes

## Constructor Summary

Constructors
Constructor
Description
`IntegerSummarySetOperations(IntegerSummary.Mode unionSummaryMode, IntegerSummary.Mode intersectionSummaryMode)`
Creates a new instance with two modes

## Method Summary

Modifier and Type
Method
Description
`IntegerSummary`
`intersection(IntegerSummary a, IntegerSummary b)`
This is called by the intersection operator when both sketches have the same hash value.
`IntegerSummary`
`union(IntegerSummary a, IntegerSummary b)`
This is called by the union operator when both sketches have the same hash value.

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### IntegerSummarySetOperations

public IntegerSummarySetOperations(IntegerSummary.Mode unionSummaryMode, IntegerSummary.Mode intersectionSummaryMode)
Creates a new instance with two modes

Parameters:
  `unionSummaryMode` - for unions
  `intersectionSummaryMode` - for intersections

## Method Details

### union

public IntegerSummary union(IntegerSummary a, IntegerSummary b)
Description copied from interface: `SummarySetOperations`
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.

Specified by:
  `union` in interface `SummarySetOperations<IntegerSummary>`
Parameters:
  `a` - Summary from sketch A
  `b` - Summary from sketch B
Returns:
  union of Summary A and Summary B

### intersection

public IntegerSummary intersection(IntegerSummary a, IntegerSummary b)
Description copied from interface: `SummarySetOperations`
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.

Specified by:
  `intersection` in interface `SummarySetOperations<IntegerSummary>`
Parameters:
  `a` - Summary from sketch A
  `b` - Summary from sketch B
Returns:
  intersection of Summary A and Summary B