542 "XPTRTOKEN_ELEM_NCNAME"); 543 fTokenNames.put(new Integer(XPTRTOKEN_ELEM_CHILD), 544 "XPTRTOKEN_ELEM_CHILD"); 545 } 546 547 /* 548 * Returns the token String 549 * @param token The index of the token 550 * @return String The token string 551 */ 552 private String getTokenString(int token) { 553 return fTokenNames.get(new Integer(token)); 554 } 555 556 /** 557 * Add the specified string as a token 558 * 559 * @param token The token string 560 */ 561 private void addToken(String tokenStr) { 562 if (!fTokenNames.containsValue(tokenStr)) { 563 Integer tokenInt = new Integer(fTokenNames.size()); 564 fTokenNames.put(tokenInt, tokenStr); 565 addToken(tokenInt.intValue()); 566 } 567 } 568 569 /** 570 * Add the specified int token 571 * 572 * @param token The int specifying the token 573 */ 574 private void addToken(int token) { 575 try { 576 fTokens[fTokenCount] = token; 577 } catch (ArrayIndexOutOfBoundsException ex) { 578 int[] oldList = fTokens; 579 fTokens = new int[fTokenCount << 1]; 580 System.arraycopy(oldList, 0, fTokens, 0, fTokenCount); 581 fTokens[fTokenCount] = token; 582 } 583 fTokenCount++; 584 } 585 586 /** | 542 "XPTRTOKEN_ELEM_NCNAME"); 543 fTokenNames.put(new Integer(XPTRTOKEN_ELEM_CHILD), 544 "XPTRTOKEN_ELEM_CHILD"); 545 } 546 547 /* 548 * Returns the token String 549 * @param token The index of the token 550 * @return String The token string 551 */ 552 private String getTokenString(int token) { 553 return fTokenNames.get(new Integer(token)); 554 } 555 556 /** 557 * Add the specified string as a token 558 * 559 * @param token The token string 560 */ 561 private void addToken(String tokenStr) { 562 String str = fTokenNames.get(tokenStr); 563 Integer tokenInt = str == null ? null : Integer.parseInt(str); 564 if (tokenInt == null) { 565 tokenInt = new Integer(fTokenNames.size()); 566 fTokenNames.put(tokenInt, tokenStr); 567 } 568 addToken(tokenInt.intValue()); 569 } 570 571 /** 572 * Add the specified int token 573 * 574 * @param token The int specifying the token 575 */ 576 private void addToken(int token) { 577 try { 578 fTokens[fTokenCount] = token; 579 } catch (ArrayIndexOutOfBoundsException ex) { 580 int[] oldList = fTokens; 581 fTokens = new int[fTokenCount << 1]; 582 System.arraycopy(oldList, 0, fTokens, 0, fTokenCount); 583 fTokens[fTokenCount] = token; 584 } 585 fTokenCount++; 586 } 587 588 /** |