Package gnu.trove.set

Examples of gnu.trove.set.TIntSet


        }

        @Override
        public void submit(TIntSet removed, TIntSet added) {
            insureInitialized();
            TIntSet parentRemoved = null, parentAdded;
            //Calculating really removed indices set
            TIntIterator iterator = removed.iterator();
            int iIndex, index;
            while (iterator.hasNext()) {
                iIndex = Arrays.binarySearch(allDummyIndices, index = iterator.next());
                usedArrays[iIndex].clear(position.currentIndex());

                if (usedArrays[iIndex].bitCount() == 0) {
                    if (parentRemoved == null)
                        parentRemoved = new TIntHashSet(removed.size());
                    parentRemoved.add(index);
                }
            }
            if (parentRemoved == null)
                parentRemoved = EMPTY_INT_SET;
View Full Code Here


                if (!(pn instanceof ParseTokenScalarFunction))
                    getAllIndices1(pn, set);
    }

    public static TIntSet getAllIndicesT(ParseToken node) {
        TIntSet set = new TIntHashSet();
        getAllIndicesT1(node, set);
        return set;
    }
View Full Code Here

        }
    }

    private void processDeletedEvt(int tgtVecId) {
        if (this.reverseIndexer.containsKey(tgtVecId)) {
            TIntSet range = this.reverseIndexer.get(tgtVecId);
            TIntIterator iter = range.iterator();
            while (iter.hasNext()) {
                int srcVecId = iter.next();
                this.sorters.get(srcVecId).remove(tgtVecId);
            }
        }
View Full Code Here

  public Properties getYtexProperties() {
    return ytexProperties;
  }

  private boolean checkCycle(ConcRel crPar, ConcRel crChild) {
    TIntSet visitedNodes = new TIntHashSet();
    return hasAncestor(crPar, crChild, visitedNodes);
  }
View Full Code Here

        other.add( 1138 );
        assertFalse( "list: " + list + " should not contain all of other: " + other,
                list.containsAll( other ) );

        TIntSet set = new TIntHashSet( list );
        assertTrue( "list: " + list + " should contain all of set: " + set,
                list.containsAll( set ) );

        set.add ( 1138 );
        assertFalse( "list: " + list + " should not contain all of set: " + set,
                list.containsAll( set ) );
    }
View Full Code Here

       
        other.add( 1138 );
        assertFalse( "list: " + list + " should not contain all of other: " + other,
                list.containsAll( other ) );

        TIntSet set = new TIntHashSet( list );
        assertTrue( "list: " + list + " should contain all of set: " + set,
                list.containsAll( set ) );

        set.add ( 1138 );
        assertFalse( "list: " + list + " should not contain all of set: " + set,
                list.containsAll( set ) );
    }
View Full Code Here

            assertEquals( keys_array[count], key );
            count++;
        }
        assertNull( keys_array[keyset.size()] );

        TIntSet raw_other = new TIntHashSet( keyset );
        Set<Integer> other = TDecorators.wrap( raw_other );
        assertFalse( keyset.retainAll( other ) );
        other.remove( keys[5] );
        assertTrue( keyset.retainAll( other ) );
        assertFalse( keyset.contains( keys[5] ) );
View Full Code Here

        super.tearDown();
    }


    public void testConstructors() throws Exception {
        TIntSet raw_set = new TIntHashSet();
        Set<Integer> set = TDecorators.wrap( raw_set );
        assertNotNull( set );

        Integer[] ints = {1138, 42, 86, 99, 101};
        set.addAll( Arrays.asList( ints ) );

        Set<Integer> copy = new HashSet<Integer>( set );
        assertTrue( "set not a copy: " + set + ", " + copy, set.equals( copy ) );

        TIntSet raw_another = new TIntHashSet( 20 );
        Set<Integer> another = TDecorators.wrap( raw_another );
        another.addAll( Arrays.asList( ints ) );
        assertTrue( "set not equal: " + set + ", " + copy, set.equals( another ) );

        raw_another = new TIntHashSet( 2, 1.0f );
View Full Code Here

        assertTrue( "set not equal: " + set + ", " + copy, set.equals( another ) );
    }


    public void testIsEmpty() throws Exception {
        TIntSet raw_set = new TIntHashSet();
        Set<Integer> set = TDecorators.wrap( raw_set );
        assertTrue( "new set wasn't empty", set.isEmpty() );

        set.add( 1 );
        assertFalse( "set with element reports empty", set.isEmpty() );
View Full Code Here

        assertTrue( "cleared set reports not-empty", set.isEmpty() );
    }


    public void testContains() throws Exception {
        TIntSet raw_set = new TIntHashSet();
        Set<Integer> set = TDecorators.wrap( raw_set );
        int i = 100;
        set.add( i );
        assertTrue( "contains failed", set.contains( i ) );
        assertFalse( "contains failed", set.contains( 1000 ) );
View Full Code Here

TOP

Related Classes of gnu.trove.set.TIntSet

Copyright © 2018 www.massapicom. 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.