net.sf.morph.reflect
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.

Since:
Nov 26, 2004
Author:
Matt Sgarlata

Field Summary
 
Fields inherited from interface net.sf.morph.reflect.SizableReflector
IMPLICIT_PROPERTY_SIZE
 
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
get
 
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
getSize
 
Methods inherited from interface net.sf.morph.reflect.Reflector
getReflectableClasses, getWrapper
 

Method Detail

set

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.

Parameters:
container - the container object
index - a number indiciating which element should be set
propertyValue - the value to be set
Returns:
the element previously at the specified position
Throws:
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.