/** * Sets the value at the specified index. * * @param index the index of the value to set * @return the previous value at that index * @throws IndexOutOfBoundsException if the index is invalid * @since Commons Collections 3.2 */ public Object setValue(int index, Object value) { Object key = insertOrder.get(index); return put(key, value); }
lom.put(1, "testInsert1", "testInsert1v"); fail("should not be able to insert at pos 1 in empty Map"); } catch (IndexOutOfBoundsException ex) {} try { lom.put(-1, "testInsert-1", "testInsert-1v"); fail("should not be able to insert at pos -1 in empty Map"); } catch (IndexOutOfBoundsException ex) {} lom.put(0, "testInsert1", "testInsert1v"); assertEquals("testInsert1v", lom.getValue(0)); lom.put("testInsertPut", "testInsertPutv"); assertEquals("testInsert1v", lom.getValue(0)); assertEquals("testInsertPutv", lom.getValue(1)); lom.put(0, "testInsert0", "testInsert0v"); assertEquals("testInsert0v", lom.getValue(0)); assertEquals("testInsert1v", lom.getValue(1)); assertEquals("testInsertPutv", lom.getValue(2)); lom.put(3, "testInsert3", "testInsert3v"); assertEquals("testInsert0v", lom.getValue(0)); assertEquals("testInsert1v", lom.getValue(1)); lom2.put(0, "testInsert0", "testInsert0v"); assertEquals("testInsert0v", lom2.getValue(0)); for (int i = 0; i < lom.size(); i++) { lom.put(i1, "1");
/** * Sets the value at the specified index. * * @param index the index of the value to set * @return the previous value at that index * @throws IndexOutOfBoundsException if the index is invalid * @since Commons Collections 3.2 */ public Object setValue(int index, Object value) { Object key = insertOrder.get(index); return put(key, value); }
public void putAll(Map map) { for (Iterator it = map.entrySet().iterator(); it.hasNext();) { Map.Entry entry = (Map.Entry) it.next(); put(entry.getKey(), entry.getValue()); } }
public void putAll(Map map) { for (Iterator it = map.entrySet().iterator(); it.hasNext();) { Map.Entry entry = (Map.Entry) it.next(); put(entry.getKey(), entry.getValue()); } }
/** * Sets the value at the specified index. * * @param index the index of the value to set * @return the previous value at that index * @throws IndexOutOfBoundsException if the index is invalid * @since Commons Collections 3.2 */ public Object setValue(int index, Object value) { Object key = insertOrder.get(index); return put(key, value); }
/** * Adds a value to the end of the list with the specified key. * * @param key A case insensitive String. * @param value The value to add * @return The value for previously mapped to this key */ public Object put(String key, Object value) { return super.put(key.toLowerCase(), value); }
/** * Sets the value at the specified index. * * @param index the index of the value to set * @return the previous value at that index * @throws IndexOutOfBoundsException if the index is invalid * @since Commons Collections 3.2 */ public Object setValue(int index, Object value) { Object key = insertOrder.get(index); return put(key, value); }
/** * Puts a key-value mapping into the map at the specified index. * * @param index The index at which the mapping should be inserted. * @param key A case insensitive String. * @param value The value. * * @return The value for previously mapped to this key */ public Object put(int index, String key, Object value) { return super.put(index, key.toLowerCase(), value); } /**
public void putAll(Map map) { for (Iterator it = map.entrySet().iterator(); it.hasNext();) { Map.Entry entry = (Map.Entry) it.next(); put(entry.getKey(), entry.getValue()); } }
public void putAll(Map map) { for (Iterator it = map.entrySet().iterator(); it.hasNext();) { Map.Entry entry = (Map.Entry) it.next(); put(entry.getKey(), entry.getValue()); } }
public void putAll(Map map) { for (Iterator it = map.entrySet().iterator(); it.hasNext();) { Map.Entry entry = (Map.Entry) it.next(); put(entry.getKey(), entry.getValue()); } }
public void putAll(Map map) { for (Iterator it = map.entrySet().iterator(); it.hasNext();) { Map.Entry entry = (Map.Entry) it.next(); put(entry.getKey(), entry.getValue()); } }
public void putAll(Map map) { for (Iterator it = map.entrySet().iterator(); it.hasNext();) { Map.Entry entry = (Map.Entry) it.next(); put(entry.getKey(), entry.getValue()); } }
public void addToAllInputs( final String key, final IActionParameter param ) { IActionParameter old = (IActionParameter) allParams.put( key, param ); if ( ( old != null ) && !allParams.containsValue( old ) ) { waitingToDieParams.add( old ); // Just in case a parameter gets over written delete it at the final dispose } }
public Map getTypeOptions() throws Exception { ListOrderedMap typeOptions = new ListOrderedMap(); typeOptions.put(CHOOSE_SCHEME, getText("admin.projects.issuetypescheme.radio1")); if (!getAllProjects().isEmpty()) { typeOptions.put(CHOOSE_PROJECT, getText("admin.projects.issuetypescheme.radio2")); } typeOptions.put(CREATE_SCHEME, getText("admin.projects.issuetypescheme.radio4")); return typeOptions; }
private ListOrderedMap resetMap( final String[] names, final ListOrderedMap oldMap ) { ListOrderedMap newMap = new ListOrderedMap(); for ( String element : names ) { newMap.put( element, oldMap.get( element ) ); } return ( newMap ); }
private void insertValueForSelectingDefaults(ListOrderedMap values) { values.put(0, Property.DEFAULT_COLUMNS, authenticationContext.getI18nHelper().getText("portlet.abstractsearchresults.defaultcols")); }
public void addToCurrentInputs( final String key, final IActionParameter param ) { if ( currentInputs.containsKey( key ) ) { currentInputs.remove( key ); } currentInputs.put( key, param ); }
private void populateAllAvailableFields(ListOrderedMap values) throws FieldException { Set fields = ComponentAccessor.getFieldManager().getAvailableNavigableFields(authenticationContext.getUser()); for (Object field1 : fields) { Field field = (Field) field1; values.put(field.getId(), field.getName()); } }