Register value.

@param term
the term
@param termVector
the term vector
@param number
the number
@param mutableKey
the mutable key
@throws IOException
Signals that an I/O exception has occurred.
774173
@SuppressWarnings("unchecked")
  private static void registerValue(BytesRef term,
      ComponentTermVector termVector, TermvectorNumberFull number,
      String[] mutableKey) throws IOException {
    if (number.docNumber > 0) {
      if (mutableKey[0] == null) {
        mutableKey[0] = MtasToken.getPostfixFromValue(term);
      }
      MtasDataCollector<Long, ?> dataCollector = (MtasDataCollector<Long, ?>) termVector.subComponentFunction.dataCollector;
      long[] valuesLong = new long[number.docNumber];
      for (int i = 0; i < number.docNumber; i++) {
        try {
          valuesLong[i] = termVector.subComponentFunction.parserFunction
              .getValueLong(new long[] { number.args[i] }, number.positions[i]);
        } catch (IOException e) {
          log.debug(e);
          dataCollector.error(mutableKey[0], e.getMessage());
        }
      }
      if (!termVector.subComponentFunction.statsType
          .equals(CodecUtil.STATS_BASIC)) {
        dataCollector.add(mutableKey[0], valuesLong, valuesLong.length);
      }
      for (SubComponentFunction function : termVector.functions) {
        if (!function.parserFunction.sumRule()
            || function.parserFunction.needPositions()
            || !function.statsType.equals(CodecUtil.STATS_BASIC)) {
          if (function.dataType.equals(CodecUtil.DATA_TYPE_LONG)) {
            valuesLong = new long[number.docNumber];
            for (int i = 0; i < number.docNumber; i++) {
              try {
                valuesLong[i] = function.parserFunction.getValueLong(
                    new long[] { number.args[i] }, number.positions[i]);
              } catch (IOException e) {
                log.debug(e);
                function.dataCollector.error(mutableKey[0], e.getMessage());
              }
            }
            function.dataCollector.add(mutableKey[0], valuesLong,
                valuesLong.length);
          } else if (function.dataType.equals(CodecUtil.DATA_TYPE_DOUBLE)) {
            double[] valuesDouble = new double[number.docNumber];
            for (int i = 0; i < number.docNumber; i++) {
              try {
                valuesDouble[i] = function.parserFunction.getValueDouble(
                    new long[] { number.args[i] }, number.positions[i]);
              } catch (IOException e) {
                log.debug(e);
                function.dataCollector.error(mutableKey[0], e.getMessage());
              }
            }
            function.dataCollector.add(mutableKey[0], valuesDouble,
                valuesDouble.length);
          }
        }
      }
    }
  }
162120
public void addTerm(String key)
    {
        TermFrequency value = trieSingle.get(key);
        if (value == null)
        {
            value = new TermFrequency(key);
            trieSingle.put(key, value);
        }
        else
        {
            value.increase();
        }
        ++totalTerm;
    }
1309133
public void addTerm(Term term) {
		// 是否有人名
		if (!hasPerson && term.termNatures().personAttr.isActive()) {
			hasPerson = true;
		}

		if (!hasNumQua && term.termNatures().numAttr.isQua()) {
			hasNumQua = true;
		}
		TermUtil.insertTerm(terms, term, InsertTermType.REPLACE);

	}
1229692
public void put(String key, byte[] value) {
		if (this.compiledStatement != null) {
			if (value == null) {
				this.compiledStatement.bindNull(compiledStatementBindIndex++);
			} else {
				compiledStatement.bindBlob(compiledStatementBindIndex++, value);
			}
		} else if (values != null) {
			values.put(key, value);
			return;
		}

		names.add(key);
		// values.put(key, value);
		args.add(value);
		valueType.add(ParamType.BYTE_ARRAY);
	}
393066
protected void registerFactorComparator(final FactorComparator<T> comparator) {
    if (null == comparator ||
        Integer.MAX_VALUE - this.getTotalWeight() < comparator.getWeight()) {
      throw new IllegalArgumentException("unable to register comparator." +
          " The passed comparator is null or has an invalid weight value.");
    }

    // add or replace the Comparator.
    this.factorComparatorList.put(comparator.getFactorName(), comparator);
    logger.debug(String.format("Factor comparator added for '%s'. Weight = '%s'",
        comparator.getFactorName(), comparator.getWeight()));
  }
