Lines Matching defs:skeleton

68  * from (skeleton, the_largest_different_calendar_field)
72 * A skeleton
89 * letter length in skeleton.
112 * There is a set of pre-defined static skeleton strings in DateFormat,
115 * For example, for a skeleton YEAR_ABBR_MONTH_DAY, which is "yMMMd",
125 * For date skeleton, the interval patterns when year, or month, or date is
127 * For time skeleton, the interval patterns when am/pm, or hour, or minute is
131 * If a skeleton is not found in a locale's DateIntervalInfo, which means
132 * the interval patterns for the skeleton is not defined in resource file,
174 * create an instance using default or given locale plus given skeleton.
176 * to use the pre-defined skeleton macros, such as
181 * create an instance using default or given locale plus given skeleton
186 * Local plus skeleton provides full pattern information.
268 * Used to save the information for a skeleton's best match skeleton.
272 // the best match skeleton
274 // 0 means the best matched skeleton is the same as input skeleton
287 * Used to save the information on a skeleton and its best match.
290 final String skeleton;
292 SkeletonAndItsBestMatch(String skeleton, String bestMatch) {
293 this.skeleton = skeleton;
359 * a DateIntervalInfo, and skeleton.
366 * @param skeleton the skeleton of the date formatter
375 public DateIntervalFormat(String skeleton, DateIntervalInfo dtItvInfo,
381 fSkeleton = skeleton;
389 private DateIntervalFormat(String skeleton, ULocale locale,
393 fSkeleton = skeleton;
403 * Construct a DateIntervalFormat from skeleton and the default <code>FORMAT</code> locale.
406 * getInstance(String skeleton, ULocale locale)
409 * @param skeleton the skeleton on which interval format based.
414 getInstance(String skeleton)
417 return getInstance(skeleton, ULocale.getDefault(Category.FORMAT));
422 * Construct a DateIntervalFormat from skeleton and a given locale.
425 * getInstance(String skeleton, ULocale locale)
428 * @param skeleton the skeleton on which interval format based.
433 getInstance(String skeleton, Locale locale)
435 return getInstance(skeleton, ULocale.forLocale(locale));
440 * Construct a DateIntervalFormat from skeleton and a given locale.
445 * to use the pre-defined skeleton macros.
457 * For example, for en_GB, if skeleton is YEAR_ABBR_MONTH_WEEKDAY_DAY,
459 * the interval patterns defined in resource file to above skeleton are:
463 * @param skeleton the skeleton on which interval format based.
468 getInstance(String skeleton, ULocale locale)
471 return new DateIntervalFormat(skeleton, locale, new SimpleDateFormat(generator.getBestPattern(skeleton), locale));
477 * Construct a DateIntervalFormat from skeleton
481 * getInstance(String skeleton, ULocale locale, DateIntervalInfo dtitvinf)
484 * @param skeleton the skeleton on which interval format based.
489 public static final DateIntervalFormat getInstance(String skeleton,
492 return getInstance(skeleton, ULocale.getDefault(Category.FORMAT), dtitvinf);
498 * Construct a DateIntervalFormat from skeleton
502 * getInstance(String skeleton, ULocale locale, DateIntervalInfo dtitvinf)
505 * @param skeleton the skeleton on which interval format based.
510 public static final DateIntervalFormat getInstance(String skeleton,
514 return getInstance(skeleton, ULocale.forLocale(locale), dtitvinf);
520 * Construct a DateIntervalFormat from skeleton
530 * There are pre-defined skeleton in DateFormat,
549 * @param skeleton the skeleton on which interval format based.
554 public static final DateIntervalFormat getInstance(String skeleton,
562 return new DateIntervalFormat(skeleton, dtitvinf, new SimpleDateFormat(generator.getBestPattern(skeleton), locale));
1060 * For example, it has interval patterns on skeleton "dMy" and "hm",
1061 * but it does not have interval patterns on skeleton "dMyhm".
1063 * The rule to generate interval patterns for both date and time skeleton are
1079 * For example, a pattern/skeleton is "hm", but the interval pattern
1091 // or by getInstance(String skeleton, .... )
1094 String skeleton = fSkeleton;
1098 /* Check whether the skeleton is a combination of date and time.
1101 StringBuilder date = new StringBuilder(skeleton.length());
1102 StringBuilder normalizedDate = new StringBuilder(skeleton.length());
1103 StringBuilder time = new StringBuilder(skeleton.length());
1104 StringBuilder normalizedTime = new StringBuilder(skeleton.length());
1106 /* the difference between time skeleton and normalizedTimeSkeleton are:
1107 * 1. (Formerly, normalized time skeleton folded 'H' to 'h'; no longer true)
1108 * 2. 'a' is omitted in normalized time skeleton.
1110 * time skeleton
1112 * The difference between date skeleton and normalizedDateSkeleton are:
1117 getDateTimeSkeleton(skeleton, date, normalizedDate,
1142 //StringBuffer skeleton = new StringBuffer(skeleton);
1144 //genFallbackForNotFound(Calendar.MINUTE, skeleton);
1145 //genFallbackForNotFound(Calendar.HOUR, skeleton);
1146 //genFallbackForNotFound(Calendar.AM_PM, skeleton);
1166 //genFallbackForNotFound(Calendar.DATE, skeleton);
1167 //genFallbackForNotFound(Calendar.MONTH, skeleton);
1168 //genFallbackForNotFound(Calendar.YEAR, skeleton);
1171 //genFallbackForNotFound(Calendar.DATE, skeleton);
1172 //genFallbackForNotFound(Calendar.MONTH, skeleton);
1173 //genFallbackForNotFound(Calendar.YEAR, skeleton);
1176 } // end of skeleton not found
1177 // interval patterns for skeleton are found in resource
1220 // prefix skeleton with 'd'
1221 skeleton = DateIntervalInfo.
1222 CALENDAR_FIELD_TO_PATTERN_LETTER[Calendar.DATE] + skeleton;
1223 genFallbackPattern(Calendar.DATE, skeleton, intervalPatterns, dtpng);
1226 // then prefix skeleton with 'M'
1227 skeleton = DateIntervalInfo.
1228 CALENDAR_FIELD_TO_PATTERN_LETTER[Calendar.MONTH] + skeleton;
1229 genFallbackPattern(Calendar.MONTH, skeleton, intervalPatterns, dtpng);
1232 // then prefix skeleton with 'y'
1233 skeleton = DateIntervalInfo.
1234 CALENDAR_FIELD_TO_PATTERN_LETTER[Calendar.YEAR] + skeleton;
1235 genFallbackPattern(Calendar.YEAR, skeleton, intervalPatterns, dtpng);
1272 * a skeleton, and a date time pattern generator
1274 * @param skeleton a skeleton
1278 private void genFallbackPattern(int field, String skeleton,
1281 String pattern = dtpng.getBestPattern(skeleton);
1295 private void genFallbackForNotFound(String field, StringBuffer skeleton) {
1296 if ( SimpleDateFormat.isFieldUnitIgnored(skeleton.toString(), field) ) {
1303 } else if ( skeleton.indexOf(field) == -1 ) {
1304 skeleton.insert(0,field);
1305 genFallbackPattern(field, skeleton, dtpng);
1311 * get separated date and time skeleton from a combined skeleton.
1313 * The difference between date skeleton and normalizedDateSkeleton are:
1318 ** the difference between time skeleton and normalizedTimeSkeleton are:
1319 * 1. both 'H' and 'h' are normalized as 'h' in normalized time skeleton,
1320 * 2. 'a' is omitted in normalized time skeleton.
1322 * skeleton
1325 * @param skeleton given combined skeleton.
1326 * @param date Output parameter for date only skeleton.
1329 * @param time Output parameter for time only skeleton.
1331 * skeleton.
1333 private static void getDateTimeSkeleton(String skeleton,
1352 for (i = 0; i < skeleton.length(); ++i) {
1353 char ch = skeleton.charAt(i);
1488 * 2. there might be no pattern for 'y' differ for skeleton "Md",
1490 * need to look for it from skeleton 'yMd'
1492 * @param dateSkeleton normalized date skeleton
1493 * @param timeSkeleton normalized time skeleton
1495 * @return whether there is interval patterns for the skeleton.
1503 String skeleton;
1504 // if both date and time skeleton present,
1510 skeleton = timeSkeleton;
1512 skeleton = dateSkeleton;
1515 /* interval patterns for skeleton "dMMMy" (but not "dMMMMy")
1517 * interval patterns for skeleton "dMMMMy" are calculated by
1518 * 1. get the best match skeleton for "dMMMMy", which is "dMMMy"
1523 // best skeleton, and the difference information
1524 BestMatchInfo retValue = fInfo.getBestSkeleton(skeleton);
1538 // 0 means the best matched skeleton is the same as input skeleton
1542 // (this will happen, for instance, if the supplied skeleton has seconds,
1545 // skeleton has different fields, not only v/z difference
1550 // only has date skeleton
1551 genIntervalPattern(Calendar.DATE, skeleton, bestSkeleton, differenceInfo, intervalPatterns);
1553 Calendar.MONTH, skeleton,
1557 bestSkeleton = skeletons.skeleton;
1558 skeleton = skeletons.bestMatchSkeleton;
1560 genIntervalPattern(Calendar.YEAR, skeleton, bestSkeleton, differenceInfo, intervalPatterns);
1562 genIntervalPattern(Calendar.MINUTE, skeleton, bestSkeleton, differenceInfo, intervalPatterns);
1563 genIntervalPattern(Calendar.HOUR, skeleton, bestSkeleton, differenceInfo, intervalPatterns);
1564 genIntervalPattern(Calendar.AM_PM, skeleton, bestSkeleton, differenceInfo, intervalPatterns);
1576 * but also return the skeleton and its best match skeleton.
1579 * @param skeleton skeleton
1580 * @param bestSkeleton the best match skeleton which has interval pattern
1582 * @param differenceInfo the difference between skeleton and best skeleton
1583 * 0 means the best matched skeleton is the same as input skeleton
1590 * @return an extended skeleton or extended best skeleton if applicable.
1594 int field, String skeleton, String bestSkeleton,
1626 // else, looking for pattern when 'y' differ for 'dMMMM' skeleton,
1628 // since there is no pattern for 'y' differs for skeleton 'MMMd',
1629 // need to look for it from skeleton 'yMMMd',
1635 skeleton = fieldLetter + skeleton;
1637 // skeleton "MMMM".
1640 // if there is no skeleton "yMMMM" defined,
1641 // look for the best match skeleton, for example: "yMMM"
1642 BestMatchInfo tmpRetValue = fInfo.getBestSkeleton(skeleton);
1651 retValue = new SkeletonAndItsBestMatch(skeleton, bestSkeleton);
1656 String part1 = adjustFieldWidth(skeleton, bestSkeleton,
1658 String part2 = adjustFieldWidth(skeleton, bestSkeleton,
1674 * the field width in input skeleton.
1692 * @param inputSkeleton the input skeleton
1693 * @param bestMatchSkeleton the best match skeleton
1747 // for skeleton "M+", the pattern is "...L..."
1783 // for skeleton "M+", the pattern is "...L..."
1802 * This is used to handle time interval patterns on skeleton with
1834 * check whether a calendar field present in a skeleton.
1836 * @param skeleton given skeleton on which to check the calendar field
1837 * @return true if field present in a skeleton.
1839 private static boolean fieldExistsInSkeleton(int field, String skeleton)
1842 return ( (skeleton.indexOf(fieldChar) == -1) ? false : true ) ;
1856 * Get the internal patterns for the skeleton