Sets the index of the selected component. A value of -1 will clear
the selection.
195858
public void setSelectedIndex (int selidx)
    {
        // update the display
        updateSelection(selidx);

        // let the model know what's up
        Object item = (selidx == -1) ? null : _model.getElementAt(selidx);
        _model.setSelectedItem(item);
    }
512931
public void set(int index, double value) {
        checkIndex(index);

        IndexValue item = new IndexValue(index, 0);
        int valueIndex = Collections.binarySearch(values, item, comp);
        if (valueIndex >= 0 && value != 0d) {
            // Replace a currently existing item with a non zero value.
            values.get(valueIndex).value = value;
        } else if (value != 0d) {
            // Add a new cell item into this row.
            item.value = value;
            values.add((valueIndex + 1) * -1, item);
        } else if (valueIndex >= 0) {
            // Remove the value since it's now zero.
            values.remove(valueIndex);
        }
    }
202612
public void setSelectedValue (E value)
    {
        String valstr = value.toString();
        for (int ii = 0; ii < getItemCount(); ii++) {
            if (getValue(ii).equals(valstr)) {
                setSelectedIndex(ii);
                break;
            }
        }
    }
25236
public int setInt(
        @DoNotSub final int index,
        final int element)
    {
        checkIndex(index);

        final int previous = elements[index];
        elements[index] = element;

        return previous;
    }
600532
def set_index(self, index):
        
        item = index.internalPointer()
        self.actionunit = item.internal_data()
        self.setEnabled(bool(self.actionunit.status.traceback))
915622
public final void remove(final int index) {
        AbstractItem removedItem = items.remove(index);

        if (removedItem instanceof Item && ((Item) removedItem).getIcon() != null) {
            iconCount--;
        } else if (removedItem instanceof Divider) {
            dividerCount--;
        }

        rawItems = null;
        notifyOnDataSetChanged();
    }
360113
public void setSelectedComponent (ComponentClass cclass, int cid)
    {
        _selected.put(cclass, Integer.valueOf(cid));
        notifyListeners(BuilderModelListener.COMPONENT_CHANGED);
    }
1097026
private void setItem(int index, int value) {
        if (index == HOUR_INDEX) {
            setValueForItem(HOUR_INDEX, value);
            int hourDegrees = (value % 12) * HOUR_VALUE_TO_DEGREES_STEP_SIZE;
            mHourRadialSelectorView.setSelection(hourDegrees, isHourInnerCircle(value), false);
            mHourRadialSelectorView.invalidate();
        } else if (index == MINUTE_INDEX) {
            setValueForItem(MINUTE_INDEX, value);
            int minuteDegrees = value * MINUTE_VALUE_TO_DEGREES_STEP_SIZE;
            mMinuteRadialSelectorView.setSelection(minuteDegrees, false, false);
            mMinuteRadialSelectorView.invalidate();
        }
    }
1149067
public void reset()
    {
        for(int i = 0; i < index.size(); i++)
            index.set(i, i);
    }
1131184
public void remove( int index ) {
		T removed = data[index];
		for( int i = index+1; i < size; i++ ) {
			data[i-1] = data[i];
		}
		data[size-1] = removed;
		size--;
	}
987116
def decrement(index=-1)
      value = @components[index]
      raise TypeError.new "'#{value}' is not an integer" unless value.is_a? Integer
      raise RangeError.new "'#{value}' is zero or less" unless value > 0

      copy = Array.new @components
      copy[index] = value - 1
      self.class.new copy
    end
347661
public void deselectByIndex(int index) {
        getDispatcher().beforeDeselect(this, index);
        
        new Select(getElement()).deselectByIndex(index);
        if (Config.getBoolConfigProperty(ConfigProperty.ENABLE_GUI_LOGGING)) {
            logUIActions(UIActions.CLEARED, Integer.toString(index));
        }
        
        getDispatcher().afterDeselect(this, index);
    }
686737
private void removeColumn(int index)
    {
        TableColumn column = tableColumns.get(index);
        column.removePropertyChangeListener(widthListener);
        tableColumns.remove(index);
        JComponent component = customComponents.remove(index);
        remove(component);
        if (componentRemover != null)
        {
            componentRemover.accept(index);
        }
    }
272720
def removeByIndex(self, index):
        """"""
        if index < len(self._invites) -1 and \
           index >=0:
            self._invites.remove(index)
1202456
public T set(int index, T element)
    {
        switch (index)
        {
            case 0:
                T previousElement1 = this.element1;
                this.element1 = element;
                return previousElement1;
            case 1:
                T previousElement2 = this.element2;
                this.element2 = element;
                return previousElement2;
            default:
                throw new IndexOutOfBoundsException("Index: " + index + ", Size: " + this.size());
        }
    }
1240474
def clear_selection
      return if @selected_indices.nil? || @selected_indices.empty?
      arr = @selected_indices.dup # to un highlight
      @selected_indices.clear
      arr.each {|i| @obj.fire_row_changed(i) }
      @selected_index = nil
      @old_selected_index = nil
      #  User should ignore first two params
      lse = ListSelectionEvent.new(0, arr.size, @obj, :CLEAR)
      @obj.fire_handler :LIST_SELECTION_EVENT, lse
      arr = nil
    end
611693
void removeComponent(int index) {
        Component component = components.get(index);
        components.remove(index);
        updateComponentOffsets(index);
        position.getAndUpdate((offset) -> offset - component.length);
    }