public int parseInto(DateTimeParserBucket bucket, CharSequence text, int position) { Map<String, DateTimeZone> parseLookup = iParseLookup; parseLookup = (parseLookup != null ? parseLookup : DateTimeUtils.getDefaultTimeZoneNames()); String matched = null; for (String name : parseLookup.keySet()) { if (csStartsWith(text, position, name)) { if (matched == null || name.length() > matched.length()) { matched = name; } } } if (matched != null) { bucket.setZone(parseLookup.get(matched)); return position + matched.length(); } return ~position; } }
public int parseInto(DateTimeParserBucket bucket, CharSequence text, int position) { Map<String, DateTimeZone> parseLookup = iParseLookup; parseLookup = (parseLookup != null ? parseLookup : DateTimeUtils.getDefaultTimeZoneNames()); String matched = null; for (String name : parseLookup.keySet()) { if (csStartsWith(text, position, name)) { if (matched == null || name.length() > matched.length()) { matched = name; } } } if (matched != null) { bucket.setZone(parseLookup.get(matched)); return position + matched.length(); } return ~position; } }
bucket.setZone(DateTimeZone.forID(prefix + best)); return pos + best.length();
bucket.setZone(DateTimeZone.forID(prefix + best)); return pos + best.length();
public int parseInto(DateTimeParserBucket bucket, String text, int position) { String str = text.substring(position); for (String name : iParseLookup.keySet()) { if (str.startsWith(name)) { bucket.setZone(iParseLookup.get(name)); return position + name.length(); } } return ~position; } }
public int parseInto(DateTimeParserBucket bucket, String text, int position) { String str = text.substring(position); String best = null; for (String id : ALL_IDS) { if (str.startsWith(id)) { if (best == null || id.length() > best.length()) { best = id; } } } if (best != null) { bucket.setZone(DateTimeZone.forID(best)); return position + best.length(); } return ~position; } }
bucket.saveField(DateTimeFieldType.secondOfMinute(), dt.getSecondOfMinute()); bucket.saveField(DateTimeFieldType.millisOfSecond(), dt.getMillisOfSecond()); bucket.setZone(DateTimeZone.UTC); } catch (Exception e) { return -1;
public int parseInto(DateTimeParserBucket bucket, String text, int position) { String str = text.substring(position); for (String name : iParseLookup.keySet()) { if (str.startsWith(name)) { bucket.setZone(iParseLookup.get(name)); return position + name.length(); } } return ~position; } }
public int parseInto(DateTimeParserBucket bucket, String text, int position) { String str = text.substring(position); String best = null; for (String id : ALL_IDS) { if (str.startsWith(id)) { if (best == null || id.length() > best.length()) { best = id; } } } if (best != null) { bucket.setZone(DateTimeZone.forID(best)); return position + best.length(); } return ~position; } }
public int parseInto(DateTimeParserBucket bucket, String text, int position) { String str = text.substring(position); String best = null; for (String id : ALL_IDS) { if (str.startsWith(id)) { if (best == null || id.length() > best.length()) { best = id; } } } if (best != null) { bucket.setZone(DateTimeZone.forID(best)); return position + best.length(); } return ~position; } }
public int parseInto(DateTimeParserBucket bucket, String text, int position) { String str = text.substring(position); String best = null; for (String id : ALL_IDS) { if (str.startsWith(id)) { if (best == null || id.length() > best.length()) { best = id; } } } if (best != null) { bucket.setZone(DateTimeZone.forID(best)); return position + best.length(); } return ~position; } }
public int parseInto(DateTimeParserBucket bucket, String text, int position) { String str = text.substring(position); String best = null; for (String id : ALL_IDS) { if (str.startsWith(id)) { if (best == null || id.length() > best.length()) { best = id; } } } if (best != null) { bucket.setZone(DateTimeZone.forID(best)); return position + best.length(); } return ~position; } }
public int parseInto(DateTimeParserBucket bucket, String text, int position) { String str = text.substring(position); String best = null; for (String id : ALL_IDS) { if (str.startsWith(id)) { if (best == null || id.length() > best.length()) { best = id; } } } if (best != null) { bucket.setZone(DateTimeZone.forID(best)); return position + best.length(); } return ~position; } }
public int parseInto(DateTimeParserBucket bucket, CharSequence text, int position) { String best = null; for (String id : ALL_IDS) { if (csStartsWith(text, position, id)) { if (best == null || id.length() > best.length()) { best = id; } } } if (best != null) { bucket.setZone(DateTimeZone.forID(best)); return position + best.length(); } return ~position; } }
public int parseInto(DateTimeParserBucket bucket, String text, int position) { Map<String, DateTimeZone> parseLookup = iParseLookup; parseLookup = (parseLookup != null ? parseLookup : DateTimeUtils.getDefaultTimeZoneNames()); String str = text.substring(position); String matched = null; for (String name : parseLookup.keySet()) { if (str.startsWith(name)) { if (matched == null || name.length() > matched.length()) { matched = name; } } } if (matched != null) { bucket.setZone(parseLookup.get(matched)); return position + matched.length(); } return ~position; } }
public int parseInto(DateTimeParserBucket bucket, String text, int position) { Map<String, DateTimeZone> parseLookup = iParseLookup; parseLookup = (parseLookup != null ? parseLookup : DateTimeUtils.getDefaultTimeZoneNames()); String str = text.substring(position); String matched = null; for (String name : parseLookup.keySet()) { if (str.startsWith(name)) { if (matched == null || name.length() > matched.length()) { matched = name; } } } if (matched != null) { bucket.setZone(parseLookup.get(matched)); return position + matched.length(); } return ~position; } }
public int parseInto(DateTimeParserBucket bucket, String text, int position) { Map<String, DateTimeZone> parseLookup = iParseLookup; parseLookup = (parseLookup != null ? parseLookup : DateTimeUtils.getDefaultTimeZoneNames()); String str = text.substring(position); String matched = null; for (String name : parseLookup.keySet()) { if (str.startsWith(name)) { if (matched == null || name.length() > matched.length()) { matched = name; } } } if (matched != null) { bucket.setZone(parseLookup.get(matched)); return position + matched.length(); } return ~position; } }
public int parseInto(DateTimeParserBucket bucket, CharSequence text, int position) { Map<String, DateTimeZone> parseLookup = iParseLookup; parseLookup = (parseLookup != null ? parseLookup : DateTimeUtils.getDefaultTimeZoneNames()); String matched = null; for (String name : parseLookup.keySet()) { if (csStartsWith(text, position, name)) { if (matched == null || name.length() > matched.length()) { matched = name; } } } if (matched != null) { bucket.setZone(parseLookup.get(matched)); return position + matched.length(); } return ~position; } }
public int parseInto(DateTimeParserBucket bucket, CharSequence text, int position) { Map<String, DateTimeZone> parseLookup = iParseLookup; parseLookup = (parseLookup != null ? parseLookup : DateTimeUtils.getDefaultTimeZoneNames()); String matched = null; for (String name : parseLookup.keySet()) { if (csStartsWith(text, position, name)) { if (matched == null || name.length() > matched.length()) { matched = name; } } } if (matched != null) { bucket.setZone(parseLookup.get(matched)); return position + matched.length(); } return ~position; } }
/** * Constucts a bucket, with the option of specifying the pivot year for * two-digit year parsing. * * @param instantLocal the initial millis from 1970-01-01T00:00:00, local time * @param chrono the chronology to use * @param locale the locale to use * @param pivotYear the pivot year to use when parsing two-digit years * @since 1.1 */ public DateTimeParserBucket(long instantLocal, Chronology chrono, Locale locale, Integer pivotYear) { super(); chrono = DateTimeUtils.getChronology(chrono); iMillis = instantLocal; iChrono = chrono.withUTC(); iLocale = (locale == null ? Locale.getDefault() : locale); setZone(chrono.getZone()); iPivotYear = pivotYear; }