Пример #1
0
 public TokenizedInputDictionaryExtension newTokenizedInputExtension(DefaultTokenizedInput input) {
   synchronized (tokenizedInputExtensionPool) {
     if (!tokenizedInputExtensionPool.empty()) {
       TokenizedInputDictionaryExtension result =
           (TokenizedInputDictionaryExtension) tokenizedInputExtensionPool.pop();
       result.setInput(input);
       return result;
     }
   }
   return new TokenizedInputDictionaryExtension(this, input);
 }
Пример #2
0
 void freeTokenizedInputExtension(TokenizedInputDictionaryExtension e) {
   if (tokenizedInputExtensionPool.size() > 1000) {
     return;
   }
   // allow them to be collected
   e.tokenizedInput = null;
   tokenizedInputExtensionPool.push(e);
 }