/** * Creates a duration from the specified object using the * {@link org.joda.time.convert.ConverterManager ConverterManager}. * * @param duration duration to convert * @throws IllegalArgumentException if duration is invalid */ protected BaseDuration(Object duration) { super(); DurationConverter converter = ConverterManager.getInstance().getDurationConverter(duration); iMillis = converter.getDurationMillis(duration); }
/** * Gets a copy of the list of converters. * * @return the converters, a copy of the real data, never null */ public PeriodConverter[] getPeriodConverters() { ConverterSet set = iPeriodConverters; PeriodConverter[] converters = new PeriodConverter[set.size()]; set.copyInto(converters); return converters; }
/** * Gets a debug representation of the object. */ public String toString() { return "ConverterManager[" + iInstantConverters.size() + " instant," + iPartialConverters.size() + " partial," + iDurationConverters.size() + " duration," + iPeriodConverters.size() + " period," + iIntervalConverters.size() + " interval]"; }
/** * Removes a converter from the set of converters. If the converter was * not in the set, no changes are made. * * @param converter the converter to remove, null ignored * @return replaced converter, or null */ public InstantConverter removeInstantConverter(InstantConverter converter) throws SecurityException { checkAlterInstantConverters(); if (converter == null) { return null; } InstantConverter[] removed = new InstantConverter[1]; iInstantConverters = iInstantConverters.remove(converter, removed); return removed[0]; }
/** * Removes a converter from the set of converters. If the converter was * not in the set, no changes are made. * * @param converter the converter to remove, null ignored * @return replaced converter, or null */ public IntervalConverter removeIntervalConverter(IntervalConverter converter) throws SecurityException { checkAlterIntervalConverters(); if (converter == null) { return null; } IntervalConverter[] removed = new IntervalConverter[1]; iIntervalConverters = iIntervalConverters.remove(converter, removed); return removed[0]; }
/** * Removes a converter from the set of converters. If the converter was * not in the set, no changes are made. * * @param converter the converter to remove, null ignored * @return replaced converter, or null */ public DurationConverter removeDurationConverter(DurationConverter converter) throws SecurityException { checkAlterDurationConverters(); if (converter == null) { return null; } DurationConverter[] removed = new DurationConverter[1]; iDurationConverters = iDurationConverters.remove(converter, removed); return removed[0]; }
/** * Removes a converter from the set of converters. If the converter was * not in the set, no changes are made. * * @param converter the converter to remove, null ignored * @return replaced converter, or null */ public PeriodConverter removePeriodConverter(PeriodConverter converter) throws SecurityException { checkAlterPeriodConverters(); if (converter == null) { return null; } PeriodConverter[] removed = new PeriodConverter[1]; iPeriodConverters = iPeriodConverters.remove(converter, removed); return removed[0]; }
public static ConverterManager getInstance() { if (INSTANCE == null) { INSTANCE = new ConverterManager(); } return INSTANCE; }
/** * Gets a copy of the set of converters. * * @return the converters, a copy of the real data, never null */ public InstantConverter[] getInstantConverters() { ConverterSet set = iInstantConverters; InstantConverter[] converters = new InstantConverter[set.size()]; set.copyInto(converters); return converters; }
/** * Creates a duration from the specified object using the * {@link org.joda.time.convert.ConverterManager ConverterManager}. * * @param duration duration to convert * @throws IllegalArgumentException if duration is invalid */ protected BaseDuration(Object duration) { super(); DurationConverter converter = ConverterManager.getInstance().getDurationConverter(duration); iMillis = converter.getDurationMillis(duration); }
/** * Gets a debug representation of the object. */ public String toString() { return "ConverterManager[" + iInstantConverters.size() + " instant," + iPartialConverters.size() + " partial," + iDurationConverters.size() + " duration," + iPeriodConverters.size() + " period," + iIntervalConverters.size() + " interval]"; }
public static ConverterManager getInstance() { if (INSTANCE == null) { INSTANCE = new ConverterManager(); } return INSTANCE; }
/** * Gets a copy of the list of converters. * * @return the converters, a copy of the real data, never null */ public DurationConverter[] getDurationConverters() { ConverterSet set = iDurationConverters; DurationConverter[] converters = new DurationConverter[set.size()]; set.copyInto(converters); return converters; }
/** * Gets a copy of the set of converters. * * @return the converters, a copy of the real data, never null */ public PartialConverter[] getPartialConverters() { ConverterSet set = iPartialConverters; PartialConverter[] converters = new PartialConverter[set.size()]; set.copyInto(converters); return converters; }
/** * Gets a copy of the list of converters. * * @return the converters, a copy of the real data, never null */ public IntervalConverter[] getIntervalConverters() { ConverterSet set = iIntervalConverters; IntervalConverter[] converters = new IntervalConverter[set.size()]; set.copyInto(converters); return converters; }
/** * Gets a copy of the list of converters. * * @return the converters, a copy of the real data, never null */ public DurationConverter[] getDurationConverters() { ConverterSet set = iDurationConverters; DurationConverter[] converters = new DurationConverter[set.size()]; set.copyInto(converters); return converters; }
/** * Gets a copy of the list of converters. * * @return the converters, a copy of the real data, never null */ public PeriodConverter[] getPeriodConverters() { ConverterSet set = iPeriodConverters; PeriodConverter[] converters = new PeriodConverter[set.size()]; set.copyInto(converters); return converters; }
/** * Gets a copy of the list of converters. * * @return the converters, a copy of the real data, never null */ public IntervalConverter[] getIntervalConverters() { ConverterSet set = iIntervalConverters; IntervalConverter[] converters = new IntervalConverter[set.size()]; set.copyInto(converters); return converters; }
/** * Gets a copy of the set of converters. * * @return the converters, a copy of the real data, never null */ public PartialConverter[] getPartialConverters() { ConverterSet set = iPartialConverters; PartialConverter[] converters = new PartialConverter[set.size()]; set.copyInto(converters); return converters; }
/** * Gets a copy of the set of converters. * * @return the converters, a copy of the real data, never null */ public InstantConverter[] getInstantConverters() { ConverterSet set = iInstantConverters; InstantConverter[] converters = new InstantConverter[set.size()]; set.copyInto(converters); return converters; }