unbbayes.prs
Interface INode

All Known Subinterfaces:
IPluginNode
All Known Implementing Classes:
ContinuousNode, DecisionNode, LearningNode, Node, ProbabilisticNode, TreeVariable, UtilityNode

public interface INode

Interface representing a generic node, containing only references and state information (it does not contain visual/graphical data)

Version:
04/18/2009
Author:
Shou Matsumoto Refactor: interface extraction Node -> INode

Method Summary
 void addChildNode(INode child)
          Adds a child to this node
 void addParentNode(INode parent)
          Add a parent to this node
 void appendState(String state)
          Inserts a state with the specified name at the end of the list.
 List<INode> getAdjacentNodes()
          Obtains a list of adjacent nodes.
 List<INode> getChildNodes()
          Obtains a list of children.
 String getDescription()
          Obtains the name of this node.
 String getName()
          Returns the node's literal symbol.
 List<INode> getParentNodes()
          Obtains a list of parents.
 String getStateAt(int index)
          Returns the state of the position given by index
 int getStatesSize()
          It returns the node's quantity of states.
 int getType()
          Method to extract node's type.
 void removeChildNode(INode child)
          Removes a child from this node
 void removeLastState()
          Deletes the node's last inserted state (i.e the last element inside the list of states).
 void removeParentNode(INode parent)
          Removes a parent from this node
 void removeStateAt(int index)
          Used within dalgo2.
 void setChildNodes(List<INode> children)
          Sets a new list of children.
 void setDescription(String text)
          Changes node's description.
 void setName(String name)
          Set the node's name, which in most cases it is the node's ID.
 void setParentNodes(List<INode> parents)
          Sets a new list of parents.
 void setStateAt(String state, int index)
          Replaces a state at given position to the specified position.
 void setStates(List<String> states)
          Sets the states.
 

Method Detail

setDescription

void setDescription(String text)
Changes node's description.

Parameters:
text - node's description.

setName

void setName(String name)
Set the node's name, which in most cases it is the node's ID.

Parameters:
name - Node's name.

setChildNodes

void setChildNodes(List<INode> children)
Sets a new list of children.

Parameters:
children - List of nodes representing the children.

setParentNodes

void setParentNodes(List<INode> parents)
Sets a new list of parents.

Parameters:
parents - List of nodes representing the parents.

addChildNode

void addChildNode(INode child)
                  throws InvalidParentException
Adds a child to this node

Parameters:
child -
Throws:
InvalidParentException

removeChildNode

void removeChildNode(INode child)
Removes a child from this node

Parameters:
child -

addParentNode

void addParentNode(INode parent)
                   throws InvalidParentException
Add a parent to this node

Parameters:
parent -
Throws:
InvalidParentException

removeParentNode

void removeParentNode(INode parent)
Removes a parent from this node

Parameters:
parent -

getDescription

String getDescription()
Obtains the name of this node.

Returns:
node's description.

getAdjacentNodes

List<INode> getAdjacentNodes()
Obtains a list of adjacent nodes.

Returns:
reference for this node's adjacents.

getName

String getName()
Returns the node's literal symbol.

Returns:
node's literal abbreviation.

getChildNodes

List<INode> getChildNodes()
Obtains a list of children.

Returns:
list of children.

getParentNodes

List<INode> getParentNodes()
Obtains a list of parents.

Returns:
list of parents.

appendState

void appendState(String state)
Inserts a state with the specified name at the end of the list.

Parameters:
state - Name of the state to be added.

removeLastState

void removeLastState()
Deletes the node's last inserted state (i.e the last element inside the list of states).


removeStateAt

void removeStateAt(int index)
Used within dalgo2. It should not be used with nodes having potential table's informations.


setStateAt

void setStateAt(String state,
                int index)
Replaces a state at given position to the specified position.

Parameters:
state - Name of the new state.
index - Position of the state being substituted. Starts with 0.

getStatesSize

int getStatesSize()
It returns the node's quantity of states.

Returns:
How many states the node has.

getStateAt

String getStateAt(int index)
Returns the state of the position given by index

Parameters:
index - position of the state to be read.
Returns:
Name of the state at index

setStates

void setStates(List<String> states)
Sets the states.

Parameters:
states - The states to set

getType

int getType()
Method to extract node's type. It is free to use any value as any meaning.

Returns:


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