SUTime.IsoDate isoDate = new SUTime.IsoDate(m.group(1), m.group(2), m.group(3)); if (time != null) { SUTime.IsoTime isoTime = new SUTime.IsoTime(m.group(5), m.group(6), m.group(7), m.group(8)); return new SUTime.IsoDateTime(isoDate,isoTime); } else { if (m.matches()) { SUTime.IsoDate date = new SUTime.IsoDate(m.group(1), m.group(2), m.group(3)); SUTime.IsoTime time = new SUTime.IsoTime(m.group(4), m.group(5), null); return new SUTime.IsoDateTime(date,time); return new SUTime.IsoTime(m.group(1), m.group(2), m.group(3), m.group(4)); if (m.matches()) { isoTime = new SUTime.IsoTime(m.group(1), m.group(2), m.group(4));
public IsoTime(String h, String m, String s, String ms) { if (h != null) { hour = Integer.parseInt(h); } if (m != null) { minute = Integer.parseInt(m); } if (s != null) { second = Integer.parseInt(s); } if (ms != null) { millis = Integer.parseInt(s); } initBase(); }
SUTime.IsoDate isoDate = new SUTime.IsoDate(m.group(1), m.group(2), m.group(3)); if (time != null) { SUTime.IsoTime isoTime = new SUTime.IsoTime(m.group(5), m.group(6), m.group(7), m.group(8)); return new SUTime.IsoDateTime(isoDate,isoTime); } else { if (m.matches()) { SUTime.IsoDate date = new SUTime.IsoDate(m.group(1), m.group(2), m.group(3)); SUTime.IsoTime time = new SUTime.IsoTime(m.group(4), m.group(5), null); return new SUTime.IsoDateTime(date,time); m = p.matcher(dateStr); if (m.matches()) { return new SUTime.IsoTime(m.group(1), m.group(2), m.group(3), m.group(4)); m = p.matcher(dateStr); if (m.matches()) { isoTime = new SUTime.IsoTime(m.group(1), m.group(2), m.group(3));
SUTime.IsoDate isoDate = new SUTime.IsoDate(m.group(1), m.group(2), m.group(3)); if (time != null) { SUTime.IsoTime isoTime = new SUTime.IsoTime(m.group(5), m.group(6), m.group(7), m.group(8)); return new SUTime.IsoDateTime(isoDate,isoTime); } else { if (m.matches()) { SUTime.IsoDate date = new SUTime.IsoDate(m.group(1), m.group(2), m.group(3)); SUTime.IsoTime time = new SUTime.IsoTime(m.group(4), m.group(5), null); return new SUTime.IsoDateTime(date,time); return new SUTime.IsoTime(m.group(1), m.group(2), m.group(3), m.group(4)); if (m.matches()) { isoTime = new SUTime.IsoTime(m.group(1), m.group(2), m.group(4));
SUTime.IsoDate isoDate = new SUTime.IsoDate(m.group(1), m.group(2), m.group(3)); if (time != null) { SUTime.IsoTime isoTime = new SUTime.IsoTime(m.group(5), m.group(6), m.group(7), m.group(8)); return new SUTime.IsoDateTime(isoDate,isoTime); } else { if (m.matches()) { SUTime.IsoDate date = new SUTime.IsoDate(m.group(1), m.group(2), m.group(3)); SUTime.IsoTime time = new SUTime.IsoTime(m.group(4), m.group(5), null); return new SUTime.IsoDateTime(date,time); return new SUTime.IsoTime(m.group(1), m.group(2), m.group(3), m.group(4)); if (m.matches()) { isoTime = new SUTime.IsoTime(m.group(1), m.group(2), m.group(4));
String s = (secGroup >= 0)? results.group(secGroup):null; if (h != null || m != null || s != null) { isoTime = new SUTime.IsoTime(h,m,s);
public SUTime.Temporal apply(String text) { // TODO: TIMEZONE? DateTime dateTime = null; try { dateTime = formatter.parseDateTime(text); } catch(org.joda.time.IllegalFieldValueException e) { logger.warning("WARNING: Invalid temporal \"" + text + "\" (" + e.getMessage() + "). Skipping and continuing..."); return null; } assert(dateTime != null); if (hasDate && hasTime) { return new SUTime.GroundedTime(dateTime); // return new SUTime.IsoDateTime( new SUTime.IsoTime(dateTime.getHourOfDay(), dateTime.getMinuteOfHour(), dateTime.getSecondOfMinute()); // Date d = new SUTime.IsoDate(dateTime.getYear(), dateTime.getMonthOfYear(), dateTime.getDayOfMonth()) ); } else if (hasTime) { // TODO: Millisecs? return new SUTime.IsoTime(dateTime.getHourOfDay(), dateTime.getMinuteOfHour(), dateTime.getSecondOfMinute()); } else if (hasDate) { return new SUTime.IsoDate(dateTime.getYear(), dateTime.getMonthOfYear(), dateTime.getDayOfMonth()); } else { return null; } }
public IsoTime(String h, String m, String s, String ms) { if (h != null) { hour = Integer.parseInt(h); } if (m != null) { minute = Integer.parseInt(m); } if (s != null) { second = Integer.parseInt(s); } if (ms != null) { millis = Integer.parseInt(s); } /* String h2 = (hour >= 0)? String.format("%02d", hour): PAD_FIELD_UNKNOWN2; String m2 = (minute >= 0)? String.format("%02d", minute): PAD_FIELD_UNKNOWN2; String s2 = (second >= 0)? String.format("%02d", second): PAD_FIELD_UNKNOWN2; String ms2 = (millis >= 0)? String.format(".%04d", millis): ""; isoTimeString = "T" + h2 + ":" + m2 + ":" + s2 + ms2; */ initBase(); }
public IsoTime(String h, String m, String s, String ms) { if (h != null) { hour = Integer.parseInt(h); } if (m != null) { minute = Integer.parseInt(m); } if (s != null) { second = Integer.parseInt(s); } if (ms != null) { millis = Integer.parseInt(s); } initBase(); }
public IsoTime(String h, String m, String s, String ms) { if (h != null) { hour = Integer.parseInt(h); } if (m != null) { minute = Integer.parseInt(m); } if (s != null) { second = Integer.parseInt(s); } if (ms != null) { millis = Integer.parseInt(s); } initBase(); }
public IsoTime(int h, int m, int s, int ms, int halfday) { this.hour = h; this.minute = m; this.second = s; this.millis = ms; this.halfday = halfday; // Some error checks second += millis / 1000; millis = millis % 1000; minute += second / 60; second = second % 60; hour += hour / 60; minute = minute % 60; // Error checks done initBase(); }
public IsoTime(Number h, Number m, Number s, Number ms, Number halfday) { this.hour = (h != null)? h.intValue():-1; this.minute = (m != null)? m.intValue():-1; this.second = (s != null)? s.intValue():-1; this.millis = (ms != null)? ms.intValue():-1; this.halfday = (halfday != null)? halfday.intValue():-1; initBase(); }
public IsoTime(int h, int m, int s, int ms, int halfday) { this.hour = h; this.minute = m; this.second = s; this.millis = ms; this.halfday = halfday; initBase(); }
public IsoTime(int h, int m, int s, int ms) { this.hour = h; this.minute = m; this.second = s; this.millis = ms; /* String h2 = (hour >= 0)? String.format("%02d", hour): PAD_FIELD_UNKNOWN2; String m2 = (minute >= 0)? String.format("%02d", minute): PAD_FIELD_UNKNOWN2; String s2 = (second >= 0)? String.format("%02d", second): PAD_FIELD_UNKNOWN2; String ms2 = (millis >= 0)? String.format(".%04d", millis): ""; isoTimeString = "T" + h2 + ":" + m2 + ":" + s2 + ms2; */ initBase(); }
public IsoTime(int h, int m, int s, int ms, int halfday) { this.hour = h; this.minute = m; this.second = s; this.millis = ms; this.halfday = halfday; // Some error checks second += millis / 1000; millis = millis % 1000; minute += second / 60; second = second % 60; hour += hour / 60; minute = minute % 60; // Error checks done initBase(); }