Beispiel #1
0
 public static Tuple join(Tuple t1, Tuple t2, int joinkey1, int joinkey2) {
   Tuple t = new Tuple(t1.getSize() + t2.getSize() - 1);
   int fieldNumber = 0;
   for (String f1 : t1.getFields()) t.set(fieldNumber++, f1);
   for (String f2 : t2.getFields()) if (!t2.field[joinkey2].equals(f2)) t.set(fieldNumber++, f2);
   return t;
 }
Beispiel #2
0
 // this constructor unserializes a string into a tuple
 public static Tuple makeTupleFromPipeData(String line) {
   StringTokenizer st = new StringTokenizer(line, separator, false);
   int size = Integer.parseInt(st.nextToken());
   Tuple t = new Tuple(size);
   int fieldNumber = 0;
   while (st.hasMoreTokens()) t.set(fieldNumber++, st.nextToken());
   return t;
 }
Beispiel #3
0
 // this constructor unserializes a string into a tuple
 public static Tuple makeTupleFromFileData(Relation r, String line) {
   StringTokenizer st = new StringTokenizer(line);
   int size = r.getSize();
   Tuple t = new Tuple(size);
   int fieldNumber = 0;
   while (st.hasMoreTokens()) t.set(fieldNumber++, st.nextToken());
   return t;
 }