将指定位置的数据替换为指定数据

@param data
指定数据
@param index
指定位置
@throws IndexOutOfBoundsException
数组越界时抛出该异常
976988
public void replace(byte data, int index) throws IndexOutOfBoundsException {
        if (index >= this.size || index < 0) {
            throw new IndexOutOfBoundsException("数组大小为：" + this.size + ";下标为：" + index);
        }
        this.datas[index] = data;
    }
196684
public void setWrappedData(Object data) {
        if (data == null) {
            inner = null;
            arrayFromInner = null;
            setRowIndex(-1);
        } else {
            inner = (Collection<E>) data;            
            arrayFromInner = (E[]) new Object[inner.size()];
            inner.toArray(arrayFromInner);
            setRowIndex(0);
        }
    }
739997
public void write(byte[] bytes, int offset, int len)
    {
        if (bytes == null)
        {
            return;
        }
        if ((offset < 0) || (offset > bytes.length) || (len < 0) || ((offset + len) - bytes.length > 0))
        {
            throw new IndexOutOfBoundsException("offset=" + offset + ", len=" + len + ", bytes.length=" + bytes.length);
        }
        ensureCapacity(size + len);
        System.arraycopy(bytes, offset, buffer, size, len);
        size += len;
    }
637183
public static void skipIndex(DataInput in) throws IOException
    {
        /* read only the column index list */
        int columnIndexSize = in.readInt();
        /* skip the column index data */
        if (in instanceof FileDataInput)
        {
            FileUtils.skipBytesFully(in, columnIndexSize);
        }
        else
        {
            // skip bytes
            byte[] skip = new byte[columnIndexSize];
            in.readFully(skip);
        }
    }
616937
@Override
	public void setXY(int index, Point2D pt) {
		if (index < 0 || index >= m_pointCount)
			// TODO exception
			throw new IndexOutOfBoundsException();

		_verifyAllStreams();
		// AttributeStreamOfDbl v = (AttributeStreamOfDbl)
		// m_vertexAttributes[0];
		AttributeStreamOfDbl v = (AttributeStreamOfDbl) m_vertexAttributes[0];
		v.write(index * 2, pt);
		notifyModified(DirtyFlags.DirtyCoordinates);
	}
940950
public static int selectIndex( float []data , int k , int maxIndex ,  int []indexes) {

		for( int i = 0; i < maxIndex; i++ ) {
			indexes[i] = i;
		}

		int i,j,mid;
		int n = maxIndex;
		int a;
		int l = 0;
		int ir = n-1;

		int temp;

		for(;;) {
			if( ir <= l+1 ) {
				if( ir == l+1 && data[indexes[ir]] < data[indexes[l]] ) {
					temp = indexes[l];
					indexes[l] = indexes[ir];
					indexes[ir] = temp;
				}
				return indexes[k];
			} else {
				mid = (l+ir) >> 1;

				int lp1 = l+1;
				temp = indexes[mid];
				indexes[mid] = indexes[lp1];
				indexes[lp1] = temp;

				if( data[indexes[l]] > data[indexes[ir]] ) {
					temp = indexes[l];
					indexes[l] = indexes[ir];
					indexes[ir] = temp;
				}

				if( data[indexes[lp1]] > data[indexes[ir]] ) {
					temp = indexes[lp1];
					indexes[lp1] = indexes[ir];
					indexes[ir] = temp;
				}

				if( data[indexes[l]] > data[indexes[lp1]] ) {
					temp = indexes[lp1];
					indexes[lp1] = indexes[l];
					indexes[l] = temp;
				}

				i=lp1;
				j=ir;
				a=indexes[lp1];

				for(;;) {
					do i++; while(data[indexes[i]]<data[a]);
					do j--; while (data[indexes[j]]>data[a]);
					if( j < i) break;
					temp = indexes[i];
					indexes[i] = indexes[j];
					indexes[j] = temp;
				}
				indexes[lp1] = indexes[j];
				indexes[j] = a;
				if( j >= k ) ir=j-1;
				if( j <= k ) l=i;
			}
		}
	}
