List of utility methods to do List Hash
int | hashCode(List list) hash Code if (list == null) { return 0; final int prime = 31; int result = 1; for (Iterator it = list.iterator(); it.hasNext();) { result = prime * result + it.next().hashCode(); return result; |
int | hashCode(List> list) Computes the hash code for a list per the contract defined by List#hashCode() . return listHashCode(list);
|
int | hashCodeForList(final Collection list) Generates a hash code using the algorithm specified in java.util.List#hashCode() . if (list == null) { return 0; int hashCode = 1; Iterator it = list.iterator(); Object obj = null; while (it.hasNext()) { obj = it.next(); ... |
int | hashContents(List l) finds a hash value which takes into account the value of all elements, such that two sets for which equivalent(a, b) returns true will hashContents() to the same value int out = 0; int count = 0; for (Iterator ii = l.iterator(); ii.hasNext(); ++count) { Object o = ii.next(); if (o != null) out ^= (o.hashCode() ^ count); return out; ... |