ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [10/11] ignite git commit: IGNITE-2264: Added "strict" methods.
Date Sun, 03 Jan 2016 20:17:26 GMT
IGNITE-2264: Added "strict" methods.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/c29ebe4e
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/c29ebe4e
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/c29ebe4e

Branch: refs/heads/ignite-2264
Commit: c29ebe4e908f845bb4df19df4c71abb3f0d60b49
Parents: 6b7300e
Author: vozerov-gridgain <vozerov@gridgain.com>
Authored: Sun Jan 3 23:36:21 2016 +0400
Committer: vozerov-gridgain <vozerov@gridgain.com>
Committed: Sun Jan 3 23:36:21 2016 +0400

----------------------------------------------------------------------
 .../ignite/internal/util/IgniteUtils.java       | 40 ++++++++++++++++++++
 1 file changed, 40 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/c29ebe4e/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
index 7f20fb8..f3d7f00 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
@@ -9080,6 +9080,16 @@ public abstract class IgniteUtils {
     }
 
     /**
+     * Creates new {@link HashMap} with the given size and load factor 1.
+     *
+     * @param size Expected size.
+     * @return New map.
+     */
+    public static <K, V> HashMap<K, V> newHashMapStrict(int size) {
+        return new HashMap<>(size, 1.0f);
+    }
+
+    /**
      * Creates new {@link LinkedHashMap} with expected size.
      *
      * @param expSize Expected size of created map.
@@ -9092,6 +9102,16 @@ public abstract class IgniteUtils {
     }
 
     /**
+     * Creates new {@link LinkedHashMap} with the given size and load factor 1.
+     *
+     * @param size Expected size.
+     * @return New map.
+     */
+    public static <K, V> HashMap<K, V> newLinkedHashMapStrict(int size) {
+        return new LinkedHashMap<>(size, 1.0f);
+    }
+
+    /**
      * Creates new {@link HashSet} with expected size.
      *
      * @param expSize Expected size of created map.
@@ -9103,6 +9123,16 @@ public abstract class IgniteUtils {
     }
 
     /**
+     * Creates new {@link HashSet} with the given size and load factor 1.
+     *
+     * @param size Expected size.
+     * @return New set.
+     */
+    public static <T> HashSet<T> newHashSetStrict(int size) {
+        return new HashSet<>(size, 1.0f);
+    }
+
+    /**
      * Creates new {@link LinkedHashSet} with expected size.
      *
      * @param expSize Expected size of created map.
@@ -9114,6 +9144,16 @@ public abstract class IgniteUtils {
     }
 
     /**
+     * Creates new {@link LinkedHashSet} with the given size and load factor 1.
+     *
+     * @param size Expected size.
+     * @return New set.
+     */
+    public static <T> LinkedHashSet<T> newLinkedHashSetStrict(int size) {
+        return new LinkedHashSet<>(size, 1.0f);
+    }
+
+    /**
      * Creates new map that limited by size.
      *
      * @param limit Limit for size.


Mime
View raw message