Package gnu.trove.set

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


    public void testRetainAll() throws Exception {

        int[] ints = {1138, 42, 13, 86, 99, 101};

        TIntSet set = new TIntHashSet();
        set.addAll(ints);

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

        int[] to_retain = {13, 86, 99, 1138};
View Full Code Here


        TIntSet set = new TIntHashSet();
        set.addAll(ints);

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

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

        TIntSet retain_set = new TIntHashSet();
        retain_set.addAll(to_retain);
View Full Code Here

        other.addAll(ints);

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

        TIntSet retain_set = new TIntHashSet();
        retain_set.addAll(to_retain);

        List<Integer> retain_list = new ArrayList<Integer>();
        for (int element : to_retain) {
            retain_list.add(element);
        }
View Full Code Here

    public void testRemoveAll() throws Exception {

        int[] ints = {1138, 42, 13, 86, 99, 101};

        TIntSet set = new TIntHashSet();
        set.addAll(ints);

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

        int[] to_remove = {13, 86, 99, 1138};
View Full Code Here

        TIntSet set = new TIntHashSet();
        set.addAll(ints);

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

        int[] to_remove = {13, 86, 99, 1138};

        TIntSet remove_set = new TIntHashSet();
        remove_set.addAll(to_remove);
View Full Code Here

        other.addAll(ints);

        int[] to_remove = {13, 86, 99, 1138};

        TIntSet remove_set = new TIntHashSet();
        remove_set.addAll(to_remove);

        List<Integer> remove_list = new ArrayList<Integer>();
        for (int element : to_remove) {
            remove_list.add(element);
        }
View Full Code Here

    }


    public void testClear() throws Exception {
        TIntSet set = new TIntHashSet();
        set.addAll(new int[]{1, 2, 3});
        assertEquals("size was not 3", 3, set.size());
        set.clear();
        assertEquals("initial size was not 0", 0, set.size());
    }
View Full Code Here

    public void testSerialize() throws Exception {
        int[] ints = {1138, 42, 86, 99, 101};

        TIntSet set = new TIntHashSet();
        set.addAll(ints);
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        ObjectOutputStream oos = new ObjectOutputStream(baos);
        oos.writeObject(set);

        ByteArrayInputStream bias = new ByteArrayInputStream(baos.toByteArray());
View Full Code Here


    public void testToArray() {
        TIntSet set = new TIntHashSet();
        int[] ints = {42, 1138, 13, 86, 99};
        set.addAll(ints);
        int[] res = set.toArray();
        Arrays.sort(ints);
        Arrays.sort(res);
        assertTrue(Arrays.equals(ints, res));
    }
View Full Code Here


    public void testToArrayMatchesIteratorOrder() {
        TIntSet set = new TIntHashSet();
        int[] ints = {42, 1138, 13, 86, 99};
        set.addAll(ints);
        int[] toarray_ints = set.toArray();

        int[] iter_ints = new int[5];
        TIntIterator iter = set.iterator();
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.