Package gnu.trove.map

Examples of gnu.trove.map.TObjectIntMap


     */
    public boolean equals( Object other ) {
        if ( ! ( other instanceof TObjectIntMap ) ) {
            return false;
        }
        TObjectIntMap that = ( TObjectIntMap ) other;
        if ( that.size() != this.size() ) {
            return false;
        }
        try {
            TObjectIntIterator iter = this.iterator();
            while ( iter.hasNext() ) {
                iter.advance();
                Object key = iter.key();
                int value = iter.value();
                if ( value == no_entry_value ) {
                    if ( !( that.get( key ) == that.getNoEntryValue() &&
                      that.containsKey( key ) ) ) {

                        return false;
                    }
                } else {
                    if ( value != that.get( key ) ) {
                        return false;
                    }
                }
            }
        } catch ( ClassCastException ex ) {
View Full Code Here


     */
    public boolean equals( Object other ) {
        if ( ! ( other instanceof TObjectIntMap ) ) {
            return false;
        }
        TObjectIntMap that = ( TObjectIntMap ) other;
        if ( that.size() != this.size() ) {
            return false;
        }
        try {
            TObjectIntIterator iter = this.iterator();
            while ( iter.hasNext() ) {
                iter.advance();
                Object key = iter.key();
                int value = iter.value();
                if ( value == no_entry_value ) {
                    if ( !( that.get( key ) == that.getNoEntryValue() &&
                      that.containsKey( key ) ) ) {

                        return false;
                    }
                } else {
                    if ( value != that.get( key ) ) {
                        return false;
                    }
                }
            }
        } catch ( ClassCastException ex ) {
View Full Code Here

     */
    public boolean equals( Object other ) {
        if ( ! ( other instanceof TObjectIntMap ) ) {
            return false;
        }
        TObjectIntMap that = ( TObjectIntMap ) other;
        if ( that.size() != this.size() ) {
            return false;
        }
        try {
            TObjectIntIterator iter = this.iterator();
            while ( iter.hasNext() ) {
                iter.advance();
                Object key = iter.key();
                int value = iter.value();
                if ( value == no_entry_value ) {
                    if ( !( that.get( key ) == that.getNoEntryValue() &&
                      that.containsKey( key ) ) ) {

                        return false;
                    }
                } else {
                    if ( value != that.get( key ) ) {
                        return false;
                    }
                }
            }
        } catch ( ClassCastException ex ) {
View Full Code Here

     */
    public boolean equals( Object other ) {
        if ( ! ( other instanceof TObjectIntMap ) ) {
            return false;
        }
        TObjectIntMap that = ( TObjectIntMap ) other;
        if ( that.size() != this.size() ) {
            return false;
        }
        try {
            TObjectIntIterator iter = this.iterator();
            while ( iter.hasNext() ) {
                iter.advance();
                Object key = iter.key();
                int value = iter.value();
                if ( value == no_entry_value ) {
                    if ( !( that.get( key ) == that.getNoEntryValue() &&
                      that.containsKey( key ) ) ) {

                        return false;
                    }
                } else {
                    if ( value != 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 );

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

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

TOP

Related Classes of gnu.trove.map.TObjectIntMap

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.