Interface MutableIndexedContainerReflector

All Superinterfaces:
net.sf.composite.Component, ContainerReflector, IndexedContainerReflector, Reflector, SizableReflector
All Known Implementing Classes:
ArrayReflector, ListReflector, ServletRequestReflector, SimpleDelegatingReflector, StubbornDelegatingReflector

public interface MutableIndexedContainerReflector
extends IndexedContainerReflector

A reflector for an indexed structure that allows modification of an element at a given index. Most objects that are indexed are also "mutably indexed", if you will, but some are not. Most notably, you can't change an element at a specified index of a SortedSet because by virtue of adding something new to the set you may be changing the indices of the elements.

Nov 26, 2004
Matt Sgarlata

Field Summary
Fields inherited from interface net.sf.morph.reflect.SizableReflector
Method Summary
 java.lang.Object set(java.lang.Object container, int index, java.lang.Object propertyValue)
          Sets the element at the specified index.
Methods inherited from interface net.sf.morph.reflect.IndexedContainerReflector
Methods inherited from interface net.sf.morph.reflect.ContainerReflector
getContainedType, getIterator
Methods inherited from interface net.sf.morph.reflect.Reflector
getReflectableClasses, getWrapper
Methods inherited from interface net.sf.morph.reflect.SizableReflector
Methods inherited from interface net.sf.morph.reflect.Reflector
getReflectableClasses, getWrapper

Method Detail


java.lang.Object set(java.lang.Object container,
                     int index,
                     java.lang.Object propertyValue)
                     throws ReflectionException
Sets the element at the specified index. Valid indexes range between 0 and one less than the container object's size, inclusive.

container - the container object
index - a number indiciating which element should be set
propertyValue - the value to be set
the element previously at the specified position
ReflectionException - if container is null or
index is not a valid index for the given container object or
the object at the specified index could not be set for some reason

Copyright © 2004-2008.