org.apache.datasketches.common

## Enum Family

- java.lang.Object
- - java.lang.Enum<Family>
  - - org.apache.datasketches.common.Family

All Implemented Interfaces:
  Serializable, Comparable<Family>

    public enum Family
    extends Enum<Family>

Defines the various families of sketch and set operation classes. A family defines a set of classes that share fundamental algorithms and behaviors. The classes within a family may still differ by how they are stored and accessed. For example, internally there are separate classes for the QuickSelect sketch algorithm that operate on the Java heap and off-heap. Not all of these families have parallel forms on and off-heap but are included for completeness.

Author:
  Lee Rhodes

### Enum Constant Summary

Enum Constants
Enum Constant and Description
`A_NOT_B` The A and not B family is an operation for the Theta Sketch Framework of sketches.
`ALPHA` The Alpha Sketch family is a member of the Theta Sketch Framework of sketches and is best suited for real-time processes where both the updating of the sketch and getting the estimate is performed directly on the sketch.
`BLOOMFILTER` Bloom Filter
`COMPACT` The Compact Sketch family is a member of the Theta Sketch Framework of sketches.
`COUNTMIN` CountMin Sketch
`CPC` Compressed Probabilistic Counting (CPC) Sketch
`EBPPS` Exact and Bounded, Probability Proportional to Size (EBPPS)
`FREQUENCY` The Frequency family of sketches.
`HLL` The HLL family of sketches.
`INTERSECTION` The Intersection family is an operation for the Theta Sketch Framework of sketches.
`KLL` KLL quantiles sketch
`QUANTILES` The Quantiles family of sketches.
`QUICKSELECT` The QuickSelect Sketch family is a member of the Theta Sketch Framework of sketches and is the workhorse of the Theta Sketch Families and can be constructed for either on-heap or off-heap operation.
`REQ` Relative Error Quantiles Sketch
`RESERVOIR` The Reservoir family of sketches.
`RESERVOIR_UNION` The reservoir sampling family of Union operations.
`TDIGEST` t-Digest for estimating quantiles and ranks
`TUPLE` The Tuple family of sketches is a large family of sketches that are extensions of the Theta Sketch Framework.
`UNION` The Union family is an operation for the Theta Sketch Framework of sketches.
`VAROPT` The VarOpt family of sketches.
`VAROPT_UNION` The VarOpt family of sketches.

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`void` `checkFamilyID(int id)`
`String` `getFamilyName()` Returns the name for this family
`int` `getID()` Returns the byte ID for this family
`int` `getMaxPreLongs()` Returns the maximum preamble size for this family in longs
`int` `getMinPreLongs()` Returns the minimum preamble size for this family in longs
`static Family` `idToFamily(int id)` Returns the Family given the ID
`static Family` `stringToFamily(String famName)` Returns the Family given the family name
`String` `toString()`
`static Family` `valueOf(String name)` Returns the enum constant of this type with the specified name.
`static Family[]` `values()` Returns an array containing the constants of this enum type, in the order they are declared.

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

`clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf`

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

`getClass, notify, notifyAll, wait, wait, wait`

### Enum Constant Detail

#### ALPHA

    public static final Family ALPHA

The Alpha Sketch family is a member of the Theta Sketch Framework of sketches and is best suited for real-time processes where both the updating of the sketch and getting the estimate is performed directly on the sketch. In this situation the AlphaSketch has roughly a 30% improvement (~1/sqrt(2*k)) in its error distribution as compared to the QuickSelect (or similar KMV-derived) sketches.

If the AlphaSketch is fed into any SetOperation, the error distribution reverts back to the normal QuickSelect/KMV error distribution (~1/sqrt(k)). For this reason, the AlphaSketch does not have a sister class for off-heap operation. The Alpha Sketch has a roughly 30% faster overall update time as compared to the QuickSelect sketch family.

The Alpha Sketch is created using the UpdateSketch.builder(). See Alpha TCF and Theta Sketch Framework

#### QUICKSELECT

    public static final Family QUICKSELECT

