org.apache.cocoon.forms.util
Class RepeaterAsList

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList
          extended by org.apache.cocoon.forms.util.RepeaterAsList
All Implemented Interfaces:
Iterable, Collection, List

public class RepeaterAsList
extends AbstractList

A List view of a Repeater, each element of the list being a Map wrapping a repeater row, as defined by ContainerWidgetAsMap.

This implementation of list supports all methods, with the following restrictions:

Since:
2.1.8
Version:
$Id: RepeaterAsList.html 1304258 2012-03-23 10:09:27Z ilgrosso $

Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
RepeaterAsList(Repeater repeater)
          Same as RepeaterAsList(repeater, false).
RepeaterAsList(Repeater repeater, boolean keysToLowerCase)
          Create a List view around a repeater.
 
Method Summary
 void add(int index, Object o)
           
 void clear()
           
 Object get(int index)
           
 Repeater getWidget()
          Get the repeater widget that is wrapped by this List.
 Widget getWidget(String path)
          Get a widget relative to the repeater wrapped by this List
 Object remove(int index)
           
 Object set(int index, Object o)
           
 int size()
           
 
Methods inherited from class java.util.AbstractList
add, addAll, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, removeRange, subList
 
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray
 

Constructor Detail

RepeaterAsList

public RepeaterAsList(Repeater repeater,
                      boolean keysToLowerCase)
Create a List view around a repeater. The keysToLowerCase parameter specifies if Maps wrapping rows should convert input keys to lower case, as specified by ContainerWidgetAsMap.ContainerWidgetAsMap(AbstractContainerWidget, boolean).

Parameters:
repeater - the repeater to wrap
keysToLowerCase - should we convert input keys to lower case?

RepeaterAsList

public RepeaterAsList(Repeater repeater)
Same as RepeaterAsList(repeater, false).

Method Detail

getWidget

public Repeater getWidget()
Get the repeater widget that is wrapped by this List.

Returns:
the wrapped Repeater

getWidget

public Widget getWidget(String path)
Get a widget relative to the repeater wrapped by this List

Parameters:
path - a widget lookup path
Returns:
the widget pointed to by path or null if it doesn't exist.
See Also:
Widget.lookupWidget(String)

get

public Object get(int index)
Specified by:
get in interface List
Specified by:
get in class AbstractList

size

public int size()
Specified by:
size in interface Collection
Specified by:
size in interface List
Specified by:
size in class AbstractCollection

set

public Object set(int index,
                  Object o)
Specified by:
set in interface List
Overrides:
set in class AbstractList

add

public void add(int index,
                Object o)
Specified by:
add in interface List
Overrides:
add in class AbstractList

remove

public Object remove(int index)
Specified by:
remove in interface List
Overrides:
remove in class AbstractList

clear

public void clear()
Specified by:
clear in interface Collection
Specified by:
clear in interface List
Overrides:
clear in class AbstractList


Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.