Package com.carrotsearch.hppc.predicates

Examples of com.carrotsearch.hppc.predicates.BytePredicate


    @Override
    public int removeAll(final ByteLookupContainer c)
    {
        // We know c holds sub-types of byte and we're not modifying c, so go unchecked.
        final ByteContainer c2 = (ByteContainer) c;
        return this.removeAll(new BytePredicate()
        {
            public boolean apply(byte k)
            {
                return c2.contains(k);
            }
View Full Code Here


    @Override
    public int retainAll(final ByteLookupContainer c)
    {
        // We know c holds sub-types of byte and we're not modifying c, so go unchecked.
        final ByteContainer c2 = (ByteContainer) c;
        return this.removeAll(new BytePredicate()
        {
            public boolean apply(byte k)
            {
                return !c2.contains(k);
            }
View Full Code Here

     * and negates the predicate.
     */
    @Override
    public int retainAll(final BytePredicate predicate)
    {
        return removeAll(new BytePredicate()
        {
            public boolean apply(byte value)
            {
                return !predicate.apply(value);
            };
View Full Code Here

    @Override
    public int removeAll(final ByteLookupContainer c)
    {
        // We know c holds sub-types of byte and we're not modifying c, so go unchecked.
        final ByteContainer c2 = (ByteContainer) c;
        return this.removeAll(new BytePredicate()
        {
            public boolean apply(byte k)
            {
                return c2.contains(k);
            }
View Full Code Here

    @Override
    public int retainAll(final ByteLookupContainer c)
    {
        // We know c holds sub-types of byte and we're not modifying c, so go unchecked.
        final ByteContainer c2 = (ByteContainer) c;
        return this.removeAll(new BytePredicate()
        {
            public boolean apply(byte k)
            {
                return !c2.contains(k);
            }
View Full Code Here

     * and negates the predicate.
     */
    @Override
    public int retainAll(final BytePredicate predicate)
    {
        return removeAll(new BytePredicate()
        {
            public boolean apply(byte value)
            {
                return !predicate.apply(value);
            };
View Full Code Here

    @Test
    public void testRemoveAllWithPredicate()
    {
        set.add(newArray(set.keys, 0, key1, key2));

        assertEquals(1, set.removeAll(new BytePredicate()
        {
            public boolean apply(/* replaceIf:applied. */ byte  /* end */ v)
            {
                return v == key1;
            };
View Full Code Here

    @Test
    public void testRetainAllWithPredicate()
    {
        set.add(newArray(set.keys, 0, key1, key2, 3, 4, 5));

        assertEquals(4, set.retainAll(new BytePredicate()
        {
            public boolean apply(/* replaceIf:applied. */ byte  /* end */ v)
            {
                return v == key1 || v == key2;
            };
View Full Code Here

    @Test
    public void testRemoveAllWithPredicate()
    {
        list.add(newArray(list.buffer, 0, key1, key2, key1, 4));

        assertEquals(3, list.removeAll(new BytePredicate()
        {
            public boolean apply(/* replaceIf:applied. */ byte  /* end */ v)
            {
                return v == key1 || v == key2;
            };
View Full Code Here

    @Test
    public void testRetainAllWithPredicate()
    {
        list.add(newArray(list.buffer, 0, key1, key2, key1, 0));

        assertEquals(2, list.retainAll(new BytePredicate()
        {
            public boolean apply(/* replaceIf:applied. */ byte  /* end */ v)
            {
                return v == key1 || v == key2;
            };
View Full Code Here

TOP

Related Classes of com.carrotsearch.hppc.predicates.BytePredicate

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.