Package gnu.trove.iterator

Examples of gnu.trove.iterator.TLongIterator


        /** {@inheritDoc} */
        public boolean containsAll( TLongCollection collection ) {
            if ( collection == this ) {
                return true;
            }
            TLongIterator iter = collection.iterator();
            while ( iter.hasNext() ) {
                if ( ! TLongObjectHashMap.this.containsKey( iter.next() ) ) {
                    return false;
                }
            }
            return true;
        }
View Full Code Here


        }

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

        public boolean retainAll( TLongCollection collection ) {
            if ( this == collection ) {
                return false;
            }
            boolean modified = false;
            TLongIterator iter = iterator();
            while ( iter.hasNext() ) {
                if ( ! collection.contains( iter.next() ) ) {
                    iter.remove();
                    modified = true;
                }
            }
            return modified;
        }
View Full Code Here

            if ( collection == this ) {
                clear();
                return true;
            }
            boolean changed = false;
            TLongIterator iter = collection.iterator();
            while ( iter.hasNext() ) {
                long element = iter.next();
                if ( remove( element ) ) {
                    changed = true;
                }
            }
            return changed;
View Full Code Here

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

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

    }

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

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

        TLongLinkedList that = (TLongLinkedList) o;

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

        TLongIterator iterator = iterator();
        TLongIterator 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("{");
        TLongIterator it = iterator();
        while (it.hasNext()) {
            long 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( TLongCollection collection ) {
            TLongIterator iter = collection.iterator();
            while ( iter.hasNext() ) {
                if ( ! TObjectLongCustomHashMap.this.containsValue( iter.next() ) ) {
                    return false;
                }
            }
            return true;
        }
View Full Code Here

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

TOP

Related Classes of gnu.trove.iterator.TLongIterator

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.