class SequenceItem implements Comparable<SequenceItem> {

	public static String getDittedString(List<SequenceItem> itemList, int totalLength) {
		StringBuilder sb = new StringBuilder();
		int symbolsWritten = 0;
		for (SequenceItem currentItem : itemList) {
			if (currentItem.getIndex() < symbolsWritten) {
				throw new IllegalArgumentException(
					"itemList must be in ascending order of item index");
			}
			while (currentItem.getIndex() > symbolsWritten) {
				sb.append(".");//add a dit
				symbolsWritten++;
			}
			sb.append(currentItem.getSymbol());
			symbolsWritten++;
		}
		if (symbolsWritten > totalLength) {
			throw new IllegalArgumentException("mismatch between itemList and totalLength");
		}
		while (symbolsWritten < totalLength) {
			sb.append(".");
			symbolsWritten++;
		}
		return sb.toString();
	}

	public  SequenceItem(String item, int index);

}