|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--xbneditor.Block
|
+--xbneditor.ChanceBlock
This class inherits all of the functionality of the Block class. It is then specalized to be a probability node, and thus it holds the names and values associated with different probabilities.
| Constructor Summary | |
ChanceBlock()
An empty constructor. |
|
ChanceBlock(java.lang.String name,
double x,
double y,
boolean isnew)
Constructs a new Chance block with a given name and location. |
|
| Method Summary | |
void |
add()
Adds a new state to the current node. |
void |
add(java.lang.String name)
Adds a new state to the node. |
void |
delete(int loc)
Deletes the state at the corresponding location in the LinkedList. |
java.util.LinkedList |
getAttributeNames()
Returns a LinkedList of the state names |
java.util.LinkedList |
getAttributeValues()
Returns a LinkedList of the state values |
int |
getColumns()
Gets the number of columns that the array of probabilities is currently using. |
int |
getRows()
Gets the number of rows that the array of probabilities is using, this does the same thing as numAttributes. |
int |
getTotalColumns()
Returns the total number of columns in the array that this particular ChanceBlock has access to. |
double |
getValue(int irow,
int icolumn)
Gets the corresponding value in the probability table |
int |
numAttributes()
Returns the number of states this node has, it does the same thing that getRows does |
void |
setAttributeName(java.lang.String name,
int loc)
Sets the name of a state at a specific location in the LinkedList of names. |
void |
setAttributeValue(java.lang.Double value,
int loc)
Sets the value of a state at a specific location in the LinkedList of values. |
void |
setColumns(int numcolumns)
Changes how many columns in the probability table. |
void |
setValue(double item,
int irow,
int icolumn)
Sets the corresponding value in the probability table to the value that is being passed in. |
void |
setValues(double[][] values,
int columns)
Stores all of the probabilites of the corresponding linked list |
void |
shrinkTable(int numattributes,
int offset)
This function allows the tables to shrink when a node has been deleted. |
| Methods inherited from class xbneditor.Block |
getBlockName, getType, getx, gety, setBlockName, setCoordinates, setType |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public ChanceBlock()
public ChanceBlock(java.lang.String name,
double x,
double y,
boolean isnew)
name - the name of this chance blockx - the inital x location of this blocky - the inital y location of this blockinnew - a boolean that tells if this is a node that is
being loaded from a file or if it is one the user has
created| Method Detail |
public int numAttributes()
public java.util.LinkedList getAttributeNames()
public java.util.LinkedList getAttributeValues()
public void setAttributeName(java.lang.String name,
int loc)
name - the name to be setloc - the location in the LinkedList to set the name to
public void setAttributeValue(java.lang.Double value,
int loc)
value - the value to be setloc - the location in the LinkedList to set the value topublic void add()
addpublic void add(java.lang.String name)
name - the name of the state that is being addedaddpublic void delete(int loc)
loc - the location of the state to delete
public void setValues(double[][] values,
int columns)
values - a two dimensinal array in which the rows
represent the number of attributes that this particular
node has, the columns represent the number of possible
combinations that these can be recongized inacross - the number of rows across in the arraypublic int getRows()
public int getColumns()
public int getTotalColumns()
public void setColumns(int numcolumns)
columns - the number that are currently being used
public double getValue(int irow,
int icolumn)
irow - the row the value is inicolumn - the column the value is in
public void setValue(double item,
int irow,
int icolumn)
item - the new value of the tableirow - the row that corresponds to the new valueicolumn - the column that corresponds to the new value
public void shrinkTable(int numattributes,
int offset)
numattributes - the number of attributes that need to be
collapsed into oneoffset - the number that is inbetween these attributes
that need to be shrank
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||