fork download
  1. import java.util.ArrayList;
  2. import java.util.List;
  3. import java.util.Map;
  4.  
  5. import com.google.common.collect.ImmutableList;
  6. import com.google.common.collect.ImmutableMap;
  7. import com.googlecode.cqengine.ConcurrentIndexedCollection;
  8. import com.googlecode.cqengine.IndexedCollection;
  9. import com.googlecode.cqengine.codegen.AttributeBytecodeGenerator;
  10. import com.googlecode.cqengine.query.parser.sql.SQLParser;
  11. import com.googlecode.cqengine.resultset.ResultSet;
  12.  
  13. import lombok.AllArgsConstructor;
  14. import lombok.Data;
  15.  
  16.  
  17. @AllArgsConstructor
  18. @Data
  19. class Car {
  20. public String name;
  21. public List<String> featureBulletPoints;
  22. public Map<String, String> randomMap;
  23.  
  24. }
  25. public class Activity {
  26.  
  27. public static void main(String args[]) {
  28. List<Car> sampleList = new ArrayList<>();
  29. sampleList.add(new Car("mercedes", ImmutableList.of("att", "mehngi"), ImmutableMap.of("a", "bmwMap")));
  30. sampleList.add(new Car("bmw", ImmutableList.of("nice"), ImmutableMap.of("b", "set")));
  31. sampleList.add(new Car("ferrari", ImmutableList.of("bahli att", "sports"), ImmutableMap.of("rando", "anothe")));
  32. sampleList.add(new Car("rolls royce", ImmutableList.of("sirra", "kuch bhi"), ImmutableMap.of("blahh", "hola")));
  33. IndexedCollection<Car> indexedCollection = new ConcurrentIndexedCollection<Car>();
  34. indexedCollection.addAll(sampleList);
  35. SQLParser<Car> sqlParser = SQLParser.forPojoWithAttributes(Car.class, AttributeBytecodeGenerator.createAttributes(Car.class));
  36. ResultSet<Car> results = sqlParser.retrieve(indexedCollection, "SELECT * FROM indexedCollection WHERE name = 'mercedes'");
  37. for(Car car : results) {
  38. System.out.println(car);
  39. }
  40. results.close();
  41. }
  42.  
  43. }
  44.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:25: error: class Activity is public, should be declared in a file named Activity.java
public class Activity {
       ^
Main.java:7: error: package com.googlecode.cqengine does not exist
import com.googlecode.cqengine.ConcurrentIndexedCollection;
                              ^
Main.java:8: error: package com.googlecode.cqengine does not exist
import com.googlecode.cqengine.IndexedCollection;
                              ^
Main.java:9: error: package com.googlecode.cqengine.codegen does not exist
import com.googlecode.cqengine.codegen.AttributeBytecodeGenerator;
                                      ^
Main.java:10: error: package com.googlecode.cqengine.query.parser.sql does not exist
import com.googlecode.cqengine.query.parser.sql.SQLParser;
                                               ^
Main.java:11: error: package com.googlecode.cqengine.resultset does not exist
import com.googlecode.cqengine.resultset.ResultSet;
                                        ^
Main.java:13: error: package lombok does not exist
import lombok.AllArgsConstructor;
             ^
Main.java:14: error: package lombok does not exist
import lombok.Data;
             ^
Main.java:17: error: cannot find symbol
@AllArgsConstructor
 ^
  symbol: class AllArgsConstructor
Main.java:18: error: cannot find symbol
@Data
 ^
  symbol: class Data
Main.java:29: error: constructor Car in class Car cannot be applied to given types;
        sampleList.add(new Car("mercedes", ImmutableList.of("att", "mehngi"), ImmutableMap.of("a", "bmwMap")));
                       ^
  required: no arguments
  found: String,ImmutableList<String>,ImmutableMap<String,String>
  reason: actual and formal argument lists differ in length
Main.java:30: error: constructor Car in class Car cannot be applied to given types;
        sampleList.add(new Car("bmw", ImmutableList.of("nice"), ImmutableMap.of("b", "set")));
                       ^
  required: no arguments
  found: String,ImmutableList<String>,ImmutableMap<String,String>
  reason: actual and formal argument lists differ in length
Main.java:31: error: constructor Car in class Car cannot be applied to given types;
        sampleList.add(new Car("ferrari", ImmutableList.of("bahli att", "sports"), ImmutableMap.of("rando", "anothe")));
                       ^
  required: no arguments
  found: String,ImmutableList<String>,ImmutableMap<String,String>
  reason: actual and formal argument lists differ in length
Main.java:32: error: constructor Car in class Car cannot be applied to given types;
        sampleList.add(new Car("rolls royce", ImmutableList.of("sirra", "kuch bhi"), ImmutableMap.of("blahh", "hola")));
                       ^
  required: no arguments
  found: String,ImmutableList<String>,ImmutableMap<String,String>
  reason: actual and formal argument lists differ in length
Main.java:33: error: cannot find symbol
        IndexedCollection<Car> indexedCollection = new ConcurrentIndexedCollection<Car>();
        ^
  symbol:   class IndexedCollection
  location: class Activity
Main.java:33: error: cannot find symbol
        IndexedCollection<Car> indexedCollection = new ConcurrentIndexedCollection<Car>();
                                                       ^
  symbol:   class ConcurrentIndexedCollection
  location: class Activity
Main.java:35: error: cannot find symbol
        SQLParser<Car> sqlParser = SQLParser.forPojoWithAttributes(Car.class, AttributeBytecodeGenerator.createAttributes(Car.class));
        ^
  symbol:   class SQLParser
  location: class Activity
Main.java:35: error: cannot find symbol
        SQLParser<Car> sqlParser = SQLParser.forPojoWithAttributes(Car.class, AttributeBytecodeGenerator.createAttributes(Car.class));
                                                                              ^
  symbol:   variable AttributeBytecodeGenerator
  location: class Activity
Main.java:35: error: cannot find symbol
        SQLParser<Car> sqlParser = SQLParser.forPojoWithAttributes(Car.class, AttributeBytecodeGenerator.createAttributes(Car.class));
                                   ^
  symbol:   variable SQLParser
  location: class Activity
Main.java:36: error: cannot find symbol
        ResultSet<Car> results = sqlParser.retrieve(indexedCollection, "SELECT * FROM indexedCollection WHERE name = 'mercedes'");
        ^
  symbol:   class ResultSet
  location: class Activity
20 errors
stdout
Standard output is empty