Examples of retainAll()


Examples of gnu.trove.THashSet.retainAll()

  }

  public static VarSet defaultIntersection (VarSet v1, VarSet v2)
  {// Grossly inefficient implementation
    THashSet hset = new THashSet (v1);
    hset.retainAll (v2);
    Variable[] ret = new Variable [hset.size ()];

    int vai = 0;
    for (int vi = 0; vi < v1.size(); vi++) {
      Variable var = v1.get (vi);
View Full Code Here

Examples of gnu.trove.TIntCollection.retainAll()

        List<Integer> java_list = new ArrayList<Integer>();
        for ( int value : vals ) {
            java_list.add( value );
        }
        assertFalse( "collection: " + collection + ", should contain all in list: " +
                     java_list, collection.retainAll( java_list ) );

        java_list.remove( 5 );
        assertTrue( "collection: " + collection + ", should contain all in list: " +
                    java_list, collection.retainAll( java_list ) );
        assertFalse( collection.contains( vals[5] ) );
View Full Code Here

Examples of gnu.trove.TLongCollection.retainAll()

        // test with a java.util.Map
        Set<Number> java_set = new HashSet<Number>();
        for ( int i = 0; i < vals.length; i++ ) {
            java_set.add( Long.valueOf( vals[i] ) );
        }
        assertFalse( values.retainAll( java_set ) );
        assertEquals( keys.length, values.size() );
        assertEquals( keys.length, map.size() );
        for ( int i = 0; i < keys.length; i++ ) {
            assertTrue( values.contains( vals[i] ) );
            assertTrue( map.containsValue( vals[i] ) );
View Full Code Here

Examples of gnu.trove.list.TIntList.retainAll()

        }

        assertEquals( element_count, list.size() );
        assertEquals( element_count, other.size() );

        assertFalse( list.retainAll( list ) );

        assertFalse( list.retainAll( other ) );
        assertEquals( element_count, list.size() );
        for ( int i = 0; i < list.size(); i++ ) {
            assertEquals( i , list.get( i ) );
View Full Code Here

Examples of gnu.trove.set.TIntSet.retainAll()

        Collection<Integer> test_collection = new HashSet<Integer>();
        for ( int i = 0; i < element_count; i++ ) {
            test_collection.add( keys[i] );
        }
        keyset.retainAll( test_collection );
        assertFalse( keyset.isEmpty() );
        assertFalse( map.isEmpty() );

        // Reset map
        for ( int i = 0; i < element_count; i++ ) {
View Full Code Here

Examples of it.unimi.dsi.fastutil.ints.IntLinkedOpenHashSet.retainAll()

              s0.clear();
              s1.clear();
              // TODO: in case we have positions, we should check them, too
              IntIterators.pour( termLists ? indexReader[ i ].documents( terms[ i ].get( t ) ) : indexReader[ i ].documents( t ), s0 );
              IntIterators.pour( termLists ? indexReader[ i ].documents( terms[ i ].get( u ) ) : indexReader[ i ].documents( u ), s1 );
              s0.retainAll( s1 );
              indexIterator =  termLists ? indexReader[ i ].documents( terms[ i ].get( t ) ) : indexReader[ i ].documents( t );
              additionalIterator = termLists ? additionalReader.documents( terms[ i ].get( u ) ) : additionalReader.documents( u );
              it = s0.iterator();
              documentIterator = AndDocumentIterator.getInstance( indexIterator, additionalIterator );
              for( int j = s0.size(); j-- != 0; ) if ( it.nextInt() != documentIterator.nextDocument() ) throw new AssertionError();
View Full Code Here

Examples of it.unimi.dsi.fastutil.longs.LongSet.retainAll()

    @Test
    public void testRetainAll() {
        LongKeyDomain lks = LongKeyDomain.create(20, 25, 30, 42, 62, 99);
        LongSet ls = lks.modifiableActiveSetView();
        List<Long> rm = Longs.asList(20, 25, 62, 30, 98, 1);
        assertThat(ls.retainAll(rm), equalTo(true));
        assertThat(ls, contains(20L, 25L, 30L, 62L));
        assertThat(Lists.newArrayList(lks.activeIndexIterator(false)),
                   contains(0, 1, 2, 4));
    }
View Full Code Here

Examples of java.util.ArrayList.retainAll()

    if (dragged instanceof Listitem) {
      Set<Listitem> itemSet = new HashSet<Listitem>(getListbox()
          .getSelectedItems());
      itemSet.add((Listitem) dragged);
      List<Listitem> itemList = new ArrayList(getListbox().getItems());
      itemList.retainAll(itemSet);
      for (Listitem listitem : itemList) {
        if (listitem != target) {
          listitem.getParent().removeChild(listitem);
          target.getParent().insertBefore(listitem, target);
        }
View Full Code Here

Examples of java.util.ArrayList.retainAll()

    public boolean retainAll(Collection collection) {

        if (fast) {
            synchronized (this) {
                ArrayList temp = (ArrayList) list.clone();
                boolean result = temp.retainAll(collection);
                list = temp;
                return (result);
            }
        } else {
            synchronized (list) {
View Full Code Here

Examples of java.util.ArrayList.retainAll()

                        || cpc.getConfs().isEmpty() || cpc.getConfs().contains("*")) {
                    error = "A container already exists for the selected conf of "
                            + "the module descriptor";
                } else {
                    ArrayList list = new ArrayList(cpc.getConfs());
                    list.retainAll(selectedConfigurations);
                    if (!list.isEmpty()) {
                        error = "A container already exists for the selected conf of "
                                + "the module descriptor";
                    }
                }
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.