Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 703 for hashCode (0.19 sec)

  1. guava-tests/test/com/google/common/collect/MultisetsImmutableEntryTest.java

      }
    
      public void testHashCode() {
        assertEquals(control("foo", 1).hashCode(), entry("foo", 1).hashCode());
        assertEquals(control("bar", 2).hashCode(), entry("bar", 2).hashCode());
      }
    
      public void testHashCodeNull() {
        assertEquals(control(NE, 1).hashCode(), entry(NE, 1).hashCode());
      }
    
      public void testNegativeCount() {
        try {
          entry("foo", -1);
          fail();
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Feb 21 10:16:44 GMT 2024
    - 2.8K bytes
    - Viewed (0)
  2. guava-testlib/test/com/google/common/testing/EqualsTesterTest.java

          assertErrorMessage(
              e,
              "the Object#hashCode ("
                  + a.hashCode()
                  + ") of "
                  + a
                  + " [group 1, item 1] must be equal to the Object#hashCode ("
                  + b.hashCode()
                  + ") of "
                  + b);
          return;
        }
        fail("Should get invalid hashCode error");
      }
    
      public void testNullEqualityGroup() {
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Mon Apr 17 15:49:06 GMT 2023
    - 12.9K bytes
    - Viewed (0)
  3. android/guava-tests/benchmark/com/google/common/collect/IteratorBenchmark.java

          for (int index = 0; index < size; index++) {
            sum += array[index].hashCode();
          }
        }
        return sum;
      }
    
      @Benchmark
      int arrayIndexedLength(int reps) {
        int sum = 0;
        for (int i = 0; i < reps; i++) {
          for (int index = 0; index < array.length; index++) {
            sum += array[index].hashCode();
          }
        }
        return sum;
      }
    
      @Benchmark
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 3.4K bytes
    - Viewed (0)
  4. guava-testlib/src/com/google/common/collect/testing/google/MultisetReadsTester.java

      public void testEntrySet_hashCode_size0() {
        assertEquals(
            "multiset.entrySet() has incorrect hash code", 0, getMultiset().entrySet().hashCode());
      }
    
      @CollectionSize.Require(ONE)
      public void testEntrySet_hashCode_size1() {
        assertEquals(
            "multiset.entrySet() has incorrect hash code",
            1 ^ e0().hashCode(),
            getMultiset().entrySet().hashCode());
      }
    
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Tue Jan 09 20:10:38 GMT 2018
    - 3.9K bytes
    - Viewed (0)
  5. guava/src/com/google/common/base/Objects.java

       * public int hashCode() {
       *   return Objects.hashCode(getX(), getY(), getZ());
       * }
       * }</pre>
       *
       * <p><b>Warning:</b> When a single object is supplied, the returned hash code does not equal the
       * hash code of that object.
       *
       * <p><b>Java 7+ users:</b> This method should be treated as deprecated; use {@link
       * java.util.Objects#hash} instead.
       */
    Java
    - Registered: Fri Apr 05 12:43:09 GMT 2024
    - Last Modified: Thu Feb 15 16:12:13 GMT 2024
    - 2.9K bytes
    - Viewed (0)
  6. android/guava/src/com/google/common/collect/RegularImmutableSet.java

      private final transient int hashCode;
      // the same values as `elements` in hashed positions (plus nulls)
      @VisibleForTesting final transient @Nullable Object[] table;
      // 'and' with an int to get a valid table index.
      private final transient int mask;
      private final transient int size;
    
      RegularImmutableSet(
          @Nullable Object[] elements, int hashCode, @Nullable Object[] table, int mask, int size) {
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Thu Feb 22 21:19:52 GMT 2024
    - 3.7K bytes
    - Viewed (0)
  7. android/guava-tests/test/com/google/common/hash/AbstractStreamingHasherTest.java

        sink.putByte((byte) 7);
        sink.putBytes(new byte[] {});
        sink.putBytes(new byte[] {8});
        HashCode unused = sink.hash();
        sink.assertInvariants(8);
        sink.assertBytes(expected);
      }
    
      public void testShort() {
        Sink sink = new Sink(4);
        sink.putShort((short) 0x0201);
        HashCode unused = sink.hash();
        sink.assertInvariants(2);
        sink.assertBytes(new byte[] {1, 2, 0, 0}); // padded with zeros
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 8.5K bytes
    - Viewed (0)
  8. guava-testlib/src/com/google/common/collect/testing/testers/MapHashCodeTester.java

        assertEquals(
            "A Map's hashCode() should be the sum of those of its entries (where "
                + "a null element in an entry counts as having a hash of zero).",
            expectedHashCode,
            getMap().hashCode());
      }
    
      private static int hash(Entry<?, ?> e) {
        return (e.getKey() == null ? 0 : e.getKey().hashCode())
            ^ (e.getValue() == null ? 0 : e.getValue().hashCode());
      }
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Tue Jan 09 20:10:38 GMT 2018
    - 2.9K bytes
    - Viewed (0)
  9. android/guava-testlib/src/com/google/common/collect/testing/testers/MapHashCodeTester.java

        assertEquals(
            "A Map's hashCode() should be the sum of those of its entries (where "
                + "a null element in an entry counts as having a hash of zero).",
            expectedHashCode,
            getMap().hashCode());
      }
    
      private static int hash(Entry<?, ?> e) {
        return (e.getKey() == null ? 0 : e.getKey().hashCode())
            ^ (e.getValue() == null ? 0 : e.getValue().hashCode());
      }
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Tue Jan 09 20:10:38 GMT 2018
    - 2.9K bytes
    - Viewed (0)
  10. guava/src/com/google/common/base/Functions.java

            return f.equals(that.f) && g.equals(that.g);
          }
          return false;
        }
    
        @Override
        public int hashCode() {
          return f.hashCode() ^ g.hashCode();
        }
    
        @Override
        public String toString() {
          // TODO(cpovirk): maybe make this look like the method call does ("Functions.compose(...)")
          return g + "(" + f + ")";
    Java
    - Registered: Fri Apr 05 12:43:09 GMT 2024
    - Last Modified: Thu Feb 15 16:12:13 GMT 2024
    - 14.1K bytes
    - Viewed (0)
Back to top