Package gnu.trove.iterator

Examples of gnu.trove.iterator.TIntIterator


    }

    /** {@inheritDoc} */
    public boolean retainAll(TIntCollection collection) {
        boolean modified = false;
        TIntIterator iter = iterator();
        while (iter.hasNext()) {
            if (!collection.contains(iter.next())) {
                iter.remove();
                modified = true;
            }
        }
        return modified;
    }
View Full Code Here


    /** {@inheritDoc} */
    public boolean retainAll(int[] array) {
        Arrays.sort(array);

        boolean modified = false;
        TIntIterator iter = iterator();
        while (iter.hasNext()) {
            if (Arrays.binarySearch(array, iter.next()) < 0) {
                iter.remove();
                modified = true;
            }
        }
        return modified;
    }
View Full Code Here

    }

    /** {@inheritDoc} */
    public boolean removeAll(Collection<?> collection) {
        boolean modified = false;
        TIntIterator iter = iterator();
        while (iter.hasNext()) {
            if (collection.contains(Integer.valueOf(iter.next()))) {
                iter.remove();
                modified = true;
            }
        }
        return modified;
    }
View Full Code Here

    }

    /** {@inheritDoc} */
    public boolean removeAll(TIntCollection collection) {
        boolean modified = false;
        TIntIterator iter = iterator();
        while (iter.hasNext()) {
            if (collection.contains(iter.next())) {
                iter.remove();
                modified = true;
            }
        }
        return modified;
    }
View Full Code Here

    /** {@inheritDoc} */
    public boolean removeAll(int[] array) {
        Arrays.sort(array);

        boolean modified = false;
        TIntIterator iter = iterator();
        while (iter.hasNext()) {
            if (Arrays.binarySearch(array, iter.next()) >= 0) {
                iter.remove();
                modified = true;
            }
        }
        return modified;
    }
View Full Code Here

    }

    /** {@inheritDoc} */
    public TIntIterator iterator() {
        return new TIntIterator() {
            TIntLink l = head;
            TIntLink current;

            public int next() {
                if (no(l))
View Full Code Here

        TIntLinkedList that = (TIntLinkedList) o;

        if (no_entry_value != that.no_entry_value) return false;
        if (size != that.size) return false;

        TIntIterator iterator = iterator();
        TIntIterator thatIterator = that.iterator();
        while (iterator.hasNext()) {
            if (!thatIterator.hasNext())
                return false;

            if (iterator.next() != thatIterator.next())
                return false;
        }

        return true;
    }
View Full Code Here

    }

    @Override
    public String toString() {
        final StringBuilder buf = new StringBuilder("{");
        TIntIterator it = iterator();
        while (it.hasNext()) {
            int next = it.next();
            buf.append(next);
            if (it.hasNext())
                buf.append(", ");
        }
        buf.append("}");
        return buf.toString();
View Full Code Here

            return true;
        }

        /** {@inheritDoc} */
        public boolean containsAll( TIntCollection collection ) {
            TIntIterator iter = collection.iterator();
            while ( iter.hasNext() ) {
                if ( ! TObjectIntCustomHashMap.this.containsValue( iter.next() ) ) {
                    return false;
                }
            }
            return true;
        }
View Full Code Here

        /** {@inheritDoc} */
        @SuppressWarnings({"SuspiciousMethodCalls"})
        public boolean retainAll( Collection<?> collection ) {
            boolean modified = false;
            TIntIterator iter = iterator();
            while ( iter.hasNext() ) {
                if ( ! collection.contains( Integer.valueOf ( iter.next() ) ) ) {
                    iter.remove();
                    modified = true;
                }
            }
            return modified;
        }
View Full Code Here

TOP

Related Classes of gnu.trove.iterator.TIntIterator

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.