507 "XPTRTOKEN_SCHEMENAME"); 508 fTokenNames.put(new Integer(XPTRTOKEN_SCHEMEDATA), 509 "XPTRTOKEN_SCHEMEDATA"); 510 } 511 512 /** 513 * Returns the token String 514 * @param token The index of the token 515 * @return String The token string 516 */ 517 private String getTokenString(int token) { 518 return fTokenNames.get(new Integer(token)); 519 } 520 521 /** 522 * Add the specified string as a token 523 * 524 * @param token The token string 525 */ 526 private void addToken(String tokenStr) { 527 if (!fTokenNames.containsValue(tokenStr)) { 528 Integer tokenInt = new Integer(fTokenNames.size()); 529 fTokenNames.put(tokenInt, tokenStr); 530 addToken(tokenInt.intValue()); 531 } 532 } 533 534 /** 535 * Add the specified int token 536 * 537 * @param token The int specifying the token 538 */ 539 private void addToken(int token) { 540 try { 541 fTokens[fTokenCount] = token; 542 } catch (ArrayIndexOutOfBoundsException ex) { 543 int[] oldList = fTokens; 544 fTokens = new int[fTokenCount << 1]; 545 System.arraycopy(oldList, 0, fTokens, 0, fTokenCount); 546 fTokens[fTokenCount] = token; 547 } 548 fTokenCount++; 549 } 550 551 /** | 507 "XPTRTOKEN_SCHEMENAME"); 508 fTokenNames.put(new Integer(XPTRTOKEN_SCHEMEDATA), 509 "XPTRTOKEN_SCHEMEDATA"); 510 } 511 512 /** 513 * Returns the token String 514 * @param token The index of the token 515 * @return String The token string 516 */ 517 private String getTokenString(int token) { 518 return fTokenNames.get(new Integer(token)); 519 } 520 521 /** 522 * Add the specified string as a token 523 * 524 * @param token The token string 525 */ 526 private void addToken(String tokenStr) { 527 String str = fTokenNames.get(tokenStr); 528 Integer tokenInt = str == null ? null : Integer.parseInt(str); 529 if (tokenInt == null) { 530 tokenInt = new Integer(fTokenNames.size()); 531 fTokenNames.put(tokenInt, tokenStr); 532 } 533 addToken(tokenInt.intValue()); 534 } 535 536 /** 537 * Add the specified int token 538 * 539 * @param token The int specifying the token 540 */ 541 private void addToken(int token) { 542 try { 543 fTokens[fTokenCount] = token; 544 } catch (ArrayIndexOutOfBoundsException ex) { 545 int[] oldList = fTokens; 546 fTokens = new int[fTokenCount << 1]; 547 System.arraycopy(oldList, 0, fTokens, 0, fTokenCount); 548 fTokens[fTokenCount] = token; 549 } 550 fTokenCount++; 551 } 552 553 /** |