net.sourceforge.nrl.parser.model
Class ModelCollection

java.lang.Object
  extended by net.sourceforge.nrl.parser.model.ModelCollection
All Implemented Interfaces:
IModelCollection

public class ModelCollection
extends Object
implements IModelCollection


Constructor Summary
ModelCollection()
           
 
Method Summary
 void addModelPackage(IPackage modelPackage)
          Add a package to the collection
 void clear()
          Empty the collection.
 IModelElement getElementByName(String name)
          Do a deep search of model elements by name in all packages of all models.
 IModelElement getElementByQualifiedName(String qualifiedName)
          Get an element by its exact, qualified name (e.g.
 IPackage getModelPackageByName(String name)
          Return a model package by name.
 IPackage[] getModelPackages()
          Return all top-level packages in the collection.
 boolean isAmbiguous(String name)
          Returns true if a model element name is ambiguous because it occurs in multiple packages within one model, or within multiple models.
 int size()
          Returns the number of models in the collection.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModelCollection

public ModelCollection()
Method Detail

addModelPackage

public void addModelPackage(IPackage modelPackage)
Add a package to the collection

Parameters:
modelPackage - the package

clear

public void clear()
Empty the collection.


getElementByName

public IModelElement getElementByName(String name)
Description copied from interface: IModelCollection
Do a deep search of model elements by name in all packages of all models.

Specified by:
getElementByName in interface IModelCollection
Parameters:
name - the name
Returns:
the element if found or null

getElementByQualifiedName

public IModelElement getElementByQualifiedName(String qualifiedName)
Description copied from interface: IModelCollection
Get an element by its exact, qualified name (e.g. package::element).

Specified by:
getElementByQualifiedName in interface IModelCollection
Parameters:
qualifiedName - the qualified name
Returns:
the elemtn or null

getModelPackageByName

public IPackage getModelPackageByName(String name)
Description copied from interface: IModelCollection
Return a model package by name.

Specified by:
getModelPackageByName in interface IModelCollection
Parameters:
name - the name
Returns:
the package or null if not found

getModelPackages

public IPackage[] getModelPackages()
Description copied from interface: IModelCollection
Return all top-level packages in the collection. The array can be empty but is never null.

Specified by:
getModelPackages in interface IModelCollection
Returns:
the packages

isAmbiguous

public boolean isAmbiguous(String name)
Description copied from interface: IModelCollection
Returns true if a model element name is ambiguous because it occurs in multiple packages within one model, or within multiple models.

Specified by:
isAmbiguous in interface IModelCollection
Parameters:
name - the name to check
Returns:
true if ambiguous

size

public int size()
Description copied from interface: IModelCollection
Returns the number of models in the collection. This is a short-hand method.

Specified by:
size in interface IModelCollection
Returns:
the number of models


Copyright © 2006-2010 Christian Nentwich and others