Top Description Inners Fields Constructors Methods
com.ibm.icu.text

public Class DateIntervalInfo

extends Object
implements Cloneable, Freezable<DateIntervalInfo>, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, com.ibm.icu.util.Freezable, java.lang.Cloneable
Imports
java.io.Serializable, java.util.HashMap, .HashSet, .LinkedHashMap, .LinkedHashSet, .Locale, .Map, .Map.Entry, .MissingResourceException, .Objects, .Set, com.ibm.icu.impl.ICUCache, .ICUData, .ICUResourceBundle, .SimpleCache, .UResource, .UResource.Key, .UResource.Value, com.ibm.icu.util.Calendar, .Freezable, .ICUCloneNotSupportedException, .ICUException, .ULocale, .UResourceBundle

DateIntervalInfo is a public class for encapsulating localizable date time interval patterns. It is used by DateIntervalFormat.

For most users, ordinary use of DateIntervalFormat does not need to create DateIntervalInfo object directly. DateIntervalFormat will take care of it when creating a date interval formatter when user pass in skeleton and locale.

For power users, who want to create their own date interval patterns, or want to re-set date interval patterns, they could do so by directly creating DateIntervalInfo and manipulating it.

Logically, the interval patterns are mappings from (skeleton, the_largest_different_calendar_field) to (date_interval_pattern).

A skeleton

  1. only keeps the field pattern letter and ignores all other parts in a pattern, such as space, punctuations, and string literals.
  2. hides the order of fields.
  3. might hide a field's pattern letter length. For those non-digit calendar fields, the pattern letter length is important, such as MMM, MMMM, and MMMMM; EEE and EEEE, and the field's pattern letter length is honored. For the digit calendar fields, such as M or MM, d or dd, yy or yyyy, the field pattern length is ignored and the best match, which is defined in date time patterns, will be returned without honor the field pattern letter length in skeleton.

The calendar fields we support for interval formatting are: year, month, date, day-of-week, am-pm, hour, hour-of-day, minute, and second (though we do not currently have specific intervalFormat data for skeletons with seconds). Those calendar fields can be defined in the following order: year > month > date > am-pm > hour > minute > second The largest different calendar fields between 2 calendars is the first different calendar field in above order. For example: the largest different calendar fields between "Jan 10, 2007" and "Feb 20, 2008" is year.

There is a set of pre-defined static skeleton strings. There are pre-defined interval patterns for those pre-defined skeletons in locales' resource files. For example, for a skeleton YEAR_ABBR_MONTH_DAY, which is "yMMMd", in en_US, if the largest different calendar field between date1 and date2 is "year", the date interval pattern is "MMM d, yyyy - MMM d, yyyy", such as "Jan 10, 2007 - Jan 10, 2008". If the largest different calendar field between date1 and date2 is "month", the date interval pattern is "MMM d - MMM d, yyyy", such as "Jan 10 - Feb 10, 2007". If the largest different calendar field between date1 and date2 is "day", the date interval pattern is ""MMM d-d, yyyy", such as "Jan 10-20, 2007". For date skeleton, the interval patterns when year, or month, or date is different are defined in resource files. For time skeleton, the interval patterns when am/pm, or hour, or minute is different are defined in resource files.

There are 2 dates in interval pattern. For most locales, the first date in an interval pattern is the earlier date. There might be a locale in which the first date in an interval pattern is the later date. We use fallback format for the default order for the locale. For example, if the fallback format is "{0} - {1}", it means the first date in the interval pattern for this locale is earlier date. If the fallback format is "{1} - {0}", it means the first date is the later date. For a particular interval pattern, the default order can be overridden by prefixing "latestFirst:" or "earliestFirst:" to the interval pattern. For example, if the fallback format is "{0}-{1}", but for skeleton "yMMMd", the interval pattern when day is different is "latestFirst:d-d MMM yy", it means by default, the first date in interval pattern is the earlier date. But for skeleton "yMMMd", when day is different, the first date in "d-d MMM yy" is the later date.

