Package it.unimi.dsi.fastutil.longs

Examples of it.unimi.dsi.fastutil.longs.LongSortedSet.headSet()


    @Test
    public void testHeadSet() {
        long[] data = {7, 5, 2, 6, 42};
        LongSortedSet set = new LongSortedArraySet(data);
        assertEquals(data.length, set.size());
        testSetSimple(set.headSet(7));
    }

    @Test
    public void testTailSet() {
        long[] data = {0, 5, 2, 6, 1};
View Full Code Here


                   equalTo(new long[]{7, 8, 42, 639}));
        assertThat(LongIterators.unwrap(set.iterator(2)),
                   equalTo(new long[]{7, 8, 42, 639}));
        assertThat(LongIterators.unwrap(set.iterator(7)),
                   equalTo(new long[]{8, 42, 639}));
        assertThat(set.headSet(42), hasSize(2));
    }

    @Test
    public void testMaskMid() {
        LongKeyDomain keys = LongKeyDomain.create(2, 7, 8, 42, 639);
View Full Code Here

                   equalTo(new long[]{2, 7, 42, 639}));
        assertThat(LongIterators.unwrap(set.iterator(2)),
                   equalTo(new long[]{7, 42, 639}));
        assertThat(LongIterators.unwrap(set.iterator(7)),
                   equalTo(new long[]{42, 639}));
        assertThat(set.headSet(42), hasSize(2));
        assertThat(set.toLongArray(),
                   equalTo(new long[]{2, 7, 42, 639}));
    }

    @Test
View Full Code Here

                   equalTo(new long[]{2, 7, 8, 42}));
        assertThat(LongIterators.unwrap(set.iterator(2)),
                   equalTo(new long[]{7, 8, 42}));
        assertThat(LongIterators.unwrap(set.iterator(7)),
                   equalTo(new long[]{8, 42}));
        assertThat(set.headSet(42).toLongArray(),
                   equalTo(new long[]{2, 7, 8}));
        assertThat(set.tailSet(7).toLongArray(),
                   equalTo(new long[]{7, 8, 42}));
    }
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.