java.io.File.hashCode()方法的使用及代码示例

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

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

File.hashCode介绍

[英]Returns an integer hash code for the receiver. Any two objects for which equals returns true must return the same hash code.
[中]返回接收器的整数哈希代码。equals返回true的任何两个对象都必须返回相同的哈希代码。

代码示例

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

@Override
public int hashCode()
{
  return file.hashCode();
}

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

@Override
  public int hashCode() {
    return artifact != null ? artifact.hashCode() : 0;
  }
}

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

@Override
public int hashCode() {
  return checksumFile != null ? checksumFile.hashCode() : 0;
}

代码示例来源:origin: facebook/facebook-android-sdk

@Override
  public int hashCode() {
    int result = HASH_SEED;
    result = (result * HASH_MULTIPLIER) + file.hashCode();
    result = (result * HASH_MULTIPLIER) + (int) (modified % Integer.MAX_VALUE);
    return result;
  }
}

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

@Override
public int hashCode() {
  final int prime = 31;
  int result = 1;
  result = prime * result + ((file == null) ? 0 : file.hashCode());
  return result;
}

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

@Override
public int hashCode() {
  final int prime = 31;
  int result = 1;
  result = prime * result + ((file == null) ? 0 : file.hashCode());
  return result;
}

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

public int hashCode () {
  return parent != null ? parent.hashCode() + name.hashCode() : name.hashCode();
}

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

public int hashCode () {
  return parent != null ? parent.hashCode() + name.hashCode() : name.hashCode();
}

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

@Override
  public int hashCode() {
    int result = srcFile != null ? srcFile.hashCode() : 0;
    result = 31 * result + (destOnAgent != null ? destOnAgent.hashCode() : 0);
    return result;
  }
}

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

public int hashCode() {
  int result;
  result = (file != null ? file.hashCode() : 0);
  result = 31 * result + (destiname != null ? destiname.hashCode() : 0);
  return result;
}

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

public int hashCode()
{
  final int prime = 31;
  int result = 1;
  result = prime * result + eventType;
  result = prime * result + ( ( exception == null ) ? 0 : exception.hashCode() );
  result = prime * result + ( ( localFile == null ) ? 0 : localFile.hashCode() );
  result = prime * result + requestType;
  return result;
}

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

@Override
public int hashCode() {
  final int prime = 31;
  int result = 1;
  result = prime * result
      + ((directory == null) ? 0 : directory.hashCode());
  result = prime * result
      + ((filename == null) ? 0 : filename.hashCode());
  return result;
}

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

@Override
public int hashCode()
{
  int result = (int) type;
  result = 31 * result + (file != null ? file.hashCode() : 0);
  result = 31 * result + recordId;
  result = 31 * result + (int) fill1;
  result = 31 * result + (int) (fill2 ^ (fill2 >>> 32));
  return result;
}

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

public int hashCode() {
  int result = super.hashCode();
  result = 31 * result + (command != null ? command.hashCode() : 0);
  result = 31 * result + (args != null ? args.hashCode() : 0);
  result = 31 * result + (workingDir != null ? workingDir.hashCode() : 0);
  result = 31 * result + (errorString != null ? errorString.hashCode() : 0);
  return result;
}

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

public int hashCode() {
  int result;
  result = (jobIdentifier != null ? jobIdentifier.hashCode() : 0);
  result = 31 * result + (rootFolder != null ? rootFolder.hashCode() : 0);
  result = 31 * result + (relativePath != null ? relativePath.hashCode() : 0);
  return result;
}

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

/** {@inheritDoc} */
@Override public int hashCode() {
  int res = host == null ? 0 : host.hashCode();
  res = 31 * res + (uname == null ? 0 : uname.hashCode());
  res = 31 * res + (passwd == null ? 0 : passwd.hashCode());
  res = 31 * res + (key == null ? 0 : key.hashCode());
  res = 31 * res + (igniteHome == null ? 0 : igniteHome.hashCode());
  res = 31 * res + (cfg == null ? 0 : cfg.hashCode());
  res = 31 * res + (script == null ? 0 : script.hashCode());
  res = 31 * res + port;
  res = 31 * res + nodes;
  return res;
}

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

@Override public int hashCode() {
 int result = maxRowsInMemory;
 result = 31 * result + maxRowsPerSegment;
 result = 31 * result + (intermediatePersistPeriod != null ? intermediatePersistPeriod.hashCode() : 0);
 result = 31 * result + (basePersistDirectory != null ? basePersistDirectory.hashCode() : 0);
 result = 31 * result + maxPendingPersists;
 result = 31 * result + (indexSpec != null ? indexSpec.hashCode() : 0);
 result = 31 * result + (reportParseExceptions ? 1 : 0);
 result = 31 * result + (int) (handoffConditionTimeout ^ (handoffConditionTimeout >>> 32));
 result = 31 * result + (resetOffsetAutomatically ? 1 : 0);
 return result;
}

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

@Override
  public int hashCode() {
    int result = (fetchMaterials ? 1 : 0);
    result = 31 * result + (cleanWorkingDirectory ? 1 : 0);
    result = 31 * result + (builders != null ? builders.hashCode() : 0);
    result = 31 * result + (artifactPlans != null ? artifactPlans.hashCode() : 0);
    result = 31 * result + (propertyGenerators != null ? propertyGenerators.hashCode() : 0);
    result = 31 * result + (artifactStores != null ? artifactStores.hashCode() : 0);
    result = 31 * result + (buildWorkingDirectory != null ? buildWorkingDirectory.hashCode() : 0);
    result = 31 * result + (jobIdentifier != null ? jobIdentifier.hashCode() : 0);
    result = 31 * result + (initialContext != null ? initialContext.hashCode() : 0);
    result = 31 * result + (materialRevisions != null ? materialRevisions.hashCode() : 0);
    result = 31 * result + (approver != null ? approver.hashCode() : 0);
    return result;
  }
}

代码示例来源:origin: org.apache.ant/ant

/**
 * Get the hash code for this Resource.
 * @return hash code as int.
 */
@Override
public int hashCode() {
  if (isReference()) {
    return getCheckedRef().hashCode();
  }
  return MAGIC * (getFile() == null ? NULL_FILE : getFile().hashCode());
}

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

StandardRecord( File file, int recordId )
{
  this.type = 42;
  this.file = file;
  this.recordId = recordId;
  int fileHash = file.hashCode();
  int a = xorshift( fileHash ^ xorshift( recordId ) );
  int b = xorshift( a );
  int c = xorshift( b );
  long d = b;
  d = d << 32;
  d += c;
  fill1 = (short) a;
  fill2 = d;
}

相关文章