The recommended way to create a DateIntervalFormat object is to pass in the locale. By using a Locale parameter, the DateIntervalFormat object is initialized with the pre-defined interval patterns for a given or default locale.

Users can also create DateIntervalFormat object by supplying their own interval patterns. It provides flexibility for power usage.

After a DateIntervalInfo object is created, clients may modify the interval patterns using setIntervalPattern function as so desired. Currently, users can only set interval patterns when the following calendar fields are different: ERA, YEAR, MONTH, DATE, DAY_OF_MONTH, DAY_OF_WEEK, AM_PM, HOUR, HOUR_OF_DAY, MINUTE, SECOND, and MILLISECOND. Interval patterns when other calendar fields are different is not supported.

DateIntervalInfo objects are cloneable. When clients obtain a DateIntervalInfo object, they can feel free to modify it as necessary.

DateIntervalInfo are not expected to be subclassed. Data for a calendar is loaded out of resource bundles. Through ICU 4.4, date interval patterns are only supported in the Gregorian calendar; non-Gregorian calendars are supported from ICU 4.4.1.

ICU Status
Stable since ICU 4.0.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
DateIntervalInfo.DateIntervalSink

Sink for enumerating all of the date interval skeletons.

public static class
DateIntervalInfo.PatternInfo

PatternInfo class saves the first and second part of interval pattern, and whether the interval pattern is earlier date first.

Field Summary

Modifier and TypeField and Description
pack-priv static final String[]
private static String
pack-priv static final int
private static final ICUCache<String, DateIntervalInfo>
private static String
private static String
private String
private boolean
private Map<String, Map<String, DateIntervalInfo.PatternInfo>>
private transient boolean
private transient volatile boolean
private static String
private static String
private static final int
private static final long

Constructor Summary

AccessConstructor and Description
public
DateIntervalInfo()

Deprecated This API is ICU internal only.
Create empty instance.
public
DateIntervalInfo(ULocale
the interval patterns are loaded from the appropriate calendar data (specified calendar or default calendar) in this locale.
locale
)

Construct DateIntervalInfo for the given locale,

public
DateIntervalInfo(Locale
the interval patterns are loaded from the appropriate calendar data (specified calendar or default calendar) in this locale.
locale
)

Construct DateIntervalInfo for the given java.util.Locale.

Method Summary

Modifier and TypeMethod and Description
public Object

Returns:

a copy of the object
clone
()

Overrides java.lang.Object.clone.

Clone this object.
public DateIntervalInfo
cloneAsThawed()

Implements com.ibm.icu.util.Freezable.cloneAsThawed.

Provides for the clone operation.
private static Map<String, Map<String, DateIntervalInfo.PatternInfo>>
private Object
public boolean
equals(Object
the reference object with which to compare.
a
)

Overrides java.lang.Object.equals.

Override equals
public DateIntervalInfo
freeze()

Implements com.ibm.icu.util.Freezable.freeze.

Freezes the object.
public static DateIntervalInfo.PatternInfo

Returns:

pattern info object
genPatternInfo
(String
interval pattern
intervalPattern
,
boolean
whether the first date in intervalPattern is earlier date or later date
laterDateFirst
)

Deprecated This API is ICU internal only.
Break interval patterns as 2 part and save them into pattern info.
pack-priv DateIntervalFormat.BestMatchInfo
getBestSkeleton(String inputSkeleton)

public boolean
getDefaultOrder()

Get default order -- whether the first date in pattern is later date or not.

public String

Returns:

fallback interval pattern
getFallbackIntervalPattern
()

Get the fallback interval pattern.

public DateIntervalInfo.PatternInfo

Returns:

interval pattern return null if interval pattern is not found.
getIntervalPattern
(String
the skeleton
skeleton
,
int
the largest different calendar field
field
)

Get the interval pattern given the largest different calendar field.

public Map<String, Set<String>>
getPatterns()

Deprecated This API is ICU internal only.
public Map<String, Map<String, DateIntervalInfo.PatternInfo>>
getRawPatterns()

