

















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


















-^ JQL is a simple extension for Java.•^ JQL adds support for
-^ Object Querying
-^ We're^
-^ An easy way – the nested loop join:–^ ArrayList results = new Arraylist();^ –^ for(Session s : sessions)^ –^ for(Window w : windows)^ –^ if(w.name.equals(s.name))^ –^
results.add(new Object[w,s]);
-^ This takes
-^ results = selectAll(Session s =sessions,
Window w = windows: »^ s.name.equals(w.name));
-^ Let the Query Evaluator take care of thedetails!
-^ assert null == selectA(BinTree a, BinTree b : •^
(a != b && a.left == b.left) || •
(a != b && a.right == b.right)|| •
a.left == b.right);
-^ public class GroupChat{^ –^ private List participants;^ –^ public SomeClass(){^ –^ participants = new ArrayList();^ –^ ...^ –^ }^ –^ public void addChatter(String name){^ –^ ...^ –^ participants.add(new Session(name));^ –^ ...^ –^ } •^ }
ObjectTracker docsity.com
Sessions Windows
w.name ==s.name Temp. Results w.ID == 5 w.ID == 5 && w.name == s.name
-^ HashMap<Integer,ArrayList
= newArrayList
-^ } •^ ArrayList<Object[]> matches =
new ArrayList<Object[]>(); • Collections.sort(array4); • for(Integer i2 : array2) {^ –^ int b=i2;^ –^ ArrayList
for(Integer i1 : grp) {
int a=i1; for(Integer i3 : array3) {int c=i3;if(b != c) {for(intx=array4.size();x!=0;x=x1){int d=array4.get(x-1);if(c<d){Object[] t = new Object[4];t[0]=a;t[1]=b;t[2]=c;t[3]=d;matches.add(t);}^ else {^
break; }} } } } } return matches;