public abstract class Intersection extends SetOperation
| Constructor and Description |
|---|
Intersection() |
| Modifier and Type | Method and Description |
|---|---|
Family |
getFamily()
Gets the Family of this SetOperation
|
abstract CompactSketch |
getResult()
Gets the result of this operation as an ordered CompactSketch on the Java heap.
|
abstract CompactSketch |
getResult(boolean dstOrdered,
org.apache.datasketches.memory.WritableMemory dstMem)
Gets the result of this operation as a CompactSketch of the chosen form.
|
abstract boolean |
hasResult()
Returns true if there is an intersection result available
|
CompactSketch |
intersect(Sketch a,
Sketch b)
Perform intersect set operation on the two given sketch arguments and return the result as an
ordered CompactSketch on the heap.
|
abstract CompactSketch |
intersect(Sketch a,
Sketch b,
boolean dstOrdered,
org.apache.datasketches.memory.WritableMemory dstMem)
Perform intersect set operation on the two given sketches and return the result as a
CompactSketch.
|
abstract void |
reset()
Resets this Intersection.
|
abstract byte[] |
toByteArray()
Serialize this intersection to a byte array form.
|
abstract void |
update(Sketch sketchIn)
Intersect the given sketch with the internal state.
|
builder, getMaxIntersectionBytes, getMaxUnionBytes, heapify, heapify, isSameResource, wrap, wrap, wrap, wrappublic Family getFamily()
SetOperationgetFamily in class SetOperationpublic abstract CompactSketch getResult(boolean dstOrdered, org.apache.datasketches.memory.WritableMemory dstMem)
Note that presenting an intersection with an empty or null sketch sets the internal state of the intersection to empty = true, and current count = 0. This is consistent with the mathematical definition of the intersection of any set with the null set is always null.
dstOrdered - See Destination OrdereddstMem - See Destination Memory.public abstract CompactSketch getResult()
public abstract boolean hasResult()
public abstract void reset()
public abstract byte[] toByteArray()
public abstract void update(Sketch sketchIn)
sketchIn - the given sketchpublic CompactSketch intersect(Sketch a, Sketch b)
a - The first sketch argumentb - The second sketch argumentpublic abstract CompactSketch intersect(Sketch a, Sketch b, boolean dstOrdered, org.apache.datasketches.memory.WritableMemory dstMem)
a - The first sketch argumentb - The second sketch argumentdstOrdered - See Destination Ordered.dstMem - See Destination Memory.Copyright © 2015–2020 The Apache Software Foundation. All rights reserved.