Deprecated This API is ICU internal only.
Get the internal patterns, with a deep clone for safety.
public int
hashCode()

Overrides java.lang.Object.hashCode.

Override hashcode
private void
private void
initializeFromReadOnlyPatterns(DateIntervalInfo
must have read-only fIntervalPatterns.
dii
)

Initialize this object

public boolean
isFrozen()

Implements com.ibm.icu.util.Freezable.isFrozen.

Determines whether the object has been frozen or not.
pack-priv static void
parseSkeleton(String
skeleton to be parsed
skeleton
,
int[]
parsed skeleton field width
skeletonFieldWidth
)

Parse skeleton, save each field's width.

public void
setFallbackIntervalPattern(String
fall-back interval pattern.
fallbackPattern
)

Re-set the fallback interval pattern.

public void
setIntervalPattern(String
the skeleton on which interval pattern based
skeleton
,
int
the largest different calendar unit.
lrgDiffCalUnit
,
String
the interval pattern on the largest different calendar unit. For example, if lrgDiffCalUnit is "year", the interval pattern for en_US when year is different could be "'from' yyyy 'to' yyyy".
intervalPattern
)

Provides a way for client to build interval patterns.

private void
setIntervalPattern(String skeleton, String lrgDiffCalUnit, DateIntervalInfo.PatternInfo ptnInfo)

private DateIntervalInfo.PatternInfo
setIntervalPatternInternally(String skeleton, String lrgDiffCalUnit, String intervalPattern)

private void
setup(ULocale locale)

private static int
splitPatternInto2Part(String intervalPattern)

private static boolean
stringNumeric(int fieldWidth, int anotherFieldWidth, char patternLetter)

Inherited from java.lang.Object:
finalizegetClassnotifynotifyAlltoStringwaitwaitwait

Field Detail

CALENDAR_FIELD_TO_PATTERN_LETTERback to summary
pack-priv static final String[] CALENDAR_FIELD_TO_PATTERN_LETTER
CALENDAR_KEYback to summary
private static String CALENDAR_KEY
currentSerialVersionback to summary
pack-priv static final int currentSerialVersion
DIICACHEback to summary
private static final ICUCache<String, DateIntervalInfo> DIICACHE
EARLIEST_FIRST_PREFIXback to summary
private static String EARLIEST_FIRST_PREFIX
FALLBACK_STRINGback to summary
private static String FALLBACK_STRING
fFallbackIntervalPatternback to summary
private String fFallbackIntervalPattern
fFirstDateInPtnIsLaterDateback to summary
private boolean fFirstDateInPtnIsLaterDate
fIntervalPatternsback to summary
private Map<String, Map<String, DateIntervalInfo.PatternInfo>> fIntervalPatterns
fIntervalPatternsReadOnlyback to summary
private transient boolean fIntervalPatternsReadOnly
frozenback to summary
private transient volatile boolean frozen
INTERVAL_FORMATS_KEYback to summary
private static String INTERVAL_FORMATS_KEY
LATEST_FIRST_PREFIXback to summary
private static String LATEST_FIRST_PREFIX
MINIMUM_SUPPORTED_CALENDAR_FIELDback to summary
private static final int MINIMUM_SUPPORTED_CALENDAR_FIELD
serialVersionUIDback to summary
private static final long serialVersionUID

Constructor Detail

DateIntervalInfoback to summary
public DateIntervalInfo()

Deprecated

This API is ICU internal only.

Create empty instance. It does not initialize any interval patterns except that it initialize default fall-back pattern as "{0} - {1}", which can be reset by setFallbackIntervalPattern(). It should be followed by setFallbackIntervalPattern() and setIntervalPattern(), and is recommended to be used only for power users who wants to create their own interval patterns and use them to create date interval formatter.

Annotations
@Deprecated
ICU Status
Internal ICU component.
DateIntervalInfoback to summary
public DateIntervalInfo(ULocale locale)

Construct DateIntervalInfo for the given locale,

Parameters
locale:ULocale

the interval patterns are loaded from the appropriate calendar data (specified calendar or default calendar) in this locale.

