public int hashCode() { // a pseudo (local standard) time stamp value in milliseconds // from the Epoch, assuming Gregorian calendar fields. long hash = ((((((long) year - 1970) * 12) + (month - 1)) * 30) + dayOfMonth) * 24; hash = ((((((hash + hours) * 60) + minutes) * 60) + seconds) * 1000) + millis; hash -= zoneOffset; int normalized = isNormalized() ? 1 : 0; int zone = zoneinfo != null ? zoneinfo.hashCode() : 0; return (int) hash * (int) (hash >> 32) ^ normalized ^ zone; }
private static void printTZ(TimeZone tz) { String tzid = tz.getID(); String gmtOffset = toGMTOffsetString(tz.getRawOffset()); boolean isDst = tz.useDaylightTime(); String clazz = tz.getClass().getSimpleName(); String text = String.format( "%-20s (%s) - hasDST=%s (%s:%08x)", tzid, gmtOffset, (isDst ? "Y" : "N"), clazz, tz.hashCode()); System.out.println(text); }
/** @see java.lang.Object#hashCode() */ public int hashCode() { int result = 17; long latLong = Double.doubleToLongBits(latitude); long lonLong = Double.doubleToLongBits(longitude); long elevLong = Double.doubleToLongBits(elevation); int latInt = (int) (latLong ^ (latLong >>> 32)); int lonInt = (int) (lonLong ^ (lonLong >>> 32)); int elevInt = (int) (elevLong ^ (elevLong >>> 32)); result = 37 * result + getClass().hashCode(); result += 37 * result + latInt; result += 37 * result + lonInt; result += 37 * result + elevInt; result += 37 * result + (locationName == null ? 0 : locationName.hashCode()); result += 37 * result + (timeZone == null ? 0 : timeZone.hashCode()); return result; }
/** * Returns a hashcode compatible with equals. * * @return a hashcode compatible with equals */ @Override public int hashCode() { return mPattern.hashCode() + 13 * (mTimeZone.hashCode() + 13 * mLocale.hashCode()); }
/** {@inheritDoc} */ @Override public int hashCode() { return (mStyle * 31 + mLocale.hashCode()) * 31 + mTimeZone.hashCode(); }
/** * Return a hashcode compatible with equals. * * @return a hashcode compatible with equals */ @Override public int hashCode() { return pattern.hashCode() + 13 * (timeZone.hashCode() + 13 * locale.hashCode()); }