void (int parentIndex, char ch) { if (myAllNodesSize == 0) { int initialCapacity = 10; myAllNodesChars = new char[initialCapacity]; myAllNodesParents = new char[initialCapacity]; myAllNodesChildren = new char[initialCapacity][]; } else if (myAllNodesSize >= myAllNodesChars.length) { int increment = Math.max(myAllNodesSize >> 2, 10); int newSize = myAllNodesSize + increment; myAllNodesChars = ArrayUtil.realloc(myAllNodesChars, newSize); myAllNodesParents = ArrayUtil.realloc(myAllNodesParents, newSize); myAllNodesChildren = ArrayUtil.realloc(myAllNodesChildren, newSize, FACTORY); } myAllNodesChars[myAllNodesSize] = ch; myAllNodesParents[myAllNodesSize] = (char)parentIndex; myAllNodesChildren[myAllNodesSize] = null; ++myAllNodesSize; assert myAllNodesSize < Character.MAX_VALUE; }