The QuickSelect Sketch family is a member of the Theta Sketch Framework of sketches and is the workhorse of the Theta Sketch Families and can be constructed for either on-heap or off-heap operation. The QuickSelect Sketch is created using the UpdateSketch.builder(). See Quick Select TCF

#### COMPACT

    public static final Family COMPACT

The Compact Sketch family is a member of the Theta Sketch Framework of sketches. The are read-only and cannot be updated, but can participate in any of the Set Operations. The compact sketches are never created directly with a constructor or Builder. Instead they are created as a result of the compact() method of an UpdateSketch or as a result of a getSketchSamples() of a SetOperation.

#### UNION

    public static final Family UNION

The Union family is an operation for the Theta Sketch Framework of sketches. The Union is constructed using the SetOperation.builder().

#### INTERSECTION

    public static final Family INTERSECTION

The Intersection family is an operation for the Theta Sketch Framework of sketches. The Intersection is constructed using the SetOperation.builder().

#### A_NOT_B

    public static final Family A_NOT_B

The A and not B family is an operation for the Theta Sketch Framework of sketches. The AnotB operation is constructed using the SetOperation.builder().

#### HLL

    public static final Family HLL

The HLL family of sketches. (Not part of TSF.)

#### QUANTILES

    public static final Family QUANTILES

The Quantiles family of sketches. (Not part of TSF.)

#### TUPLE

    public static final Family TUPLE

The Tuple family of sketches is a large family of sketches that are extensions of the Theta Sketch Framework.

#### FREQUENCY

    public static final Family FREQUENCY

The Frequency family of sketches. (Not part of TSF.)

#### RESERVOIR

    public static final Family RESERVOIR

The Reservoir family of sketches. (Not part of TSF.)

#### RESERVOIR_UNION

    public static final Family RESERVOIR_UNION

The reservoir sampling family of Union operations. (Not part of TSF.)

#### VAROPT

    public static final Family VAROPT

The VarOpt family of sketches. (Not part of TSF.)

#### VAROPT_UNION

    public static final Family VAROPT_UNION

The VarOpt family of sketches. (Not part of TSF.)

#### KLL

    public static final Family KLL

KLL quantiles sketch

#### CPC

    public static final Family CPC

Compressed Probabilistic Counting (CPC) Sketch

#### REQ

    public static final Family REQ

Relative Error Quantiles Sketch

#### COUNTMIN

    public static final Family COUNTMIN

CountMin Sketch

#### EBPPS

    public static final Family EBPPS

Exact and Bounded, Probability Proportional to Size (EBPPS)

#### TDIGEST

    public static final Family TDIGEST

t-Digest for estimating quantiles and ranks

#### BLOOMFILTER

    public static final Family BLOOMFILTER

Bloom Filter

### Method Detail

#### values

    public static Family[] values()

Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:

    for (Family c : Family.values())
        System.out.println(c);

Returns:
  an array containing the constants of this enum type, in the order they are declared

#### valueOf

    public static Family valueOf(String name)

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
  `name` - the name of the enum constant to be returned.
Returns:
  the enum constant with the specified name
Throws:
  `IllegalArgumentException` - if this enum type has no constant with the specified name
  `NullPointerException` - if the argument is null

#### getID

    public int getID()

Returns the byte ID for this family

Returns:
  the byte ID for this family

#### checkFamilyID

    public void checkFamilyID(int id)

Parameters:
  `id` - the given id, a value < 128.

#### getFamilyName

    public String getFamilyName()

Returns the name for this family

Returns:
  the name for this family

#### getMinPreLongs

    public int getMinPreLongs()

Returns the minimum preamble size for this family in longs

Returns:
  the minimum preamble size for this family in longs

#### getMaxPreLongs

    public int getMaxPreLongs()

Returns the maximum preamble size for this family in longs

Returns:
  the maximum preamble size for this family in longs

#### toString

    public String toString()

Overrides:
  `toString` in class `Enum<Family>`

#### idToFamily

    public static Family idToFamily(int id)

Returns the Family given the ID

Parameters:
  `id` - the given ID
Returns:
  the Family given the ID

#### stringToFamily

    public static Family stringToFamily(String famName)

Returns the Family given the family name

Parameters:
  `famName` - the family name
Returns:
  the Family given the family name