1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package net.sf.morph.reflect;
17
18 /**
19 * A reflector for an indexed structure that allows modification of an element
20 * at a given index. Most objects that are indexed are also "mutably indexed",
21 * if you will, but some are not. Most notably, you can't change an
22 * element at a specified index of a SortedSet because by virtue of adding
23 * something new to the set you may be changing the indices of the elements.
24 *
25 * @author Matt Sgarlata
26 * @since Nov 26, 2004
27 */
28 public interface MutableIndexedContainerReflector extends IndexedContainerReflector {
29
30 /**
31 * Sets the element at the specified index. Valid indexes range between 0
32 * and one less than the container object's size, inclusive.
33 *
34 * @param container
35 * the container object
36 * @param index
37 * a number indiciating which element should be set
38 * @param propertyValue
39 * the value to be set
40 * @return the element previously at the specified position
41 * @throws ReflectionException
42 * if <code>container</code> is null or <br>
43 * <code>index</code> is not a valid index for the given
44 * container object or <br>
45 * the object at the specified index could not be set for some
46 * reason
47 */
48 public Object set(Object container, int index, Object propertyValue)
49 throws ReflectionException;
50
51 }