diff --git a/src/org/hwo/ObjectTable.java b/src/org/hwo/ObjectTable.java new file mode 100644 index 0000000..4cd7b5b --- /dev/null +++ b/src/org/hwo/ObjectTable.java @@ -0,0 +1,147 @@ +package org.hwo; + +import java.util.ArrayList; +import java.util.List; + +public class ObjectTable { + + private int width; + private List rows; + + public ObjectTable(int width){ + this.width = width; + this.rows = new ArrayList(); + } + public ObjectTable(){ + this.width = 0; + this.rows = new ArrayList(); + } + + public ObjectTable selectColums(int[] columns){ + ObjectTable ot = new ObjectTable( columns.length ); + + for (ObjectSet row: this.rows){ + Object[] sv = new Object[ columns.length ]; + + for (int i=0;i width){ + throw new ArrayIndexOutOfBoundsException(); + } + + for (int n=0;n