Package gnu.trove.set

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


        int no_entry_value = Integer.MIN_VALUE;
        TIntSet set = new TIntHashSet(10, 0.5f, no_entry_value);
        assertEquals(no_entry_value, set.getNoEntryValue());

        int[] ints = {42, 1138, 13, 86, 99};
        set.addAll(ints);

        int[] sink = new int[ints.length + 2];
        sink[sink.length - 1] = -1;
        sink[sink.length - 2] = -2;
View Full Code Here


        TIntSet raw_set = new TIntHashSet();
        Set<Integer> set = TDecorators.wrap( raw_set );
        set.addAll( Arrays.asList( ints ) );

        TIntSet other = new TIntHashSet();
        other.addAll( Arrays.asList( ints ) );

        Integer[] to_retain = {13, 86, 99, 1138};

        TIntSet raw_retain_set = new TIntHashSet();
        Set<Integer> retain_set = TDecorators.wrap( raw_retain_set );
View Full Code Here

        assertTrue( "sets incorrectly not equal: " + set + ", " + other,
                set.equals( other ) );

        int[] mismatched = {72, 49, 53, 1024, 999};
        TIntSet raw_unequal = new TIntHashSet();
        raw_unequal.addAll( mismatched );
        Set<Integer> unequal = TDecorators.wrap( raw_unequal );

        assertFalse( "sets incorrectly equal: " + set + ", " + unequal,
                set.equals( unequal ) );
View Full Code Here


    public void testHashcode() {
        int[] ints = {1138, 42, 86, 99, 101};
        TIntSet raw_set = new TIntHashSet();
        raw_set.addAll( ints );
        Set<Integer> set = TDecorators.wrap( raw_set );
        TIntSet raw_other = new TIntHashSet();
        raw_other.addAll( ints );
        Set<Integer> other = TDecorators.wrap( raw_other );
View Full Code Here

        int[] ints = {1138, 42, 86, 99, 101};
        TIntSet raw_set = new TIntHashSet();
        raw_set.addAll( ints );
        Set<Integer> set = TDecorators.wrap( raw_set );
        TIntSet raw_other = new TIntHashSet();
        raw_other.addAll( ints );
        Set<Integer> other = TDecorators.wrap( raw_other );

        assertTrue( "hashcodes incorrectly not equal: " + set + ", " + other,
                set.hashCode() == other.hashCode() );
View Full Code Here

        assertTrue( "hashcodes incorrectly not equal: " + set + ", " + other,
                set.hashCode() == other.hashCode() );

        int[] mismatched = {72, 49, 53, 1024, 999};
        TIntSet unequal = new TIntHashSet();
        unequal.addAll( mismatched );

        assertFalse( "hashcodes unlikely equal: " + set + ", " + unequal,
                set.hashCode() == unequal.hashCode() );
    }
}
View Full Code Here

        for ( int i = 0; i < keys.length; i++ ) {
            java_set.add( Integer.valueOf( keys[i] ) );
        }

        try {
            set.addAll( java_set );
            fail( "Expected UnsupportedOperationException" );
        }
        catch ( UnsupportedOperationException ex ) {
            // Expected
        }
View Full Code Here

        catch ( UnsupportedOperationException ex ) {
            // Expected
        }

        try {
            set.addAll( set );
            fail( "Expected UnsupportedOperationException" );
        }
        catch ( UnsupportedOperationException ex ) {
            // Expected
        }
View Full Code Here

        catch ( UnsupportedOperationException ex ) {
            // Expected
        }

        try {
            set.addAll( keys );
            fail( "Expected UnsupportedOperationException" );
        }
        catch ( UnsupportedOperationException ex ) {
            // Expected
        }
View Full Code Here

        TIntSet set = map.keySet();
        assertEquals( map.size(), set.size() );
        assertFalse( set.isEmpty() );

        TIntSet other = new TIntHashSet();
        other.addAll( keys );

        assertTrue( "sets incorrectly not equal: " + set + ", " + other,
                set.equals( other ) );

        int[] mismatched = {72, 49, 53, 1024, 999};
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.