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

java.lang.Object
  extended by org.eclipse.gmt.umlx.ecore.accessor.ParentAccessor<C,P,CM>
      extended by org.eclipse.gmt.umlx.ecore.accessor.SingleParentAccessor<C,P,CM>
All Implemented Interfaces:
IParentAccessor<C,P,CM>, ISiblingAccessor<C,P,CM>
Direct Known Subclasses:
ResourceSetResourcesSiblingAccessor, SimpleEObjectAccessor

public abstract class SingleParentAccessor<C,P,CM>
extends ParentAccessor<C,P,CM>
implements ISiblingAccessor<C,P,CM>


Method Summary
 P basicGetParent(C child)
           
 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)
           
 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.
 void setParent(C child, java.lang.Object newParent)
           
 
Methods inherited from class org.eclipse.gmt.umlx.ecore.accessor.ParentAccessor
getBaseParentClass, getChildClass, getCoModel, getCoModelClass, getParentAccessor, getParentAccessor, setCoModel
 
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.ISiblingAccessor
getChildren
 
Methods inherited from interface org.eclipse.gmt.umlx.ecore.accessor.IParentAccessor
eResource, getBaseParentClass, getChildClass, getCoModel, getCoModelClass, setCoModel
 

Method Detail

basicGetParent

public final P basicGetParent(C child)
Specified by:
basicGetParent 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 final 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

getSiblingAccessor

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

getSiblings

public final 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.

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

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 newParent)
Specified by:
setParent in interface IParentAccessor<C,P,CM>