Examples of retainAll()


Examples of com.alibaba.fastjson.JSONArray.retainAll()

        Assert.assertEquals(0, array.size());
        array.addAll(0, Arrays.asList(1, 2, 3));
        Assert.assertEquals(3, array.size());
        array.clear();
        array.addAll(0, Arrays.asList(1, 2, 3));
        Assert.assertEquals(true, array.retainAll(Arrays.asList(1, 2)));
        Assert.assertEquals(2, array.size());
        Assert.assertEquals(true, array.retainAll(Arrays.asList(2, 4)));
        Assert.assertEquals(1, array.size());
        array.set(0, 4);
        Assert.assertEquals(4, array.toArray()[0]);
View Full Code Here

Examples of com.hazelcast.core.IList.retainAll()

        listTest.add("item0");
        listTest.add("item1");
        listTest.add("item2");


        assertTrue(list.retainAll(listTest));
        assertEquals(3, list.size());
        assertIterableEquals(list, "item0", "item1", "item2");
    }

    @Test(expected = NullPointerException.class)
View Full Code Here

Examples of com.hazelcast.core.ISet.retainAll()

        Set retained = new HashSet();

        for (int i = 1; i <= 10; i++) {
            set.add("item" + i);
        }
        set.retainAll(retained);
        assertEquals(0, set.size());
    }

    @Test
    public void testRetainAll_whenArgumentHasSameElements() {
View Full Code Here

Examples of com.ibm.icu.text.UnicodeSet.retainAll()

            case 22: test.removeAll(" a"); break;
            case 23: test.removeAll(new UnicodeSet("[\\ a]")); break;
            case 24: test.retain(' '); break;
            case 25: test.retain(' ','a'); break;
            case 26: test.retain(" "); break;
            case 27: test.retainAll(" a"); break;
            case 28: test.retainAll(new UnicodeSet("[\\ a]")); break;
            case 29: test.set(0,1); break;
            case 30: test.set(new UnicodeSet("[ab]")); break;
           
            default: continue main; // so we don't keep having to change the endpoint, and gaps are not skipped.
View Full Code Here

Examples of de.ailis.jollada.model.Nodes.retainAll()

        elements.add(child);
        final List<Object> toRetain = new ArrayList<Object>();
        toRetain.add(child);
        toRetain.add(new Node());
        toRetain.add("test");
        assertFalse(elements.retainAll(toRetain));
        toRetain.remove(child);
        assertTrue(elements.retainAll(toRetain));

        // Check if node was correctly detached from elements
        assertEquals(0, elements.size());
View Full Code Here

Examples of de.lmu.ifi.dbs.elki.database.ids.HashSetModifiableDBIDs.retainAll()

  protected DBIDs computeSubspace(Vector<IntIntPair> subspace, ArrayList<ArrayList<DBIDs>> ranges) {
    HashSetModifiableDBIDs ids = DBIDUtil.newHashSet(ranges.get(subspace.get(0).first - 1).get(subspace.get(0).second));
    // intersect all selected dimensions
    for(int i = 1; i < subspace.size(); i++) {
      DBIDs current = ranges.get(subspace.get(i).first - 1).get(subspace.get(i).second);
      ids.retainAll(current);
      if(ids.size() == 0) {
        break;
      }
    }
    return ids;
View Full Code Here

Examples of de.lmu.ifi.dbs.elki.database.ids.ModifiableDBIDs.retainAll()

    }
    resultIntervals.add(this.intervals.last());
    resultIntervals.add(other.intervals.last());

    ModifiableDBIDs resultIDs = DBIDUtil.newHashSet(this.ids);
    resultIDs.retainAll(other.ids);

    if(resultIDs.size() / all >= tau) {
      return new CLIQUEUnit<V>(resultIntervals, resultIDs);
    }
View Full Code Here

Examples of edu.brown.utils.PartitionSet.retainAll()

        // the prepare response once all of the PartitionExecutors have successfully
        // acknowledged that we're ready to commit
        PartitionSet partitions = new PartitionSet(request.getPartitionsList());
        assert(partitions.isEmpty() == false) :
            "Unexpected empty list of updated partitions for txn #" + txn_id;
        partitions.retainAll(hstore_site.getLocalPartitionIds());
       
        RemoteTransaction ts = this.hstore_site.getTransaction(txn_id);
        assert(ts != null) : "Unexpected null transaction handle for txn #" + txn_id;
       
        // Always create a new prepare callback because we may get multiple messages
View Full Code Here

Examples of gnu.trove.THashSet.retainAll()

    Set remainingVars = new THashSet (fromMdl.variablesSet ());
    remainingVars.removeAll (inputVars);
    for (Iterator it = fromMdl.factorsIterator (); it.hasNext ();) {
      Factor ptl = (Factor) it.next ();
      Set theseVars = new THashSet (ptl.varSet ());
      theseVars.retainAll (remainingVars);
      Factor slicedPtl = ptl.slice (assn);
      toMdl.addFactor (slicedPtl);
      if (toSlicedMap != null) {
        toSlicedMap.put (ptl, slicedPtl);
      }
View Full Code Here

Examples of gnu.trove.THashSet.retainAll()

  /** Computes a nondestructive intersection of two collections. */
  public static Collection intersection (Collection c1, Collection c2)
  {
    Set set = new THashSet (c1);
    set.retainAll (c2);
    return set;
  }

  public static Collection union (Collection c1, Collection c2)
  {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.