ujf.verimag.bip.metamodelAPI
Class BipUtil

java.lang.Object
  extended by ujf.verimag.bip.metamodelAPI.BipUtil

public class BipUtil
extends java.lang.Object


Constructor Summary
BipUtil()
           
 
Method Summary
static void addDeclarationToAtom(AtomType atom, Declaration declaration)
          Add an declaration to an existing Atom
static void addDeclarationToModule(Module module, Declaration declaration)
          Add a declaration to an existing Module
static AtomType getAtomTypeDefinition(java.lang.String definitionName, Module module)
          Search for a given atom definition within a module.
static Component getComponentInstance(CompoundType scope, java.lang.String instName)
          Get component instance from a compound type
static CompoundType getCompoundTypeDefinition(java.lang.String definitionName, Module module)
          Search for a given atom definition within a module.
static Connector getConnectorInstance(CompoundType scope, java.lang.String instName)
          Get connector instance from a compound type
static ConnectorType getConnectorType(Module module, java.lang.String connectorTypeName)
          Search for a given Connector type within a module
static DataType getDataType(java.lang.String name, Module module)
          Look for a datatype in a module.
static Port getPort(ComponentType componentType, java.lang.String portName)
          Search for a given port within a component type.
static PortDefinition getPortDefinition(AtomType atom, java.lang.String portName)
          Search for a given port definition within an atom.
static PortType getPortType(Module module, java.lang.String portTypeName)
          Search for a given Port type within a module
static State getState(PetriNet behavior, java.lang.String stateName)
          Returns a State which exists inside a petrinet
static java.util.List<Transition> getTransitionFrom(PetriNet behavior, State from)
          Returns a list of transitions starting from a specific state
static java.util.List<Transition> getTransitionTo(PetriNet behavior, State to)
          Returns a list of transitions ending in a specific state
static Variable getVariable(AtomType atom, java.lang.String varname)
          Search for a given variable within an atom
static Variable[] getVariablesStartWith(AtomType atom, java.lang.String prefix)
          Search for variables with names starting with a given prefix within an atom
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BipUtil

public BipUtil()
Method Detail

getTransitionFrom

public static java.util.List<Transition> getTransitionFrom(PetriNet behavior,
                                                           State from)
Returns a list of transitions starting from a specific state

Parameters:
behavior - the behavior
from - the starting state
Returns:
the list of transitions

getTransitionTo

public static java.util.List<Transition> getTransitionTo(PetriNet behavior,
                                                         State to)
Returns a list of transitions ending in a specific state

Parameters:
behavior - the behavior
from - the ending state
Returns:
the list of transitions

getState

public static State getState(PetriNet behavior,
                             java.lang.String stateName)
Returns a State which exists inside a petrinet

Parameters:
behavior - the Petrinet
stateName - the name of the State
Returns:
the State if found, null otherwise

getPortDefinition

public static PortDefinition getPortDefinition(AtomType atom,
                                               java.lang.String portName)
Search for a given port definition within an atom.

Parameters:
atom - the atom
portName - the port's name
Returns:
the PortDefinition object if found, null if not.

getPort

public static Port getPort(ComponentType componentType,
                           java.lang.String portName)
Search for a given port within a component type.

Parameters:
componentType - the component type
portName - the port's name
Returns:
the Port object if found, null if not.

getAtomTypeDefinition

public static AtomType getAtomTypeDefinition(java.lang.String definitionName,
                                             Module module)
Search for a given atom definition within a module.

Parameters:
definitionName - the name of the atom definition
module - the bip module
Returns:
the AtomType definition if found, null if not

getCompoundTypeDefinition

public static CompoundType getCompoundTypeDefinition(java.lang.String definitionName,
                                                     Module module)
Search for a given atom definition within a module.

Parameters:
definitionName - the name of the atom definition
module - the bip module
Returns:
the AtomType definition if found, null if not

getPortType

public static PortType getPortType(Module module,
                                   java.lang.String portTypeName)
Search for a given Port type within a module

Parameters:
module - module
portTypeName - the port type name
Returns:
the PortType object if found, null if not.

getConnectorType

public static ConnectorType getConnectorType(Module module,
                                             java.lang.String connectorTypeName)
Search for a given Connector type within a module

Parameters:
module - module
connectorTypeName - the connector type name
Returns:
the ConnectorType object if found, null if not.

getVariable

public static Variable getVariable(AtomType atom,
                                   java.lang.String varname)
Search for a given variable within an atom

Parameters:
atom - the atom
varname - the variable name
Returns:
the Variable object if found, null if not.

getVariablesStartWith

public static Variable[] getVariablesStartWith(AtomType atom,
                                               java.lang.String prefix)
Search for variables with names starting with a given prefix within an atom

Parameters:
atom - the atom
prefix - the prefix
Returns:
an array of Variable object

getDataType

public static DataType getDataType(java.lang.String name,
                                   Module module)
Look for a datatype in a module. Makes the assumption that data type are always opaque element.

Parameters:
name - the name of the type
module - the module in which the type is looked for
Returns:
the DataType object found, null if not found.

addDeclarationToModule

public static void addDeclarationToModule(Module module,
                                          Declaration declaration)
Add a declaration to an existing Module

Parameters:
module - the module
declaration - the declaration

addDeclarationToAtom

public static void addDeclarationToAtom(AtomType atom,
                                        Declaration declaration)
Add an declaration to an existing Atom

Parameters:
atom - the atom
declaration - the declaration

getComponentInstance

public static Component getComponentInstance(CompoundType scope,
                                             java.lang.String instName)
Get component instance from a compound type

Parameters:
scope - the compound type
instName - the name of the instance
Returns:
the instance if found, null otherwise

getConnectorInstance

public static Connector getConnectorInstance(CompoundType scope,
                                             java.lang.String instName)
Get connector instance from a compound type

Parameters:
scope - the compound type
instName - the name of the instance
Returns:
the instance if found, null otherwise