public abstract class Union extends SetOperation
Constructor and Description |
---|
Union() |
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 void |
reset()
Resets this Union.
|
abstract byte[] |
toByteArray()
Returns a byte array image of this Union object
|
abstract void |
union(org.apache.datasketches.memory.Memory mem)
Perform a Union operation with this union and the given Memory image of any sketch of the
Theta Family.
|
abstract void |
union(Sketch sketchIn)
Perform a Union operation with this union and the given on-heap sketch of the Theta Family.
|
CompactSketch |
union(Sketch sketchA,
Sketch sketchB)
This implements a stateless, pair-wise union operation.
|
abstract CompactSketch |
union(Sketch sketchA,
Sketch sketchB,
boolean dstOrdered,
org.apache.datasketches.memory.WritableMemory dstMem)
This implements a stateless, pair-wise union operation.
|
abstract void |
update(byte[] data)
Update this union with the given byte array item.
|
abstract void |
update(char[] data)
Update this union with the given char array item.
|
abstract void |
update(double datum)
Update this union with the given double (or float) data item.
|
abstract void |
update(int[] data)
Update this union with the given integer array item.
|
abstract void |
update(long datum)
Update this union with the given long data item.
|
abstract void |
update(long[] data)
Update this union with the given long array item.
|
abstract void |
update(org.apache.datasketches.memory.Memory mem)
Deprecated.
2.0.0. Use
union(Memory) instead. |
abstract void |
update(Sketch sketchIn)
Deprecated.
2.0.0. Use
union(Sketch) instead. |
abstract void |
update(String datum)
Update this union with the with the given String data item.
|
builder, getMaxAnotBResultBytes, getMaxIntersectionBytes, getMaxUnionBytes, heapify, heapify, isSameResource, wrap, wrap, wrap, wrap
public Family getFamily()
SetOperation
getFamily
in class SetOperation
public abstract CompactSketch getResult()
public abstract CompactSketch getResult(boolean dstOrdered, org.apache.datasketches.memory.WritableMemory dstMem)
dstOrdered
- See Destination OrdereddstMem
- See Destination Memory.public abstract void reset()
public abstract byte[] toByteArray()
public CompactSketch union(Sketch sketchA, Sketch sketchB)
Nulls and empty sketches are ignored.
sketchA
- The first argumentsketchB
- The second argumentpublic abstract CompactSketch union(Sketch sketchA, Sketch sketchB, boolean dstOrdered, org.apache.datasketches.memory.WritableMemory dstMem)
Nulls and empty sketches are ignored.
sketchA
- The first argumentsketchB
- The second argumentdstOrdered
- If true, the returned CompactSketch will be ordered.dstMem
- If not null, the returned CompactSketch will be placed in this WritableMemory.public abstract void union(Sketch sketchIn)
This method can be repeatedly called. If the given sketch is null it is interpreted as an empty sketch.
sketchIn
- The incoming sketch.@Deprecated public abstract void update(Sketch sketchIn)
union(Sketch)
instead.This method can be repeatedly called. If the given sketch is null it is interpreted as an empty sketch.
sketchIn
- The incoming sketch.public abstract void union(org.apache.datasketches.memory.Memory mem)
This method can be repeatedly called. If the given sketch is null it is interpreted as an empty sketch.
mem
- Memory image of sketch to be merged@Deprecated public abstract void update(org.apache.datasketches.memory.Memory mem)
union(Memory)
instead.This method can be repeatedly called. If the given sketch is null it is interpreted as an empty sketch.
mem
- Memory image of sketch to be mergedpublic abstract void update(long datum)
datum
- The given long datum.public abstract void update(double datum)
datum
- The given double datum.public abstract void update(String datum)
Note: this will not produce the same output hash values as the update(char[])
method and will generally be a little slower depending on the complexity of the UTF8 encoding.
Note: this is not a Sketch Union operation. This treats the given string as a data item.
datum
- The given String.public abstract void update(byte[] data)
Note: this is not a Sketch Union operation. This treats the given byte array as a data item.
data
- The given byte array.public abstract void update(int[] data)
Note: this is not a Sketch Union operation. This treats the given integer array as a data item.
data
- The given int array.public abstract void update(char[] data)
Note: this will not produce the same output hash values as the update(String)
method but will be a little faster as it avoids the complexity of the UTF8 encoding.
Note: this is not a Sketch Union operation. This treats the given char array as a data item.
data
- The given char array.public abstract void update(long[] data)
Note: this is not a Sketch Union operation. This treats the given char array as a data item.
data
- The given long array.Copyright © 2015–2021 The Apache Software Foundation. All rights reserved.