Examples of TLongSet


Examples of gnu.trove.set.TLongSet

    /** {@inheritDoc} */
    public boolean equals( Object other ) {
        if ( ! ( other instanceof TLongSet ) ) {
            return false;
        }
        TLongSet that = ( TLongSet ) other;
        if ( that.size() != this.size() ) {
            return false;
        }
        for ( int i = _states.length; i-- > 0; ) {
            if ( _states[i] == FULL ) {
                if ( ! that.contains( _set[i] ) ) {
                    return false;
                }
            }
        }
        return true;
View Full Code Here

Examples of gnu.trove.set.TLongSet

        /** {@inheritDoc) */
        public boolean equals( Object other ) {
            if (! ( other instanceof TLongSet ) ) {
                return false;
            }
            final TLongSet that = ( TLongSet ) other;
            if ( that.size() != this.size() ) {
                return false;
            }
            for ( int i = _states.length; i-- > 0; ) {
                if ( _states[i] == FULL ) {
                    if ( ! that.contains( _set[i] ) ) {
                        return false;
                    }
                }
            }
            return true;
View Full Code Here

Examples of gnu.trove.set.TLongSet

    /** {@inheritDoc} */
    public boolean equals( Object other ) {
        if ( ! ( other instanceof TLongSet ) ) {
            return false;
        }
        TLongSet that = ( TLongSet ) other;
        if ( that.size() != this.size() ) {
            return false;
        }
        for ( int i = _states.length; i-- > 0; ) {
            if ( _states[i] == FULL ) {
                if ( ! that.contains( _set[i] ) ) {
                    return false;
                }
            }
        }
        return true;
View Full Code Here

Examples of gnu.trove.set.TLongSet

        /** {@inheritDoc) */
        public boolean equals( Object other ) {
            if (! ( other instanceof TLongSet ) ) {
                return false;
            }
            final TLongSet that = ( TLongSet ) other;
            if ( that.size() != this.size() ) {
                return false;
            }
            for ( int i = _states.length; i-- > 0; ) {
                if ( _states[i] == FULL ) {
                    if ( ! that.contains( _set[i] ) ) {
                        return false;
                    }
                }
            }
            return true;
View Full Code Here

Examples of gnu.trove.set.TLongSet

        assertTrue( values.containsAll( java_set ) );
        java_set.add( Long.valueOf( 12 ) );
        assertFalse( values.containsAll( java_set ) );

        // test with a TCollection
        TLongSet tintset = new TLongHashSet( vals );
        assertTrue( values.containsAll( tintset ) );
        tintset.add( 12 );
        assertFalse( values.containsAll( tintset ) );

        // test raw array
        assertTrue( values.containsAll( vals ) );
        vals[3] = vals[3] + 1;
View Full Code Here

Examples of gnu.trove.set.TLongSet

        assertFalse( values.isEmpty() );

        assertFalse( values.retainAll( values ) );

        // test with a TCollection
        TLongSet tintset = new TLongHashSet( vals );
        assertFalse( "values: " + values + ", collection: " + tintset,
                values.retainAll( tintset ) );
        TLongCollection collection = new TLongArrayList( vals );
        assertFalse( "values: " + values + ", collection: " + collection,
                values.retainAll( collection ) );
View Full Code Here

Examples of gnu.trove.set.TLongSet

            map.put( keys[i], vals[i] );
        }
        values = map.valueCollection();

        // With empty set
        TLongSet tlongset = new TLongHashSet();
        assertFalse( "values: " + values + ", collection: " + tlongset,
                values.removeAll( tlongset ) );

        // With partial set
        tlongset = new TLongHashSet( vals );
        tlongset.remove( 42 * 2 );
        assertTrue( "values: " + values + ", collection: " + tlongset,
                values.removeAll( tlongset ) );
        assertEquals( "set: " + values, 1, values.size() );
        assertEquals( "set: " + values, 1, map.size() );
        for ( int i = 0; i < keys.length; i++ ) {
View Full Code Here

Examples of gnu.trove.set.TLongSet

        nObjects++;
    }

    public final void insert(LineString geom, final Object item) {
        Coordinate[] coord = geom.getCoordinates();
        final TLongSet keys = new TLongHashSet(coord.length * 8);
        for (int i = 0; i < coord.length - 1; i++) {
            // TODO Cut the segment if longer than bin size
            // to reduce the number of wrong bins
            Envelope env = new Envelope(coord[i], coord[i + 1]);
            visit(env, true, new BinVisitor<T>() {
                @Override
                public boolean visit(List<T> bin, long mapKey) {
                    keys.add(mapKey);
                    return false;
                }
            });
        }
        keys.forEach(new TLongProcedure() {
            @SuppressWarnings("unchecked")
            @Override
            public boolean execute(long key) {
                // Note: bins have been initialized in the previous visit
                bins.get(key).add((T) item);
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.