org.eclipse.amp.axf.core
Interface ICompositionProvider

All Known Implementing Classes:
AscapeModelProvider

public interface ICompositionProvider

The Interface IMemberProvider.


Method Summary
 java.lang.Class getChildrenClass(java.lang.Object member)
          Provides the most specific class that the composition is guaranteed to contain.
 java.lang.Object getChildrenPrototype(java.lang.Object member)
          Returns an exemplar object that characterizes the members of the composition.
 java.lang.Iterable getIteratable(java.lang.Object hasIterable)
          Gets the composition members for this level of the composition in iterable form.
 java.util.List getList(java.lang.Object hasIterable)
          Gets the composition members for this level of the composition as a list.
 java.lang.Object getParent(java.lang.Object member)
          Gets the list.
 boolean isChildrenComposition(java.lang.Object member)
          Indicates whether children of the provided object are themselves capable of providing composition members.
 boolean isComposition(java.lang.Object member)
          Indicates whether this object is a composition, i.e.
 boolean isMutable(java.lang.Object hasIterable)
          Checks if is mutable.
 

Method Detail

getIteratable

java.lang.Iterable getIteratable(java.lang.Object hasIterable)
Gets the composition members for this level of the composition in iterable form. Note that as iterables allow just-in-time usage of the underlying objects and do not require size or index positions to be known, composition consumers should generally use this form for best performance whenever practical. (In the worst case, where only an iterable is known, a call to getList() may require providers to first build a list.) On the other hand, providers should simply provide the most efficient usage which in many cases will simply mean returning getList for this method.

Parameters:
hasIterable - the parent object for this level of composition
Returns:
the iteratable
See Also:
#getList()

getList

java.util.List getList(java.lang.Object hasIterable)
Gets the composition members for this level of the composition as a list. Consumers should generally use getIterable(), see above.

Parameters:
hasIterable - the parent object for this level of composition
hasIterable - the has iterable
Returns:
the list
See Also:
#getIterable()

isMutable

boolean isMutable(java.lang.Object hasIterable)
Checks if is mutable.

Parameters:
hasIterable - the has iterable
Returns:
true, if is mutable

isComposition

boolean isComposition(java.lang.Object member)
Indicates whether this object is a composition, i.e. contains other members. If not, it will be assumed to be a model leaf.

Parameters:
parent - the object to test for composition.
Returns:
true if any children of the parent object's level are themselves compositions.

isChildrenComposition

boolean isChildrenComposition(java.lang.Object member)
Indicates whether children of the provided object are themselves capable of providing composition members. If not, we can assume that they represent the leaves of the composition structure.

Parameters:
parent - the object for which we are testing children members.
Returns:
true if any children of the parent object's level are themselves compositions.

getChildrenClass

java.lang.Class getChildrenClass(java.lang.Object member)
Provides the most specific class that the composition is guaranteed to contain. For cases where no common base class exists, should simply return Object.class.

Parameters:
member -
Returns:

getChildrenPrototype

java.lang.Object getChildrenPrototype(java.lang.Object member)
Returns an exemplar object that characterizes the members of the composition. This is useful for constraining the composition beyond type to state. For example, a prototype may help consumers specialize on the case for Foo.class where foo.bar > 10. Consumers should handle the case where prototype object is null, falling back to specializing on child class.

Parameters:
member -
Returns:
the prototype object. May be null.

getParent

java.lang.Object getParent(java.lang.Object member)
Gets the list.

Parameters:
hasIterable - the has iterable
Returns:
the list