From 89a265edb14a716d7b6a37fd64e00dfaf1b5ae22 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Thu, 27 Aug 2015 22:20:53 +0200 Subject: [PATCH] =?utf8?q?Added=20method=20resultSet()=20to=20Result=20Sig?= =?utf8?q?ned-off-by:Roland=20H=C3=A4der=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../mxchange/jcore/database/result/DatabaseResult.java | 10 ++++++++++ src/org/mxchange/jcore/database/result/Result.java | 8 ++++++++ 2 files changed, 18 insertions(+) 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 (); } -- 2.39.5