/*
(non-Javadoc)

@see
mtas.codec.util.DataCollector.MtasDataOperations#add11(java.lang.Number,
java.lang.Number)
13944
@Override
  public Long add11(Long arg1, Long arg2) {
    if (arg1 == null || arg2 == null) {
      return null;
    } else {
      return arg1 + arg2;
    }
  }
1065870
public Object add(Object data, int iOpenMode) throws DBException, RemoteException
    {
        Object key = this.getKey(data);
        if (key == null)
        {   // If autosequence, bump key
            try   {
                key = m_mDataMap.lastKey();
            } catch (NoSuchElementException ex)   {
                key = new Integer(0);
            }
            if (key instanceof Integer)   // Always
                key = new Integer(((Integer)key).intValue() + 1);
            ((Vector)data).set(0, key);
        }
        if (m_mDataMap.get(key) != null)
            throw new DBException("Duplicate record");
        m_mDataMap.put(key, data);
        m_objCurrentKey = null;
        m_iterator = null;
        
        return key;
    }
321567
public void addDeref(ValueNumber vn, Location location) {
        if (UnconditionalValueDerefAnalysis.DEBUG) {
            System.out.println("Adding dereference of " + vn + " to # " + System.identityHashCode(this) + " @ " + location);
        }
        valueNumbersUnconditionallyDereferenced.set(vn.getNumber());

        Set<Location> derefLocationSet = getDerefLocationSet(vn);
        derefLocationSet.add(location);
    }
1197419
@Override
  public void merge(MtasDataCollector<?, ?> newDataCollector,
      Map<MtasDataCollector<?, ?>, MtasDataCollector<?, ?>> map,
      boolean increaseSourceNumber) throws IOException {
    closeNewList();
    if (!collectorType.equals(newDataCollector.getCollectorType())
        || !dataType.equals(newDataCollector.getDataType())
        || !statsType.equals(newDataCollector.getStatsType())
        || !(newDataCollector instanceof MtasDataBasic)) {
      throw new IOException("cannot merge different dataCollectors");
    } else {
      segmentRegistration = null;
      @SuppressWarnings("unchecked")
      MtasDataBasic<T1, T2> newMtasDataBasic = (MtasDataBasic<T1, T2>) newDataCollector;
      newMtasDataBasic.closeNewList();
      initNewList(newMtasDataBasic.getSize());
      if (collectorType.equals(DataCollector.COLLECTOR_TYPE_LIST)) {
        map.put(newDataCollector, this);
        for (int i = 0; i < newMtasDataBasic.getSize(); i++) {
          MtasDataCollector<?, ?>[] subCollectors = new MtasDataCollector[1];
          subCollectors[0] = add(newMtasDataBasic.keyList[i],
              increaseSourceNumber);
          setError(newCurrentPosition, newMtasDataBasic.errorNumber[i],
              newMtasDataBasic.errorList[i], newCurrentExisting);
          setValue(newCurrentPosition, newMtasDataBasic.basicValueSumList[i],
              newMtasDataBasic.basicValueNList[i], newCurrentExisting);
          if (hasSub() && newMtasDataBasic.hasSub()) {
            // single key implies exactly one subCollector if hasSub
            subCollectors[0].merge(
                newMtasDataBasic.subCollectorListNextLevel[i], map,
                increaseSourceNumber);
          }
        }
        closeNewList();
      } else if (collectorType.equals(DataCollector.COLLECTOR_TYPE_DATA)) {
        map.put(newDataCollector, this);
        if (newMtasDataBasic.getSize() > 0) {
          MtasDataCollector<?, ?> subCollector = add(increaseSourceNumber);
          setError(newCurrentPosition, newMtasDataBasic.errorNumber[0],
              newMtasDataBasic.errorList[0], newCurrentExisting);
          setValue(newCurrentPosition, newMtasDataBasic.basicValueSumList[0],
              newMtasDataBasic.basicValueNList[0], newCurrentExisting);
          if (hasSub() && newMtasDataBasic.hasSub()) {
            subCollector.merge(newMtasDataBasic.subCollectorNextLevel, map,
                increaseSourceNumber);
          }
        }
        closeNewList();
      } else {
        throw new IOException("cannot merge " + collectorType);
      }
    }
  }
830171
public WordNumberCollectorBundle addNumber(String key, Number number) {
        numberCollector.add(key, number);
        return this;
    }
175239
public final Tuple4<T12, T13, T14, T15> skip11() {
        return new Tuple4<>(v12, v13, v14, v15);
    }
1301857
@Override
  public MtasDataCollector<?, ?> add(String key, long[] values, int number)
      throws IOException {
    if (key != null) {
      Double[] newValues = new Double[number];
      for (int i = 0; i < values.length; i++)
        newValues[i] = Long.valueOf(values[i]).doubleValue();
      MtasDataCollector<?, ?> subCollector = add(key, false);
      setValue(newCurrentPosition, newValues, number, newCurrentExisting);
      return subCollector;
    } else {
      return null;
    }
  }
1363584
public T AddEx(T value) {
        if (m_Count < m_Capacity) {
            m_Array[++m_Count] = value;
            UpHeap();
            return null;
        }
        else if (m_Capacity == 0) return value;
        else if (greaterThan(m_Array[1], value)) {
            T retVal = m_Array[1];
            m_Array[1] = value;
            DownHeap();
            return retVal;
        }
        else return value;
    }
641726
private void addLineNumber(BitSet lineNumbers) {
        LineNumberTable lnt = getCode().getLineNumberTable();
        if (lnt == null) {
            lineNumbers.set(0);
        } else {
            int line = lnt.getSourceLine(getPC());
            if (line < 0) {
                lineNumbers.set(lineNumbers.size());
            } else {
                lineNumbers.set(line);
            }
        }
    }
1087107
def addValue(self, source, data):
    """"""
    self.__result[self._dataFormat.getValue(data)].append(source)
576098
public static ListDouble add(final ListNumber data1, final ListNumber data2) {
        if (data1.size() != data2.size())
            throw new IllegalArgumentException("Can't sum ListNumbers of different size (" + data1.size() + " - " + data2.size() + ")");
        return new ListDouble() {

            @Override
            public double getDouble(int index) {
                return data1.getDouble(index) + data2.getDouble(index);
            }

            @Override
            public int size() {
                return data1.size();
            }
        };
    }
996222
public void addNextValue(Object val) {
    String newVal = val.toString();
    if (this.minVal == null || this.minVal.compareTo(newVal) > 0) {
      this.minVal = newVal;
    }
  }
1126670
public void add(int var, Type t) {
    Set<Integer> tVars = t.getTypeVariables();
    Set<Integer> intersection = Sets.intersection(tVars, bindings.keySet());
    Preconditions.checkArgument(intersection.size() == 0,
        "Tried to replace %s with %s, but already have bindings for %s", var, t, intersection);
    Preconditions.checkArgument(!tVars.contains(var),
        "Recursive replacement: tried to replace %s with %s", var, t);
    
    Map<Integer, Type> newBinding = Maps.newHashMap();
    newBinding.put(var, t);
    for (int boundVar : bindings.keySet()) {
      bindings.put(boundVar, bindings.get(boundVar).substitute(newBinding));
    }
    bindings.put(var, t);
  }
463737
public static int calculateMod11CheckSum(int[] weights, StringNumber number) {
       int c = calculateChecksum(weights, number, false) % 11;
       if (c == 1) {
          throw new IllegalArgumentException(ERROR_INVALID_CHECKSUM + number);
       }
       return c == 0 ? 0 : 11 - c;
    }
229068
public void addLineOffset(int offset) {
        if (numLines >= lineNumberMap.length) {
            // Grow the line number map.
            int capacity = lineNumberMap.length * 2;
            int[] newLineNumberMap = new int[capacity];
            System.arraycopy(lineNumberMap, 0, newLineNumberMap, 0, lineNumberMap.length);
            lineNumberMap = newLineNumberMap;
        }

        lineNumberMap[numLines++] = offset;
    }
841014
public void addPhoneNumber(String newPhoneNumber) {
        if (newPhoneNumber==null || newPhoneNumber.trim().length()==0) {
            return;
        }

        if (phoneNumbers == null) {
            phoneNumbers = new ArrayList<>(1);
        }
        for (PhoneNumber phoneNumber : phoneNumbers) {
            if (phoneNumber.value.equals(newPhoneNumber) && phoneNumber.getType() == null) {
                throw new IllegalArgumentException("Already contains phoneNumber " + newPhoneNumber);
            }
        }

        PhoneNumber number = new PhoneNumber();
        number.setValue(newPhoneNumber);
        phoneNumbers.add(number);
    }
1111233
@Nonnull
  public CSSExpression addNumber (@Nonnegative final int nIndex, final int nValue)
  {
    return addMember (nIndex, new CSSExpressionMemberTermSimple (nValue));
  }