ICU Status
Stable since ICU 4.0.
DateIntervalInfoback to summary
public DateIntervalInfo(Locale locale)

Construct DateIntervalInfo for the given java.util.Locale.

Parameters
locale:Locale

the interval patterns are loaded from the appropriate calendar data (specified calendar or default calendar) in this locale.

ICU Status
Stable since ICU 54.

Method Detail

cloneback to summary
public Object clone()

Overrides java.lang.Object.clone.

Clone this object.

Returns:Object

a copy of the object

Annotations
@Override
ICU Status
Stable since ICU ICU4.0.
cloneAsThawedback to summary
public DateIntervalInfo cloneAsThawed()

Implements com.ibm.icu.util.Freezable.cloneAsThawed.

Doc from com.ibm.icu.util.Freezable.cloneAsThawed.

Provides for the clone operation. Any clone is initially unfrozen.

Annotations
@Override
ICU Status
Stable since ICU 4.4.
cloneIntervalPatternsback to summary
private static Map<String, Map<String, DateIntervalInfo.PatternInfo>> cloneIntervalPatterns(Map<String, Map<String, DateIntervalInfo.PatternInfo>> patterns)
cloneUnfrozenDIIback to summary
private Object cloneUnfrozenDII()
equalsback to summary
public boolean equals(Object a)

Overrides java.lang.Object.equals.

Override equals

Parameters
a:Object

Doc from java.lang.Object.equals.

the reference object with which to compare.

Returns:boolean

Doc from java.lang.Object.equals.

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
ICU Status
Stable since ICU 4.0.
freezeback to summary
public DateIntervalInfo freeze()

Implements com.ibm.icu.util.Freezable.freeze.

Doc from com.ibm.icu.util.Freezable.freeze.

Freezes the object.

Returns:DateIntervalInfo

the object itself.

Annotations
@Override
ICU Status
Stable since ICU 4.4.
genPatternInfoback to summary
public static DateIntervalInfo.PatternInfo genPatternInfo(String intervalPattern, boolean laterDateFirst)

Deprecated

This API is ICU internal only.

Break interval patterns as 2 part and save them into pattern info.

Parameters
intervalPattern:String

interval pattern

laterDateFirst:boolean

whether the first date in intervalPattern is earlier date or later date

Returns:DateIntervalInfo.PatternInfo

pattern info object

Annotations
@Deprecated
ICU Status
Internal ICU component.
getBestSkeletonback to summary
pack-priv DateIntervalFormat.BestMatchInfo getBestSkeleton(String inputSkeleton)
getDefaultOrderback to summary
public boolean getDefaultOrder()

Get default order -- whether the first date in pattern is later date or not. return default date ordering in interval pattern. true if the first date in pattern is later date, false otherwise.

ICU Status
Stable since ICU 4.0.
getFallbackIntervalPatternback to summary
public String getFallbackIntervalPattern()

Get the fallback interval pattern.

Returns:String

fallback interval pattern

ICU Status
Stable since ICU 4.0.
getIntervalPatternback to summary
public DateIntervalInfo.PatternInfo getIntervalPattern(String skeleton, int field)

Get the interval pattern given the largest different calendar field.

Parameters
skeleton:String

the skeleton

field:int

the largest different calendar field

Returns:DateIntervalInfo.PatternInfo

interval pattern return null if interval pattern is not found.

Exceptions
IllegalArgumentException:
if getting interval pattern on a calendar field that is smaller than the MINIMUM_SUPPORTED_CALENDAR_FIELD
ICU Status
Stable since ICU 4.0.
getPatternsback to summary
public Map<String, Set<String>> getPatterns()

Deprecated

This API is ICU internal only.

Annotations
@Deprecated
ICU Status
Internal ICU component: CLDR
getRawPatternsback to summary
public Map<String, Map<String, DateIntervalInfo.PatternInfo>> getRawPatterns()

Deprecated

This API is ICU internal only.

Get the internal patterns, with a deep clone for safety.

Annotations
@Deprecated
ICU Status
Internal ICU component: CLDR
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Override hashcode

