Sets or add an entry.
@param i the index of entry.
@param x the value of entry.
@return true if a new entry added, false if an existing entry updated.
762812
public boolean set(int i, double x) {
        if (x == 0.0) {
            remove(i);
            return false;
        }
        
        Iterator<Entry> it = array.iterator();
        for (int k = 0; it.hasNext(); k++) {
            Entry e = it.next();
            if (e.i == i) {
                e.x = x;
                return false;
            } else if (e.i > i) {
                array.add(k, new Entry(i, x));
                return true;
            }
        }
        
        array.add(new Entry(i, x));
        return true;
    }
1023357
private boolean incrementAt(int i, int j)
    {
        int offset = j << 2;
        long mask = (0xfL << offset);
        long t = tableAt(i);
        if ((t & mask) != mask)
        {
            tableAt(i, t + (1L << offset));
            return true;
        }
        return false;
    }
162596
public void set(int i, byte value) {
        if (i < 0 || i >= size) {
            throw new IndexOutOfBoundsException();
        }
        elements[i] = value;
    }
852925
public boolean add (int oid)
    {
        // check for existence
        for (int ii = 0; ii < _size; ii++) {
            if (_oids[ii] == oid) {
                return false;
            }
        }

        // make room if necessary
        if (_size+1 >= _oids.length) {
            expand();
        }

        // add the oid
        _oids[_size++] = oid;
        return true;
    }
1272523
public boolean add(final int value) {
        if (size == capacity) {
            throw new IllegalStateException("This IntHashSet of capacity " + capacity + " is full");
        }
        int index = intHash(value, mask);

        while (values[index] != missingValue) {
            if (values[index] == value) {
                return false;
            }

            index = next(index);
        }

        values[index] = value;
        size++;

        return true;
    }
1223776
public boolean checkedAdd(final int x) {
    final short hb = Util.highbits(x);
    final int i = highLowContainer.getIndex(hb);
    if (i >= 0) {
      Container c = highLowContainer.getContainerAtIndex(i);
      int oldCard = c.getCardinality();
      // we need to keep the newContainer if a switch between containers type
      // occur, in order to get the new cardinality
      Container newCont = c.add(Util.lowbits(x));
      highLowContainer.setContainerAtIndex(i, newCont);
      if (newCont.getCardinality() > oldCard) {
        return true;
      }
    } else {
      final ArrayContainer newac = new ArrayContainer();
      highLowContainer.insertNewKeyValueAt(-i - 1, hb, newac.add(Util.lowbits(x)));
      return true;
    }
    return false;
  }
1133618
public final void insert(final int i, final int[] e) {
        final int l = e.length;
        if (l == 0) return;
        if (size + l > list.length) list = Arrays.copyOf(list, newSize(size + l));
        Array.move(list, i, l, size - i);
        System.arraycopy(e, 0, list, i, l);
        size += l;
    }
33195
@Override
    public boolean add(E e) {
        synchronized (linkedList) {
            if (capacity <= linkedList.size())
                linkedList.remove();
            return addAndChangeCurrentIndex(e);
        }
    }
886617
public void set(int i, double value) {
        switch (i) {
            case 0: {
                x = value;
                break;
            }
            case 1: {
                y = value;
                break;
            }
            case 2: {
                z = value;
                break;
            }
            default: {
                throw new ArrayIndexOutOfBoundsException(i);
            }
        }
    }
1337830
private void addEdge(int i, int j) {
		if(!nodes.contains(i)){
			nodes.add(i);
			edges.put(i, new HashSet<Integer>());
			size++;
		}else if(!edges.containsKey(i)){
			edges.put(i, new HashSet<Integer>());
		}

		if(!nodes.contains(j)){
			nodes.add(j);
			size++;
		}
		edgesInv.put(j, i);

		if(!edges.get(i).contains(j)){
			edges.get(i).add(j);
		}

	}
272674
def append(self, x):
        
        super(EntriesList, self).append(x)

        if self.entries_collection is not None:
            self.entries_collection.add_entry(self.date, x)
642004
public void put(ElementType x) {
        if (full()) {
            getIdx = (getIdx + 1) % elements.length;
        } else {
            size++;
        }

        elements[putIdx] = x;
        putIdx = (putIdx + 1) % elements.length;
    }
697670
private void inc(ArrayList<Integer> array, int index) {
        array.set(index, array.get(index) + 1);
    }
743682
public int push(int i)
  {

    if ((m_firstFree + 1) >= m_mapSize)
    {
      m_mapSize += m_blocksize;

      int newMap[] = new int[m_mapSize];

      System.arraycopy(m_map, 0, newMap, 0, m_firstFree + 1);

      m_map = newMap;
    }

    m_map[m_firstFree] = i;

    m_firstFree++;

    return i;
  }
449167
public void remove(int i) {
        Iterator<Entry> it = array.iterator();
        while (it.hasNext()) {
            Entry e = it.next();
            if (e.i == i) {
                it.remove();
                break;
            }
        }
    }
461559
public boolean checkedAdd(final int x) {
    final short hb = BufferUtil.highbits(x);
    final int i = highLowContainer.getIndex(hb);
    if (i >= 0) {
      MappeableContainer C = highLowContainer.getContainerAtIndex(i);
      int oldcard = C.getCardinality();
      C = C.add(BufferUtil.lowbits(x));
      getMappeableRoaringArray().setContainerAtIndex(i, C);
      return C.getCardinality() > oldcard;
    } else {
      final MappeableArrayContainer newac = new MappeableArrayContainer();
      getMappeableRoaringArray().insertNewKeyValueAt(-i - 1, hb, newac.add(BufferUtil.lowbits(x)));
      return true;
    }
  }
188907
public void insertChild(int i, Object t) {
		if (i < 0 || i > getChildCount()) {
			throw new IndexOutOfBoundsException(i+" out or range");
		}

		if (children == null) {
			children = createChildrenList();
		}

		children.add(i, t);
		// walk others to increment their child indexes
		// set index, parent of this one too
		this.freshenParentAndChildIndexes(i);
	}