1 /* 2 * UnBBayes 3 * Copyright (C) 2002, 2008 Universidade de Brasilia - http://www.unb.br 4 * 5 * This file is part of UnBBayes. 6 * 7 * UnBBayes is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * UnBBayes is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with UnBBayes. If not, see <http://www.gnu.org/licenses/>. 19 * 20 */ 21 package unbbayes.prs; 22 23 import java.util.ArrayList; 24 import java.util.List; 25 26 /** 27 * Interface for a graph building of Node's and Edge's 28 */ 29 30 public interface Graph { 31 32 /** 33 * Retorna os edgeList do grafo. 34 * 35 *@return edgeList do grafo. 36 */ 37 public List<Edge> getEdges(); 38 39 /** 40 * Retorna os n�s do grafo. 41 * 42 *@return n�s do grafo. 43 * 44 * @todo Eliminar esse metodo! eh utilizado na classe NetWindow 45 */ 46 public ArrayList<Node> getNodes(); 47 48 /** 49 * Returna o n�mero de vari�veis da rede. 50 * 51 *@return n�mero de vari�veis da rede. 52 */ 53 public int getNodeCount(); 54 55 56 /** 57 * Retira do grafo o arco especificado. 58 * 59 *@param arco arco a ser retirado. 60 */ 61 public void removeEdge(Edge arco) ; 62 63 /** 64 * Adiciona novo n� ao grafo. 65 * 66 *@param no n� a ser inserido. 67 */ 68 public void addNode(Node no); 69 70 /** 71 * Adiciona o arco � rede. 72 * 73 *@param arco arco a ser inserido. 74 */ 75 public void addEdge(Edge arco) throws Exception; 76 77 /** 78 * Remove n� do grafo. 79 * 80 *@param elemento no a ser removido. 81 */ 82 public void removeNode(Node elemento); 83 84 /** 85 * Verifica exist�ncia de determinado arco. 86 * 87 *@param no1 n� origem. 88 *@param no2 n� destino. 89 *@return posi��o do arco no vetor ou -1 caso n�o exista tal arco. 90 */ 91 public int hasEdge(Node no1, Node no2); 92 93 }