net.sourceforge.nrl.parser.model
Interface IPackage

All Superinterfaces:
IModelElement
All Known Implementing Classes:
AbstractPackage, UML2Package, XSDPackage

public interface IPackage
extends IModelElement

A package contains model elements and other packages.


Nested Class Summary
 
Nested classes/interfaces inherited from interface net.sourceforge.nrl.parser.model.IModelElement
IModelElement.ElementType
 
Method Summary
 List<IModelElement> getContents(boolean deep)
          Return the contents of this package, a collection of IModelElement objects.
 IModelElement getElementByName(String name, boolean deep)
          Scan a package and return the model element with a given name.
 int getSize()
          Return the number of elements and packages in the package
 boolean isAmbiguous(String name)
          Returns true if a model element name occurs in multiple sub-packages, and hence a global reference to the name would be ambiguous.
 
Methods inherited from interface net.sourceforge.nrl.parser.model.IModelElement
getContainingPackage, getDescendants, getDocumentation, getElementType, getName, getOriginalName, getParent, getQualifiedName, getUserData, isAssignableFrom, isSupplementary, setUserData
 

Method Detail

getContents

List<IModelElement> getContents(boolean deep)
Return the contents of this package, a collection of IModelElement objects. Can optionally return all contents recursively, including the contents of subpackages.

Parameters:
deep - if true, return the contents of subpackages
Returns:
the contents, a list of IModelElement objects

getElementByName

IModelElement getElementByName(String name,
                               boolean deep)
Scan a package and return the model element with a given name. Optionally, also scans all subpackages.

Note: This returns the first element matching the name if a deep search is used. Use isAmbiguous(String) to determine if multiple elements with the name exist - and if so, look them up in the right package instead.

Parameters:
name - the name to look for
deep - scan subpackages if true
Returns:
the element or null if not found

getSize

int getSize()
Return the number of elements and packages in the package

Returns:
the number of elements and packages

isAmbiguous

boolean isAmbiguous(String name)
Returns true if a model element name occurs in multiple sub-packages, and hence a global reference to the name would be ambiguous.

Parameters:
name - the element name
Returns:
true if multiple elements with this name exist in the package or subpackages


Copyright © 2006-2010 Christian Nentwich and others