net.sf.morph.reflect
Interface IndexedContainerReflector
- All Superinterfaces:
- net.sf.composite.Component, ContainerReflector, Reflector, SizableReflector
- All Known Subinterfaces:
- MutableIndexedContainerReflector
- All Known Implementing Classes:
- ArrayReflector, ListReflector, ServletRequestReflector, SimpleDelegatingReflector, SortedSetReflector, StubbornDelegatingReflector
public interface IndexedContainerReflector
- extends ContainerReflector, SizableReflector
A reflector for 'container-like' structures that have a logical ordering
which can be used to retrieve elements at a specific index within the
structure. Lists, SortedSets, and arrays are good examples of indexed
structures. Note that some indexed structures will have O(1) methods for
retrieving objects at a given index (ArrayList, TreeSet, array) and others
will have O(n) methods for retrieving objects at a given index (LinkedList).
- Since:
- Nov 14, 2004
- Author:
- Matt Sgarlata
Method Summary |
java.lang.Object |
get(java.lang.Object container,
int index)
Gets the element at the specified index. |
get
java.lang.Object get(java.lang.Object container,
int index)
throws ReflectionException
- Gets 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 objectindex
- a number indiciating which element should be retrieved
- Returns:
- the object at the specified index
- 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 retrieved for
some reason
Copyright © 2004-2008.