org.loom.binding
Class ListNode

java.lang.Object
  extended by org.loom.binding.Node
      extended by org.loom.binding.AbstractCollectionNode
          extended by org.loom.binding.ListNode

public class ListNode
extends AbstractCollectionNode

A Node representing a List


Constructor Summary
ListNode()
           
 
Method Summary
protected  java.lang.Object ensureCapacity(java.lang.Object container, java.lang.Object collection, int minSize)
          Checks that the collection has at least the expected size.
protected  java.lang.Object get(java.lang.Object list, int index)
           
protected  int getSize(java.lang.Object list)
           
protected  void set(java.lang.Object list, int index, java.lang.Object item)
          Adds an item to the list
 
Methods inherited from class org.loom.binding.AbstractCollectionNode
addItemToList, applyValidationImpl, getValue, setPropertyWrapper, setValue
 
Methods inherited from class org.loom.binding.Node
applyValidation, getChild, getIndex, getIndexAsInt, getNextNodeClass, getPropertyName, getPropertyWrapper, isLeaf, setChild
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ListNode

public ListNode()
Method Detail

get

protected java.lang.Object get(java.lang.Object list,
                               int index)
Specified by:
get in class AbstractCollectionNode
Returns:
the required item in the list

getSize

protected int getSize(java.lang.Object list)
Specified by:
getSize in class AbstractCollectionNode
Parameters:
list - the List/array instance
Returns:
the size of the list

set

protected void set(java.lang.Object list,
                   int index,
                   java.lang.Object item)
Description copied from class: AbstractCollectionNode
Adds an item to the list

Specified by:
set in class AbstractCollectionNode

ensureCapacity

protected java.lang.Object ensureCapacity(java.lang.Object container,
                                          java.lang.Object collection,
                                          int minSize)
Description copied from class: AbstractCollectionNode
Checks that the collection has at least the expected size. Enlarge it if it doesn't

Specified by:
ensureCapacity in class AbstractCollectionNode
Parameters:
container - the instance that contains this collection property
collection - the collection to check
minSize - the minimum size required
Returns:
the original collection if it does have the minimum size required, or a bigger copy if not.