|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbe.ac.vub.cocompose.lang.impl.DefaultElement
be.ac.vub.cocompose.lang.impl.core.DefaultModelElement
be.ac.vub.cocompose.lang.impl.core.DefaultNamespace
Default container and namespace mechanism for all CoCompose language elements.
Constructor Summary | |
DefaultNamespace()
|
Method Summary | |
void |
accept(ModelVisitor modelVisitor)
Accepts a visitor. |
void |
addOwnedElement(int index,
ModelElement modelElement)
Adds an element to this namespace. |
void |
addOwnedElement(ModelElement modelElement)
Adds an element to this namespace. |
ModelElement |
getDeepOwnedElement(ModelElement copy)
Retrieves an owned element in this namespace or a nested namespace. |
List |
getDeepOwnedElements(Class elementClass)
Returns the elements of a given class within this namespace and nested namespaces. |
ModelElement |
getOwnedElement(String name)
Retrieves an owned element by its name. |
String |
getOwnedElementId(ModelElement modelElement)
Returns a new Id for the given ModelElement. |
List |
getOwnedElements()
Returns the elements within this namespace. |
List |
getOwnedElements(Class elementClass)
Returns the elements of a given class within this namespace. |
Set |
getOwnedIds()
Returns the global ids for the root namespace. |
boolean |
isRegistered(String name)
Checks whether a name is already registered within this namespace. |
void |
registerNameChange(String oldName,
String newName)
Registers an element name within this namespace. |
void |
removeOwnedElement(ModelElement modelElement)
Removes a element from this namespace. |
protected int |
translateIndex(int index,
List otherList)
Translates the given ownedElements index to an otherList index. |
protected int |
translateIndex(int index,
List sourceList,
List otherList)
Translates the given ownedElements index to an otherList index. |
Methods inherited from class be.ac.vub.cocompose.lang.impl.core.DefaultModelElement |
getId, getModel, getName, getNamespace, getRootNamespace, setId, setName, setNamespace, toString |
Methods inherited from class be.ac.vub.cocompose.lang.impl.DefaultElement |
addPropertyChangeListener, firePropertyChange, fireStructureChange, removePropertyChangeListener |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface be.ac.vub.cocompose.lang.core.ModelElement |
getId, getModel, getName, getNamespace, getRootNamespace, setId, setName, setNamespace |
Methods inherited from interface be.ac.vub.cocompose.lang.Element |
addPropertyChangeListener, removePropertyChangeListener |
Constructor Detail |
public DefaultNamespace()
Method Detail |
public void accept(ModelVisitor modelVisitor) throws ModelElementException
accept
in interface VisitedElement
accept
in class DefaultModelElement
modelVisitor
- The visitor to accept.
ModelElementException
public void addOwnedElement(ModelElement modelElement) throws ModelElementException
addOwnedElement
in interface Namespace
modelElement
- - the element to add.
ModelElementException
- - if the name of the element is already used within this namespace.public void addOwnedElement(int index, ModelElement modelElement) throws ModelElementException
addOwnedElement
in interface Namespace
index
- - the index at which to add the element.modelElement
- - the element to add.
ModelElementException
- - if the name of the element is already used within this namespace.public void removeOwnedElement(ModelElement modelElement)
removeOwnedElement
in interface Namespace
modelElement
- - the element to remove.public List getOwnedElements()
getOwnedElements
in interface Namespace
public List getOwnedElements(Class elementClass)
getOwnedElements
in interface Namespace
elementClass
- the element class.
public List getDeepOwnedElements(Class elementClass)
getDeepOwnedElements
in interface Namespace
elementClass
- the element class.
public ModelElement getOwnedElement(String name)
getOwnedElement
in interface Namespace
name
- - the name of the element to retrieve.
public ModelElement getDeepOwnedElement(ModelElement copy)
getDeepOwnedElement
in interface Namespace
copy
- - the (remote) copy of the element to retrieve.
public boolean isRegistered(String name)
isRegistered
in interface Namespace
name
- - the name to check.
public void registerNameChange(String oldName, String newName) throws ModelElementException
registerNameChange
in interface Namespace
oldName
- - the name to change.newName
- - the name to change into.
ModelElementException
- - if the new name is already used or if the old name does not exist in this namespace.public String getOwnedElementId(ModelElement modelElement)
getOwnedElementId
in interface Namespace
modelElement
- - the element to get the Id for.
public Set getOwnedIds()
getOwnedIds
in interface Namespace
protected int translateIndex(int index, List otherList)
index
- - the index to translate.otherList
- - the other list to which the index should be translated.
protected int translateIndex(int index, List sourceList, List otherList)
index
- - the index to translate.sourceList
- - the list to which the index refers.otherList
- - the other list to which the index should be translated.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |