# Class SetOperationCornerCases

java.lang.Object
org.apache.datasketches.thetacommon.SetOperationCornerCases

public class SetOperationCornerCases extends Object
Simplifies and speeds up set operations by resolving specific corner cases.

Author:
  Lee Rhodes

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static enum`
`SetOperationCornerCases.AnotbAction`
A not B actions
`static enum`
`SetOperationCornerCases.CornerCase`
List of corner cases
`static enum`
`SetOperationCornerCases.IntersectAction`
Intersection actions
`static enum`
`SetOperationCornerCases.UnionAction`
List of union actions

## Constructor Summary

Constructors
Constructor
Description
`SetOperationCornerCases()`
No argument constructor.

## Method Summary

Modifier and Type
Method
Description
`static int`
`createCornerCaseId(long thetaLongA, int countA, boolean emptyA, long thetaLongB, int countB, boolean emptyB)`
Creates the CornerCase ID
`static int`
`sketchStateId(boolean isEmpty, int numRetained, long thetaLong)`
Returns the sketch state ID

### Methods inherited from class Object

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

## Constructor Details

### SetOperationCornerCases

public SetOperationCornerCases()
No argument constructor.

## Method Details

### createCornerCaseId

public static int createCornerCaseId(long thetaLongA, int countA, boolean emptyA, long thetaLongB, int countB, boolean emptyB)
Creates the CornerCase ID

Parameters:
  `thetaLongA` - the theta of A as a long
  `countA` - the count of A
  `emptyA` - true if A is empty
  `thetaLongB` - the theta of B as a long
  `countB` - the count of B
  `emptyB` - true if B is empty
Returns:
  the Corner Case ID

### sketchStateId

public static int sketchStateId(boolean isEmpty, int numRetained, long thetaLong)
Returns the sketch state ID

Parameters:
  `isEmpty` - true if empty
  `numRetained` - the number of items retained
  `thetaLong` - the value of theta as a long
Returns:
  the sketch state ID