/** * Parses a {@code MutableInterval} from the specified string. * <p> * The String formats are described by {@link ISODateTimeFormat#dateTimeParser()} * and {@link ISOPeriodFormat#standard()}, and may be 'datetime/datetime', * 'datetime/period' or 'period/datetime'. * * @param str the string to parse, not null * @since 2.0 */ public static MutableInterval parse(String str) { return new MutableInterval(str); }
/** * Parses a {@code MutableInterval} from the specified string. * <p> * The String formats are described by {@link ISODateTimeFormat#dateTimeParser()} * and {@link ISOPeriodFormat#standard()}, and may be 'datetime/datetime', * 'datetime/period' or 'period/datetime'. * * @param str the string to parse, not null * @since 2.0 */ public static MutableInterval parse(String str) { return new MutableInterval(str); }
/** * Get this time interval as a <code>MutableInterval</code>. * <p> * This will always return a new <code>MutableInterval</code> with the same interval. * * @return the time interval as a MutableInterval object */ public MutableInterval toMutableInterval() { return new MutableInterval(getStartMillis(), getEndMillis(), getChronology()); }
/** * Get this time interval as a <code>MutableInterval</code>. * <p> * This will always return a new <code>MutableInterval</code> with the same interval. * * @return the time interval as a MutableInterval object */ public MutableInterval toMutableInterval() { return new MutableInterval(getStartMillis(), getEndMillis(), getChronology()); }
/** * Parses a {@code MutableInterval} from the specified string. * <p> * The String formats are described by {@link ISODateTimeFormat#dateTimeParser()} * and {@link ISOPeriodFormat#standard()}, and may be 'datetime/datetime', * 'datetime/period' or 'period/datetime'. * * @param str the string to parse, not null * @since 2.0 */ public static MutableInterval parse(String str) { return new MutableInterval(str); }
/** * Constructs a time interval converting or copying from another object * that describes an interval. * * @param interval the time interval to copy * @param chrono the chronology to use, null means let converter decide * @throws IllegalArgumentException if the interval is invalid */ protected BaseInterval(Object interval, Chronology chrono) { super(); IntervalConverter converter = ConverterManager.getInstance().getIntervalConverter(interval); if (converter.isReadableInterval(interval, chrono)) { ReadableInterval input = (ReadableInterval) interval; iChronology = (chrono != null ? chrono : input.getChronology()); iStartMillis = input.getStartMillis(); iEndMillis = input.getEndMillis(); } else if (this instanceof ReadWritableInterval) { converter.setInto((ReadWritableInterval) this, interval, chrono); } else { MutableInterval mi = new MutableInterval(); converter.setInto(mi, interval, chrono); iChronology = mi.getChronology(); iStartMillis = mi.getStartMillis(); iEndMillis = mi.getEndMillis(); } checkInterval(iStartMillis, iEndMillis); }
/** * Constructs a time interval converting or copying from another object * that describes an interval. * * @param interval the time interval to copy * @param chrono the chronology to use, null means let converter decide * @throws IllegalArgumentException if the interval is invalid */ protected BaseInterval(Object interval, Chronology chrono) { super(); IntervalConverter converter = ConverterManager.getInstance().getIntervalConverter(interval); if (converter.isReadableInterval(interval, chrono)) { ReadableInterval input = (ReadableInterval) interval; iChronology = (chrono != null ? chrono : input.getChronology()); iStartMillis = input.getStartMillis(); iEndMillis = input.getEndMillis(); } else if (this instanceof ReadWritableInterval) { converter.setInto((ReadWritableInterval) this, interval, chrono); } else { MutableInterval mi = new MutableInterval(); converter.setInto(mi, interval, chrono); iChronology = mi.getChronology(); iStartMillis = mi.getStartMillis(); iEndMillis = mi.getEndMillis(); } checkInterval(iStartMillis, iEndMillis); }
/** * Get this time interval as a <code>MutableInterval</code>. * <p> * This will always return a new <code>MutableInterval</code> with the same interval. * * @return the time interval as a MutableInterval object */ public MutableInterval toMutableInterval() { return new MutableInterval(getStartMillis(), getEndMillis(), getChronology()); }
/** * Parses a {@code MutableInterval} from the specified string. * <p> * The String formats are described by {@link ISODateTimeFormat#dateTimeParser()} * and {@link ISOPeriodFormat#standard()}, and may be 'datetime/datetime', * 'datetime/period' or 'period/datetime'. * * @param str the string to parse, not null * @since 2.0 */ public static MutableInterval parse(String str) { return new MutableInterval(str); }
/** * Parses a {@code MutableInterval} from the specified string. * <p> * The String formats are described by {@link ISODateTimeFormat#dateTimeParser()} * and {@link ISOPeriodFormat#standard()}, and may be 'datetime/datetime', * 'datetime/period' or 'period/datetime'. * * @param str the string to parse, not null * @since 2.0 */ public static MutableInterval parse(String str) { return new MutableInterval(str); }
/** * Constructs a time interval converting or copying from another object * that describes an interval. * * @param interval the time interval to copy * @param chrono the chronology to use, null means let converter decide * @throws IllegalArgumentException if the interval is invalid */ protected BaseInterval(Object interval, Chronology chrono) { super(); IntervalConverter converter = ConverterManager.getInstance().getIntervalConverter(interval); if (converter.isReadableInterval(interval, chrono)) { ReadableInterval input = (ReadableInterval) interval; iChronology = (chrono != null ? chrono : input.getChronology()); iStartMillis = input.getStartMillis(); iEndMillis = input.getEndMillis(); } else if (this instanceof ReadWritableInterval) { converter.setInto((ReadWritableInterval) this, interval, chrono); } else { MutableInterval mi = new MutableInterval(); converter.setInto(mi, interval, chrono); iChronology = mi.getChronology(); iStartMillis = mi.getStartMillis(); iEndMillis = mi.getEndMillis(); } checkInterval(iStartMillis, iEndMillis); }
@Override public Object create(Object request, SpecimenContext context) { if (!(request.equals(ReadableInterval.class) || request.equals(ReadWritableInterval.class))) return new NoSpecimen(); Interval interval = (Interval) context.resolve(Interval.class); return new MutableInterval(interval); } }
/** * Get this time interval as a <code>MutableInterval</code>. * <p> * This will always return a new <code>MutableInterval</code> with the same interval. * * @return the time interval as a MutableInterval object */ public MutableInterval toMutableInterval() { return new MutableInterval(getStartMillis(), getEndMillis(), getChronology()); }
/** * Get this time interval as a <code>MutableInterval</code>. * <p> * This will always return a new <code>MutableInterval</code> with the same interval. * * @return the time interval as a MutableInterval object */ public MutableInterval toMutableInterval() { return new MutableInterval(getStartMillis(), getEndMillis(), getChronology()); }
/** * Get this time interval as a <code>MutableInterval</code>. * <p> * This will always return a new <code>MutableInterval</code> with the same interval. * * @return the time interval as a MutableInterval object */ public MutableInterval toMutableInterval() { return new MutableInterval(getStartMillis(), getEndMillis(), getChronology()); }
/** * Get this time interval as a <code>MutableInterval</code>. * <p> * This will always return a new <code>MutableInterval</code> with the same interval. * * @return the time interval as a MutableInterval object */ public MutableInterval toMutableInterval() { return new MutableInterval(getStartMillis(), getEndMillis(), getChronology()); }
/** * Get this time interval as a <code>MutableInterval</code>. * <p> * This will always return a new <code>MutableInterval</code> with the same interval. * * @return the time interval as a MutableInterval object */ public MutableInterval toMutableInterval() { return new MutableInterval(getStartMillis(), getEndMillis(), getChronology()); }
/** * Get this time interval as a <code>MutableInterval</code>. * <p> * This will always return a new <code>MutableInterval</code> with the same interval. * * @return the time interval as a MutableInterval object */ public MutableInterval toMutableInterval() { return new MutableInterval(getStartMillis(), getEndMillis(), getChronology()); }
/** * Get this time interval as a <code>MutableInterval</code>. * <p> * This will always return a new <code>MutableInterval</code> with the same interval. * * @return the time interval as a MutableInterval object */ public MutableInterval toMutableInterval() { return new MutableInterval(getStartMillis(), getEndMillis(), getChronology()); }
/** * Get this time interval as a <code>MutableInterval</code>. * <p> * This will always return a new <code>MutableInterval</code> with the same interval. * * @return the time interval as a MutableInterval object */ public MutableInterval toMutableInterval() { return new MutableInterval(getStartMillis(), getEndMillis(), getChronology()); }