@Override public int hashCode() { int result = variableName.hashCode(); result = 31 * result + dataType.hashCode(); return result; } }
/** * Override Object.hashCode() to implement equals. */ @Override public int hashCode() { int result = 17; result = 37 * result + getShortName().hashCode(); result = 37 * result + nelems; result = 37 * result + getDataType().hashCode(); if (svalue != null) result = 37 * result + svalue.hashCode(); else if (values != null) { for (int i = 0; i < getLength(); i++) { int h = isString() ? getStringValue(i).hashCode() : getNumericValue(i).hashCode(); result = 37 * result + h; } } return result; }
/** * Override Object.hashCode() to implement equals. */ @Override public int hashCode() { int result = 17; result = 37 * result + getShortName().hashCode(); result = 37 * result + nelems; result = 37 * result + getDataType().hashCode(); if (svalue != null) result = 37 * result + svalue.hashCode(); else if (values != null) { for (int i = 0; i < getLength(); i++) { int h = isString() ? getStringValue(i).hashCode() : getNumericValue(i).hashCode(); result = 37 * result + h; } } return result; }
/** * Override Object.hashCode() to implement equals. */ @Override public int hashCode() { if(CDMNode.OBJECTHASH) return super.hashCode(); else { if (hashCode == 0) { int result = 17; result = 37 * result + getShortName().hashCode(); result = 37 * result + nelems; result = 37 * result + getDataType().hashCode(); if (svalue != null) result = 37 * result + svalue.hashCode(); else if (values != null) { for (int i = 0; i < getLength(); i++) { int h = isString() ? getStringValue(i).hashCode() : getNumericValue(i).hashCode(); result = 37 * result + h; } } hashCode = result; } return hashCode; } }
/** * An implementation of {@link Object#hashCode} that is consistent with {@link #equals(Array, Array)}. * * @param array an array to hash. * @return a hash code value for the array. */ // TODO: Should we add this to Array as the Object.hashCode() implementation? How much work is that? public static int hashCode(Array array) { if (array == null) { return 0; } int hash = 3; hash = 29 * hash + array.getDataType().hashCode(); hash = 29 * hash + Arrays.hashCode(array.getShape()); // We can't simply hash array.getStorage(), because array may be a "view" that doesn't include all of the // elements in the backing store. for (IndexIterator iter = array.getIndexIterator(); iter.hasNext(); ) { hash = 29 * hash + iter.next().hashCode(); hash = 29 * hash + Arrays.hashCode(iter.getCurrentCounter()); } return hash; } }
/** * Override Object.hashCode() to implement equals. */ public int hashCode() { if(CDMNode.OBJECTHASH) return super.hashCode(); else { if (hashCode == 0) { int result = 17; result = 37 * result + getShortName().hashCode(); if (isScalar()) result++; result = 37 * result + getDataType().hashCode(); result = 37 * result + getParentGroup().hashCode(); if (getParentStructure() != null) result = 37 * result + getParentStructure().hashCode(); if (isVariableLength) result++; result = 37 * result + dimensions.hashCode(); hashCode = result; } return hashCode; } }
/** * Override Object.hashCode() to implement equals. */ @Override public int hashCode() { if (hashCode == 0) { int result = 17; result = 37 * result + getShortName().hashCode(); if (isScalar()) result++; result = 37 * result + getDataType().hashCode(); result = 37 * result + getParentGroup().hashCode(); if (getParentStructure() != null) result = 37 * result + getParentStructure().hashCode(); if (isVariableLength) result++; result = 37 * result + dimensions.hashCode(); hashCode = result; } return hashCode; }
/** * Override Object.hashCode() to implement equals. */ @Override public int hashCode() { if (hashCode == 0) { int result = 17; result = 37 * result + getShortName().hashCode(); if (isScalar()) result++; result = 37 * result + getDataType().hashCode(); result = 37 * result + getParentGroup().hashCode(); if (getParentStructure() != null) result = 37 * result + getParentStructure().hashCode(); if (isVariableLength) result++; result = 37 * result + dimensions.hashCode(); hashCode = result; } return hashCode; }