java.util.Collection.hashCode()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(4.0k)|赞(0)|评价(0)|浏览(179)

本文整理了Java中java.util.Collection.hashCode()方法的一些代码示例,展示了Collection.hashCode()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Collection.hashCode()方法的具体详情如下:
包路径:java.util.Collection
类名称:Collection
方法名:hashCode

Collection.hashCode介绍

[英]Returns an integer hash code for the receiver. Objects which are equal return the same value for this method.
[中]返回接收器的整数哈希代码。相等的对象为此方法返回相同的值。

代码示例

代码示例来源:origin: google/guava

  1. @Override
  2. public int hashCode() {
  3. return target.hashCode();
  4. }

代码示例来源:origin: bumptech/glide

  1. @Override
  2. public int hashCode() {
  3. return transformations.hashCode();
  4. }

代码示例来源:origin: prestodb/presto

  1. @Override
  2. public int hashCode() {
  3. return target.hashCode();
  4. }

代码示例来源:origin: apache/flink

  1. @Override
  2. public int hashCode() {
  3. return this.collection.hashCode();
  4. }

代码示例来源:origin: google/j2objc

  1. @Override
  2. public int hashCode() {
  3. return target.hashCode();
  4. }

代码示例来源:origin: stanfordnlp/CoreNLP

  1. public int hashCode() {
  2. return features.hashCode();
  3. }

代码示例来源:origin: commons-collections/commons-collections

  1. public int hashCode() {
  2. synchronized (lock) {
  3. return collection.hashCode();
  4. }
  5. }

代码示例来源:origin: neo4j/neo4j

  1. @Override
  2. public int hashCode()
  3. {
  4. int result = commands.hashCode();
  5. result = 31 * result + (additionalHeader != null ? Arrays.hashCode( additionalHeader ) : 0);
  6. result = 31 * result + masterId;
  7. result = 31 * result + authorId;
  8. result = 31 * result + (int) (timeStarted ^ (timeStarted >>> 32));
  9. result = 31 * result + (int) (latestCommittedTxWhenStarted ^ (latestCommittedTxWhenStarted >>> 32));
  10. return result;
  11. }

代码示例来源:origin: spring-projects/spring-framework

  1. @Override
  2. public int hashCode() {
  3. return getContent().hashCode();
  4. }

代码示例来源:origin: spring-projects/spring-framework

  1. @Override
  2. public int hashCode() {
  3. return getContent().hashCode();
  4. }

代码示例来源:origin: spring-projects/spring-framework

  1. @Override
  2. public int hashCode() {
  3. return getContent().hashCode();
  4. }

代码示例来源:origin: apache/kafka

  1. @Override
  2. public int hashCode() {
  3. int result = owner != null ? owner.hashCode() : 0;
  4. result = 31 * result + (renewers != null ? renewers.hashCode() : 0);
  5. result = 31 * result + (int) (issueTimestamp ^ (issueTimestamp >>> 32));
  6. result = 31 * result + (int) (maxTimestamp ^ (maxTimestamp >>> 32));
  7. result = 31 * result + (tokenId != null ? tokenId.hashCode() : 0);
  8. return result;
  9. }
  10. }

代码示例来源:origin: gocd/gocd

  1. @Override
  2. public int hashCode() {
  3. int result = super.hashCode();
  4. result = 31 * result + (artifact_id != null ? artifact_id.hashCode() : 0);
  5. result = 31 * result + (configuration != null ? configuration.hashCode() : 0);
  6. return result;
  7. }
  8. }

代码示例来源:origin: commons-collections/commons-collections

  1. public int hashCode() {
  2. if (fast) {
  3. return get(map).hashCode();
  4. } else {
  5. synchronized (map) {
  6. return get(map).hashCode();
  7. }
  8. }
  9. }

代码示例来源:origin: commons-collections/commons-collections

  1. public int hashCode() {
  2. if (fast) {
  3. return get(map).hashCode();
  4. } else {
  5. synchronized (map) {
  6. return get(map).hashCode();
  7. }
  8. }
  9. }

代码示例来源:origin: hibernate/hibernate-orm

  1. @Override
  2. public int hashCode() {
  3. checkInit();
  4. return delegate.hashCode();
  5. }
  6. }

代码示例来源:origin: spring-projects/spring-security-oauth

  1. @Override
  2. public int hashCode() {
  3. final int prime = 31;
  4. int result = super.hashCode();
  5. result = prime * result + (approved ? 1231 : 1237);
  6. result = prime * result + ((authorities == null) ? 0 : authorities.hashCode());
  7. result = prime * result + ((extensions == null) ? 0 : extensions.hashCode());
  8. result = prime * result + ((redirectUri == null) ? 0 : redirectUri.hashCode());
  9. result = prime * result + ((resourceIds == null) ? 0 : resourceIds.hashCode());
  10. result = prime * result + ((responseTypes == null) ? 0 : responseTypes.hashCode());
  11. return result;
  12. }

代码示例来源:origin: gocd/gocd

  1. @Override
  2. public int hashCode() {
  3. int result = super.hashCode();
  4. result = 31 * result + (plugin_configuration != null ? plugin_configuration.hashCode() : 0);
  5. result = 31 * result + (configuration != null ? configuration.hashCode() : 0);
  6. return result;
  7. }

代码示例来源:origin: robolectric/robolectric

  1. @Override
  2. public int hashCode() {
  3. int result = observerId;
  4. result = 31 * result + packageNames.hashCode();
  5. result = 31 * result + (int) (timeLimit ^ (timeLimit >>> 32));
  6. result = 31 * result + timeUnit.hashCode();
  7. result = 31 * result + callbackIntent.hashCode();
  8. return result;
  9. }
  10. }

代码示例来源:origin: gocd/gocd

  1. @Override
  2. public int hashCode() {
  3. int result = getId() != null ? getId().hashCode() : 0;
  4. result = 31 * result + (store_id != null ? store_id.hashCode() : 0);
  5. result = 31 * result + (getConfiguration() != null ? getConfiguration().hashCode() : 0);
  6. return result;
  7. }

相关文章