HomeSort by relevance Sort by last modified time
    Searched refs:HashCode (Results 1 - 25 of 45) sorted by null

1 2

  /external/guava/guava/src/com/google/common/hash/
HashFunction.java 40 * represents a hash code as an instance of {@link HashCode}.
93 * and finally ask for the {@code HashCode} when finished using {@link Hasher#hash}. (See
111 * <h3>Relationship to {@link Object#hashCode}</h3>
115 * algorithms can't be easily substituted. Also, implementations of {@code hashCode} tend
117 * poor-quality {@code hashCode} implementations, including those in many JDK classes.
119 * <p>{@code Object.hashCode} implementations tend to be very fast, but have weak
124 * uses of hash functions beyond data structures, however, {@code Object.hashCode} almost
137 * HashCode hc = hf.newHasher()
157 HashCode hashLong(long input);
164 HashCode hashBytes(byte[] input)
    [all...]
HashCodes.java 18 * Static factories for {@link HashCode} instances.
26 * Creates a 32-bit {@code HashCode}, of which the bytes will form the passed int, interpreted
29 static HashCode fromInt(int hash) {
33 private static class IntHashCode extends HashCode {
57 throw new IllegalStateException("this HashCode only has 32 bits; cannot create a long");
62 * Creates a 64-bit {@code HashCode}, of which the bytes will form the passed long, interpreted
65 static HashCode fromLong(long hash) {
69 private static class LongHashCode extends HashCode {
102 * Creates a {@code HashCode} from a byte array. The array is <i>not</i> copied defensively,
103 * so it must be handed-off so as to preserve the immutability contract of {@code HashCode}
    [all...]
HashCode.java 30 public abstract class HashCode {
31 HashCode() {}
34 * Returns the first four bytes of {@linkplain #asBytes() this hashcode's bytes}, converted to
40 * Returns the first eight bytes of {@linkplain #asBytes() this hashcode's bytes}, converted to
49 * changes to it will <i>not</i> be reflected in this {@code HashCode} object or any other arrays
78 if (object instanceof HashCode) {
79 HashCode that = (HashCode) object;
88 * Returns a "Java hash code" for this {@code HashCode} instance; this is well-defined
89 * (so, for example, you can safely put {@code HashCode} instances into a {@cod
    [all...]
Hashing.java 150 * If {@code hashCode} has enough bits, returns {@code hashCode.asLong()}, otherwise
151 * returns a {@code long} value with {@code hashCode.asInt()} as the least-significant
154 public static long padToLong(HashCode hashCode) {
155 return (hashCode.bits() < 64) ? UnsignedInts.toLong(hashCode.asInt()) : hashCode.asLong();
159 * Assigns to {@code hashCode} a "bucket" in the range {@code [0, buckets)}, in a uniform
171 public static int consistentHash(HashCode hashCode, int buckets)
    [all...]
AbstractStreamingHashFunction.java 36 @Override public HashCode hashString(CharSequence input) {
40 @Override public HashCode hashString(CharSequence input, Charset charset) {
44 @Override public HashCode hashLong(long input) {
48 @Override public HashCode hashBytes(byte[] input) {
52 @Override public HashCode hashBytes(byte[] input, int off, int len) {
220 public final HashCode hash() {
229 abstract HashCode makeHash();
Hasher.java 68 HashCode hash();
AbstractCompositeHashFunction.java 10 * {@linkplain #makeHash(Hasher[])} that constructs the final {@code HashCode}.
22 * Constructs a {@code HashCode} from the {@code Hasher} objects of the functions. Each of them
23 * has consumed the entire input and they are ready to output a {@code HashCode}. The order of
26 // this could be cleaner if it passed HashCode[], but that would create yet another array...
27 /* protected */ abstract HashCode makeHash(Hasher[] hashers);
127 @Override public HashCode hash() {
Murmur3_32HashFunction.java 89 @Override public HashCode makeHash() {
AbstractNonStreamingHashFunction.java 101 public HashCode hash() {
MessageDigestHashFunction.java 168 public HashCode hash() {
Murmur3_128HashFunction.java 135 @Override public HashCode makeHash() {
  /external/guava/guava-tests/test/com/google/common/hash/
AbstractNonStreamingHashFunctionTest.java 35 HashCode[] codes = new HashCode[hashers.size()];
55 HashCode makeHash() {
83 public HashCode hashBytes(byte[] input) {
88 public HashCode hashBytes(byte[] input, int off, int len) {
93 public HashCode hashString(CharSequence input) {
98 public HashCode hashString(CharSequence input, Charset charset) {
103 public HashCode hashLong(long input) {
HashingTest.java 51 private void checkConsistentHashCorrectness(long hashCode) {
54 int b = Hashing.consistentHash(hashCode, shards);
102 public void checkSameResult(HashCode hashCode, long equivLong) {
103 assertEquals(Hashing.consistentHash(equivLong, 5555), Hashing.consistentHash(hashCode, 5555));
116 Hashing.combineOrdered(Collections.<HashCode>emptySet());
131 HashCode hash31 = HashCodes.fromInt(31);
132 HashCode hash32 = HashCodes.fromInt(32);
145 List<HashCode> hashCodes = Lists.newArrayList();
149 HashCode hashCode1 = Hashing.combineOrdered(hashCodes)
    [all...]
HashFunctionsTest.java 38 * Checks that a Hasher returns the same HashCode when given the same input, and also
43 Set<HashCode> hashcodes = Sets.newHashSetWithExpectedSize(objects);
46 HashCode hashcode1 = hashFunction.newHasher().putObject(o, HashTestUtils.BAD_FUNNEL).hash();
47 HashCode hashcode2 = hashFunction.newHasher().putObject(o, HashTestUtils.BAD_FUNNEL).hash();
HashCodesTest.java 50 HashCode fromInt = HashCodes.fromInt(expected.asInt);
60 HashCode fromLong = HashCodes.fromLong(expected.asLong);
68 HashCode fromBytes = HashCodes.fromBytes(expected.bytes);
73 private void assertExpectedHashCode(ExpectedHashCode expected, HashCode hash) {
92 private void assertSideEffectFree(HashCode hash) {
99 private void assertReadableBytes(HashCode hashCode) {
100 assertTrue(hashCode.bits() >= 32); // sanity
101 byte[] hashBytes = hashCode.asBytes();
102 int totalBytes = hashCode.bits() / 8
    [all...]
AbstractStreamingHasherTest.java 27 /** Test we get the HashCode that is created by the sink. Later we ignore the result */
170 @Override HashCode makeHash() {
220 public HashCode hashBytes(byte[] input) {
225 public HashCode hashBytes(byte[] input, int off, int len) {
235 public HashCode hashString(CharSequence input) {
240 public HashCode hashString(CharSequence input, Charset charset) {
245 public HashCode hashLong(long input) {
FunnelsTest.java 53 @Override HashCode makeHash() { throw new UnsupportedOperationException(); }
  /external/chromium_org/v8/test/cctest/compiler/
test-operator.cc 33 CHECK_EQ(17, op1.HashCode());
36 CHECK_EQ(18, op2.HashCode());
95 CHECK_EQ(op1a.HashCode(), op1b.HashCode());
100 CHECK_NE(op1a.HashCode(), op2a.HashCode());
101 CHECK_NE(op2a.HashCode(), op2b.HashCode());
165 CHECK_EQ(op1a.HashCode(), op1b.HashCode());
    [all...]
  /external/chromium_org/v8/src/compiler/
operator.h 68 // Compute a hashcode to speed up equivalence-set checking.
71 virtual int HashCode() const = 0;
117 virtual int HashCode() const FINAL { return opcode(); }
139 static int HashCode(T a) { return 0; }
151 static int HashCode(int a) { return a; }
161 static int HashCode(double a) {
175 static int HashCode(Unique<Object> a) {
176 return static_cast<int>(a.Hashcode());
187 static int HashCode(Unique<Name> a) { return static_cast<int>(a.Hashcode()); }
    [all...]
value-numbering-reducer.cc 15 size_t HashCode(Node* node) { return node->op()->HashCode(); }
60 Entry** head = &buckets_[HashCode(node) % arraysize(buckets_)];
simplified-operator.cc 70 static int HashCode(const FieldAccess& val) {
87 static int HashCode(const ElementAccess& access) {
js-operator.h 207 static int HashCode(ContextAccess val) {
223 static int HashCode(Runtime::FunctionId val) { return static_cast<int>(val); }
machine-operator.cc 38 static int HashCode(const StoreRepresentation& rep) {
53 static int HashCode(LoadRepresentation type) { return type; }
common-operator.cc 46 static int HashCode(ExternalReference reference) {
  /external/antlr/antlr-3.4/runtime/Delphi/Sources/Antlr3.Runtime/
Antlr.Runtime.Tools.pas 242 HashCode: Integer;
256 function GetBucketIndex(const Key: TKey; HashCode: Integer): Integer;
258 procedure RehashAdd(HashCode: Integer; const Key: TKey; const Value: TValue);
259 procedure DoAdd(HashCode, Index: Integer; const Key: TKey; const Value: TValue);
567 if oldItems[i].HashCode <> 0 then
568 RehashAdd(oldItems[i].HashCode, oldItems[i].Key, oldItems[i].Value);
599 function TDictionary<TKey,TValue>.GetBucketIndex(const Key: TKey; HashCode: Integer): Integer;
606 start := HashCode and (Length(FItems) - 1);
610 hc := FItems[Result].HashCode;
617 if (hc = HashCode) and FComparer.Equals(FItems[Result].Key, Key) the
    [all...]

Completed in 1088 milliseconds

1 2