org.eclipse.gmt.umlx.ecore.accessor
Interface ISiblingAccessor<C,P,CM>

Type Parameters:
C - The known child class
P - The known parent class
All Superinterfaces:
IParentAccessor<C,P,CM>
All Known Implementing Classes:
E2AssociationE2DirectedAssociationSiblingAccessor, EClassOperationsSiblingAccessor, EClassStructuralFeaturesSiblingAccessor, EEnumELiteralsSiblingAccessor, EOperationParametersSiblingAccessor, EPackageClassifiersSiblingAccessor, EPackageSubpackagesSiblingAccessor, GClassAttributesSiblingAccessor, GClassOperationsSiblingAccessor, GDiagramParentDiagramsSiblingAccessor, GEnumLiteralsSiblingAccessor, GImportsSiblingAccessor, GModelElementAccessor, GSheetLinksSiblingAccessor, GSheetNodesSiblingAccessor, GStickyNotesSiblingAccessor, OrphanageAssociationsSiblingAccessor, OrphanageE2TransientLinksSiblingAccessor, OrphanageInheritancesSiblingAccessor, ResourcePackagesSiblingAccessor, ResourceSetResourcesSiblingAccessor, SiblingAccessor, SimpleENamedElementAccessor, SimpleEObjectAccessor, SingleParentAccessor, TxClassAttributeVariablesSiblingAccessor, TxHelperParametersSiblingAccessor, UClassVariableUAttributeVariablesSiblingAccessor, UExpressionVariableExpressionSiblingAccessor, UHelperUParametersSiblingAccessor, UHelperUSelfParameterAccessor, UMappingInstanceUBindingsSiblingAccessor, UMappingUDomainsSiblingAccessor, URelationSubrulesSiblingAccessor, URelationUAttributeVariablesSiblingAccessor, URelationUClassVariableDeclarationsSiblingAccessor, URelationUExpressionVariableDeclarationsSiblingAccessor, URelationUMappingInstancesSiblingAccessor, UTransformationUDomainsSiblingAccessor, UTransformationUHelpersSiblingAccessor, UTransformationUMappingsSiblingAccessor, UTransformationUTypedModelsSiblingAccessor

public interface ISiblingAccessor<C,P,CM>
extends IParentAccessor<C,P,CM>

ISibling provides generic support for operations requiring type-dependent access to the siblings of a child object. An adapter may be obtained by Tree.getSibling(child,parent) where child and parent may be an instance or class. Thereafter the adapter may be used to obtain the siblings by getSiblings().


Method Summary
 java.util.List<? super C> getChildren(P parent)
          Return all child class children of parent.
 java.lang.String getLabel(C child)
          Get the label (name/text/whetever) of the child.
 java.lang.Class<P> getParentClass()
          Return the parent class
 java.util.List<? super C> getSiblings(C child)
          Return all siblings of and with the same class as child.
 boolean hasLabel()
          Test whether the child class has a label field.
 int removeChild(C child, P parent)
          Remove the child from the parent returning the non-negative index at which the removal was made, or -ve if not found.
 void setLabel(C child, java.lang.String label)
          Set the label (name/text/whetever) of the child.
 
Methods inherited from interface org.eclipse.gmt.umlx.ecore.accessor.IParentAccessor
basicGetParent, eResource, getBaseParentClass, getChildClass, getCoModel, getCoModelClass, getParent, getSiblingAccessor, setCoModel, setParent
 

Method Detail

getChildren

java.util.List<? super C> getChildren(P parent)
Return all child class children of parent. Note that the returned list is the parenmt's list if the parent happens to maintain a suitable list, otherwise a temporary list is constructed for the return. Changes to the temporary do not affect the parent.

Parameters:
parent - parent of required children
Returns:
the non-null but possibly empty list of children

getLabel

java.lang.String getLabel(C child)
Get the label (name/text/whetever) of the child.

Parameters:
child - providing the label
Returns:
the label

getParentClass

java.lang.Class<P> getParentClass()
Return the parent class

Returns:
the parent class

getSiblings

java.util.List<? super C> getSiblings(C child)
Return all siblings of and with the same class as child.

Parameters:
child -
Returns:
the siblings.

hasLabel

boolean hasLabel()
Test whether the child class has a label field.

Returns:
true if getLabel() and setLabel() are useable.

removeChild

int removeChild(C child,
                P parent)
Remove the child from the parent returning the non-negative index at which the removal was made, or -ve if not found.

Parameters:
child - child to remove
parent - expected parent of child
Returns:
removal index

setLabel

void setLabel(C child,
              java.lang.String label)
Set the label (name/text/whetever) of the child.

Parameters:
child - providing the label
label - the label