977865
public void add(ASN1Set entry) {
        ASN1EncodableVector v = new ASN1EncodableVector();
        int size = seq.size();
        for (int i = 0; i < size; i++) {
            v.add(seq.getObjectAt(i));
        }
        v.add(entry);
        seq = new DERSequence(v);
    }
1284351
public void handleContextVector(String focusKey,
                                    String secondaryKey,
                                    SparseDoubleVector context) {
        // Get the list of context vectors for the focus key.
        List<SparseDoubleVector> termContexts = dataVectors.get(focusKey);
        if (termContexts == null) {
            synchronized (this) {
                termContexts = dataVectors.get(focusKey);
                if (termContexts == null) {
                    termContexts = new ArrayList<SparseDoubleVector>();
                    dataVectors.put(focusKey, termContexts);
                }
            }
        }

        // Add the new context vector.
        int contextId = 0;
        synchronized (termContexts) {
            contextId = termContexts.size();
            termContexts.add(context);
        }

        // Record the association.
        if (reporter != null)
            reporter.assignContextToKey(focusKey, secondaryKey, contextId);
    }
697612
public void handIn(String key, V obj) {
		if (!retrieveSharedQueue(key).offer(obj)) {
			throw new RuntimeException("Could not register the given element, broker slot is already occupied.");
		}
	}
206961
@Override
  public MtasDataCollector<?, ?> add(String key, double[] values, int number)
      throws IOException {
    if (key != null) {
      MtasDataCollector<?, ?> subCollector = add(key, false);
      setValue(newCurrentPosition, ArrayUtils.toObject(values), number,
          newCurrentExisting);
      return subCollector;
    } else {
      return null;
    }
  }
368597
@Deprecated
    public static void writeWordVectors(@NonNull Word2Vec vec, @NonNull String path) throws IOException {
        BufferedWriter write = new BufferedWriter(
                new OutputStreamWriter(new FileOutputStream(new File(path), false), "UTF-8"));

        writeWordVectors(vec, write);

        write.flush();
        write.close();
    }
172235
public WordNumberCollectorBundle addData(String key, String data) {
        if (JMString.isNumber(data))
            addNumber(key, Double.valueOf(data));
        else
            addWord(key, data);
        return this;
    }
466366
public WordNumberCollectorBundle addWord(String key, String word) {
        wordCollector.add(key, word);
        return this;
    }
1101593
private static void registerMorse(Character abc, String dict) {
		alphabets.put(Integer.valueOf(abc), dict);
		dictionaries.put(dict, Integer.valueOf(abc));
	}
731773
private void register(String key, String alias) {
        String[] pcs = key.split(PREFIX_DELIM_REGEX, 2);

        if (pcs.length != 2) {
            throw new IllegalArgumentException("Illegal key value: " + key);
        }

        register(pcs[0], pcs[1], alias);
    }
160197
public void addMacro(String key, String value) {

        if (m_additionalMacros == null) {
            // use lazy initializing
            m_additionalMacros = new HashMap<String, String>();
        }
        m_additionalMacros.put(key, value);
    }
357900
@SuppressWarnings("unchecked")
    public void addKey(StorableKey<S> key) {
        if (key == null) {
            throw new IllegalArgumentException();
        }
        add(new StorableIndex<S>(key, Direction.UNSPECIFIED));
    }
1187143
public void addSubTerm(final IndexTerm term) {
        int i = 0;
        final int subTermNum = subTerms.size();

        if (IndexTermPrefix.SEE != term.getTermPrefix() && IndexTermPrefix.SEE_ALSO != term.getTermPrefix()) {
            //if the term is not "index-see" or "index-see-also"
            leaf = false;
        }

        for (; i < subTermNum; i++) {
            final IndexTerm subTerm = subTerms.get(i);

            if (subTerm.equals(term)) {
                return;
            }

            // Add targets when same term name and same term key
            if (subTerm.getTermFullName().equals(term.getTermFullName())
                    && subTerm.getTermKey().equals(term.getTermKey())) {
                subTerm.addTargets(term.getTargetList());
                subTerm.addSubTerms(term.getSubTerms());
                return;
            }
        }

        if (i == subTermNum) {
            subTerms.add(term);
        }
    }