net.sf.molae.pipe.tree
Interface CompositionView<T>

All Known Implementing Classes:
CompositionView.DefaultCompositionView

public interface CompositionView<T>

A Composition View defines for each class the children to be regarded.

See Also:
Composition, DepthFirstIterator

Nested Class Summary
static class CompositionView.DefaultCompositionView
          Default implementation of a CompositionView.
 
Field Summary
static CompositionView<Object> DEFAULT_COMPOSITION_VIEW
          The default composition view.
 
Method Summary
 Collection<? extends T> getChildren(T obj)
          Returns the components of the specified object.
 

Field Detail

DEFAULT_COMPOSITION_VIEW

static final CompositionView<Object> DEFAULT_COMPOSITION_VIEW
The default composition view.
  1. If the specified object is a Collection, it is returned itself.
  2. If it is a Composition, the component collection is returned.
Any other object is not recognized and returns null.

Method Detail

getChildren

Collection<? extends T> getChildren(T obj)
Returns the components of the specified object.

Parameters:
obj - an object
Returns:
the components of the specified object, null or an empty collection if it has no components.