Package gnu.trove.map

Examples of gnu.trove.map.TIntObjectMap


    /** {@inheritDoc} */
    public boolean equals( Object other ) {
        if ( ! ( other instanceof TIntObjectMap ) ) {
            return false;
        }
        TIntObjectMap that = ( TIntObjectMap ) other;
        if ( that.size() != this.size() ) {
            return false;
        }
        try {
            TIntObjectIterator iter = this.iterator();
            while ( iter.hasNext() ) {
                iter.advance();
                int key = iter.key();
                Object value = iter.value();
                if ( value == null ) {
                    if ( !( that.get( key ) == null && that.containsKey( key ) ) ) {
                        return false;
                    }
                } else {
                    if ( !value.equals( that.get( key ) ) ) {
                        return false;
                    }
                }
            }
        } catch ( ClassCastException ex ) {
View Full Code Here


    /** {@inheritDoc} */
    public boolean equals( Object other ) {
        if ( ! ( other instanceof TIntObjectMap ) ) {
            return false;
        }
        TIntObjectMap that = ( TIntObjectMap ) other;
        if ( that.size() != this.size() ) {
            return false;
        }
        try {
            TIntObjectIterator iter = this.iterator();
            while ( iter.hasNext() ) {
                iter.advance();
                int key = iter.key();
                Object value = iter.value();
                if ( value == null ) {
                    if ( !( that.get( key ) == null && that.containsKey( key ) ) ) {
                        return false;
                    }
                } else {
                    if ( !value.equals( that.get( key ) ) ) {
                        return false;
                    }
                }
            }
        } catch ( ClassCastException ex ) {
View Full Code Here

        oos.writeObject( original_map );

        ByteArrayInputStream bias = new ByteArrayInputStream( baos.toByteArray() );
        ObjectInputStream ois = new ObjectInputStream( bias );

        TIntObjectMap deserialized_map = ( TIntObjectMap ) ois.readObject();
        THash deserialized_hash = ( THash ) deserialized_map;

        assertEquals( original_map, deserialized_map );
        assertEquals( original_map.getNoEntryKey(), deserialized_map.getNoEntryKey() );
        assertEquals( original_hash._loadFactor, deserialized_hash._loadFactor );
    }
View Full Code Here

TOP

Related Classes of gnu.trove.map.TIntObjectMap

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.