Skip to content
Browse files

added method to fetch all value which are not marked as 'removable' (h…

  • Loading branch information...
1 parent 9d0aae1 commit 6df977d33127f9a7550989cde573fba261bbec7a @belaban committed
Showing with 14 additions and 1 deletion.
  1. +14 −1 src/org/jgroups/blocks/LazyRemovalCache.java
View
15 src/org/jgroups/blocks/LazyRemovalCache.java
@@ -159,7 +159,20 @@ public void retainAll(Collection<K> keys, boolean force) {
return retval;
}
- public Map<K,V >contents() {
+ /**
+ * Adds all value which have not been marked as removable to the returned set
+ * @return
+ */
+ public Set<V> nonRemovedValues() {
+ Set<V> retval=new HashSet<V>();
+ for(Entry<V> entry: map.values()) {
+ if(!entry.removable)
+ retval.add(entry.val);
+ }
+ return retval;
+ }
+
+ public Map<K,V> contents() {
Map<K,V> retval=new HashMap<K,V>();
for(Map.Entry<K,Entry<V>> entry: map.entrySet())
retval.put(entry.getKey(), entry.getValue().val);

0 comments on commit 6df977d

Please sign in to comment.
Something went wrong with that request. Please try again.