Returns:int

Doc from java.lang.Object.hashCode.

a hash code value for this object.

Annotations
@Override
ICU Status
Stable since ICU 4.0.
initializeDataback to summary
private void initializeData(ULocale locale)
initializeFromReadOnlyPatternsback to summary
private void initializeFromReadOnlyPatterns(DateIntervalInfo dii)

Initialize this object

Parameters
dii:DateIntervalInfo

must have read-only fIntervalPatterns.

isFrozenback to summary
public boolean isFrozen()

Implements com.ibm.icu.util.Freezable.isFrozen.

Doc from com.ibm.icu.util.Freezable.isFrozen.

Determines whether the object has been frozen or not.

Annotations
@Override
ICU Status
Stable since ICU 4.0.
parseSkeletonback to summary
pack-priv static void parseSkeleton(String skeleton, int[] skeletonFieldWidth)

Parse skeleton, save each field's width. It is used for looking for best match skeleton, and adjust pattern field width.

Parameters
skeleton:String

skeleton to be parsed

skeletonFieldWidth:int[]

parsed skeleton field width

setFallbackIntervalPatternback to summary
public void setFallbackIntervalPattern(String fallbackPattern)

Re-set the fallback interval pattern. In construction, default fallback pattern is set as "{0} - {1}". And constructor taking locale as parameter will set the fallback pattern as what defined in the locale resource file. This method provides a way for user to replace the fallback pattern.

Parameters
fallbackPattern:String

fall-back interval pattern.

Exceptions
UnsupportedOperationException:
if the object is frozen
IllegalArgumentException:
if there is no pattern {0} or pattern {1} in fallbakckPattern
ICU Status
Stable since ICU 4.0.
setIntervalPatternback to summary
public void setIntervalPattern(String skeleton, int lrgDiffCalUnit, String intervalPattern)

Provides a way for client to build interval patterns. User could construct DateIntervalInfo by providing a list of skeletons and their patterns.

For example:

DateIntervalInfo dIntervalInfo = new DateIntervalInfo();
dIntervalInfo.setIntervalPattern("yMd", Calendar.YEAR, "'from' yyyy-M-d 'to' yyyy-M-d");
dIntervalInfo.setIntervalPattern("yMMMd", Calendar.MONTH, "'from' yyyy MMM d 'to' MMM d");
dIntervalInfo.setIntervalPattern("yMMMd", Calendar.DAY, "yyyy MMM d-d");
dIntervalInfo.setFallbackIntervalPattern("{0} ~ {1}");
Restriction: Currently, users can only set interval patterns when the following calendar fields are different: ERA, YEAR, MONTH, DATE, DAY_OF_MONTH, DAY_OF_WEEK, AM_PM, HOUR, HOUR_OF_DAY, MINUTE, SECOND, and MILLISECOND. Interval patterns when other calendar fields are different are not supported.
Parameters
skeleton:String

the skeleton on which interval pattern based

lrgDiffCalUnit:int

the largest different calendar unit.

intervalPattern:String

the interval pattern on the largest different calendar unit. For example, if lrgDiffCalUnit is "year", the interval pattern for en_US when year is different could be "'from' yyyy 'to' yyyy".

Exceptions
IllegalArgumentException:
if setting interval pattern on a calendar field that is smaller than the MINIMUM_SUPPORTED_CALENDAR_FIELD
UnsupportedOperationException:
if the object is frozen
ICU Status
Stable since ICU 4.0.
setIntervalPatternback to summary
private void setIntervalPattern(String skeleton, String lrgDiffCalUnit, DateIntervalInfo.PatternInfo ptnInfo)
setIntervalPatternInternallyback to summary
private DateIntervalInfo.PatternInfo setIntervalPatternInternally(String skeleton, String lrgDiffCalUnit, String intervalPattern)
setupback to summary
private void setup(ULocale locale)
splitPatternInto2Partback to summary
private static int splitPatternInto2Part(String intervalPattern)
stringNumericback to summary
private static boolean stringNumeric(int fieldWidth, int anotherFieldWidth, char patternLetter)
com.ibm.icu.text back to summary

