package relop;

/**
 * The projection operator extracts columns from a relation; unlike in
 * relational algebra, this operator does NOT eliminate duplicate tuples.
 */
public class Projection extends Iterator {

  /**
   * Constructs a projection, given the underlying iterator and field numbers.
   */
  public Projection(Iterator iter, Integer... fields) {
    throw new UnsupportedOperationException("Not implemented");
  }

  /**
   * Gives a one-line explaination of the iterator, repeats the call on any
   * child iterators, and increases the indent depth along the way.
   */
  public void explain(int depth) {
    throw new UnsupportedOperationException("Not implemented");
  }

  /**
   * Restarts the iterator, i.e. as if it were just constructed.
   */
  public void restart() {
    throw new UnsupportedOperationException("Not implemented");
  }

  /**
   * Returns true if the iterator is open; false otherwise.
   */
  public boolean isOpen() {
    throw new UnsupportedOperationException("Not implemented");
  }

  /**
   * Closes the iterator, releasing any resources (i.e. pinned pages).
   */
  public void close() {
    throw new UnsupportedOperationException("Not implemented");
  }

  /**
   * Returns true if there are more tuples, false otherwise.
   */
  public boolean hasNext() {
    throw new UnsupportedOperationException("Not implemented");
  }

  /**
   * Gets the next tuple in the iteration.
   * 
   * @throws IllegalStateException if no more tuples
   */
  public Tuple getNext() {
    throw new UnsupportedOperationException("Not implemented");
  }

} // public class Projection extends Iterator

@@ -212,27 +212,78 @@
 ator %7B%0D%0A
-%0D%0A  
+%09private Iterator iter;%0D%0A%09private Integer%5B%5D fields;%0D%0A%0D%0A%09
 /**%0D%0A
-  
+%09
  * Const
@@ -352,25 +352,23 @@
 mbers.%0D%0A
-  
+%09
  */%0D%0A
-  
+%09
 public P
@@ -410,27 +410,118 @@
  fields) %7B%0D%0A
-   
+%09%09this.iter = iter;%0D%0A%09%09this.fields = fields;%0D%0A%09%09this.setSchema(this.iter.getSchema());%0D%0A%0D%0A%09%09//
  throw new U
@@ -570,32 +570,29 @@
 ted%22);%0D%0A
-  
+%09
 %7D%0D%0A%0D%0A
-  
+%09
 /**%0D%0A
-  
+%09
  * Gives
@@ -658,18 +658,17 @@
 on any%0D%0A
-  
+%09
  * child
@@ -726,25 +726,23 @@
 e way.%0D%0A
-  
+%09
  */%0D%0A
-  
+%09
 public v
@@ -763,28 +763,26 @@
 t depth) %7B%0D%0A
-    
+%09%09
 throw new Un
@@ -830,32 +830,29 @@
 ted%22);%0D%0A
-  
+%09
 %7D%0D%0A%0D%0A
-  
+%09
 /**%0D%0A
-  
+%09
  * Resta
@@ -907,25 +907,23 @@
 ucted.%0D%0A
-  
+%09
  */%0D%0A
-  
+%09
 public v
@@ -935,28 +935,26 @@
 estart() %7B%0D%0A
-    
+%09%09
 throw new Un
@@ -1002,32 +1002,29 @@
 ted%22);%0D%0A
-  
+%09
 %7D%0D%0A%0D%0A
-  
+%09
 /**%0D%0A
-  
+%09
  * Retur
@@ -1070,33 +1070,31 @@
 otherwise.%0D%0A
-  
+%09
  */%0D%0A
-  
+%09
 public boole
@@ -1104,28 +1104,26 @@
 isOpen() %7B%0D%0A
-    
+%09%09
 throw new Un
@@ -1171,32 +1171,29 @@
 ted%22);%0D%0A
-  
+%09
 %7D%0D%0A%0D%0A
-  
+%09
 /**%0D%0A
-  
+%09
  * Close
@@ -1254,25 +1254,23 @@
 ages).%0D%0A
-  
+%09
  */%0D%0A
-  
+%09
 public v
@@ -1280,28 +1280,26 @@
  close() %7B%0D%0A
-    
+%09%09
 throw new Un
@@ -1347,32 +1347,29 @@
 ted%22);%0D%0A
-  
+%09
 %7D%0D%0A%0D%0A
-  
+%09
 /**%0D%0A
-  
+%09
  * Retur
@@ -1420,25 +1420,23 @@
 rwise.%0D%0A
-  
+%09
  */%0D%0A
-  
+%09
 public b
@@ -1447,36 +1447,34 @@
 an hasNext() %7B%0D%0A
-    
+%09%09
 throw new Unsupp
@@ -1522,24 +1522,21 @@
 );%0D%0A
-  
+%09
 %7D%0D%0A%0D%0A
-  
+%09
 /**%0D%0A
-  
+%09
  * G
@@ -1577,17 +1577,15 @@
 n.%0D%0A
-  
+%09
  * %0D%0A
-  
+%09
  * @
@@ -1612,16 +1612,33 @@
 xception
+%0D%0A%09 *            
  if no m
@@ -1653,17 +1653,15 @@
 es%0D%0A
-  
+%09
  */%0D%0A
-  
+%09
 publ
@@ -1682,20 +1682,18 @@
 xt() %7B%0D%0A
-    
+%09%09
 throw ne
@@ -1745,18 +1745,17 @@
 ted%22);%0D%0A
-  
+%09
 %7D%0D%0A%0D%0A%7D /

update projection