net.sf.morph.wrap
Interface MutableIndexedContainer

All Superinterfaces:
Container, IndexedContainer, Sizable, Wrapper
All Known Subinterfaces:
DecoratedMutableIndexedContainer

public interface MutableIndexedContainer
extends IndexedContainer

A wrapper for an indexed container 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:
Jan 16, 2005
Author:
Matt Sgarlata

Method Summary
 java.lang.Object set(int index, java.lang.Object propertyValue)
          Sets the element at the specified index.
 
Methods inherited from interface net.sf.morph.wrap.IndexedContainer
get
 
Methods inherited from interface net.sf.morph.wrap.Container
getContainedType, getIterator
 
Methods inherited from interface net.sf.morph.wrap.Wrapper
getWrappedObject
 
Methods inherited from interface net.sf.morph.wrap.Sizable
getSize
 
Methods inherited from interface net.sf.morph.wrap.Wrapper
getWrappedObject
 

Method Detail

set

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

Parameters:
index - a number indiciating which element should be set
propertyValue - the value to be set
Returns:
the element previously at the specified position
Throws:
WrapperException - if index is not a valid index for this container object or
the object at the specified index could not be set for some reason


Copyright © 2004-2008.