vocleditor.model
Class VOCLTools

java.lang.Object
  extended by vocleditor.model.VOCLTools

public class VOCLTools
extends java.lang.Object

Containts static functions to help getting modelelements ... blah

Author:
bjoern TODO

Constructor Summary
VOCLTools()
           
 
Method Summary
static void collectVariables(VOCLModel.NavExp navexp, java.util.List l)
          Collects all variables used by ClassifierRoles, Attributes, Methods of a navexp andits sub expressions
static java.util.List deleteUnusedVariables(VOCLModel.Constraint constraint)
          removes all unused variable declarations from constraint.allVariables and returns a list of removed variables
static java.util.List getAllClassifiers(VOCLModel.NavExp navexp, java.util.List list)
          lists all ClassifierRoles within a NavExp and sub expressions
static java.util.List getAllMethods(java.util.List classifiers, java.util.List list)
          lists all Methods from a list of ClassifierRoles
static int getExpressionDepth(VOCLModel.VOCLExpression exp)
          helper method to find the depth of a Expression
static VOCLModel.VariableDeclaration getVariable(VOCLModel.Constraint constraint, java.lang.String name, java.lang.String type)
          Finds or creates a VariableDeclaration inside of a constraint
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VOCLTools

public VOCLTools()
Method Detail

getAllClassifiers

public static java.util.List getAllClassifiers(VOCLModel.NavExp navexp,
                                               java.util.List list)
lists all ClassifierRoles within a NavExp and sub expressions

Parameters:
navexp - the navexp to start collecting ClassifierRoles
list - the list to add the ClassifierRoles to
Returns:
the given list

getAllMethods

public static java.util.List getAllMethods(java.util.List classifiers,
                                           java.util.List list)
lists all Methods from a list of ClassifierRoles

Parameters:
classifiers - list of classifiers to search for methods
list - the list to add the Methods to
Returns:
the given list

collectVariables

public static void collectVariables(VOCLModel.NavExp navexp,
                                    java.util.List l)
Collects all variables used by ClassifierRoles, Attributes, Methods of a navexp andits sub expressions

Parameters:
l - List to add Variables to
navexp - navexp to start looking from

deleteUnusedVariables

public static java.util.List deleteUnusedVariables(VOCLModel.Constraint constraint)
removes all unused variable declarations from constraint.allVariables and returns a list of removed variables

Parameters:
constraint - the Constraint to remove unused variables from
Returns:
a List of variables removed from the constraint

getVariable

public static VOCLModel.VariableDeclaration getVariable(VOCLModel.Constraint constraint,
                                                        java.lang.String name,
                                                        java.lang.String type)
Finds or creates a VariableDeclaration inside of a constraint

Parameters:
constraint - the constraint to hold the VariableDeclaration
name - the name of the VariableDeclaration
type - the type of the VariableDeclaration
Returns:
an already existing or newly created VariableDeclaration with the given name and type

getExpressionDepth

public static int getExpressionDepth(VOCLModel.VOCLExpression exp)
helper method to find the depth of a Expression

Parameters:
exp - VOCLExpression
Returns:
the depth