org.overture.pof.PPoTreeBase 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.overture.pof;
import org.overture.ast.node.Node;
import java.util.Map;
import java.lang.Boolean;
import java.util.HashMap;
import org.overture.ast.node.INode;
import org.overture.pof.PPoTree;
import java.lang.String;
/**
* Generated file by AST Creator
* @author Kenneth Lausdahl
*
* Extensions by the COMPASS Project
* @author Rasmus Winther Lauritsen, Anders Kaels Malmos
*
*/
@SuppressWarnings({"all"})
public abstract class PPoTreeBase extends Node implements PPoTree
{
private static final long serialVersionUID = 1L;
/**
* Creates a new default constructor {@link PPoTreeBase} node with no children.
*/
public PPoTreeBase()
{
}
/**
* 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));
}
return fields;
}
public String toString()
{
return super.toString();
}
/**
* Returns a deep clone of this {@link PPoTreeBase} node.
* @return a deep clone of this {@link PPoTreeBase} node
*/
@Override
public abstract PPoTree clone();
/**
* Creates a deep clone of this {@link PPoTreeBase} 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 PPoTreeBase} node
*/
@Override
public abstract PPoTree clone(Map oldToNewMap);
/**
* Forwarding hashCode call to {@link Object#hashCode()}.
**/
@Override
public int hashCode()
{
return super.hashCode();
}
/**
* Essentially this.toString().equals(o.toString()).
**/
@Override
public boolean equals(Object o)
{
if (o != null && o instanceof PPoTreeBase) {
return toString().equals(o.toString());
}
return false;
}
/**
* Removes the {@link INode} {@code child} as a child of this {@link PPoTreeBase} 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 PPoTreeBase} node
* @throws RuntimeException if {@code child} is not a child of this {@link PPoTreeBase} node
*/
public void removeChild(INode child)
{
throw new RuntimeException("Not a child.");
}
}