xUtils源码阅读(4)-MemCacheKey
2016-09-19 16:21
393 查看
该类通过图片的url和显示参数,生成hashcode以供使用。
功能简单,单一。
源码:
/**
* Created by wyouflf on 15/10/20.
*/
/*package*/ final class MemCacheKey {
public final String url;
public final ImageOptions options;
public MemCacheKey(String url, ImageOptions options) {
this.url = url;
this.options = options;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
MemCacheKey that = (MemCacheKey) o;
if (!url.equals(that.url)) return false;
return options.equals(that.options);
}
@Override
public int hashCode() {
int result = url.hashCode();
result = 31 * result + options.hashCode();
return result;
}
@Override
public String toString() {
return url + options.toString();
}
}
功能简单,单一。
源码:
/**
* Created by wyouflf on 15/10/20.
*/
/*package*/ final class MemCacheKey {
public final String url;
public final ImageOptions options;
public MemCacheKey(String url, ImageOptions options) {
this.url = url;
this.options = options;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
MemCacheKey that = (MemCacheKey) o;
if (!url.equals(that.url)) return false;
return options.equals(that.options);
}
@Override
public int hashCode() {
int result = url.hashCode();
result = 31 * result + options.hashCode();
return result;
}
@Override
public String toString() {
return url + options.toString();
}
}
相关文章推荐
- Memcache源码阅读(5)---哈希表管理
- Memcache-Java-Client-Release源码阅读(之三)
- Memcache-Java-Client-Release源码阅读(之二)
- Memcache-Java-Client-Release源码阅读(之六)
- Memcache源码阅读(7)---用户输入的处理
- Xutils3源码阅读,体验高大上的注解
- xUtils源码阅读(5)-ReuseableBitmapDrawable
- Memcache源码阅读(1)---看源码的心得
- Memcache源码阅读(8)---多线程
- xUtils源码阅读(8)-ImageDecoder
- Memcache源码阅读(3)---处理用户输入
- Memcache-Java-Client-Release源码阅读(之五)
- Memcache源码阅读(6)---数据存储
- Memcache源码阅读-:memcache.c
- Universal-Image-Loader源码阅读(16)-memory/impl/FuzzyKeyMemoryCache
- xUtils源码阅读(1)- x
- Memcache-Java-Client-Release源码阅读(之七)
- Memcache-Java-Client-Release源码阅读(之一)
- redis源码阅读(5)-timeEvent事件之过期key回收
- Memcache-Java-Client-Release源码阅读(之四)