org.eclipse.gmt.umlx.ecore.accessor
Class SiblingAccessor<C,P,CM>

java.lang.Object
  extended by org.eclipse.gmt.umlx.ecore.accessor.SiblingAccessor<C,P,CM>
All Implemented Interfaces:
IParentAccessor<C,P,CM>, ISiblingAccessor<C,P,CM>
Direct Known Subclasses:
EPackageSubpackagesSiblingAccessor, ResourcePackagesSiblingAccessor, UClassVariableUAttributeVariablesSiblingAccessor, UExpressionVariableExpressionSiblingAccessor, UMappingUDomainsSiblingAccessor, URelationUAttributeVariablesSiblingAccessor, UTransformationUDomainsSiblingAccessor

public abstract class SiblingAccessor<C,P,CM>
extends java.lang.Object
implements ISiblingAccessor<C,P,CM>


Method Summary
 P basicGetParent(C child)
           
 java.lang.Class<P> getBaseParentClass()
           
 java.lang.Class<C> getChildClass()
           
abstract  java.util.List<? super C> getChildren(P parent)
          Return all child class children of parent.
 CM getCoModel(C child)
           
 java.lang.Class<CM> getCoModelClass()
           
 java.lang.String getLabel(C child)
          Get the label (name/text/whetever) of the child.
abstract  P getParent(C child)
           
 java.lang.Class<P> getParentClass()
          Return the parent class
<P1 extends P>
ISiblingAccessor<? super C,? super P1,?>
getSiblingAccessor(java.lang.Class<P1> parentClass)
           
abstract  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 setCoModel(C child, CM coModel)
           
 void setLabel(C child, java.lang.String label)
          Set the label (name/text/whetever) of the child.
 void setParent(C child, java.lang.Object parent)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.gmt.umlx.ecore.accessor.IParentAccessor
eResource
 

Method Detail

basicGetParent

public P basicGetParent(C child)
Specified by:
basicGetParent in interface IParentAccessor<C,P,CM>

getBaseParentClass

public java.lang.Class<P> getBaseParentClass()
Specified by:
getBaseParentClass in interface IParentAccessor<C,P,CM>

getChildClass

public java.lang.Class<C> getChildClass()
Specified by:
getChildClass in interface IParentAccessor<C,P,CM>

getChildren

public abstract java.util.List<? super C> getChildren(P parent)
Description copied from interface: ISiblingAccessor
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.

Specified by:
getChildren in interface ISiblingAccessor<C,P,CM>
Parameters:
parent - parent of required children
Returns:
the non-null but possibly empty list of children

getCoModel

public CM getCoModel(C child)
Specified by:
getCoModel in interface IParentAccessor<C,P,CM>

getCoModelClass

public java.lang.Class<CM> getCoModelClass()
Specified by:
getCoModelClass in interface IParentAccessor<C,P,CM>

getLabel

public java.lang.String getLabel(C child)
Description copied from interface: ISiblingAccessor
Get the label (name/text/whetever) of the child.

Specified by:
getLabel in interface ISiblingAccessor<C,P,CM>
Parameters:
child - providing the label
Returns:
the label

getParent

public abstract P getParent(C child)
Specified by:
getParent in interface IParentAccessor<C,P,CM>

getParentClass

public java.lang.Class<P> getParentClass()
Description copied from interface: ISiblingAccessor
Return the parent class

Specified by:
getParentClass in interface ISiblingAccessor<C,P,CM>
Returns:
the parent class

getSiblings

public abstract java.util.List<? super C> getSiblings(C child)
Description copied from interface: ISiblingAccessor
Return all siblings of and with the same class as child.

Specified by:
getSiblings in interface ISiblingAccessor<C,P,CM>
Returns:
the siblings.

getSiblingAccessor

public <P1 extends P> ISiblingAccessor<? super C,? super P1,?> getSiblingAccessor(java.lang.Class<P1> parentClass)
Specified by:
getSiblingAccessor in interface IParentAccessor<C,P,CM>

hasLabel

public boolean hasLabel()
Description copied from interface: ISiblingAccessor
Test whether the child class has a label field.

Specified by:
hasLabel in interface ISiblingAccessor<C,P,CM>
Returns:
true if getLabel() and setLabel() are useable.

removeChild

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

Specified by:
removeChild in interface ISiblingAccessor<C,P,CM>
Parameters:
child - child to remove
parent - expected parent of child
Returns:
removal index

setCoModel

public void setCoModel(C child,
                       CM coModel)
Specified by:
setCoModel in interface IParentAccessor<C,P,CM>

setLabel

public void setLabel(C child,
                     java.lang.String label)
Description copied from interface: ISiblingAccessor
Set the label (name/text/whetever) of the child.

Specified by:
setLabel in interface ISiblingAccessor<C,P,CM>
Parameters:
child - providing the label
label - the label

setParent

public void setParent(C child,
                      java.lang.Object parent)
Specified by:
setParent in interface IParentAccessor<C,P,CM>