blob: c970b5a428cbca8ba0f15f0c5c9bde951752b91f [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2004-2010 Abel Hegedus and Daniel Varro
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Abel Hegedus - initial API and implementation
*******************************************************************************/
package org.eclipse.viatra2.core.tracebased.tracetree;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.eclipse.viatra2.core.tracebased.TraceException;
import org.eclipse.viatra2.framework.IFramework;
/**
* Interface for the node of the trace tree
*
*
* @author Abel Hegedus
*
*/
public interface ITraceTreeNode {
/**
* Get children tree nodes of the current node
*
* @return the map of children node IDs and references
*/
public Map<String, ITraceTreeNode> getChildren();
/**
* Get ordered list of children tree nodes of the current node
*
* @return the ordered list of children nodes
*/
public List<ITraceTreeNode> getOrderedChildrenList();
/**
* Get ID set of children nodes
*
* @return the set of ids for children nodes
*/
public Set<String> getChildrenIDs();
/**
* Adds a new child to the ordered list of children and puts it into the map
*
* @param child the trace tree node to be added as a child
*/
public void addChild(ITraceTreeNode child);
/**
* Get the parent node for the given node (or null if it is the root)
*
* @return the parent node
*/
public ITraceTreeNode getParent();
/**
* Get a child corresponding to a specific id
*
* @param childID the id of the child
* @return
*/
public ITraceTreeNode getChild(String childID);
/**
* Get id of the current node
*
* @return the id of the node
*/
public String getID();
/**
* Execute the model manipulations stored in the node
*
* @param framework the VIATRA framework with the model
* @throws TraceException if the model state is not in synch with the node
*/
public void doExecute(IFramework framework) throws TraceException;
/**
* Undo the model manipulations stored in the node
*
* @param framework the VIATRA framework with the model
* @throws TraceException if the model state is not in synch with the node
*/
public void undo(IFramework framework) throws TraceException;
}