All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jadex.rules.parser.conditions.javagrammar.MethodAccess Maven / Gradle / Ivy

package jadex.rules.parser.conditions.javagrammar;

import jadex.commons.SUtil;
import jadex.rules.rulesystem.rules.Variable;


/**
 *  Invoke a method on an object.
 */
public class MethodAccess	extends	Suffix
{
	//-------- attributes --------
	
	/** The name of the method. */
	protected String	name;
	
	/** The parameter value expressions. */
	protected Expression[]	parametervalues;
	
	//-------- constructors --------
	
	/**
	 *  Create a new method access.
	 *  @param name	The method name.
	 *  @param parametervalues	Expressions for the parameter values (if any).
	 */
	public MethodAccess(String name, Expression[] parametervalues)
	{
		this.name	= name;
		this.parametervalues	= parametervalues;
	}
	
	//-------- methods --------
	
	/**
	 *  Test if a variable is contained in the suffix.
	 *  @param var	The variable.
	 *  @return	True, when the variable is contained.
	 */
	public boolean	containsVariable(Variable var)
	{
		boolean	ret	= false;
		for(int i=0; !ret && parametervalues!=null && i




© 2015 - 2025 Weber Informatics LLC | Privacy Policy