ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [2/5] ignite git commit: IGNITE-2263: Removed "F.viewReadOnly(..., BiClosure, ...)" - it is no longer needed.
Date Wed, 30 Dec 2015 10:33:35 GMT
IGNITE-2263: Removed "F.viewReadOnly(..., BiClosure, ...)" - it is no longer needed.


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

Branch: refs/heads/ignite-2263
Commit: 9bd3150d4acb2f12852ff99d831d43be14319d38
Parents: 80ccd1c
Author: vozerov-gridgain <vozerov@gridgain.com>
Authored: Wed Dec 30 13:23:43 2015 +0300
Committer: vozerov-gridgain <vozerov@gridgain.com>
Committed: Wed Dec 30 13:23:43 2015 +0300

----------------------------------------------------------------------
 .../ignite/internal/util/lang/GridFunc.java     | 120 -------------------
 1 file changed, 120 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/9bd3150d/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFunc.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFunc.java
b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFunc.java
index 7922f2c..9be08a7 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFunc.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFunc.java
@@ -1607,126 +1607,6 @@ public class GridFunc {
     }
 
     /**
-     * Read-only view on map that supports transformation of values and key filtering. Resulting
map will
-     * only "have" keys for which all provided predicates, if any, evaluates to {@code true}.
-     * Note that only wrapping map will be created and no duplication of data will occur.
-     * Also note that if array of given predicates is not empty then method {@code size()}
-     * uses full iteration through the entry set.
-     *
-     * @param m Input map that serves as a base for the view.
-     * @param trans Transformer for map value transformation.
-     * @param p Optional predicates. If predicates are not provided - all will be in the
view.
-     * @param <K> Type of the key.
-     * @param <V> Type of the input map value.
-     * @param <V1> Type of the output map value.
-     * @return Light-weight view on given map with provided predicate and transformer.
-     */
-    public static <K0, K extends K0, V0, V extends V0, V1> Map<K, V1> viewReadOnly(@Nullable
final Map<K, V> m,
-        final IgniteBiClosure<K, V, V1> trans, @Nullable final IgnitePredicate<?
super K>... p) {
-        A.notNull(trans, "trans");
-
-        if (isEmpty(m) || isAlwaysFalse(p))
-            return Collections.emptyMap();
-
-        assert m != null;
-
-        return new GridSerializableMap<K, V1>() {
-            /** Entry predicate. */
-            private IgnitePredicate<Entry<K, V>> ep = new P1<Map.Entry<K,
V>>() {
-                @Override public boolean apply(Entry<K, V> e) {
-                    return isAll(e.getKey(), p);
-                }
-            };
-
-            @NotNull
-            @Override public Set<Entry<K, V1>> entrySet() {
-                return new GridSerializableSet<Map.Entry<K, V1>>() {
-                    @NotNull
-                    @Override public Iterator<Entry<K, V1>> iterator() {
-                        return new Iterator<Entry<K, V1>>() {
-                            private Iterator<Entry<K, V>> it = iterator0(m.entrySet(),
true, ep);
-
-                            @Override public boolean hasNext() {
-                                return it.hasNext();
-                            }
-
-                            @Override public Entry<K, V1> next() {
-                                final Entry<K, V> e = it.next();
-
-                                return new Entry<K, V1>() {
-                                    @Override public K getKey() {
-                                        return e.getKey();
-                                    }
-
-                                    @Override public V1 getValue() {
-                                        return trans.apply(e.getKey(), e.getValue());
-                                    }
-
-                                    @Override public V1 setValue(V1 val) {
-                                        throw new UnsupportedOperationException(
-                                            "Put is not supported for readonly map view.");
-                                    }
-                                };
-                            }
-
-                            @Override public void remove() {
-                                throw new UnsupportedOperationException("Remove is not support
for readonly map view.");
-                            }
-                        };
-                    }
-
-                    @Override public int size() {
-                        return F.size(m.keySet(), p);
-                    }
-
-                    @SuppressWarnings({"unchecked"})
-                    @Override public boolean remove(Object o) {
-                        throw new UnsupportedOperationException("Remove is not support for
readonly map view.");
-                    }
-
-                    @SuppressWarnings({"unchecked"})
-                    @Override public boolean contains(Object o) {
-                        return F.isAll((Map.Entry<K, V>)o, ep) && m.entrySet().contains(o);
-                    }
-
-                    @Override public boolean isEmpty() {
-                        return !iterator().hasNext();
-                    }
-                };
-            }
-
-            @Override public boolean isEmpty() {
-                return entrySet().isEmpty();
-            }
-
-            @SuppressWarnings({"unchecked"})
-            @Nullable @Override public V1 get(Object key) {
-                if (isAll((K) key, p)) {
-                    V v = m.get(key);
-
-                    if (v != null)
-                        return trans.apply((K)key, v);
-                }
-
-                return null;
-            }
-
-            @Nullable @Override public V1 put(K key, V1 val) {
-                throw new UnsupportedOperationException("Put is not supported for readonly
map view.");
-            }
-
-            @Override public V1 remove(Object key) {
-                throw new UnsupportedOperationException("Remove is not supported for readonly
map view.");
-            }
-
-            @SuppressWarnings({"unchecked"})
-            @Override public boolean containsKey(Object key) {
-                return isAll((K)key, p) && m.containsKey(key);
-            }
-        };
-    }
-
-    /**
      * Read-only map view of a collection. Resulting map is a lightweight view of an input
collection,
      * with filtered elements of an input collection as keys, and closure execution results
      * as values. The map will only contain keys for which all provided predicates, if any,
evaluate


Mime
View raw message