本文整理了Java中org.modeshape.common.util.HashCode
类的一些代码示例,展示了HashCode
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HashCode
类的具体详情如下:
包路径:org.modeshape.common.util.HashCode
类名称:HashCode
[英]Utilities for easily computing hash codes. The algorithm should generally produce good distributions for use in hash-based containers or collections, but as expected does always result in repeatable hash codes given the inputs.
[中]用于轻松计算哈希代码的实用程序。该算法通常应该生成良好的分布,以便在基于散列的容器或集合中使用,但正如预期的那样,在给定输入的情况下,总是会产生可重复的散列代码。
代码示例来源:origin: org.modeshape/modeshape-graph
/**
* {@inheritDoc}
*
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
return HashCode.compute(at, workspaceName);
}
代码示例来源:origin: org.modeshape/modeshape-common
/**
* Compute a combined hash code from the supplied objects. This method always returns 0 if no objects are supplied.
*
* @param objects the objects that should be used to compute the hash code
* @return the hash code
*/
public static int compute( Object... objects ) {
return _compute(0, objects);
}
代码示例来源:origin: ModeShape/modeshape
@Test
public void shouldComputeHashCodeForOnePrimitive() {
assertThat(HashCode._compute(1), is(not(0)));
assertThat(HashCode.compute((long)8), is(not(0)));
assertThat(HashCode._compute((short) 3), is(not(0)));
assertThat(HashCode.compute(1.0f), is(not(0)));
assertThat(HashCode.compute(1.0d), is(not(0)));
assertThat(HashCode.compute(true), is(not(0)));
}
代码示例来源:origin: ModeShape/modeshape
@Test
public void shouldComputeHashCodeForMultiplePrimitives() {
assertThat(HashCode._compute(1, 2, 3), is(not(0)));
assertThat(HashCode.compute((long)8, (long)22, 33), is(not(0)));
assertThat(HashCode._compute((short) 3, (long) 22, true), is(not(0)));
}
代码示例来源:origin: org.modeshape/modeshape-graph
/**
* {@inheritDoc}
*
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
return HashCode.compute(on, workspaceName);
}
代码示例来源:origin: org.fcrepo/modeshape-common
/**
* Compute a combined hash code from the supplied objects. This method always returns 0 if no objects are supplied.
*
* @param objects the objects that should be used to compute the hash code
* @return the hash code
*/
public static int compute( Object... objects ) {
return _compute(0, objects);
}
代码示例来源:origin: org.modeshape/modeshape-repository
public RepositoryNodePath( String repositorySourceName,
String workspaceName,
String nodePath ) {
this.repositorySourceName = repositorySourceName;
this.workspaceName = workspaceName;
this.nodePath = nodePath;
this.hc = HashCode.compute(this.repositorySourceName, this.workspaceName, this.nodePath);
}
代码示例来源:origin: ModeShape/modeshape
/**
* Compute a combined hash code from the supplied objects. This method always returns 0 if no objects are supplied.
*
* @param objects the objects that should be used to compute the hash code
* @return the hash code
*/
public static int compute( Object... objects ) {
return _compute(0, objects);
}
代码示例来源:origin: org.teiid.modeshape/teiid-modeshape-sequencer-vdb
/**
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
return HashCode.compute(this.name, this.namespacePrefix, this.namespaceUri, this.value);
}
代码示例来源:origin: org.modeshape/modeshape-graph
/**
* {@inheritDoc}
*
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
return HashCode.compute(under, childName, workspaceName);
}
代码示例来源:origin: org.fcrepo/modeshape-common
/**
* {@inheritDoc}
*
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
return HashCode.compute(this.category, this.name, this.label);
}
代码示例来源:origin: org.modeshape/modeshape-graph
/**
* {@inheritDoc}
*
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
return HashCode.compute(at, workspaceName);
}
代码示例来源:origin: org.modeshape/modeshape-graph
/**
* {@inheritDoc}
*
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
return HashCode.compute(startingAfter, workspaceName);
}
代码示例来源:origin: org.fcrepo/modeshape-jcr
/**
* @param name the segment name
* @throws IllegalArgumentException if the name is null or if the index is invalid
*/
public BasicPathSegment( Name name ) {
assert name != null;
this.name = name;
this.index = Path.DEFAULT_INDEX;
hc = HashCode.compute(name, index);
}
代码示例来源:origin: ModeShape/modeshape
/**
* @param name the segment name
* @throws IllegalArgumentException if the name is null or if the index is invalid
*/
public BasicPathSegment( Name name ) {
assert name != null;
this.name = name;
this.index = Path.DEFAULT_INDEX;
hc = HashCode.compute(name, index);
}
代码示例来源:origin: ModeShape/modeshape
/**
* {@inheritDoc}
*
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
return HashCode.compute(this.category, this.name, this.label);
}
代码示例来源:origin: org.modeshape/modeshape-sequencer-teiid
/**
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
return HashCode.compute(this.name, this.namespacePrefix, this.namespaceUri, this.value);
}
代码示例来源:origin: org.modeshape/modeshape-graph
/**
* {@inheritDoc}
*
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
return HashCode.compute(at, workspaceName);
}
代码示例来源:origin: org.modeshape/modeshape-graph
/**
* {@inheritDoc}
*
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
return HashCode.compute(of, workspaceName);
}
代码示例来源:origin: org.modeshape/modeshape-graph
/**
* {@inheritDoc}
*
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
return HashCode.compute(from, workspaceName, propertyName);
}
内容来源于网络,如有侵权,请联系作者删除!