unbbayes.prs
Class Network

java.lang.Object
  extended by unbbayes.prs.Network
All Implemented Interfaces:
Graph
Direct Known Subclasses:
SingleEntityNetwork

public class Network
extends Object
implements Graph


Field Summary
protected  List<Edge> edgeList
          List of edges that this network has.
protected  String id
           
protected  String name
           
protected  Map<String,Integer> nodeIndexes
           
protected  ArrayList<Node> nodeList
          List of nodes that this network has.
protected  Node.NodeNameChangedListener nodeNameChangedListener
           
 
Constructor Summary
Network(String name)
           
 
Method Summary
 void addEdge(Edge edge)
          Adds an edge into the net.
 void addNode(Node node)
          Add the node.
protected  void clearEdges()
          Clean the edge list
protected  void clearNodes()
          Clean the node list
 Edge getEdge(Node no1, Node no2)
          Retorna o arco entre dois n√≥s caso ele exista
 List<Edge> getEdges()
          Retorna os edgeList do grafo.
 String getId()
          Returns the id.
 String getName()
          Retorna o nome da rede.
 Node getNode(String name)
          Returns the node that has the given name.
 Node getNodeAt(int index)
          Retorna o nÔøΩ do grafo com o respectivo ÔøΩndice.
 int getNodeCount()
          Returna o nÔøΩmero de variÔøΩveis da rede.
 int getNodeIndex(String name)
          Return the index for the node with the given name.
 Map<String,Integer> getNodeIndexes()
           
 ArrayList<Node> getNodes()
          Retorna os nÔøΩs do grafo.
 int hasEdge(Node no1, Node no2)
          Verifica existÔøΩncia de determinado arco.
protected  int hasEdge(Node no1, Node no2, List<Edge> vetArcos)
           
 void removeEdge(Edge edge)
          Remove the edge.
 void removeNode(Node element)
          Remove node.
 void setName(String name)
          Seta o nome da rede.
 void setNodeIndexes(Map<String,Integer> nodeIndexes)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

id

protected String id

name

protected String name

nodeList

protected ArrayList<Node> nodeList
List of nodes that this network has.


edgeList

protected List<Edge> edgeList
List of edges that this network has.


nodeIndexes

protected Map<String,Integer> nodeIndexes

nodeNameChangedListener

protected Node.NodeNameChangedListener nodeNameChangedListener
Constructor Detail

Network

public Network(String name)
Method Detail

getEdges

public List<Edge> getEdges()
Retorna os edgeList do grafo.

Specified by:
getEdges in interface Graph
Returns:
edgeList do grafo.

getNodes

public ArrayList<Node> getNodes()
Retorna os nÔøΩs do grafo.

Specified by:
getNodes in interface Graph
Returns:
nÔøΩs do grafo.

getNodeCount

public int getNodeCount()
Returna o nÔøΩmero de variÔøΩveis da rede.

Specified by:
getNodeCount in interface Graph
Returns:
nÔøΩmero de variÔøΩveis da rede.

getNodeAt

public Node getNodeAt(int index)
Retorna o nÔøΩ do grafo com o respectivo ÔøΩndice.

Parameters:
index - ÔøΩndice do nÔøΩ.
Returns:
nÔøΩ com respectivo ÔøΩndice no List.

getNode

public Node getNode(String name)
Returns the node that has the given name.

Parameters:
name - node name.
Returns:
the node that has the given name.

getNodeIndex

public int getNodeIndex(String name)
Return the index for the node with the given name.

Returns:
the index for the node with the given name.

removeEdge

public void removeEdge(Edge edge)
Remove the edge.

Specified by:
removeEdge in interface Graph
Parameters:
edge - the edge to be removed.

addNode

public void addNode(Node node)
Add the node.

Specified by:
addNode in interface Graph
Parameters:
node - node to be added.

addEdge

public void addEdge(Edge edge)
             throws InvalidParentException
Adds an edge into the net. - The table of the destination node will be updated with the new Variable

Specified by:
addEdge in interface Graph
Parameters:
edge - An edge to be inserted.
Throws:
InvalidParentException

removeNode

public void removeNode(Node element)
Remove node.

Specified by:
removeNode in interface Graph
Parameters:
element - node to be removed.

clearNodes

protected void clearNodes()
Clean the node list


clearEdges

protected void clearEdges()
Clean the edge list


hasEdge

public int hasEdge(Node no1,
                   Node no2)
Verifica existÔøΩncia de determinado arco.

Specified by:
hasEdge in interface Graph
Parameters:
no1 - nÔøΩ origem.
no2 - nÔøΩ destino.
Returns:
posiÔøΩÔøΩo do arco no vetor ou -1 caso nÔøΩo exista tal arco.

hasEdge

protected int hasEdge(Node no1,
                      Node no2,
                      List<Edge> vetArcos)

getEdge

public Edge getEdge(Node no1,
                    Node no2)
Retorna o arco entre dois nós caso ele exista

Parameters:
no1 - Nó origem
no2 - Nó destino
Returns:
o arco entre no1 e no 2 caso ele exista ou null cc.

setName

public void setName(String name)
Seta o nome da rede.

Parameters:
name - nome da rede.

getName

public String getName()
Retorna o nome da rede.

Returns:
nome da rede.

getId

public String getId()
Returns the id.

Returns:
String

toString

public String toString()
Overrides:
toString in class Object
See Also:
Object.toString()

getNodeIndexes

public Map<String,Integer> getNodeIndexes()
Returns:
the nodeIndexes

setNodeIndexes

public void setNodeIndexes(Map<String,Integer> nodeIndexes)
Parameters:
nodeIndexes - the nodeIndexes to set


Copyright © 2001-2010 University of Brasilia - UnB. All Rights Reserved.