diff --git a/.gitignore b/.gitignore
index cedaa518..49803047 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,7 +3,6 @@
*.jar
*.war
*.ear
-*.class
hs_err_pid*
.idea
*.iml
@@ -18,4 +17,5 @@ workbench.xmi
*.swp
.settings
.checkstyle
+GoogleMapsAPI.properties
twitter4j.properties
diff --git a/EkaterinaVishnevskaya/.gitignore b/EkaterinaVishnevskaya/.gitignore
new file mode 100644
index 00000000..7f59e8c1
--- /dev/null
+++ b/EkaterinaVishnevskaya/.gitignore
@@ -0,0 +1 @@
+twitter4j.properties
\ No newline at end of file
diff --git a/EkaterinaVishnevskaya/pom.xml b/EkaterinaVishnevskaya/pom.xml
new file mode 100644
index 00000000..880dee95
--- /dev/null
+++ b/EkaterinaVishnevskaya/pom.xml
@@ -0,0 +1,38 @@
+
+
+ 4.0.0
+
+
+ ru.fizteh.fivt.students
+ parent
+ 1.0-SNAPSHOT
+
+
+ EkaterinaVishnevskaya
+ jar
+
+
+ UTF-8
+
+
+
+ junit
+ junit
+ 3.8.1
+ test
+
+
+ org.twitter4j
+ twitter4j-stream
+ [4.0,)
+
+
+ com.beust
+ jcommander
+ 1.48
+
+
+
+
\ No newline at end of file
diff --git a/EkaterinaVishnevskaya/src/main/java/ru/fizteh/fivt/students/EkaterinaVishnevskaya/CollectionQl2/CollectionsQL.java b/EkaterinaVishnevskaya/src/main/java/ru/fizteh/fivt/students/EkaterinaVishnevskaya/CollectionQl2/CollectionsQL.java
new file mode 100644
index 00000000..9a3625f5
--- /dev/null
+++ b/EkaterinaVishnevskaya/src/main/java/ru/fizteh/fivt/students/EkaterinaVishnevskaya/CollectionQl2/CollectionsQL.java
@@ -0,0 +1,32 @@
+package ru.fizteh.fivt.students.EkaterinaVishnevskaya.CollectionQl2;
+
+import java.time.LocalDate;
+import java.util.ArrayList;
+
+
+public class CollectionsQL {
+
+ /**
+ *
+ * @param
+ * @param collection
+ * @return
+ */
+ /*public static Selector from(AbstractCollection collection)
+ {
+ return new Selector<>(collection);
+ }*/
+
+ /**
+ * @param args the command line arguments
+ */
+ public static void main(String[] args) {
+ ArrayList students = new ArrayList();
+ students.add(new Student("ivanov", LocalDate.parse("1986-08-06"), "494"));
+ students.add(new Student("sidorov", LocalDate.parse("1999-08-06"), "495"));
+ students.add(new Student("john", LocalDate.parse("1987-08-06"), "494"));
+ Query q = new Query(students);
+ Iterable it = q.where(Conditions.rlike(Student::getName, ".*ov")).orderBy(Comparators.desc(Student::getGroup)).groupBy(Student::getGroup).select(Statistics.class, Student::getGroup).having(s -> s.getCount() > 0).execute();
+ System.out.println(it);
+ }
+}
diff --git a/EkaterinaVishnevskaya/src/main/java/ru/fizteh/fivt/students/EkaterinaVishnevskaya/CollectionQl2/Comparators.java b/EkaterinaVishnevskaya/src/main/java/ru/fizteh/fivt/students/EkaterinaVishnevskaya/CollectionQl2/Comparators.java
new file mode 100644
index 00000000..02caadb2
--- /dev/null
+++ b/EkaterinaVishnevskaya/src/main/java/ru/fizteh/fivt/students/EkaterinaVishnevskaya/CollectionQl2/Comparators.java
@@ -0,0 +1,28 @@
+package ru.fizteh.fivt.students.EkaterinaVishnevskaya.CollectionQl2;
+
+import java.util.Comparator;
+import java.util.function.Function;
+
+/**
+ * Created by V on 19.12.2015.
+ */
+public class Comparators {
+ public static > Comparator asc(Function func){
+ Comparator comparator = new Comparator() {
+ @Override
+ public int compare(Student o1, Student o2) {
+ return func.apply(o1).compareTo(func.apply(o2));
+ }
+ };
+ return comparator;
+ }
+ public static > Comparator desc(Function func){
+ Comparator comparator = new Comparator() {
+ @Override
+ public int compare(Student o1, Student o2) {
+ return func.apply(o1).compareTo(func.apply(o2));
+ }
+ };
+ return comparator.reversed();
+ }
+}
diff --git a/EkaterinaVishnevskaya/src/main/java/ru/fizteh/fivt/students/EkaterinaVishnevskaya/CollectionQl2/Conditions.java b/EkaterinaVishnevskaya/src/main/java/ru/fizteh/fivt/students/EkaterinaVishnevskaya/CollectionQl2/Conditions.java
new file mode 100644
index 00000000..4de5e5e7
--- /dev/null
+++ b/EkaterinaVishnevskaya/src/main/java/ru/fizteh/fivt/students/EkaterinaVishnevskaya/CollectionQl2/Conditions.java
@@ -0,0 +1,20 @@
+package ru.fizteh.fivt.students.EkaterinaVishnevskaya.CollectionQl2;
+
+import java.util.function.Function;
+import java.util.function.Predicate;
+
+/**
+ * Created by V on 19.12.2015.
+ */
+public class Conditions {
+ public static Predicate rlike(Function expression, String regexp) {
+ Predicate p = s -> expression.apply(s).endsWith(regexp);
+ return p;
+ }
+ public static Predicate like(Function expression, String pattern) {
+ Predicate p1 = s -> expression.apply(s).startsWith(pattern);
+ Predicate p2 = s -> expression.apply(s).endsWith(pattern);
+ Predicate p3 = p1.and(p2);
+ return p3;
+ }
+}
diff --git a/EkaterinaVishnevskaya/src/main/java/ru/fizteh/fivt/students/EkaterinaVishnevskaya/CollectionQl2/Query.java b/EkaterinaVishnevskaya/src/main/java/ru/fizteh/fivt/students/EkaterinaVishnevskaya/CollectionQl2/Query.java
new file mode 100644
index 00000000..f951412a
--- /dev/null
+++ b/EkaterinaVishnevskaya/src/main/java/ru/fizteh/fivt/students/EkaterinaVishnevskaya/CollectionQl2/Query.java
@@ -0,0 +1,186 @@
+package ru.fizteh.fivt.students.EkaterinaVishnevskaya.CollectionQl2;
+
+import java.lang.reflect.Constructor;
+import java.util.*;
+import java.util.function.Function;
+import java.util.function.Predicate;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+/**
+ * Created by V on 19.12.2015.
+ */
+ public class Query {
+ public Query(AbstractCollection collection)
+ {
+ result = new ArrayList<>();
+ actionsForInput = new ArrayList();
+ actionsForOutput = new ArrayList();
+ selectAction = null;
+ sequence = collection.stream();
+ selectResult = null;
+ }
+
+ /*private Query(AbstractCollection collection, ArrayList > other)
+ {
+
+ }*/
+
+ public Query where(Predicate predicate)
+ {
+ actionsForInput.add(() -> {
+ whereImpl(predicate);
+ });
+ return this;
+ }
+
+ public Query select(Class resultType, Function... functions)
+ {
+ selectAction = () -> {
+ try {
+ selectImpl(resultType, functions);
+ } catch (InstantiationException ex) {
+ Logger.getLogger(Query.class.getName()).log(Level.SEVERE, null, ex);
+ }
+ };
+ return this;
+ }
+
+
+ private void selectImpl(Class resultType, Function... functions) throws InstantiationException
+ {
+ //ArrayList