]> git.mxchange.org Git - jcore.git/commitdiff
Added method resultSet() to Result
authorRoland Haeder <roland@mxchange.org>
Thu, 27 Aug 2015 20:20:53 +0000 (22:20 +0200)
committerRoland Haeder <roland@mxchange.org>
Thu, 27 Aug 2015 20:20:53 +0000 (22:20 +0200)
Signed-off-by:Roland Häder <roland@mxchange.org>

src/org/mxchange/jcore/database/result/DatabaseResult.java
src/org/mxchange/jcore/database/result/Result.java

index e541bfa7f7c90ef16f4140d76c4b3f94caf4492c..a5cfd4a99374a8658a0d732224e3ddaa6fd20bb4 100644 (file)
@@ -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<Storea
        public final int size () {
                return this.result.size();
        }
+
+       @Override
+       public Set<? extends Storeable> resultSet () {
+               // Return it
+               return Collections.unmodifiableSet(this.result);
+       }
 }
index 4c8217ba7ac1c12355f450fa368bbadd3c5ee787..ff67e63e8a161409e7314bc3f205f5f326b47fa1 100644 (file)
@@ -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<T extends Storeable> 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<? extends Storeable> resultSet ();
 }