Package gnu.trove.map.hash

Examples of gnu.trove.map.hash.ArrayHashingStrategy


    assertFalse( foo.hashCode() == bar.hashCode() );
    //noinspection ArrayEquals
    assertFalse( foo.equals( bar ) );

    HashingStrategy<char[]> strategy = new ArrayHashingStrategy();
    assertTrue( strategy.computeHashCode( foo ) ==
      strategy.computeHashCode( bar ) );
    assertTrue( strategy.equals( foo, bar ) );

    Set<char[]> set = new TCustomHashSet<char[]>( strategy );
    set.add( foo );
    assertTrue( set.contains( foo ) );
    assertTrue( set.contains( bar ) );
View Full Code Here


  public void testSerialization() throws Exception {
    char[] foo = new char[] { 'a', 'b', 'c' };
    char[] bar = new char[] { 'a', 'b', 'c' };

    HashingStrategy<char[]> strategy = new ArrayHashingStrategy();
    Set<char[]> set = new TCustomHashSet<char[]>( strategy );

    set.add( foo );

    // Make sure it still works after being serialized
View Full Code Here

TOP

Related Classes of gnu.trove.map.hash.ArrayHashingStrategy

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.