205951
public void setData(byte[] data) throws IOException {
        output = new ByteArrayOutputStream();
        output.write(data);
        output.flush();
        setContentLength(output.size());
    }
296184
public void setIndex(String indexName) throws CmsException {

        if (CmsStringUtil.isEmpty(indexName)) {
            throw new CmsException(Messages.get().container(Messages.ERR_INDEXSOURCE_CREATE_MISSING_NAME_0));
        }
        CmsSolrIndex index = OpenCms.getSearchManager().getIndexSolr(indexName);
        if (index == null) {
            throw new CmsException(Messages.get().container(Messages.ERR_INDEX_NOT_FOUND_1, indexName));
        }

        m_index = index;

    }
959542
public Object get(int index) {

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

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

        return elementData[index];
    }
1295391
public synchronized XEvent remove(int index)
			throws IndexOutOfBoundsException, IOException {
		// check overflow list and adjust indices
		XEvent removed = null;
		int smallerOverflow = 0;
		for (int i = 0; i < overflowSize; i++) {
			if (overflowIndices[i] == index) {
				removed = overflowEntries[i];
			} else if (overflowIndices[i] > index) {
				overflowIndices[i] = overflowIndices[i] - 1;
				if (removed != null) {
					// move left
					overflowIndices[i - 1] = overflowIndices[i];
					overflowEntries[i - 1] = overflowEntries[i];
				}
			} else if (overflowIndices[i] < index) {
				smallerOverflow++;
			}
		}
		if (removed != null) {
			// adjust overflow size
			overflowSize--;
			// invalidate entry in overflow set
			overflowIndices[overflowSize] = -1;
			overflowEntries[overflowSize] = null;
		} else {
			int bufferIndex = index - smallerOverflow;
			for (int hole = holeFlags.nextSetBit(0); hole >= 0
					&& hole <= bufferIndex; hole = holeFlags
					.nextSetBit(hole + 1)) {
				bufferIndex++;
			}
			removed = buffer.get(bufferIndex);
			holeFlags.set(bufferIndex, true);
		}
		size--;
		return removed;
	}
1112011
public void removeIndex(ValidationData data) {
        for (ValidationDataIndex idx : this.idxs) {
            ValidationIndexUtil.removeIndexData(data, idx);
        }
    }
319971
public E get(int index) {
        if (index >= size)
            throw new IndexOutOfBoundsException(outOfBoundsMsg(index));

        return (E) elementData[index];
    }
830205
public final void setData(@Nullable Data<?> data) {
        setDatas(data != null ? singleton(data) : Collections.<Data<?>>emptyList());
    }
1349820
private static void checkRange(int fromIndex, int toIndex) {
		if (fromIndex < 0)
			throw new IndexOutOfBoundsException("fromIndex < 0: " + fromIndex);
		if (toIndex < 0)
			throw new IndexOutOfBoundsException("toIndex < 0: " + toIndex);
		if (fromIndex > toIndex)
			throw new IndexOutOfBoundsException("fromIndex: " + fromIndex +
					" > toIndex: " + toIndex);
	}
320909
public void handleData(String data) {
		state = data.equals("1");
		sendEvent(new CheckEvent(this.user, getPayload(), state));
		if (checkHandler != null)
			checkHandler.checked(state);
	}
493510
@SuppressWarnings("unchecked")
    public V getValue(int index)
    {
        if ((index < 0) || (index >= size()))
        {
            throw new IndexOutOfBoundsException();
        }
        return (V) _array[index * 2 + 1];
    }
1094464
protected final void rangeCheck (int index, boolean insert)
    {
        if ((index < 0) || (insert ? (index > _size) : (index >= _size))) {
            throw new IndexOutOfBoundsException(
                "Index: " + index + ", Size: " + _size);
        }
    }