Operates exactly as {@link #set(int, java.lang.Double) }
@param index the index to set
@param element the value to set
@return the previous value at said index
332895
public double set(int index, double element)
    {
        boundsCheck(index);
        double ret = get(index);
        array[index] = element;
        return ret;
    }
321089
@Pure
	public P getElementAt(int index) {
		if (index >= 0 && index < this.referenceElementCount) {
			int idx = 0;
			for (final GridCellElement<P> element : this.elements) {
				if (element.isReferenceCell(this)) {
					if (idx == index) {
						return element.get();
					}
					++idx;
				}
			}
		}
		throw new IndexOutOfBoundsException();
	}
473806
public Object set(int index, Object element) {

        if (index >= elementCount) {
            throw new IndexOutOfBoundsException("Index out of bounds: "
                                                + index + " >= "
                                                + elementCount);
        }

        if (index < 0) {
            throw new IndexOutOfBoundsException("Index out of bounds: "
                                                + index + " < 0");
        }

        Object replacedObj = elementData[index];

        elementData[index] = element;

        return replacedObj;
    }
353986
@Override
  public Float remove(int index) {
    rangeCheck(index);
    float value = elements[index];
    for (int i = index + 1; i < size; i++) {
      elements[i - 1] = elements[i];
    }
    size -= 1;
    return value;
  }
1211714
@Override
  @SuppressWarnings("unchecked")
  public E get(int index) {
    Preconditions.checkElementIndex(index, size);
    return (E) array[index + offset];
  }
657004
public V setValueAt(int index, V value) {
        index = (index << 1) + 1;
        V old = (V)mArray[index];
        mArray[index] = value;
        return old;
    }
154715
public E set(int index, E value) {
        if (index >= mSize)
            throw new IndexOutOfBoundsException("Index: " + index + ", Size: "
                    + mSize);

        return mElements.set(index < 0 ? index + mSize : index, value);
    }
151283
@Override
    public E get(int index) {
        int idx = checkRangeConvert(index);
        return pointer.getElem(idx, idx ^ focus);
    }
2055
public void setValue(E element) {
        if(element == null)
            throw new NullPointerException("cannot set a null element");
        if(_lastId == VStack.NULL_ID)
            throw new IllegalStateException("neither next() nor previous() has been called");

        _stack.setById(_lastId, element);

        afterSet(element);
    }
436950
public double setCount(T element, double count) {
        AtomicDouble t = map.get(element);
        if (t != null) {
            double val = t.getAndSet(count);
            dirty.set(true);
            return val;
        } else {
            map.put(element, new AtomicDouble(count));
            totalCount.addAndGet(count);
            return 0;
        }

    }
531816
public double get(int index) {
	// overridden for performance only.
	if (index >= size || index < 0)
		throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
	return elements[index];
}
1092632
public ByteBuffer getElementAt(int index) {
        if (index >= elementsInBucket) {
            return null;
        } else {
            int chunk = index * gp.getElementSize() / memory[0].length;
            int offset = index * gp.getElementSize() % memory[0].length;
            return ByteBuffer.wrap(memory[chunk], offset, gp.getElementSize()).asReadOnlyBuffer();
        }
    }
168756
public double set(long index, double value) {
        compact();
        int i = findIndexMatching(index);
        if(i < 0) {
            add(index, value);
            compacted = false;
            return 0;
        } else {
            double old = vals[i];
            vals[i] = value;
            return old;
        }
    }
14417
public static <T> PositionFactory<Iterable<? extends T>, T> atIndex(final int index) {
        return new PositionFactory<Iterable<? extends T>, T>(index) {

            @Override
            public String toString() {
                return String.format("Element [%s]", index);
            }

            @Override
            protected <P> Type evaluateElementType(Position<P> parentPosition) {
                return TypeUtils.getTypeArguments(parentPosition.getType(), Iterable.class)
                    .get(Iterable.class.getTypeParameters()[0]);
            }
        };
    }
721787
public long indexOf(final String element) {
        return doWithJedis(new JedisCallable<Long>() {
            @Override
            public Long call(Jedis jedis) {
                return doIndexOf(jedis, element);
            }
        });
    }
493510
@SuppressWarnings("unchecked")
    public V getValue(int index)
    {
        if ((index < 0) || (index >= size()))
        {
            throw new IndexOutOfBoundsException();
        }
        return (V) _array[index * 2 + 1];
    }
186077
@Override
    public E set(int index, E element) {
        final ReentrantLock lock = this.lock;
        lock.lock();
        try {
            Object[] elements = getArray();
            E oldValue = get(elements, index);

            if (oldValue != element) {
                int len = elements.length;
                Object[] newElements = Arrays.copyOf(elements, len);
                newElements[index] = element;
                setArray(newElements);
            } else {
                // Not quite a no-op; ensures volatile write semantics
                setArray(elements);
            }
            return oldValue;
        } finally {
            lock.unlock();
        }
    }