test_class.file: code/src/test/java/com/googlecode/cqengine/query/simple/HasTest.java
test_class.identifier: HasTest
test_case.body: @Test
      public void testExists() {
          // Create an indexed collection (note: could alternatively use CQEngine.copyFrom() existing collection)...
          IndexedCollection<Car> cars = new ConcurrentIndexedCollection<Car>();
  
          Attribute<Car, String> NAME = new SimpleNullableAttribute<Car, String>("name") {
              public String getValue(Car car, QueryOptions queryOptions) { return car.name; }
          };
          // Add some indexes...
          cars.addIndex(StandingQueryIndex.onQuery(has(NAME)));
          cars.addIndex(StandingQueryIndex.onQuery(not(has(NAME))));
  
          // Add some objects to the collection...
          cars.add(new Car(1, "ford focus", "great condition, low mileage", Arrays.asList("spare tyre", "sunroof")));
          cars.add(new Car(2, null, "dirty and unreliable, flat tyre", Arrays.asList("spare tyre", "radio")));
          cars.add(new Car(3, "honda civic", "has a flat tyre and high mileage", Arrays.asList("radio")));
  
          Assert.assertEquals(cars.retrieve(has(NAME)).size(), 2);
          Assert.assertEquals(cars.retrieve(not(has(NAME))).size(), 1);
      }
test_case.class_method_signature: HasTest.testExists()
test_case.full_signature: @Test public void testExists()
test_case.identifier: testExists
test_case.invocations: addIndex onQuery has addIndex onQuery not has add asList add asList add asList assertEquals size retrieve has assertEquals size retrieve not has
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testExists()
focal_class.file: code/src/main/java/com/googlecode/cqengine/query/simple/Has.java
focal_class.identifier: Has
focal_class.class_method_signature: Has.Has(Attribute<O, A> attribute)
focal_class.full_signature: public  Has(Attribute<O, A> attribute)
focal_class.identifier: Has
focal_class.modifiers: public
focal_class.parameters: (Attribute<O, A> attribute)
focal_class.signature:  Has(Attribute<O, A> attribute)
focal_class.class_method_signature: Has.toString()
focal_class.full_signature: @Override public String toString()
focal_class.identifier: toString
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String toString()
focal_class.class_method_signature: Has.matchesSimpleAttribute(SimpleAttribute<O, A> attribute, O object, QueryOptions queryOptions)
focal_class.full_signature: @Override protected boolean matchesSimpleAttribute(SimpleAttribute<O, A> attribute, O object, QueryOptions queryOptions)
focal_class.identifier: matchesSimpleAttribute
focal_class.modifiers: @Override protected
focal_class.parameters: (SimpleAttribute<O, A> attribute, O object, QueryOptions queryOptions)
focal_class.return: boolean
focal_class.signature: boolean matchesSimpleAttribute(SimpleAttribute<O, A> attribute, O object, QueryOptions queryOptions)
focal_class.class_method_signature: Has.matchesNonSimpleAttribute(Attribute<O, A> attribute, O object, QueryOptions queryOptions)
focal_class.full_signature: @Override protected boolean matchesNonSimpleAttribute(Attribute<O, A> attribute, O object, QueryOptions queryOptions)
focal_class.identifier: matchesNonSimpleAttribute
focal_class.modifiers: @Override protected
focal_class.parameters: (Attribute<O, A> attribute, O object, QueryOptions queryOptions)
focal_class.return: boolean
focal_class.signature: boolean matchesNonSimpleAttribute(Attribute<O, A> attribute, O object, QueryOptions queryOptions)
focal_class.class_method_signature: Has.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: Has.calcHashCode()
focal_class.full_signature: @Override protected int calcHashCode()
focal_class.identifier: calcHashCode
focal_class.modifiers: @Override protected
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int calcHashCode()
focal_class.superclass: extends SimpleQuery<O, A>
focal_method.body: public Has(Attribute<O, A> attribute) {
          super(attribute);
      }
focal_method.class_method_signature: Has.Has(Attribute<O, A> attribute)
focal_method.full_signature: public  Has(Attribute<O, A> attribute)
focal_method.identifier: Has
focal_method.modifiers: public
focal_method.parameters: (Attribute<O, A> attribute)
focal_method.signature:  Has(Attribute<O, A> attribute)