com.bumptech.glide.load.Key.hashCode()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(3.3k)|赞(0)|评价(0)|浏览(85)

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

Key.hashCode介绍

[英]For caching to work correctly, implementations must implement this method and #equals(Object).
[中]要使缓存正常工作,实现必须实现此方法和#equals(对象)。

代码示例

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

@Override
public int hashCode() {
 int result = sourceKey.hashCode();
 result = 31 * result + signature.hashCode();
 return result;
}

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

@Override
public int hashCode() {
 int result = sourceKey.hashCode();
 result = 31 * result + signature.hashCode();
 result = 31 * result + width;
 result = 31 * result + height;
 if (transformation != null) {
  result = 31 * result + transformation.hashCode();
 }
 result = 31 * result + decodedResourceClass.hashCode();
 result = 31 * result + options.hashCode();
 return result;
}

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

@Override
public int hashCode() {
 if (hashCode == 0) {
  hashCode = model.hashCode();
  hashCode = 31 * hashCode + signature.hashCode();
  hashCode = 31 * hashCode + width;
  hashCode = 31 * hashCode + height;
  hashCode = 31 * hashCode + transformations.hashCode();
  hashCode = 31 * hashCode + resourceClass.hashCode();
  hashCode = 31 * hashCode + transcodeClass.hashCode();
  hashCode = 31 * hashCode + options.hashCode();
 }
 return hashCode;
}

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

@Override
 protected int doHash(@NonNull Key key) {
  return key.hashCode();
 }
}

代码示例来源:origin: guolindev/giffun

@Override
public int hashCode() {
  int result = id.hashCode();
  result = 31 * result + signature.hashCode();
  return result;
}

代码示例来源:origin: guolindev/giffun

@Override
public int hashCode() {
  if (hashCode == 0) {
    hashCode = id.hashCode();
    hashCode = 31 * hashCode + signature.hashCode();
    hashCode = 31 * hashCode + width;
    hashCode = 31 * hashCode + height;
    hashCode = 31 * hashCode + (cacheDecoder   != null ? cacheDecoder  .getId().hashCode() : 0);
    hashCode = 31 * hashCode + (decoder        != null ? decoder       .getId().hashCode() : 0);
    hashCode = 31 * hashCode + (transformation != null ? transformation.getId().hashCode() : 0);
    hashCode = 31 * hashCode + (encoder        != null ? encoder       .getId().hashCode() : 0);
    hashCode = 31 * hashCode + (transcoder     != null ? transcoder    .getId().hashCode() : 0);
    hashCode = 31 * hashCode + (sourceEncoder  != null ? sourceEncoder .getId().hashCode() : 0);
  }
  return hashCode;
}

代码示例来源:origin: mozilla-tw/Rocket

@Override
public int hashCode() {
 int result = sourceKey.hashCode();
 result = 31 * result + signature.hashCode();
 return result;
}

代码示例来源:origin: REBOOTERS/AndroidAnimationExercise

@Override public int hashCode() {
  int result = sourceKey.hashCode();
  result = 31 * result + signature.hashCode();
  return result;
}

代码示例来源:origin: REBOOTERS/AndroidAnimationExercise

@Override public int hashCode() {
  int result = id.hashCode();
  result = 31 * result + signature.hashCode();
  return result;
}

代码示例来源:origin: mozilla-tw/Rocket

@Override
public int hashCode() {
 if (hashCode == 0) {
  hashCode = model.hashCode();
  hashCode = 31 * hashCode + signature.hashCode();
  hashCode = 31 * hashCode + width;
  hashCode = 31 * hashCode + height;
  hashCode = 31 * hashCode + transformations.hashCode();
  hashCode = 31 * hashCode + resourceClass.hashCode();
  hashCode = 31 * hashCode + transcodeClass.hashCode();
  hashCode = 31 * hashCode + options.hashCode();
 }
 return hashCode;
}

代码示例来源:origin: mozilla-tw/Rocket

@Override
public int hashCode() {
 int result = sourceKey.hashCode();
 result = 31 * result + signature.hashCode();
 result = 31 * result + width;
 result = 31 * result + height;
 if (transformation != null) {
  result = 31 * result + transformation.hashCode();
 }
 result = 31 * result + decodedResourceClass.hashCode();
 result = 31 * result + options.hashCode();
 return result;
}

相关文章

微信公众号

最新文章

更多