Package gnu.trove.set

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


        int max = 0;
        for (Map.Entry<Integer,Integer> e : classes) {
            int clazz = e.getKey();
            int count = e.getValue();
            if (count > max) {
                ties.clear();
                max = count;
            }
            if (count == max)
                ties.add(clazz);
        }
View Full Code Here


        while (iter.hasNext()) {
            iter.advance();
            double weight = iter.value();
            if (weight > maxSum) {
                maxSum = weight;
                ties.clear();
            }
            if (weight == maxSum)
                ties.add(iter.key());
           
        }
View Full Code Here

        TIntSet s = new TIntHashSet();
        assertTrue("new set wasn't empty", s.isEmpty());

        s.add(1);
        assertTrue("set with element reports empty", !s.isEmpty());
        s.clear();
        assertTrue("cleared set reports not-empty", s.isEmpty());
    }


    public void testContains() throws Exception {
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());
    }


    public void testSerialize() throws Exception {
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() );
    }


    public void testSerialize() throws Exception {
View Full Code Here

        TIntSet s = new TIntHashSet();
        assertTrue( "new set wasn't empty", s.isEmpty() );

        s.add( 1 );
        assertTrue( "set with element reports empty", !s.isEmpty() );
        s.clear();
        assertTrue( "cleared set reports not-empty", s.isEmpty() );
    }


    public void testContains() throws Exception {
View Full Code Here

        TIntSet s = new TIntHashSet();
        assertTrue("new set wasn't empty", s.isEmpty());

        s.add(1);
        assertTrue("set with element reports empty", !s.isEmpty());
        s.clear();
        assertTrue("cleared set reports not-empty", s.isEmpty());
    }


    public void testContains() throws Exception {
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());
    }


    public void testSerialize() throws Exception {
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.