private final Class DateIntervalInfo.DateIntervalSink

extends Sink
Class Inheritance

Sink for enumerating all of the date interval skeletons.

Field Summary

Modifier and TypeField and Description
private static final String
ACCEPTED_PATTERN_LETTERS

Accepted pattern letters: Calendar.YEAR Calendar.MONTH Calendar.DATE Calendar.AM_PM Calendar.HOUR Calendar.HOUR_OF_DAY Calendar.MINUTE Calendar.SECOND Calendar.MILLISECOND

private static final String
private static final String
pack-priv DateIntervalInfo
pack-priv String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

Next calendar type
getAndResetNextCalendarType
()

Returns and resets the next calendar type.

private String

Returns:

Calendar Type
getCalendarTypeFromPath
(String path)

Extracts the calendar type from the path

public void
processSkeletonTable(UResource.Key key, UResource.Value value)

Processes the patterns for a skeleton table.

public void
put(UResource.Key
Initially the key string of the enumeration-start resource. Empty if the enumeration starts at the top level of the bundle. Reuse for output values from Array and Table getters.
key
,
UResource.Value
Call getArray() or getTable() as appropriate. Then reuse for output values from Array and Table getters.
value
,
boolean
true if the bundle has no parent; that is, its top-level table has the nofallback attribute, or it is the root bundle of a locale tree.
noFallback
)

Implements abstract com.ibm.icu.impl.UResource.Sink.put.

Called once for each bundle (child-parent-...-root).
private void
setIntervalPatternIfAbsent(String currentSkeleton, String lrgDiffCalUnit, UResource.Value intervalPattern)

Stores the interval pattern for the current skeleton in the internal data structure if it's not present.

private CharSequence

Returns:

Pattern letter
validateAndProcessPatternLetter
(CharSequence patternLetter)

Processes the pattern letter

Field Detail

ACCEPTED_PATTERN_LETTERSback to summary
private static final String ACCEPTED_PATTERN_LETTERS

Accepted pattern letters: Calendar.YEAR Calendar.MONTH Calendar.DATE Calendar.AM_PM Calendar.HOUR Calendar.HOUR_OF_DAY Calendar.MINUTE Calendar.SECOND Calendar.MILLISECOND

DATE_INTERVAL_PATH_PREFIXback to summary
private static final String DATE_INTERVAL_PATH_PREFIX
DATE_INTERVAL_PATH_SUFFIXback to summary
private static final String DATE_INTERVAL_PATH_SUFFIX
dateIntervalInfoback to summary
pack-priv DateIntervalInfo dateIntervalInfo
nextCalendarTypeback to summary
pack-priv String nextCalendarType

Constructor Detail

DateIntervalSinkback to summary
public DateIntervalSink(DateIntervalInfo dateIntervalInfo)

Method Detail

getAndResetNextCalendarTypeback to summary
public String getAndResetNextCalendarType()

Returns and resets the next calendar type.

Returns:String

Next calendar type

getCalendarTypeFromPathback to summary
private String getCalendarTypeFromPath(String path)

Extracts the calendar type from the path

Returns:String

Calendar Type

processSkeletonTableback to summary
public void processSkeletonTable(UResource.Key key, UResource.Value value)

Processes the patterns for a skeleton table.

putback to summary
public void put(UResource.Key key, UResource.Value value, boolean noFallback)

Implements abstract com.ibm.icu.impl.UResource.Sink.put.

Doc from com.ibm.icu.impl.UResource.Sink.put.

Called once for each bundle (child-parent-...-root). The value is normally an array or table resource, and implementations of this method normally iterate over the tree of resource items stored there.

Parameters
key:UResource.Key

Initially the key string of the enumeration-start resource. Empty if the enumeration starts at the top level of the bundle. Reuse for output values from Array and Table getters.

value:UResource.Value

Call getArray() or getTable() as appropriate. Then reuse for output values from Array and Table getters.

noFallback:boolean

