CloseableIterator.remove
Code IndexAdd Codota to your IDE (free)

Best code snippets using org.infinispan.commons.util.CloseableIterator.remove(Showing top 15 results out of 315)

origin: org.infinispan/infinispan-core

@Override
public boolean retainAll(Collection<?> c) {
 boolean modified = false;
 try (CloseableIterator<O> it = iterator()) {
   while (it.hasNext()) {
    if (!c.contains(it.next())) {
      it.remove();
      modified = true;
    }
   }
   return modified;
 }
}
origin: infinispan/infinispan

public void testEntrySetIteratorRemoveInExplicitTx() throws Exception {
 assertEquals(0, cache.size());
 cache.put("k1", "v1");
 TransactionManager tm = TestingUtil.getTransactionManager(cache);
 withTx(tm, () -> {
   try (CloseableIterator<Entry<Object, Object>> entryIterator = cache.entrySet().iterator()) {
    entryIterator.next();
    entryIterator.remove();
    assertEquals(0, cache.size());
   }
   tm.setRollbackOnly();
   return null;
 });
}
origin: infinispan/infinispan

@Test(dataProvider = "collections")
public void testIteratorRemove(Function<RemoteCache<?, ?>, CloseableIteratorCollection<?>> function) {
 populateCacheManager();
 CloseableIteratorCollection<?> collection = function.apply(remoteCache);
 assertEquals(100, collection.size());
 try (CloseableIterator<?> iter = collection.iterator()) {
   assertTrue(iter.hasNext());
   assertNotNull(iter.next());
   Object removed = iter.next();
   assertNotNull(removed);
   iter.remove();
   assertTrue(iter.hasNext());
 }
 assertEquals(99, collection.size());
}
origin: org.infinispan/infinispan-core

@Override
public boolean remove(Object o) {
 try (CloseableIterator<V> it = iterator()) {
   while (it.hasNext()) {
    V next = it.next();
    if (o.equals(next)) {
      it.remove();
      return true;
    }
   }
   return false;
 }
}
origin: infinispan/infinispan

  public void testKeySetIteratorRemoveInExplicitTx() throws Exception {
   assertEquals(0, cache.size());
   cache.put("k1", "v1");

   TransactionManager tm = TestingUtil.getTransactionManager(cache);
   withTx(tm, () -> {
     try (CloseableIterator<Object> entryIterator = cache.keySet().iterator()) {
      entryIterator.next();
      entryIterator.remove();
      assertEquals(0, cache.size());
     }
     tm.setRollbackOnly();
     return null;
   });
  }
}
origin: org.infinispan/infinispan-embedded

@Override
public boolean retainAll(Collection<?> c) {
 boolean modified = false;
 try (CloseableIterator<O> it = iterator()) {
   while (it.hasNext()) {
    if (!c.contains(it.next())) {
      it.remove();
      modified = true;
    }
   }
   return modified;
 }
}
origin: org.infinispan/infinispan-core

@Override
public boolean retainAll(Collection<?> c) {
 boolean modified = false;
 try (CloseableIterator<O> it = iterator()) {
   while (it.hasNext()) {
    if (!c.contains(it.next())) {
      it.remove();
      modified = true;
    }
   }
   return modified;
 }
}
origin: infinispan/infinispan

@Override
public boolean retainAll(Collection<?> c) {
 boolean modified = false;
 try (CloseableIterator<O> it = iterator()) {
   while (it.hasNext()) {
    if (!c.contains(it.next())) {
      it.remove();
      modified = true;
    }
   }
   return modified;
 }
}
origin: org.infinispan/infinispan-embedded

@Override
public boolean remove(Object o) {
 try (CloseableIterator<V> it = iterator()) {
   while (it.hasNext()) {
    V next = it.next();
    if (o.equals(next)) {
      it.remove();
      return true;
    }
   }
   return false;
 }
}
origin: org.infinispan/infinispan-core

@Override
public boolean remove(Object o) {
 try (CloseableIterator<V> it = iterator()) {
   while (it.hasNext()) {
    V next = it.next();
    if (o.equals(next)) {
      it.remove();
      return true;
    }
   }
   return false;
 }
}
origin: org.infinispan/infinispan-embedded

@Override
public boolean retainAll(Collection<?> c) {
 boolean modified = false;
 try (CloseableIterator<O> it = iterator()) {
   while (it.hasNext()) {
    if (!c.contains(it.next())) {
      it.remove();
      modified = true;
    }
   }
   return modified;
 }
}
origin: infinispan/infinispan

@Override
public boolean remove(Object o) {
 try (CloseableIterator<V> it = iterator()) {
   while (it.hasNext()) {
    V next = it.next();
    if (o.equals(next)) {
      it.remove();
      return true;
    }
   }
   return false;
 }
}
origin: org.infinispan/infinispan-embedded

@Override
public boolean remove(Object o) {
 try (CloseableIterator<V> it = iterator()) {
   while (it.hasNext()) {
    V next = it.next();
    if (o.equals(next)) {
      it.remove();
      return true;
    }
   }
   return false;
 }
}
origin: org.infinispan/infinispan-core

public void testEntrySetIteratorRemoveInExplicitTx() throws Exception {
 assertEquals(0, cache.size());
 cache.put("k1", "v1");
 TransactionManager tm = TestingUtil.getTransactionManager(cache);
 withTx(tm, () -> {
   try (CloseableIterator<Entry<Object, Object>> entryIterator = cache.entrySet().iterator()) {
    entryIterator.next();
    entryIterator.remove();
    assertEquals(0, cache.size());
   }
   tm.setRollbackOnly();
   return null;
 });
}
origin: org.infinispan/infinispan-core

  public void testKeySetIteratorRemoveInExplicitTx() throws Exception {
   assertEquals(0, cache.size());
   cache.put("k1", "v1");

   TransactionManager tm = TestingUtil.getTransactionManager(cache);
   withTx(tm, () -> {
     try (CloseableIterator<Object> entryIterator = cache.keySet().iterator()) {
      entryIterator.next();
      entryIterator.remove();
      assertEquals(0, cache.size());
     }
     tm.setRollbackOnly();
     return null;
   });
  }
}
org.infinispan.commons.utilCloseableIteratorremove

Popular methods of CloseableIterator

  • hasNext
  • next
  • close
  • forEachRemaining

Popular classes and methods

  • setContentView (Activity)
  • setRequestProperty (URLConnection)
    Sets the value of the specified request header field. The value will only be used by the current URL
  • startActivity (Activity)
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • LinkedHashMap (java.util)
    Hash table implementation of the Map interface with predictable iteration order. [Sun docs] [http:/
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • BoxLayout (javax.swing)
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • Logger (org.slf4j)
    The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that loggin

For IntelliJ IDEA,
Android Studio or Eclipse

  • Codota IntelliJ IDEA pluginCodota Android Studio pluginCode IndexSign in
  • EnterpriseFAQAboutContact Us
  • Terms of usePrivacy policyCodeboxFind Usages
Add Codota to your IDE (free)