/** * Tries to find the index of element with the given key. The key must not * be null. * * @param key the key for the element to be searched. * @return the index of the key, or -1 if not found. */ public int findElementIndex(final Object key) { if (key == null) { throw new NullPointerException("Item to find must not be null"); } for (int i = 0; i < this.data.size(); i++) { final ComboBoxItemPair datacon = (ComboBoxItemPair) this.data.get(i); if (key.equals(datacon.getValue())) { return i; } } return -1; }
/** * Tries to find the index of element with the given key. The key must not * be null. * * @param key the key for the element to be searched. * @return the index of the key, or -1 if not found. */ public int findElementIndex(final Object key) { if (key == null) { throw new NullPointerException("Item to find must not be null"); } for (int i = 0; i < this.data.size(); i++) { final ComboBoxItemPair datacon = (ComboBoxItemPair) this.data.get(i); if (key.equals(datacon.getValue())) { return i; } } return -1; }
/** * Tries to find the index of element with the given key. The key must not * be null. * * @param key the key for the element to be searched. * @return the index of the key, or -1 if not found. */ public int findElementIndex(final Object key) { if (key == null) { throw new NullPointerException("Item to find must not be null"); } for (int i = 0; i < data.size(); i++) { final ComboBoxItemPair datacon = (ComboBoxItemPair) data.get(i); if (key.equals(datacon.getValue())) { return i; } } return -1; }
/** * Returns the value at the specified index. * * @param index the requested index * @return the value at <code>index</code> */ public Object getElementAt(final int index) { if (index >= data.size()) { return null; } final ComboBoxItemPair datacon = (ComboBoxItemPair) data.get(index); if (datacon == null) { return null; } return datacon.getValue(); }
/** * Returns the value at the specified index. * * @param index the requested index * @return the value at <code>index</code> */ public Object getElementAt(final int index) { if (index >= this.data.size()) { return null; } final ComboBoxItemPair datacon = (ComboBoxItemPair) this.data.get(index); if (datacon == null) { return null; } return datacon.getValue(); }
/** * Returns the value at the specified index. * * @param index the requested index * @return the value at <code>index</code> */ public Object getElementAt(final int index) { if (index >= this.data.size()) { return null; } final ComboBoxItemPair datacon = (ComboBoxItemPair) this.data.get(index); if (datacon == null) { return null; } return datacon.getValue(); }