コード例 #1
0
 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;
 }
コード例 #2
0
ファイル: ListJavaTimeZones.java プロジェクト: koem/Zimbra
 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);
 }
コード例 #3
0
  /** @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;
  }
コード例 #4
0
ファイル: FastDatePrinter.java プロジェクト: PAMSE/APGBench
 /**
  * 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());
 }
コード例 #5
0
ファイル: FastDatePrinter.java プロジェクト: PAMSE/APGBench
 /** {@inheritDoc} */
 @Override
 public int hashCode() {
   return (mStyle * 31 + mLocale.hashCode()) * 31 + mTimeZone.hashCode();
 }
コード例 #6
0
 /**
  * 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());
 }