2 *******************************************************************************
\r
3 * Copyright (C) 2007-2010, International Business Machines Corporation and *
\r
4 * others. All Rights Reserved. *
\r
5 *******************************************************************************
\r
7 package com.ibm.icu.util;
\r
9 * <code>TimeZoneTransition</code> is a class representing a time zone transition.
\r
10 * An instance has a time of transition and rules for both before and
\r
11 * after the transition.
\r
15 public class TimeZoneTransition {
\r
16 private final TimeZoneRule from;
\r
17 private final TimeZoneRule to;
\r
18 private final long time;
\r
21 * Constructs a <code>TimeZoneTransition</code> with the time and the rules before/after
\r
24 * @param time The time of transition in milliseconds since the base time.
\r
25 * @param from The time zone rule used before the transition.
\r
26 * @param to The time zone rule used after the transition.
\r
30 public TimeZoneTransition(long time, TimeZoneRule from, TimeZoneRule to) {
\r
37 * Returns the time of transition in milliseconds since the base time.
\r
39 * @return The time of the transition in milliseconds since the base time.
\r
43 public long getTime() {
\r
48 * Returns the rule used after the transition.
\r
50 * @return The time zone rule used after the transition.
\r
54 public TimeZoneRule getTo() {
\r
59 * Returns the rule used before the transition.
\r
61 * @return The time zone rule used after the transition.
\r
65 public TimeZoneRule getFrom() {
\r
70 * Returns a <code>String</code> representation of this <code>TimeZoneTransition</code> object.
\r
71 * This method is used for debugging purpose only. The string representation can be changed
\r
72 * in future version of ICU without any notice.
\r
76 public String toString() {
\r
77 StringBuilder buf = new StringBuilder();
\r
78 buf.append("time=" + time);
\r
79 buf.append(", from={" + from + "}");
\r
80 buf.append(", to={" + to + "}");
\r
81 return buf.toString();
\r