Remove deprecated methods on Tuple AnotB
diff --git a/src/main/java/org/apache/datasketches/tuple/AnotB.java b/src/main/java/org/apache/datasketches/tuple/AnotB.java
index a7fe752..1a355e2 100644
--- a/src/main/java/org/apache/datasketches/tuple/AnotB.java
+++ b/src/main/java/org/apache/datasketches/tuple/AnotB.java
@@ -384,7 +384,6 @@
return daB;
}
-
@SuppressWarnings("unchecked")
private static <S extends Summary> DataArrays<S> getResultArraysTheta(
final long minThetaLong,
@@ -432,7 +431,6 @@
return daB;
}
-
/**
* Resets this sketch back to the empty state.
*/
@@ -444,38 +442,4 @@
curCount_ = 0;
}
- //Deprecated methods
-
- /**
- * Perform A-and-not-B set operation on the two given sketches.
- * A null sketch is interpreted as an empty sketch.
- * This is not an accumulating update. Calling this update() more than once
- * without calling getResult() will discard the result of previous update() by this method.
- * The result is obtained by calling getResult();
- *
- * @param skA The incoming sketch for the first argument
- * @param skB The incoming sketch for the second argument
- * @deprecated v2.0.0. Instead please use {@link #aNotB(Sketch, Sketch)}.
- */
- @Deprecated
- public void update(final Sketch<S> skA, final Sketch<S> skB) {
- //duplicate old behavior
- reset();
- if (skA == null) { return; }
- else { setA(skA); }
- if (skB == null) { return; }
- else { notB(skB); }
- }
-
- /**
- * Gets the result of this operation. This clears the state of this operator after the result is
- * returned.
- * @return the result of this operation as an unordered {@link CompactSketch}
- * @deprecated v2.0.0. Instead use {@link #getResult(boolean)}.
- */
- @Deprecated
- public CompactSketch<S> getResult() {
- return getResult(true);
- }
-
}
diff --git a/src/test/java/org/apache/datasketches/tuple/adouble/AdoubleAnotBTest.java b/src/test/java/org/apache/datasketches/tuple/adouble/AdoubleAnotBTest.java
index a2eae9d..8f8115f 100644
--- a/src/test/java/org/apache/datasketches/tuple/adouble/AdoubleAnotBTest.java
+++ b/src/test/java/org/apache/datasketches/tuple/adouble/AdoubleAnotBTest.java
@@ -44,7 +44,6 @@
private static final DoubleSummary.Mode mode = Mode.Sum;
private final Results results = new Results();
- @SuppressWarnings("deprecation")
private static void threeMethodsWithTheta(
final AnotB<DoubleSummary> aNotB,
final Sketch<DoubleSummary> skA,
@@ -54,11 +53,16 @@
{
CompactSketch<DoubleSummary> result;
- //Deprecated v2.0.0., Stateless, A = Tuple, B = Tuple
- //Old behavior is tolerant of nulls
- aNotB.update(skA, skB);
- result = aNotB.getResult();
- results.check(result);
+ //Stateful, A = Tuple, B = Tuple
+ if (skA != null) {
+ try {
+ aNotB.setA(skA);
+ aNotB.notB(skB);
+ result = aNotB.getResult(true);
+ results.check(result);
+ }
+ catch (final SketchesArgumentException e) { }
+ }
//Stateless A = Tuple, B = Tuple
if (skA == null || skB == null) {
@@ -160,7 +164,7 @@
public void aNotBNullEmptyCombinations() {
final AnotB<DoubleSummary> aNotB = new AnotB<>();
// calling getResult() before calling update() should yield an empty set
- final CompactSketch<DoubleSummary> result = aNotB.getResult();
+ final CompactSketch<DoubleSummary> result = aNotB.getResult(true);
results.set(0, true, 0.0, 0.0, 0.0).check(result);
final UpdatableSketch<Double, DoubleSummary> sketch = buildUpdatableTuple();
diff --git a/src/test/java/org/apache/datasketches/tuple/aninteger/IntegerSketchTest.java b/src/test/java/org/apache/datasketches/tuple/aninteger/IntegerSketchTest.java
index d12339c..4a877f7 100644
--- a/src/test/java/org/apache/datasketches/tuple/aninteger/IntegerSketchTest.java
+++ b/src/test/java/org/apache/datasketches/tuple/aninteger/IntegerSketchTest.java
@@ -82,8 +82,9 @@
for (int i = 0; i < u; i++) {
a1Sk1.update(i, 1);
}
- anotb.update(a1Sk1, a1Sk2);
- final CompactSketch<IntegerSummary> cSk = anotb.getResult();
+ anotb.setA(a1Sk1);
+ anotb.notB(a1Sk2);
+ final CompactSketch<IntegerSummary> cSk = anotb.getResult(true);
assertEquals((int)cSk.getEstimate(), u);
}
diff --git a/src/test/java/org/apache/datasketches/tuple/strings/ArrayOfStringsSketchTest.java b/src/test/java/org/apache/datasketches/tuple/strings/ArrayOfStringsSketchTest.java
index 73b207a..f5e3881 100644
--- a/src/test/java/org/apache/datasketches/tuple/strings/ArrayOfStringsSketchTest.java
+++ b/src/test/java/org/apache/datasketches/tuple/strings/ArrayOfStringsSketchTest.java
@@ -37,6 +37,7 @@
public class ArrayOfStringsSketchTest {
private static final String LS = System.getProperty("line.separator");
+ @SuppressWarnings("deprecation")
@Test
public void checkSketch() {
ArrayOfStringsSketch sketch1 = new ArrayOfStringsSketch();
@@ -71,8 +72,9 @@
assertEquals(csk.getRetainedEntries(), 3);
AnotB<ArrayOfStringsSummary> aNotB = new AnotB<>();
- aNotB.update(sketch2, sketch1);
- csk = aNotB.getResult();
+ aNotB.setA(sketch2);
+ aNotB.notB(sketch1);
+ csk = aNotB.getResult(true);
assertEquals(csk.getRetainedEntries(), 1);
}