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

org.intocps.maestro.ast.node.AFmuMappingStm Maven / Gradle / Ivy

/*******************************************************************************
* Copyright (c) 2009, 2011 Overture Team and others.
*
* Overture is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Overture is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Overture.  If not, see .
*
* The Overture Tool web-site: http://overturetool.org/
*******************************************************************************/

/* This file was generated by ASTcreator (http://www.lausdahl.com/). */

package org.intocps.maestro.ast.node;


import org.intocps.maestro.ast.LexIdentifier;
import org.intocps.maestro.ast.analysis.intf.IAnalysis;
import org.intocps.maestro.ast.analysis.AnalysisException;
import java.util.HashMap;
import org.intocps.maestro.ast.analysis.intf.IAnswer;
import org.intocps.maestro.ast.node.PStmBase;
import org.intocps.maestro.ast.analysis.intf.IQuestionAnswer;
import java.util.Map;
import org.intocps.maestro.ast.node.AFmuMappingStm;
import java.lang.Boolean;
import org.intocps.maestro.ast.analysis.intf.IQuestion;
import java.lang.String;
import org.intocps.maestro.ast.node.INode;


/**
* Generated file by AST Creator
* @author Kenneth Lausdahl
*
*/
@SuppressWarnings({"all"})
public class AFmuMappingStm extends PStmBase
{
	private static final long serialVersionUID = 1L;

	private LexIdentifier _identifier;
	private String _name;

	/**
	* Creates a new complete constructor {@code AFmuMappingStm} node with the given nodes as children.
	* @deprecated This method should not be used, use AstFactory instead.
	* The basic child nodes are removed from their previous parents.
	* @param identifier_ the {@link LexIdentifier} node for the {@code identifier} child of this {@link AFmuMappingStm} node
	* @param name_ the {@link String} node for the {@code name} child of this {@link AFmuMappingStm} node
	*/
	public AFmuMappingStm(LexIdentifier identifier_, String name_)
	{
		super();
		this.setIdentifier(identifier_);
		this.setName(name_);

	}



	/**
	 * Creates a new default constructor {@link AFmuMappingStm} node with no children.
	 */
	public AFmuMappingStm()
	{

	}


	/**
	 * Returns a deep clone of this {@link AFmuMappingStm} node.
	 * @return a deep clone of this {@link AFmuMappingStm} node
	 */
	public AFmuMappingStm clone()
	{
		return new AFmuMappingStm(
			_identifier,
			_name
		);
	}



	public String toString()
	{
		return "" + "@mapFmu("+_identifier+" -> \""+_name+"\")";
	}


	/**
	* Essentially this.toString().equals(o.toString()).
	**/
	@Override
	public boolean equals(Object o)
	{
		if (o != null && o instanceof AFmuMappingStm)		{
			 return toString().equals(o.toString());
		}
		return false;
	}


	/**
	 * Removes the {@link INode} {@code child} as a child of this {@link AFmuMappingStm} node.
	 * Do not call this method with any graph fields of this node. This will cause any child's
	 * with the same reference to be removed unintentionally or {@link RuntimeException}will be thrown.
	 * @param child the child node to be removed from this {@link AFmuMappingStm} node
	 * @throws RuntimeException if {@code child} is not a child of this {@link AFmuMappingStm} node
	 */
	public void removeChild(INode child)
	{
		throw new RuntimeException("Not a child.");
	}


	/**
	 * Creates a map of all field names and their value
	 * @param includeInheritedFields if true all inherited fields are included
	 * @return a a map of names to values of all fields
	 */
	@Override
	public Map getChildren(Boolean includeInheritedFields)
	{
		Map fields = new HashMap();
		if(includeInheritedFields)
		{
			fields.putAll(super.getChildren(includeInheritedFields));
		}
		fields.put("_identifier",this._identifier);
		fields.put("_name",this._name);
		return fields;
	}


	/**
	 * Creates a deep clone of this {@link AFmuMappingStm} node while putting all
	 * old node-new node relations in the map {@code oldToNewMap}.
	 * @param oldToNewMap the map filled with the old node-new node relation
	 * @return a deep clone of this {@link AFmuMappingStm} node
	 */
	public AFmuMappingStm clone(Map oldToNewMap)
	{
		AFmuMappingStm node = new AFmuMappingStm(
			_identifier,
			_name
		);
		oldToNewMap.put(this, node);
		return node;
	}


	/**
	* Forwarding hashCode call to {@link Object#hashCode()}.
	**/
	@Override
	public int hashCode()
	{
		return super.hashCode();
	}


	/**
	 * Sets the {@code _identifier} child of this {@link AFmuMappingStm} node.
	 * @param value the new {@code _identifier} child of this {@link AFmuMappingStm} node
	*/
	public void setIdentifier(LexIdentifier value)
	{
		this._identifier = value;
	}


	/**
	 * @return the {@link LexIdentifier} node which is the {@code _identifier} child of this {@link AFmuMappingStm} node
	*/
	public LexIdentifier getIdentifier()
	{
		return this._identifier;
	}


	/**
	 * Sets the {@code _name} child of this {@link AFmuMappingStm} node.
	 * @param value the new {@code _name} child of this {@link AFmuMappingStm} node
	*/
	public void setName(String value)
	{
		this._name = value;
	}


	/**
	 * @return the {@link String} node which is the {@code _name} child of this {@link AFmuMappingStm} node
	*/
	public String getName()
	{
		return this._name;
	}


	/**
	* Calls the {@link IAnalysis#caseAFmuMappingStm(AFmuMappingStm)} of the {@link IAnalysis} {@code caller}.
	* @param caller the {@link IAnalysis} to which this {@link AFmuMappingStm} node is applied
	*/
	@Override
	public void apply(IAnalysis caller) throws AnalysisException
	{
		caller.caseAFmuMappingStm(this);
	}


	/**
	* Calls the {@link IAnswer#caseAFmuMappingStm(AFmuMappingStm)} of the {@link IAnswer} {@code caller}.
	* @param caller the {@link IAnswer} to which this {@link AFmuMappingStm} node is applied
	*/
	@Override
	public  A apply(IAnswer caller) throws AnalysisException
	{
		return caller.caseAFmuMappingStm(this);
	}


	/**
	* Calls the {@link IQuestion#caseAFmuMappingStm(AFmuMappingStm, Object)} of the {@link IQuestion} {@code caller}.
	* @param caller the {@link IQuestion} to which this {@link AFmuMappingStm} node is applied
	* @param question the question provided to {@code caller}
	*/
	@Override
	public  void apply(IQuestion caller, Q question) throws AnalysisException
	{
		caller.caseAFmuMappingStm(this,question);
	}


	/**
	* Calls the {@link IQuestionAnswer#caseAFmuMappingStm(AFmuMappingStm, Object)} of the {@link IQuestionAnswer} {@code caller}.
	* @param caller the {@link IQuestionAnswer} to which this {@link AFmuMappingStm} node is applied
	* @param question the question provided to {@code caller}
	*/
	@Override
	public  A apply(IQuestionAnswer caller, Q question) throws AnalysisException
	{
		return caller.caseAFmuMappingStm(this,question);
	}



}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy