test_class.file: code/src/test/java/com/googlecode/cqengine/index/support/PartialIndexTest.java
test_class.identifier: PartialIndexTest
test_case.body: @Test
      public <O> void testSupportsQuery_Positive_RootQueryIsAnAndQueryWithFilterQueryAsChild() {
          // A partial index on attribute Car.PRICE, which is filtered to only index Ford and Honda cars.
          assertTrue(supportsQueryInternal(
                  backingIndexSupportsQuery(lessThan(Car.PRICE, 5000.0)),
                  in(Car.MANUFACTURER, "Ford", "Honda"),
                  and(lessThan(Car.PRICE, 5000.0), in(Car.MANUFACTURER, "Ford", "Honda")),
                  lessThan(Car.PRICE, 5000.0),
                  noQueryOptions()
          ));
      }
test_case.class_method_signature: PartialIndexTest.testSupportsQuery_Positive_RootQueryIsAnAndQueryWithFilterQueryAsChild()
test_case.full_signature: @Test public void testSupportsQuery_Positive_RootQueryIsAnAndQueryWithFilterQueryAsChild()
test_case.identifier: testSupportsQuery_Positive_RootQueryIsAnAndQueryWithFilterQueryAsChild
test_case.invocations: assertTrue supportsQueryInternal backingIndexSupportsQuery lessThan in and lessThan in lessThan noQueryOptions
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testSupportsQuery_Positive_RootQueryIsAnAndQueryWithFilterQueryAsChild()
focal_class.declarator: INDEX_RETRIEVAL_COST_DELTA = -5
focal_class.modifier: static final
focal_class.original_string: static final int INDEX_RETRIEVAL_COST_DELTA = -5;
focal_class.type: int
focal_class.var_name: INDEX_RETRIEVAL_COST_DELTA
focal_class.declarator: filterQuery
focal_class.modifier: protected final
focal_class.original_string: protected final Query<O> filterQuery;
focal_class.type: Query<O>
focal_class.var_name: filterQuery
focal_class.declarator: attribute
focal_class.modifier: protected final
focal_class.original_string: protected final Attribute<O, A> attribute;
focal_class.type: Attribute<O, A>
focal_class.var_name: attribute
focal_class.declarator: backingIndex
focal_class.modifier: protected volatile
focal_class.original_string: protected volatile I backingIndex;
focal_class.type: I
focal_class.var_name: backingIndex
focal_class.file: code/src/main/java/com/googlecode/cqengine/index/support/PartialIndex.java
focal_class.identifier: PartialIndex
focal_class.interfaces: implements AttributeIndex<A, O>
focal_class.class_method_signature: PartialIndex.PartialIndex(Attribute<O, A> attribute, Query<O> filterQuery)
focal_class.full_signature: protected  PartialIndex(Attribute<O, A> attribute, Query<O> filterQuery)
focal_class.identifier: PartialIndex
focal_class.modifiers: protected
focal_class.parameters: (Attribute<O, A> attribute, Query<O> filterQuery)
focal_class.signature:  PartialIndex(Attribute<O, A> attribute, Query<O> filterQuery)
focal_class.class_method_signature: PartialIndex.backingIndex()
focal_class.full_signature: protected I backingIndex()
focal_class.identifier: backingIndex
focal_class.modifiers: protected
focal_class.parameters: ()
focal_class.return: I
focal_class.signature: I backingIndex()
focal_class.class_method_signature: PartialIndex.getAttribute()
focal_class.full_signature: public Attribute<O, A> getAttribute()
focal_class.identifier: getAttribute
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Attribute<O, A>
focal_class.signature: Attribute<O, A> getAttribute()
focal_class.class_method_signature: PartialIndex.getFilterQuery()
focal_class.full_signature: public Query<O> getFilterQuery()
focal_class.identifier: getFilterQuery
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Query<O>
focal_class.signature: Query<O> getFilterQuery()
focal_class.class_method_signature: PartialIndex.getBackingIndex()
focal_class.full_signature: public AttributeIndex<A, O> getBackingIndex()
focal_class.identifier: getBackingIndex
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: AttributeIndex<A, O>
focal_class.signature: AttributeIndex<A, O> getBackingIndex()
focal_class.class_method_signature: PartialIndex.supportsQuery(Query<O> query, QueryOptions queryOptions)
focal_class.full_signature: @Override public boolean supportsQuery(Query<O> query, QueryOptions queryOptions)
focal_class.identifier: supportsQuery
focal_class.modifiers: @Override public
focal_class.parameters: (Query<O> query, QueryOptions queryOptions)
focal_class.return: boolean
focal_class.signature: boolean supportsQuery(Query<O> query, QueryOptions queryOptions)
focal_class.class_method_signature: PartialIndex.supportsQueryInternal(I backingIndex,
                                                                                  Query<O> filterQuery,
                                                                                  Query<O> rootQuery,
                                                                                  Query<O> branchQuery,
                                                                                  QueryOptions queryOptions)
