From: Roland Haeder Date: Thu, 27 Aug 2015 20:20:53 +0000 (+0200) Subject: Added method resultSet() to Result X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=89a265edb14a716d7b6a37fd64e00dfaf1b5ae22;p=jcore.git Added method resultSet() to Result 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 e541bfa..a5cfd4a 100644 --- a/src/org/mxchange/jcore/database/result/DatabaseResult.java +++ b/src/org/mxchange/jcore/database/result/DatabaseResult.java @@ -20,7 +20,11 @@ import java.sql.PreparedStatement; import java.sql.SQLException; import java.sql.SQLWarning; import java.text.MessageFormat; +import java.util.Collections; +import java.util.HashMap; import java.util.Iterator; +import java.util.Map; +import java.util.Set; import java.util.SortedSet; import java.util.TreeSet; import org.mxchange.jcore.BaseFrameworkSystem; @@ -138,4 +142,10 @@ public class DatabaseResult extends BaseFrameworkSystem implements Result resultSet () { + // Return it + return Collections.unmodifiableSet(this.result); + } } diff --git a/src/org/mxchange/jcore/database/result/Result.java b/src/org/mxchange/jcore/database/result/Result.java index 4c8217b..ff67e63 100644 --- a/src/org/mxchange/jcore/database/result/Result.java +++ b/src/org/mxchange/jcore/database/result/Result.java @@ -18,6 +18,7 @@ package org.mxchange.jcore.database.result; import java.sql.SQLWarning; import java.util.Iterator; +import java.util.Set; import org.mxchange.jcore.FrameworkInterface; import org.mxchange.jcore.database.storage.Storeable; @@ -56,4 +57,11 @@ public interface Result extends FrameworkInterface, Iterato * @return Size of result */ public int size (); + + /** + * Getter for a whole unmodifiable result set from this result. The id number is used as key + * + * @return A map from this result + */ + public Set resultSet (); }