private void parseFormat(final String format) {
		formatSpecification = new ArrayList<FormatPart>();
		digitPositions = 0;
		final int len = format.length();
		final StringBuilder buffer = new StringBuilder();
		boolean escape = false;
		boolean nextIsPadding = false;
		boolean hasSeenNumberOrNothing = false;
		for (int i = 0; i < len; ++i) {
			final char c = format.charAt(i);
			if (escape) {
				buffer.append(c);
				escape = false;
			} else if (nextIsPadding) {
				addConstantPart(buffer, hasSeenNumberOrNothing);
				formatSpecification.add(new DigitFormatPart(digitPositions, true, c));
				digitPositions += 1;
				nextIsPadding = false;
			} else {
				switch (c) {
					case ESCAPE:
						escape = true;
						break;
					case NUMBER_OR_PAD:
						nextIsPadding = true;
						break;
					case NUMBER_OR_NOTHING:
					case NUMBER_OR_ZERO:
						addConstantPart(buffer, hasSeenNumberOrNothing);
						if (c == NUMBER_OR_NOTHING) {
							formatSpecification.add(new DigitFormatPart(digitPositions));
							hasSeenNumberOrNothing = true;
						} else {
							formatSpecification.add(new DigitFormatPart(digitPositions, true, '0'));
						}
						digitPositions += 1;
						break;
					default:
						buffer.append(c);
				}
			}
		}

		if (buffer.length() > 0) {
			formatSpecification.add(new ConstantFormatPart(hasSeenNumberOrNothing, buffer.toString()));
		}
	}