SplitHistory implements Comparable<SplitHistory>, Serializable { public String indexPathString() { StringBuffer result = new StringBuffer(); int[] ip = indexPath(); for (int i = 0; i < ip.length - 1; i++) { result.append(Integer.toString(ip[i])); result.append('.'); } result.append(Integer.toString(ip[ip.length - 1])); return result.toString(); } SplitHistory();  SplitHistory(int initialCapacity); private  SplitHistory(boolean addRoot); private  SplitHistory(int initialCapacity, boolean addRoot); int size(); List<SplitHistoryEntry> entries(); int[] indexPath(); String indexPathString(); SplitHistory[] split(int num); SplitHistory split(int index, boolean last); @Override int compareTo(SplitHistory history); boolean isPredecessor(SplitHistory history); boolean isSuccessor(SplitHistory history); boolean isFirstUpTo(int level); boolean isLastUpTo(int level); boolean isFirst(); boolean isLast(); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString(); static SplitHistory parse(String history); static final SplitHistory ROOT; }
@Test public void testIndexPathString() { String p = "[(0/1),(0/2),(2/3)]"; assertEquals("0.0.2", (SplitHistory.parse(p).indexPathString())); p = "[(0/1),(1/2),(2/3)]"; assertEquals("0.1.2", (SplitHistory.parse(p).indexPathString())); p = "[(0/1)]"; assertEquals("0", (SplitHistory.parse(p).indexPathString())); }