From 3eecc0a415957030bd70578b52ad0f0d2d50eba5 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Wed, 12 Aug 2015 15:00:55 +0200 Subject: [PATCH] =?utf8?q?DatabaseResult=20is=20now=20"basicly=20finished"?= =?utf8?q?.=20Signed-off-by:Roland=20H=C3=A4der=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../jcore/database/result/DatabaseResult.java | 24 +++++++++++++++---- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/src/org/mxchange/jcore/database/result/DatabaseResult.java b/src/org/mxchange/jcore/database/result/DatabaseResult.java index df8386d..abddc78 100644 --- a/src/org/mxchange/jcore/database/result/DatabaseResult.java +++ b/src/org/mxchange/jcore/database/result/DatabaseResult.java @@ -17,6 +17,8 @@ package org.mxchange.jcore.database.result; import java.util.Iterator; +import java.util.SortedSet; +import java.util.TreeSet; import org.mxchange.jcore.BaseFrameworkSystem; import org.mxchange.jcore.database.storage.Storeable; @@ -25,10 +27,17 @@ import org.mxchange.jcore.database.storage.Storeable; * @author Roland Haeder */ public class DatabaseResult extends BaseFrameworkSystem implements Result { + /** + * Set of all found Storeable instances + */ + private final SortedSet result; + /** * Default constructor */ public DatabaseResult () { + // Init set here + this.result = new TreeSet<>(); } /** @@ -38,26 +47,31 @@ public class DatabaseResult extends BaseFrameworkSystem implements Result iterator () { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + // Return iterator from result set + return this.result.iterator(); } @Override public Storeable next () { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + // Call iterator's method + return this.iterator().next(); } @Override public void remove () { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + // Call iterator's method + this.iterator().remove(); } } -- 2.39.5