true if the bundle has no parent; that is, its top-level table has the nofallback attribute, or it is the root bundle of a locale tree.

Annotations
@Override
setIntervalPatternIfAbsentback to summary
private void setIntervalPatternIfAbsent(String currentSkeleton, String lrgDiffCalUnit, UResource.Value intervalPattern)

Stores the interval pattern for the current skeleton in the internal data structure if it's not present.

validateAndProcessPatternLetterback to summary
private CharSequence validateAndProcessPatternLetter(CharSequence patternLetter)

Processes the pattern letter

Returns:CharSequence

Pattern letter

com.ibm.icu.text back to summary

public final Class DateIntervalInfo.PatternInfo

extends Object
implements Cloneable, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, java.lang.Cloneable

PatternInfo class saves the first and second part of interval pattern, and whether the interval pattern is earlier date first.
ICU Status
Stable since ICU 4.0.

Field Summary

Modifier and TypeField and Description
pack-priv static final int
private final boolean
private final String
private final String
private static final long

Constructor Summary

AccessConstructor and Description
public
PatternInfo(String
The first part of interval pattern.
firstPart
,
String
The second part of interval pattern.
secondPart
,
boolean
Whether the first date in interval patter is later date or not.
firstDateInPtnIsLaterDate
)

Constructs a PatternInfo object.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if the specified object is equal to this PatternInfo.
equals
(Object
The object to be compared.
a
)

Overrides java.lang.Object.equals.

Compares the specified object with this PatternInfo for equality.
public boolean

Returns:

Whether the first date in interval patter is later date or not.
firstDateInPtnIsLaterDate
()

Returns whether the first date in interval patter is later date or not.

public String

Returns:

The first part of interval pattern.
getFirstPart
()

Returns the first part of interval pattern.

public String

Returns:

The second part of interval pattern.
getSecondPart
()

Returns the second part of interval pattern.

public int

Returns:

A hash code value for this object.
hashCode
()

Overrides java.lang.Object.hashCode.

Returns the hash code of this PatternInfo.
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

currentSerialVersionback to summary
pack-priv static final int currentSerialVersion
fFirstDateInPtnIsLaterDateback to summary
private final boolean fFirstDateInPtnIsLaterDate
fIntervalPatternFirstPartback to summary
private final String fIntervalPatternFirstPart
fIntervalPatternSecondPartback to summary
private final String fIntervalPatternSecondPart
serialVersionUIDback to summary
private static final long serialVersionUID

Constructor Detail

PatternInfoback to summary
public PatternInfo(String firstPart, String secondPart, boolean firstDateInPtnIsLaterDate)

Constructs a PatternInfo object.

Parameters
firstPart:String

The first part of interval pattern.

secondPart:String

The second part of interval pattern.

firstDateInPtnIsLaterDate:boolean

Whether the first date in interval patter is later date or not.

ICU Status
Stable since ICU 4.0.

Method Detail

equalsback to summary
public boolean equals(Object a)

Overrides java.lang.Object.equals.

Compares the specified object with this PatternInfo for equality.

Parameters
a:Object

The object to be compared.

Returns:boolean

true if the specified object is equal to this PatternInfo.

Annotations
@Override
ICU Status
Stable since ICU 4.0.
firstDateInPtnIsLaterDateback to summary
public boolean firstDateInPtnIsLaterDate()

Returns whether the first date in interval patter is later date or not.

Returns:boolean

Whether the first date in interval patter is later date or not.

ICU Status
Stable since ICU 4.0.
getFirstPartback to summary
public String getFirstPart()

Returns the first part of interval pattern.

Returns:String

The first part of interval pattern.

ICU Status
Stable since ICU 4.0.
getSecondPartback to summary
public String getSecondPart()

Returns the second part of interval pattern.

Returns:String

The second part of interval pattern.

ICU Status
Stable since ICU 4.0.
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Returns the hash code of this PatternInfo.

Returns:int

A hash code value for this object.

Annotations
@Override
ICU Status
Stable since ICU 4.0.
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override
ICU Status
Stable since ICU 4.0.