java.net.URI.hash()方法的使用及代码示例

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

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

URI.hash介绍

[英]Returns a hash-code value for this URI. The hash code is based upon all of the URI's components, and satisfies the general contract of the java.lang.Object#hashCode() method.
[中]返回此URI的哈希代码值。哈希代码基于URI的所有组件,并满足java的一般约定。lang.Object#hashCode()方法。

代码示例

代码示例来源:origin: jtulach/bck2brwsr

/**
 * Returns a hash-code value for this URI.  The hash code is based upon all
 * of the URI's components, and satisfies the general contract of the
 * {@link java.lang.Object#hashCode() Object.hashCode} method.
 *
 * @return  A hash-code value for this URI
 */
public int hashCode() {
  if (hash != 0)
    return hash;
  int h = hashIgnoringCase(0, scheme);
  h = hash(h, fragment);
  if (isOpaque()) {
    h = hash(h, schemeSpecificPart);
  } else {
    h = hash(h, path);
    h = hash(h, query);
    if (host != null) {
      h = hash(h, userInfo);
      h = hashIgnoringCase(h, host);
      h += 1949 * port;
    } else {
      h = hash(h, authority);
    }
  }
  hash = h;
  return h;
}

代码示例来源:origin: org.apidesign.bck2brwsr/emul

/**
 * Returns a hash-code value for this URI.  The hash code is based upon all
 * of the URI's components, and satisfies the general contract of the
 * {@link java.lang.Object#hashCode() Object.hashCode} method.
 *
 * @return  A hash-code value for this URI
 */
public int hashCode() {
  if (hash != 0)
    return hash;
  int h = hashIgnoringCase(0, scheme);
  h = hash(h, fragment);
  if (isOpaque()) {
    h = hash(h, schemeSpecificPart);
  } else {
    h = hash(h, path);
    h = hash(h, query);
    if (host != null) {
      h = hash(h, userInfo);
      h = hashIgnoringCase(h, host);
      h += 1949 * port;
    } else {
      h = hash(h, authority);
    }
  }
  hash = h;
  return h;
}

代码示例来源:origin: dragome/dragome-sdk

return hash;
int h= hashIgnoringCase(0, scheme);
h= hash(h, fragment);
if (isOpaque())
  h= hash(h, schemeSpecificPart);
  h= hash(h, path);
  h= hash(h, query);
  if (host != null)
    h= hash(h, userInfo);
    h= hashIgnoringCase(h, host);
    h+= 1949 * port;
    h= hash(h, authority);

相关文章

微信公众号

最新文章

更多