org.oddjob.structural
Class ChildMatch<T>

java.lang.Object
  extended by org.oddjob.structural.ChildMatch<T>
Type Parameters:
T - The type of the children.

public abstract class ChildMatch<T>
extends Object

Compares an incoming list of children with a base list and performs insert and remove operations that make the lists match.

This is an abstract class. Sub classes provide the insert and remove operations.

Author:
rob

Constructor Summary
ChildMatch(List<T> children)
          Create an instance with a list of children.
 
Method Summary
protected abstract  void insertChild(int index, T child)
          Sub classes provide implementation.
 void match(T[] match)
          Match the array to our list.
protected abstract  void removeChildAt(int index)
          Sub classes provide implementation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChildMatch

public ChildMatch(List<T> children)
Create an instance with a list of children.

Parameters:
children -
Method Detail

match

public void match(T[] match)
Match the array to our list.

Parameters:
match -

insertChild

protected abstract void insertChild(int index,
                                    T child)
Sub classes provide implementation.

Parameters:
index -
child -

removeChildAt

protected abstract void removeChildAt(int index)
Sub classes provide implementation.

Parameters:
index -