String中hashCode算法
来源:互联网 发布:晨曦计价软件 编辑:程序博客网 时间:2024/05/01 16:03
/**
* Returns a hash code for this string. The hash code for a
* <code>String</code> object is computed as
* <blockquote><pre>
* s[0]*31^(n-1) + s[1]*31^(n-2) + ... + s[n-1]
* </pre></blockquote>
* using <code>int</code> arithmetic, where <code>s[i]</code> is the
* <i>i</i>th character of the string, <code>n</code> is the length of
* the string, and <code>^</code> indicates exponentiation.
* (The hash value of the empty string is zero.)
*
* @return a hash code value for this object.
*/
public int hashCode() {
int h = hash;
if (h == 0) {
int off = offset;
char val[] = value;
int len = count;
for (int i = 0; i < len; i++) {
h = 31*h + val[off++];
}
hash = h;
}
return h;
}
- String中hashCode算法
- String中hashCode分析
- String中hashCode方法
- 从String源码揭秘hashcode()算法
- String 中equals方法和hashcode方法
- Java 中String的HashCode计算方法
- JAVA中String类的hashCode方法
- Java中String类的hashCode方法
- String类的hashCode方法的算法解读
- JS中实现JAVA的hashCode算法
- 《Effective Java》中推荐的hashCode算法
- 《Effective Java》中推荐的hashCode算法
- Java中String类hashCode()和equals()问题
- javascript 实现 java 中String的hashcode方法
- String中hashCode的缓存和懒加载
- 简单探讨java中String类的hashCode()
- java中String类的hashCode方法实现
- Java编程:String 类中 hashCode() 方法详解
- WinCE中telnet,FTP及网络共享的使用方法
- 安装oracle10g时,前提条件不足:必须将 Microsoft LoopBack Adapter 配置为系统的主网络适配器
- wince驱动入门必看-WinCE流设备驱动简介及GPIO驱动的实现
- WinCE中telnet,FTP及网络共享的使用方法
- 左连接、右连接和全连接的区别
- String中hashCode算法
- 2010 Intel CUP memorandum
- 国产杀毒软件,回家吃饭吧
- WinCE系统声音定制
- db2 auto start
- sql语句修改数据库字段
- MDX 基本概念
- 虚函数
- win32文字显示和刷新