From 1925567b3d81c0d9d772c45a5ee03ba75c34929b Mon Sep 17 00:00:00 2001 From: "Brian S. O'Neill" Date: Mon, 4 Sep 2006 02:47:07 +0000 Subject: Removed extra constructors. --- .../com/amazon/carbonado/qe/CompositeScore.java | 38 ++------------------ .../amazon/carbonado/qe/IndexedQueryAnalyzer.java | 9 ----- .../com/amazon/carbonado/qe/OrderingScore.java | 38 ++------------------ .../amazon/carbonado/qe/UnionQueryAnalyzer.java | 7 ---- .../carbonado/qe/TestIndexedQueryAnalyzer.java | 18 +++++----- .../carbonado/qe/TestIndexedQueryExecutor.java | 42 +++++++++++----------- .../com/amazon/carbonado/qe/TestOrderingScore.java | 2 +- 7 files changed, 35 insertions(+), 119 deletions(-) diff --git a/src/main/java/com/amazon/carbonado/qe/CompositeScore.java b/src/main/java/com/amazon/carbonado/qe/CompositeScore.java index be4ceb7..2a85a32 100644 --- a/src/main/java/com/amazon/carbonado/qe/CompositeScore.java +++ b/src/main/java/com/amazon/carbonado/qe/CompositeScore.java @@ -45,22 +45,7 @@ public class CompositeScore { * * @param index index to evaluate * @param filter optional filter which cannot contain any logical 'or' operations. - * @throws IllegalArgumentException if index is null or filter is not supported - */ - public static CompositeScore evaluate - (StorableIndex index, - Filter filter) - { - return evaluate(index, filter, null); - } - - /** - * Evaluates the given index for its filtering and ordering capabilities - * against the given filter and order-by properties. - * - * @param index index to evaluate - * @param filter optional filter which cannot contain any logical 'or' operations. - * @param orderings properties which define desired ordering + * @param orderings optional properties which define desired ordering * @throws IllegalArgumentException if index is null or filter is not supported */ public static CompositeScore evaluate @@ -87,26 +72,7 @@ public class CompositeScore { * @param unique true if index is unique * @param clustered true if index is clustered * @param filter optional filter which cannot contain any logical 'or' operations. - * @throws IllegalArgumentException if index is null or filter is not supported - */ - public static CompositeScore evaluate - (OrderedProperty[] indexProperties, - boolean unique, - boolean clustered, - Filter filter) - { - return evaluate(indexProperties, unique, clustered, filter, null); - } - - /** - * Evaluates the given index properties for its filtering and ordering - * capabilities against the given filter and order-by properties. - * - * @param indexProperties index properties to evaluate - * @param unique true if index is unique - * @param clustered true if index is clustered - * @param filter optional filter which cannot contain any logical 'or' operations. - * @param orderings properties which define desired ordering + * @param orderings optional properties which define desired ordering * @throws IllegalArgumentException if index is null or filter is not supported */ public static CompositeScore evaluate diff --git a/src/main/java/com/amazon/carbonado/qe/IndexedQueryAnalyzer.java b/src/main/java/com/amazon/carbonado/qe/IndexedQueryAnalyzer.java index 92c21dd..23ec0d1 100644 --- a/src/main/java/com/amazon/carbonado/qe/IndexedQueryAnalyzer.java +++ b/src/main/java/com/amazon/carbonado/qe/IndexedQueryAnalyzer.java @@ -73,15 +73,6 @@ public class IndexedQueryAnalyzer { return mType; } - /** - * @param filter optional filter which which must be {@link Filter#isBound - * bound} and cannot contain any logical 'or' operations. - * @throws IllegalArgumentException if filter is not supported - */ - public Result analyze(Filter filter) { - return analyze(filter, null); - } - /** * @param filter optional filter which which must be {@link Filter#isBound * bound} and cannot contain any logical 'or' operations. diff --git a/src/main/java/com/amazon/carbonado/qe/OrderingScore.java b/src/main/java/com/amazon/carbonado/qe/OrderingScore.java index 67edcdd..843e22d 100644 --- a/src/main/java/com/amazon/carbonado/qe/OrderingScore.java +++ b/src/main/java/com/amazon/carbonado/qe/OrderingScore.java @@ -68,22 +68,7 @@ public class OrderingScore { * * @param index index to evaluate * @param filter optional filter which cannot contain any logical 'or' operations. - * @throws IllegalArgumentException if index is null or filter is not supported - */ - public static OrderingScore evaluate - (StorableIndex index, - Filter filter) - { - return evaluate(index, filter, null); - } - - /** - * Evaluates the given index for its ordering capabilities against the - * given filter and order-by properties. - * - * @param index index to evaluate - * @param filter optional filter which cannot contain any logical 'or' operations. - * @param orderings properties which define desired ordering + * @param orderings optional properties which define desired ordering * @throws IllegalArgumentException if index is null or filter is not supported */ public static OrderingScore evaluate @@ -110,26 +95,7 @@ public class OrderingScore { * @param unique true if index is unique * @param clustered true if index is clustered * @param filter optional filter which cannot contain any logical 'or' operations. - * @throws IllegalArgumentException if index is null or filter is not supported - */ - public static OrderingScore evaluate - (OrderedProperty[] indexProperties, - boolean unique, - boolean clustered, - Filter filter) - { - return evaluate(indexProperties, unique, clustered, filter, null); - } - - /** - * Evaluates the given index properties for its ordering capabilities - * against the given filter and order-by properties. - * - * @param indexProperties index properties to evaluate - * @param unique true if index is unique - * @param clustered true if index is clustered - * @param filter optional filter which cannot contain any logical 'or' operations. - * @param orderings properties which define desired ordering + * @param orderings optional properties which define desired ordering * @throws IllegalArgumentException if index is null or filter is not supported */ public static OrderingScore evaluate diff --git a/src/main/java/com/amazon/carbonado/qe/UnionQueryAnalyzer.java b/src/main/java/com/amazon/carbonado/qe/UnionQueryAnalyzer.java index b4e45fa..b07934c 100644 --- a/src/main/java/com/amazon/carbonado/qe/UnionQueryAnalyzer.java +++ b/src/main/java/com/amazon/carbonado/qe/UnionQueryAnalyzer.java @@ -57,13 +57,6 @@ public class UnionQueryAnalyzer { mIndexAnalyzer = new IndexedQueryAnalyzer(type, indexProvider); } - /** - * @param filter optional filter which must be {@link Filter#isBound bound} - */ - public Result analyze(Filter filter) { - return analyze(filter, null); - } - /** * @param filter optional filter which must be {@link Filter#isBound bound} * @param orderings optional properties which define desired ordering diff --git a/src/test/java/com/amazon/carbonado/qe/TestIndexedQueryAnalyzer.java b/src/test/java/com/amazon/carbonado/qe/TestIndexedQueryAnalyzer.java index 85c78cb..166d6e6 100644 --- a/src/test/java/com/amazon/carbonado/qe/TestIndexedQueryAnalyzer.java +++ b/src/test/java/com/amazon/carbonado/qe/TestIndexedQueryAnalyzer.java @@ -71,7 +71,7 @@ public class TestIndexedQueryAnalyzer extends TestCase { IndexedQueryAnalyzer iqa = new IndexedQueryAnalyzer(Address.class, IxProvider.INSTANCE); Filter
filter = Filter.filterFor(Address.class, "addressZip = ?"); filter = filter.bind(); - IndexedQueryAnalyzer.Result result = iqa.analyze(filter); + IndexedQueryAnalyzer.Result result = iqa.analyze(filter, null); assertFalse(result.handlesAnything()); assertEquals(filter, result.getCompositeScore().getFilteringScore().getRemainderFilter()); @@ -84,7 +84,7 @@ public class TestIndexedQueryAnalyzer extends TestCase { IndexedQueryAnalyzer iqa = new IndexedQueryAnalyzer(Address.class, IxProvider.INSTANCE); Filter
filter = Filter.filterFor(Address.class, "addressID = ?"); filter = filter.bind(); - IndexedQueryAnalyzer.Result result = iqa.analyze(filter); + IndexedQueryAnalyzer.Result result = iqa.analyze(filter, null); assertTrue(result.handlesAnything()); assertEquals(filter, result.getCompositeScore().getFilteringScore().getIdentityFilter()); @@ -97,7 +97,7 @@ public class TestIndexedQueryAnalyzer extends TestCase { IndexedQueryAnalyzer iqa = new IndexedQueryAnalyzer(Shipment.class, IxProvider.INSTANCE); Filter filter = Filter.filterFor(Shipment.class, "shipmentID = ?"); filter = filter.bind(); - IndexedQueryAnalyzer.Result result = iqa.analyze(filter); + IndexedQueryAnalyzer.Result result = iqa.analyze(filter, null); assertTrue(result.handlesAnything()); assertEquals(filter, result.getCompositeScore().getFilteringScore().getIdentityFilter()); @@ -107,7 +107,7 @@ public class TestIndexedQueryAnalyzer extends TestCase { filter = Filter.filterFor(Shipment.class, "orderID = ?"); filter = filter.bind(); - result = iqa.analyze(filter); + result = iqa.analyze(filter, null); assertTrue(result.handlesAnything()); assertEquals(filter, result.getCompositeScore().getFilteringScore().getIdentityFilter()); @@ -120,7 +120,7 @@ public class TestIndexedQueryAnalyzer extends TestCase { IndexedQueryAnalyzer iqa = new IndexedQueryAnalyzer(Shipment.class, IxProvider.INSTANCE); Filter filter = Filter.filterFor(Shipment.class, "order.orderTotal >= ?"); filter = filter.bind(); - IndexedQueryAnalyzer.Result result = iqa.analyze(filter); + IndexedQueryAnalyzer.Result result = iqa.analyze(filter, null); assertTrue(result.handlesAnything()); assertTrue(result.getCompositeScore().getFilteringScore().hasRangeStart()); @@ -136,7 +136,7 @@ public class TestIndexedQueryAnalyzer extends TestCase { Filter filter = Filter.filterFor (Shipment.class, "shipmentNotes = ? & order.orderTotal >= ?"); filter = filter.bind(); - IndexedQueryAnalyzer.Result result = iqa.analyze(filter); + IndexedQueryAnalyzer.Result result = iqa.analyze(filter, null); assertTrue(result.handlesAnything()); assertTrue(result.getCompositeScore().getFilteringScore().hasRangeStart()); @@ -155,7 +155,7 @@ public class TestIndexedQueryAnalyzer extends TestCase { Filter filter = Filter.filterFor (Shipment.class, "orderID >= ? & order.orderTotal >= ?"); filter = filter.bind(); - IndexedQueryAnalyzer.Result result = iqa.analyze(filter); + IndexedQueryAnalyzer.Result result = iqa.analyze(filter, null); assertTrue(result.handlesAnything()); assertTrue(result.getCompositeScore().getFilteringScore().hasRangeStart()); @@ -171,7 +171,7 @@ public class TestIndexedQueryAnalyzer extends TestCase { Filter filter = Filter.filterFor (Shipment.class, "order.address.addressState = ?"); filter = filter.bind(); - IndexedQueryAnalyzer.Result result = iqa.analyze(filter); + IndexedQueryAnalyzer.Result result = iqa.analyze(filter, null); assertTrue(result.handlesAnything()); assertEquals(filter, result.getCompositeScore().getFilteringScore().getIdentityFilter()); @@ -189,7 +189,7 @@ public class TestIndexedQueryAnalyzer extends TestCase { (Shipment.class, "order.address.addressState = ? & order.address.addressZip = ?"); FilterValues values = filter.initialFilterValues(); filter = values.getFilter(); - IndexedQueryAnalyzer.Result result = iqa.analyze(filter); + IndexedQueryAnalyzer.Result result = iqa.analyze(filter, null); assertTrue(result.handlesAnything()); assertEquals(Filter.filterFor(Shipment.class, "order.address.addressState = ?").bind(), diff --git a/src/test/java/com/amazon/carbonado/qe/TestIndexedQueryExecutor.java b/src/test/java/com/amazon/carbonado/qe/TestIndexedQueryExecutor.java index b3eef91..922266a 100644 --- a/src/test/java/com/amazon/carbonado/qe/TestIndexedQueryExecutor.java +++ b/src/test/java/com/amazon/carbonado/qe/TestIndexedQueryExecutor.java @@ -76,7 +76,7 @@ public class TestIndexedQueryExecutor extends TestCase { FilterValues values = filter.initialFilterValues(); filter = values.getFilter(); - CompositeScore score = CompositeScore.evaluate(index, filter); + CompositeScore score = CompositeScore.evaluate(index, filter, null); Mock executor = new Mock(index, score); @@ -96,7 +96,7 @@ public class TestIndexedQueryExecutor extends TestCase { values = filter.initialFilterValues(); filter = values.getFilter(); - score = CompositeScore.evaluate(index, filter); + score = CompositeScore.evaluate(index, filter, null); executor = new Mock(index, score); @@ -117,7 +117,7 @@ public class TestIndexedQueryExecutor extends TestCase { values = filter.initialFilterValues(); filter = values.getFilter(); - score = CompositeScore.evaluate(index, filter); + score = CompositeScore.evaluate(index, filter, null); executor = new Mock(index, score); @@ -140,7 +140,7 @@ public class TestIndexedQueryExecutor extends TestCase { FilterValues values = filter.initialFilterValues(); filter = values.getFilter(); - CompositeScore score = CompositeScore.evaluate(index, filter); + CompositeScore score = CompositeScore.evaluate(index, filter, null); Mock executor = new Mock(index, score); @@ -159,7 +159,7 @@ public class TestIndexedQueryExecutor extends TestCase { values = filter.initialFilterValues(); filter = values.getFilter(); - score = CompositeScore.evaluate(index, filter); + score = CompositeScore.evaluate(index, filter, null); executor = new Mock(index, score); @@ -178,7 +178,7 @@ public class TestIndexedQueryExecutor extends TestCase { values = filter.initialFilterValues(); filter = values.getFilter(); - score = CompositeScore.evaluate(index, filter); + score = CompositeScore.evaluate(index, filter, null); executor = new Mock(index, score); @@ -197,7 +197,7 @@ public class TestIndexedQueryExecutor extends TestCase { values = filter.initialFilterValues(); filter = values.getFilter(); - score = CompositeScore.evaluate(index, filter); + score = CompositeScore.evaluate(index, filter, null); executor = new Mock(index, score); @@ -216,7 +216,7 @@ public class TestIndexedQueryExecutor extends TestCase { values = filter.initialFilterValues(); filter = values.getFilter(); - score = CompositeScore.evaluate(index, filter); + score = CompositeScore.evaluate(index, filter, null); executor = new Mock(index, score); @@ -235,7 +235,7 @@ public class TestIndexedQueryExecutor extends TestCase { values = filter.initialFilterValues(); filter = values.getFilter(); - score = CompositeScore.evaluate(index, filter); + score = CompositeScore.evaluate(index, filter, null); executor = new Mock(index, score); @@ -276,7 +276,7 @@ public class TestIndexedQueryExecutor extends TestCase { values = filter.initialFilterValues(); filter = values.getFilter(); - score = CompositeScore.evaluate(index, filter); + score = CompositeScore.evaluate(index, filter, null); executor = new Mock(index, score); @@ -339,7 +339,7 @@ public class TestIndexedQueryExecutor extends TestCase { FilterValues values = filter.initialFilterValues(); filter = values.getFilter(); - CompositeScore score = CompositeScore.evaluate(index, filter); + CompositeScore score = CompositeScore.evaluate(index, filter, null); Mock executor = new Mock(index, score); @@ -358,7 +358,7 @@ public class TestIndexedQueryExecutor extends TestCase { values = filter.initialFilterValues(); filter = values.getFilter(); - score = CompositeScore.evaluate(index, filter); + score = CompositeScore.evaluate(index, filter, null); executor = new Mock(index, score); @@ -377,7 +377,7 @@ public class TestIndexedQueryExecutor extends TestCase { values = filter.initialFilterValues(); filter = values.getFilter(); - score = CompositeScore.evaluate(index, filter); + score = CompositeScore.evaluate(index, filter, null); executor = new Mock(index, score); @@ -396,7 +396,7 @@ public class TestIndexedQueryExecutor extends TestCase { values = filter.initialFilterValues(); filter = values.getFilter(); - score = CompositeScore.evaluate(index, filter); + score = CompositeScore.evaluate(index, filter, null); executor = new Mock(index, score); @@ -415,7 +415,7 @@ public class TestIndexedQueryExecutor extends TestCase { values = filter.initialFilterValues(); filter = values.getFilter(); - score = CompositeScore.evaluate(index, filter); + score = CompositeScore.evaluate(index, filter, null); executor = new Mock(index, score); @@ -434,7 +434,7 @@ public class TestIndexedQueryExecutor extends TestCase { values = filter.initialFilterValues(); filter = values.getFilter(); - score = CompositeScore.evaluate(index, filter); + score = CompositeScore.evaluate(index, filter, null); executor = new Mock(index, score); @@ -475,7 +475,7 @@ public class TestIndexedQueryExecutor extends TestCase { values = filter.initialFilterValues(); filter = values.getFilter(); - score = CompositeScore.evaluate(index, filter); + score = CompositeScore.evaluate(index, filter, null); executor = new Mock(index, score); @@ -541,7 +541,7 @@ public class TestIndexedQueryExecutor extends TestCase { FilterValues values = filter.initialFilterValues(); filter = values.getFilter(); - CompositeScore score = CompositeScore.evaluate(index, filter); + CompositeScore score = CompositeScore.evaluate(index, filter, null); Mock executor = new Mock(index, score); @@ -560,7 +560,7 @@ public class TestIndexedQueryExecutor extends TestCase { values = filter.initialFilterValues(); filter = values.getFilter(); - score = CompositeScore.evaluate(index, filter); + score = CompositeScore.evaluate(index, filter, null); executor = new Mock(index, score); @@ -580,7 +580,7 @@ public class TestIndexedQueryExecutor extends TestCase { values = filter.initialFilterValues(); filter = values.getFilter(); - score = CompositeScore.evaluate(index, filter); + score = CompositeScore.evaluate(index, filter, null); executor = new Mock(index, score); @@ -612,7 +612,7 @@ public class TestIndexedQueryExecutor extends TestCase { values = filter.initialFilterValues(); filter = values.getFilter(); - score = CompositeScore.evaluate(index, filter); + score = CompositeScore.evaluate(index, filter, null); executor = new Mock(index, score); diff --git a/src/test/java/com/amazon/carbonado/qe/TestOrderingScore.java b/src/test/java/com/amazon/carbonado/qe/TestOrderingScore.java index 1545b70..ac407ec 100644 --- a/src/test/java/com/amazon/carbonado/qe/TestOrderingScore.java +++ b/src/test/java/com/amazon/carbonado/qe/TestOrderingScore.java @@ -79,7 +79,7 @@ public class TestOrderingScore extends TestCase { public void testEmpty() throws Exception { StorableIndex ix = makeIndex(StorableTestBasic.class, "id"); - OrderingScore score = OrderingScore.evaluate(ix, null); + OrderingScore score = OrderingScore.evaluate(ix, null, null); assertEquals(0, score.getHandledCount()); assertEquals(0, score.getRemainderCount()); -- cgit v1.2.3