/** * Append a field prefix which applies only to the next appended field. If * the field is not printed, neither is the prefix. * * @param prefix custom prefix * @return this PeriodFormatterBuilder * @see #appendSuffix */ private PeriodFormatterBuilder appendPrefix(PeriodFieldAffix prefix) { if (prefix == null) { throw new IllegalArgumentException(); } if (iPrefix != null) { prefix = new CompositeAffix(iPrefix, prefix); } iPrefix = prefix; return this; }
/** * Append a field prefix which applies only to the next appended field. If * the field is not printed, neither is the prefix. * * @param prefix custom prefix * @return this PeriodFormatterBuilder * @see #appendSuffix */ private PeriodFormatterBuilder appendPrefix(PeriodFieldAffix prefix) { if (prefix == null) { throw new IllegalArgumentException(); } if (iPrefix != null) { prefix = new CompositeAffix(iPrefix, prefix); } iPrefix = prefix; return this; }
/** * Append a field prefix which applies only to the next appended field. If * the field is not printed, neither is the prefix. * * @param prefix custom prefix * @return this PeriodFormatterBuilder * @see #appendSuffix */ private PeriodFormatterBuilder appendPrefix(PeriodFieldAffix prefix) { if (prefix == null) { throw new IllegalArgumentException(); } if (iPrefix != null) { prefix = new CompositeAffix(iPrefix, prefix); } iPrefix = prefix; return this; }
/** * Append a field prefix which applies only to the next appended field. If * the field is not printed, neither is the prefix. * * @param prefix custom prefix * @return this PeriodFormatterBuilder * @see #appendSuffix */ private PeriodFormatterBuilder appendPrefix(PeriodFieldAffix prefix) { if (prefix == null) { throw new IllegalArgumentException(); } if (iPrefix != null) { prefix = new CompositeAffix(iPrefix, prefix); } iPrefix = prefix; return this; }
/** * Append a field prefix which applies only to the next appended field. If * the field is not printed, neither is the prefix. * * @param prefix custom prefix * @return this PeriodFormatterBuilder * @see #appendSuffix */ private PeriodFormatterBuilder appendPrefix(PeriodFieldAffix prefix) { if (prefix == null) { throw new IllegalArgumentException(); } if (iPrefix != null) { prefix = new CompositeAffix(iPrefix, prefix); } iPrefix = prefix; return this; }
/** * Append a field prefix which applies only to the next appended field. If * the field is not printed, neither is the prefix. * * @param prefix custom prefix * @return this PeriodFormatterBuilder * @see #appendSuffix */ private PeriodFormatterBuilder appendPrefix(PeriodFieldAffix prefix) { if (prefix == null) { throw new IllegalArgumentException(); } if (iPrefix != null) { prefix = new CompositeAffix(iPrefix, prefix); } iPrefix = prefix; return this; }
/** * Append a field prefix which applies only to the next appended field. If * the field is not printed, neither is the prefix. * * @param prefix custom prefix * @return this PeriodFormatterBuilder * @see #appendSuffix */ private PeriodFormatterBuilder appendPrefix(PeriodFieldAffix prefix) { if (prefix == null) { throw new IllegalArgumentException(); } if (iPrefix != null) { prefix = new CompositeAffix(iPrefix, prefix); } iPrefix = prefix; return this; }
/** * Append a field prefix which applies only to the next appended field. If * the field is not printed, neither is the prefix. * * @param prefix custom prefix * @return this PeriodFormatterBuilder * @see #appendSuffix */ private PeriodFormatterBuilder appendPrefix(PeriodFieldAffix prefix) { if (prefix == null) { throw new IllegalArgumentException(); } if (iPrefix != null) { prefix = new CompositeAffix(iPrefix, prefix); } iPrefix = prefix; return this; }
/** * Append a field prefix which applies only to the next appended field. If * the field is not printed, neither is the prefix. * * @param prefix custom prefix * @return this PeriodFormatterBuilder * @see #appendSuffix */ private PeriodFormatterBuilder appendPrefix(PeriodFieldAffix prefix) { if (prefix == null) { throw new IllegalArgumentException(); } if (iPrefix != null) { prefix = new CompositeAffix(iPrefix, prefix); } iPrefix = prefix; return this; }
public int scan(String periodStr, final int position) { int leftPosition = iLeft.scan(periodStr, position); if (leftPosition >= 0) { int rightPosition = iRight.scan(periodStr, iLeft.parse(periodStr, leftPosition)); if (!(rightPosition >= 0 && matchesOtherAffix(iRight.parse(periodStr, rightPosition) - leftPosition, periodStr, position))) { if (leftPosition > 0) { return leftPosition; } else { return rightPosition; } } } return ~position; }
FieldFormatter(FieldFormatter field, PeriodFieldAffix suffix) { iMinPrintedDigits = field.iMinPrintedDigits; iPrintZeroSetting = field.iPrintZeroSetting; iMaxParsedDigits = field.iMaxParsedDigits; iRejectSignedValues = field.iRejectSignedValues; iFieldType = field.iFieldType; iFieldFormatters = field.iFieldFormatters; iPrefix = field.iPrefix; if (field.iSuffix != null) { suffix = new CompositeAffix(field.iSuffix, suffix); } iSuffix = suffix; }
FieldFormatter(FieldFormatter field, PeriodFieldAffix suffix) { iMinPrintedDigits = field.iMinPrintedDigits; iPrintZeroSetting = field.iPrintZeroSetting; iMaxParsedDigits = field.iMaxParsedDigits; iRejectSignedValues = field.iRejectSignedValues; iFieldType = field.iFieldType; iFieldFormatters = field.iFieldFormatters; iPrefix = field.iPrefix; if (field.iSuffix != null) { suffix = new CompositeAffix(field.iSuffix, suffix); } iSuffix = suffix; }
FieldFormatter(FieldFormatter field, PeriodFieldAffix suffix) { iMinPrintedDigits = field.iMinPrintedDigits; iPrintZeroSetting = field.iPrintZeroSetting; iMaxParsedDigits = field.iMaxParsedDigits; iRejectSignedValues = field.iRejectSignedValues; iFieldType = field.iFieldType; iFieldFormatters = field.iFieldFormatters; iPrefix = field.iPrefix; if (field.iSuffix != null) { suffix = new CompositeAffix(field.iSuffix, suffix); } iSuffix = suffix; }
FieldFormatter(FieldFormatter field, PeriodFieldAffix suffix) { iMinPrintedDigits = field.iMinPrintedDigits; iPrintZeroSetting = field.iPrintZeroSetting; iMaxParsedDigits = field.iMaxParsedDigits; iRejectSignedValues = field.iRejectSignedValues; iFieldType = field.iFieldType; iFieldFormatters = field.iFieldFormatters; iPrefix = field.iPrefix; if (field.iSuffix != null) { suffix = new CompositeAffix(field.iSuffix, suffix); } iSuffix = suffix; }
FieldFormatter(FieldFormatter field, PeriodFieldAffix suffix) { iMinPrintedDigits = field.iMinPrintedDigits; iPrintZeroSetting = field.iPrintZeroSetting; iMaxParsedDigits = field.iMaxParsedDigits; iRejectSignedValues = field.iRejectSignedValues; iFieldType = field.iFieldType; iFieldFormatters = field.iFieldFormatters; iPrefix = field.iPrefix; if (field.iSuffix != null) { suffix = new CompositeAffix(field.iSuffix, suffix); } iSuffix = suffix; }
FieldFormatter(FieldFormatter field, PeriodFieldAffix suffix) { iMinPrintedDigits = field.iMinPrintedDigits; iPrintZeroSetting = field.iPrintZeroSetting; iMaxParsedDigits = field.iMaxParsedDigits; iRejectSignedValues = field.iRejectSignedValues; iFieldType = field.iFieldType; iFieldFormatters = field.iFieldFormatters; iPrefix = field.iPrefix; if (field.iSuffix != null) { suffix = new CompositeAffix(field.iSuffix, suffix); } iSuffix = suffix; }
public int scan(String periodStr, final int position) { int leftPosition = iLeft.scan(periodStr, position); if (leftPosition >= 0) { int rightPosition = iRight.scan(periodStr, iLeft.parse(periodStr, leftPosition)); if (!(rightPosition >= 0 && matchesOtherAffix(iRight.parse(periodStr, rightPosition) - leftPosition, periodStr, position))) { if (leftPosition > 0) { return leftPosition; } else { return rightPosition; } } } return ~position; }
FieldFormatter(FieldFormatter field, PeriodFieldAffix suffix) { iMinPrintedDigits = field.iMinPrintedDigits; iPrintZeroSetting = field.iPrintZeroSetting; iMaxParsedDigits = field.iMaxParsedDigits; iRejectSignedValues = field.iRejectSignedValues; iFieldType = field.iFieldType; iFieldFormatters = field.iFieldFormatters; iPrefix = field.iPrefix; if (field.iSuffix != null) { suffix = new CompositeAffix(field.iSuffix, suffix); } iSuffix = suffix; }
FieldFormatter(FieldFormatter field, PeriodFieldAffix suffix) { iMinPrintedDigits = field.iMinPrintedDigits; iPrintZeroSetting = field.iPrintZeroSetting; iMaxParsedDigits = field.iMaxParsedDigits; iRejectSignedValues = field.iRejectSignedValues; iFieldType = field.iFieldType; iFieldFormatters = field.iFieldFormatters; iPrefix = field.iPrefix; if (field.iSuffix != null) { suffix = new CompositeAffix(field.iSuffix, suffix); } iSuffix = suffix; }
public int parse(String periodStr, int position) { int pos = iLeft.parse(periodStr, position); if (pos >= 0) { pos = iRight.parse(periodStr, pos); if (pos >= 0 && matchesOtherAffix(parse(periodStr, pos) - pos, periodStr, position)) { return ~position; } } return pos; }