From 1b29de87ef07aeb80c9bf02cd4e8ae6c9dcd074a Mon Sep 17 00:00:00 2001 From: Harald Wolff Date: Wed, 26 Oct 2016 19:29:50 +0200 Subject: [PATCH] =?UTF-8?q?ObjectTable=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/org/hwo/ObjectTable.java | 147 +++++++++++++++++++++++++++++++++++ 1 file changed, 147 insertions(+) create mode 100644 src/org/hwo/ObjectTable.java 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