focal_class.full_signature: static boolean supportsQueryInternal(I backingIndex,
                                                                                  Query<O> filterQuery,
                                                                                  Query<O> rootQuery,
                                                                                  Query<O> branchQuery,
                                                                                  QueryOptions queryOptions)
focal_class.identifier: supportsQueryInternal
focal_class.modifiers: static
focal_class.parameters: (I backingIndex,
                                                                                  Query<O> filterQuery,
                                                                                  Query<O> rootQuery,
                                                                                  Query<O> branchQuery,
                                                                                  QueryOptions queryOptions)
focal_class.return: boolean
focal_class.signature: boolean supportsQueryInternal(I backingIndex,
                                                                                  Query<O> filterQuery,
                                                                                  Query<O> rootQuery,
                                                                                  Query<O> branchQuery,
                                                                                  QueryOptions queryOptions)
focal_class.class_method_signature: PartialIndex.equals(Object o)
focal_class.full_signature: @Override public boolean equals(Object o)
focal_class.identifier: equals
focal_class.modifiers: @Override public
focal_class.parameters: (Object o)
focal_class.return: boolean
focal_class.signature: boolean equals(Object o)
focal_class.class_method_signature: PartialIndex.hashCode()
focal_class.full_signature: @Override public int hashCode()
focal_class.identifier: hashCode
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int hashCode()
focal_class.class_method_signature: PartialIndex.isMutable()
focal_class.full_signature: @Override public boolean isMutable()
focal_class.identifier: isMutable
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isMutable()
focal_class.class_method_signature: PartialIndex.isQuantized()
focal_class.full_signature: @Override public boolean isQuantized()
focal_class.identifier: isQuantized
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isQuantized()
focal_class.class_method_signature: PartialIndex.retrieve(Query<O> query, QueryOptions queryOptions)
focal_class.full_signature: @Override public ResultSet<O> retrieve(Query<O> query, QueryOptions queryOptions)
focal_class.identifier: retrieve
focal_class.modifiers: @Override public
focal_class.parameters: (Query<O> query, QueryOptions queryOptions)
focal_class.return: ResultSet<O>
focal_class.signature: ResultSet<O> retrieve(Query<O> query, QueryOptions queryOptions)
focal_class.class_method_signature: PartialIndex.getEffectiveIndex()
focal_class.full_signature: @Override public Index<O> getEffectiveIndex()
focal_class.identifier: getEffectiveIndex
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Index<O>
focal_class.signature: Index<O> getEffectiveIndex()
focal_class.class_method_signature: PartialIndex.init(ObjectStore<O> objectStore, QueryOptions queryOptions)
focal_class.full_signature: @Override public void init(ObjectStore<O> objectStore, QueryOptions queryOptions)
focal_class.identifier: init
focal_class.modifiers: @Override public
focal_class.parameters: (ObjectStore<O> objectStore, QueryOptions queryOptions)
focal_class.return: void
focal_class.signature: void init(ObjectStore<O> objectStore, QueryOptions queryOptions)
focal_class.class_method_signature: PartialIndex.destroy(QueryOptions queryOptions)
focal_class.full_signature: @Override public void destroy(QueryOptions queryOptions)
focal_class.identifier: destroy
focal_class.modifiers: @Override public
focal_class.parameters: (QueryOptions queryOptions)
focal_class.return: void
focal_class.signature: void destroy(QueryOptions queryOptions)
focal_class.class_method_signature: PartialIndex.addAll(ObjectSet<O> objectSet, QueryOptions queryOptions)
focal_class.full_signature: @Override public boolean addAll(ObjectSet<O> objectSet, QueryOptions queryOptions)
focal_class.identifier: addAll
focal_class.modifiers: @Override public
focal_class.parameters: (ObjectSet<O> objectSet, QueryOptions queryOptions)
focal_class.return: boolean
focal_class.signature: boolean addAll(ObjectSet<O> objectSet, QueryOptions queryOptions)
focal_class.class_method_signature: PartialIndex.removeAll(ObjectSet<O> objectSet, QueryOptions queryOptions)
focal_class.full_signature: @Override public boolean removeAll(ObjectSet<O> objectSet, QueryOptions queryOptions)
focal_class.identifier: removeAll
focal_class.modifiers: @Override public
focal_class.parameters: (ObjectSet<O> objectSet, QueryOptions queryOptions)
focal_class.return: boolean
focal_class.signature: boolean removeAll(ObjectSet<O> objectSet, QueryOptions queryOptions)
focal_class.class_method_signature: PartialIndex.clear(QueryOptions queryOptions)
focal_class.full_signature: @Override public void clear(QueryOptions queryOptions)
focal_class.identifier: clear
focal_class.modifiers: @Override public
focal_class.parameters: (QueryOptions queryOptions)
focal_class.return: void
focal_class.signature: void clear(QueryOptions queryOptions)
focal_class.class_method_signature: PartialIndex.filter(ObjectSet<O> objects, QueryOptions queryOptions)
focal_class.full_signature: protected Collection<O> filter(ObjectSet<O> objects, QueryOptions queryOptions)
focal_class.identifier: filter
focal_class.modifiers: protected
focal_class.parameters: (ObjectSet<O> objects, QueryOptions queryOptions)
focal_class.return: Collection<O>
focal_class.signature: Collection<O> filter(ObjectSet<O> objects, QueryOptions queryOptions)
focal_class.class_method_signature: PartialIndex.createBackingIndex()
focal_class.full_signature: protected abstract I createBackingIndex()
focal_class.identifier: createBackingIndex
focal_class.modifiers: protected abstract
focal_class.parameters: ()
focal_class.return: I
focal_class.signature: I createBackingIndex()
focal_method.body: static <A, O, I extends AttributeIndex<A, O>> boolean supportsQueryInternal(I backingIndex,
                                                                                  Query<O> filterQuery,
                                                                                  Query<O> rootQuery,
                                                                                  Query<O> branchQuery,
                                                                                  QueryOptions queryOptions) {
          if (!backingIndex.supportsQuery(branchQuery, queryOptions)) {
              return false;
          }
  
          // Check: rootQuery equals filterQuery
          if (filterQuery.equals(rootQuery)) {
              return true;
          }
  
          if (!(rootQuery instanceof And)) {
              return false;
          }
          // Check: rootQuery (r) is an And query, which has filterQuery (f) as any one of its direct children:
          // r = and(x, y, f, z)
          And<O> rootAndQuery = (And<O>)rootQuery;
          if (rootAndQuery.getChildQueries().contains(filterQuery)) {
              return true;
          }
  
          // Check: rootQuery (r) is an And query and filterQuery (f) is an And query,
          // and the direct children of f are also the direct children of r:
          // f = and(a, b), r = and(x, a, y, b)
          if (!(filterQuery instanceof And)) {
              return false;
          }
          And<O> filterAndQuery = ((And<O>) filterQuery);
          return rootAndQuery.getChildQueries().containsAll(filterAndQuery.getChildQueries());
      }
focal_method.class_method_signature: PartialIndex.supportsQueryInternal(I backingIndex,
                                                                                  Query<O> filterQuery,
                                                                                  Query<O> rootQuery,
                                                                                  Query<O> branchQuery,
                                                                                  QueryOptions queryOptions)
focal_method.full_signature: static boolean supportsQueryInternal(I backingIndex,
                                                                                  Query<O> filterQuery,
                                                                                  Query<O> rootQuery,
                                                                                  Query<O> branchQuery,
                                                                                  QueryOptions queryOptions)
focal_method.identifier: supportsQueryInternal
focal_method.invocations: supportsQuery equals contains getChildQueries containsAll getChildQueries getChildQueries
focal_method.modifiers: static
focal_method.parameters: (I backingIndex,
                                                                                  Query<O> filterQuery,
                                                                                  Query<O> rootQuery,
                                                                                  Query<O> branchQuery,
                                                                                  QueryOptions queryOptions)
focal_method.return: boolean
focal_method.signature: boolean supportsQueryInternal(I backingIndex,
                                                                                  Query<O> filterQuery,
                                                                                  Query<O> rootQuery,
                                                                                  Query<O> branchQuery,
                                                                                  QueryOptions queryOptions)