Convenience method to update the list of tokens in the local system keyspace.

@param addTokens tokens to add
@param rmTokens tokens to remove
@return the collection of persisted tokens
776889
public static synchronized Collection<Token> updateLocalTokens(Collection<Token> addTokens, Collection<Token> rmTokens)
    {
        Collection<Token> tokens = getSavedTokens();
        tokens.removeAll(rmTokens);
        tokens.addAll(addTokens);
        updateTokens(tokens);
        return tokens;
    }
238661
private void convertTokenDefinitions(Map<String, ParseTreeNode> helpers,
	    Map<String, ParseTreeNode> tokens) throws GrammarException,
	    TreeException {
	tokenDefinitions = new TokenDefinitionSet();
	for (ParseTreeNode tokenDefinitionAST : parserTree.getChild("Tokens")
		.getChild("TokenDefinitions").getChildren("TokenDefinition")) {
	    TokenDefinition convertedTokenDefinition = getTokenDefinition(
		    tokenDefinitionAST, helpers, tokens);
	    tokenDefinitions.addDefinition(convertedTokenDefinition);
	}
    }
1003558
final private void addPositionFromToken(MtasToken token, Long ref)
      throws IOException {
    int prefixId = storePrefixAndTermRef ? token.getPrefixId() : 0;
    if (!closed && (token != null)) {
      if (token.checkPositionType(MtasPosition.POSITION_SINGLE)) {
        addSinglePoint(token.getPositionStart(), prefixId, token.getTermRef(),
            token.getId(), ref);
      } else if (token.checkPositionType(MtasPosition.POSITION_RANGE)) {
        addRange(token.getPositionStart(), token.getPositionEnd(), prefixId,
            token.getTermRef(), token.getId(), ref);
      } else if (token.checkPositionType(MtasPosition.POSITION_SET)) {
        // split set into minimum number of single points and ranges
        SortedMap<Integer, Integer> list = new TreeMap<>();
        int[] positions = token.getPositions();
        Integer lastPoint = null;
        Integer startPoint = null;
        for (int position : positions) {
          if (lastPoint == null) {
            startPoint = position;
            lastPoint = position;
          } else if ((position - lastPoint) != 1) {
            list.put(startPoint, lastPoint);
            startPoint = position;
          }
          lastPoint = position;
        }
        if (lastPoint != null) {
          list.put(startPoint, lastPoint);
        }
        for (Entry<Integer, Integer> entry : list.entrySet()) {
          if (entry.getKey().equals(entry.getValue())) {
            addSinglePoint(entry.getKey(), prefixId, token.getTermRef(),
                token.getId(), ref);
          } else {
            addRange(entry.getKey(), entry.getValue(), prefixId,
                token.getTermRef(), token.getId(), ref);
          }
        }
      }
    }
  }
1163448
public AlphabeticIndex<V> addLabels(UnicodeSet additions) {
        initialLabels.addAll(additions);
        buckets = null;
        return this;
    }
1142152
public void addJmsBrokers(Jms[] jmses) {
		for (Jms jms : jmses) {
			final JmsDefinition jmsDefinition = new JmsDefinition(jms.connectionFactoryName());
			jmsDefinition.addQueues(jms.queues());
			jmsDefinition.addTopics(jms.topics());
			this.jmsDefinitions.add(jmsDefinition);
		}
	}
1010459
public Parser<Token> token(String... tokenNames) {
    if (tokenNames.length == 0) return Parsers.never();
    @SuppressWarnings("unchecked")
    Parser<Token>[] ps = new Parser[tokenNames.length];
    for(int i = 0; i < tokenNames.length; i++) {
      ps[i] = Parsers.token(InternalFunctors.tokenWithSameValue(word(tokenNames[i])));
    }
    return Parsers.or(ps);
  }
347194
private void updateTokensStored(long now) {
    if (now <= this.nextTokenAvailableMillis) {
      return;
    }
    long millisUnaccounted = now - this.nextTokenAvailableMillis;
    double newTokens = millisUnaccounted * this.tokensPerMilli;
    this.nextTokenAvailableMillis = now;
    this.tokensStored = Math.min(this.tokensStored + newTokens, Math.max(this.tokensStored, this.maxBucketSizeInTokens));
  }
359816
public void setSyntaxTokens(java.util.Collection<SyntaxToken> syntaxTokens) {
        if (syntaxTokens == null) {
            this.syntaxTokens = null;
            return;
        }

        this.syntaxTokens = new java.util.ArrayList<SyntaxToken>(syntaxTokens);
    }
933857
public void setTagKeys(java.util.Collection<String> tagKeys) {
        if (tagKeys == null) {
            this.tagKeys = null;
            return;
        }

        this.tagKeys = new com.amazonaws.internal.SdkInternalList<String>(tagKeys);
    }
775306
def add(self, *tokens: str) -> None:
        """"""
        from wdom.web_node import WdomElement
        _new_tokens = []
        for token in tokens:
            self._validate_token(token)
            if token and token not in self:
                self._list.append(token)
                _new_tokens.append(token)
        if isinstance(self._owner, WdomElement) and _new_tokens:
            self._owner.js_exec('addClass', _new_tokens)
525303
public static String detokenize(List<String> tokens) {
    return TwitterKoreanProcessor.detokenize(JavaConversions.iterableAsScalaIterable(tokens));
  }
881717
public function add(string ...$tokens)
    {
        if (count($tokens) === 0) {
            return;
        }
        foreach ($tokens as $t) {
            if (in_array($t, $this->tokens)) {
                continue;
            }
            $this->tokens[] = $t;
        }
        $this->setAttributeValue();
    }
226782
@Override
    protected List<TokenParser> createAllTokenParsers() {
        List<TokenParser> parsers = new ArrayList<>();
        modules.forEach(m -> parsers.addAll(m.getTokenParsers()));

        return parsers;
    }
559840
public void add(Collection<Server> servers)
    {
        for(Server server : servers)
            this.servers.put(server.getId(), server);
    }
1305658
public void add(Collection<KeyTransaction> keyTransactions)
    {
        for(KeyTransaction keyTransaction : keyTransactions)
            this.keyTransactions.put(keyTransaction.getId(), keyTransaction);
    }
222584
protected List<EquPart> multiplize(final List<EquPart> oldTokens)
    {
        final EquPart[] equParts = oldTokens.toArray(new EquPart[0]);
        final EquPart[] fixed = new EquPart[equParts.length * 2];
        /*
         * )(, operand (, operand operand, operand function, ) operand, )
         * function
         */
        fixed[0] = equParts[0];

        EquPart m;
        int left = 0;

        for (int right = 1; right < equParts.length; right++)
        {
            if (fixed[left].multiplize(equParts[right]))
            {
                m = new OpMultiply(fixed[left]);
                left++;
                fixed[left] = m;
            }

            left++;
            fixed[left] = equParts[right];
        }

        final List<EquPart> tokens = new ArrayList<>();

        for (int i = 0; i < fixed.length; i++)
            if (fixed[i] != null)
                tokens.add(fixed[i]);

        return tokens;
    }
55975
public static UpdateResult update(String accessToken,
			UpdateDiscount updateDiscount) {
		return update(accessToken, JsonUtil.toJSONString(updateDiscount));
	}