From: Roland Haeder Date: Wed, 12 Aug 2015 13:00:55 +0000 (+0200) Subject: DatabaseResult is now "basicly finished". X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=3eecc0a415957030bd70578b52ad0f0d2d50eba5;p=jcore.git DatabaseResult is now "basicly finished". Signed-off-by:Roland Häder --- 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(); } }