Esempio n. 1
0
 void displayNode(int index) {
   if (index >= SIZE) {
     next.displayNode(index - SIZE);
     return;
   }
   for (int i = 0; i < indent[index]; i++) System.out.print("  ");
   String name = this.name[index];
   if (name == null) name = "[null]";
   int nodeNum = firstNodeNum + index;
   System.out.println(
       name
           + "     node "
           + nodeNum
           + ": line "
           + line[index]
           + ": "
           + startTag[index]
           + ","
           + afterStartTag[index]
           + ","
           + endTag[index]
           + ","
           + afterEndTag[index]
           + "  next="
           + nextNodeAtThisLevel[index]);
 }
Esempio n. 2
0
 FastXmlBlockOfNodes getBlock(int nodeNum, boolean create) {
   if (nodeNum < 0) return null;
   // Find the right array
   FastXmlBlockOfNodes block = this;
   while (nodeNum >= SIZE) {
     if (block.next == null) {
       if (!create) return null;
       // Extend the list of arrays
       block.next = new FastXmlBlockOfNodes(this.firstNodeNum + SIZE);
     }
     // Look in the next list
     block = block.next;
     nodeNum -= SIZE;
   }
   return block;
 }
Esempio n. 3
0
 void list(int upTo) {
   for (int cnt = 0; cnt < upTo; cnt++) {
     if (cnt >= SIZE) {
       next.list(upTo - SIZE);
       return;
     }
     displayNode(cnt);
   }
 }