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

net.automatalib.graphs.MutableGraph Maven / Gradle / Ivy

Go to download

This artifact contains the API of AutomataLib, which mainly consists of interfaces for the various concepts and automaton models supported by the AutomataLib core. In addition to that, it also defines some fundamental classes for dealing with words of symbols.

There is a newer version: 0.11.0
Show newest version
/* Copyright (C) 2013 TU Dortmund
 * This file is part of AutomataLib, http://www.automatalib.net/.
 * 
 * AutomataLib is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License version 3.0 as published by the Free Software Foundation.
 * 
 * AutomataLib 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
 * Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public
 * License along with AutomataLib; if not, see
 * http://www.gnu.de/documents/lgpl.en.html.
 */
package net.automatalib.graphs;

/**
 * A graph that allows modification. Note that this interface only exposes
 * methods for extending a graph. If also destructive modifications should be performed,
 * {@link ShrinkableGraph} is the adequate interface.
 * 
 * @author Malte Isberner 
 *
 * @param  node class
 * @param  edge class
 * @param  node property class
 * @param  edge property class
 */
public interface MutableGraph extends UniversalGraph {
	
	/**
	 * Adds a new node with default properties to the graph.
	 * This method behaves equivalently to the below {@link #addNode(Object)} with
	 * a null parameter.
	 * @return the newly inserted node
	 */
	public N addNode();
	
	/**
	 * Adds a new node to the graph.
	 * @param property the property for the new node
	 * @return the newly inserted node
	 */
	public N addNode(NP property);
	
	/**
	 * Inserts an edge in the graph, with the default property.
	 * Calling this method should be equivalent to invoking
	 * {@link #connect(Object, Object, Object)} with a null
	 * property value.
	 * @param source the source node
	 * @param target the target node
	 * @return the edge connecting the given nodes
	 */
	public E connect(N source, N target);
	
	/**
	 * Inserts an edge in the graph.
	 * @param source the source node of the edge
	 * @param target the target node of the edge
	 * @param property the property of the edge
	 * @return the newly inserted edge
	 */
	public E connect(N source, N target, EP property);
	
	public void setNodeProperty(N node, NP property);
	public void setEdgeProperty(E edge, EP property);
	
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy