|
|||||||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||||||
java.lang.Objectjavax.swing.tree.DefaultMutableTreeNode
weka.gui.ensembleLibraryEditor.tree.NumberNode
public class NumberNode
This subclass is responsible for allowing users to specify either a minimum, maximum, or iterator value for Integer attributes. It stores a value that is of type java.lang.Number to accomodate the many different number types used by Weka classifiers.
| Field Summary | |
|---|---|
static double |
epsilon
This is the maximum floating point value that we care about when testing for equality. |
static int |
NOT_ITERATOR
the enumerated value indicating a node is not an iterator |
static int |
PLUS_EQUAL
the enumerated value indicating a node is a += iterator |
static int |
scale
this defines the number of decimal places we care about, we arbitrarily chose 7 thinking that anything beyond this is overkill |
static int |
TIMES_EQUAL
the enumerated value indicating a node is a *= iterator |
| Fields inherited from class javax.swing.tree.DefaultMutableTreeNode |
|---|
EMPTY_ENUMERATION |
| Constructor Summary | |
|---|---|
NumberNode(java.lang.String text,
java.lang.Number value,
int iteratorType,
boolean checkable,
java.lang.String toolTipText)
The constructor simply initializes all of the member variables |
|
| Method Summary | |
|---|---|
java.lang.Number |
addNumbers(java.lang.Number a,
java.lang.Number b)
adds two objects that are instances of one of the child classes of java.lang.Number |
boolean |
equals(java.lang.Number a,
java.lang.Number b)
tests for equality among two objects that are instances of one of the child classes of java.lang.Number |
boolean |
getCheckable()
returns whether or not this node can be toggled on and off |
int |
getIteratorType()
getter for this node's iteratorType which will be one of the three enumerated values |
java.text.NumberFormat |
getNumberFormat()
A helper method to figure out what number format should be used to display the numbers value in a formatted text box. |
java.lang.Number |
getOneValue()
figures out the class of this node's object and returns a new instance of it initialized with the value of "1". |
boolean |
getSelected()
getter for the node selected state |
java.lang.String |
getText()
returns the text to be displayed for this node |
java.lang.String |
getToolTipText()
getter for the tooltip text |
java.lang.Number |
getTwoValue()
figures out the class of this node's object and returns a new instance of it initialized with the value of "2". |
java.lang.Number |
getValue()
getter for this node's object |
java.lang.Number |
getZeroValue()
figures out the class of this node's object and returns a new instance of it initialized with the value of "0". |
boolean |
lessThan(java.lang.Number a,
java.lang.Number b)
tests if the first argument is greater than the second among two objects that are instances of one of the child classes of java.lang.Number |
java.lang.Number |
multiplyNumbers(java.lang.Number a,
java.lang.Number b)
multiplies two objects that are instances of one of the child classes of java.lang.Number |
static double |
roundDouble(double a)
This method rounds a double to the number of decimal places defined by scale |
static float |
roundFloat(float a)
This method rounds a float to the number of decimal places defined by scale |
void |
setIteratorType(int newValue)
setter for this nodes iteratorType which should be one of the three enumerated values |
void |
setSelected(boolean newValue)
setter for the node selected state |
void |
setUserObject(java.lang.Object o)
this is a simple filter for the setUserObject method. |
void |
setValue(java.lang.Number newValue)
setter for this nodes object |
java.lang.String |
toString()
returns a string representation |
| Methods inherited from class javax.swing.tree.DefaultMutableTreeNode |
|---|
add, breadthFirstEnumeration, children, clone, depthFirstEnumeration, getAllowsChildren, getChildAfter, getChildAt, getChildBefore, getChildCount, getDepth, getFirstChild, getFirstLeaf, getIndex, getLastChild, getLastLeaf, getLeafCount, getLevel, getNextLeaf, getNextNode, getNextSibling, getParent, getPath, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getUserObject, getUserObjectPath, insert, isLeaf, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, remove, removeAllChildren, removeFromParent, setAllowsChildren, setParent |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int NOT_ITERATOR
public static final int TIMES_EQUAL
public static final int PLUS_EQUAL
public static final int scale
public static final double epsilon
| Constructor Detail |
|---|
public NumberNode(java.lang.String text,
java.lang.Number value,
int iteratorType,
boolean checkable,
java.lang.String toolTipText)
text - the namevalue - the actual valueiteratorType - the iterator typecheckable - true if it's checkabletoolTipText - the tooltip to use| Method Detail |
|---|
public static double roundDouble(double a)
a - the value to round
public static float roundFloat(float a)
a - the value to round
public boolean getSelected()
public void setSelected(boolean newValue)
newValue - the new selected statepublic java.lang.Number getValue()
public void setValue(java.lang.Number newValue)
newValue - the new value to usepublic int getIteratorType()
public void setIteratorType(int newValue)
newValue - the new iterator type to usepublic boolean getCheckable()
public java.lang.String getText()
public java.lang.String getToolTipText()
public void setUserObject(java.lang.Object o)
setUserObject in interface javax.swing.tree.MutableTreeNodesetUserObject in class javax.swing.tree.DefaultMutableTreeNodeo - the user objectpublic java.lang.String toString()
toString in class javax.swing.tree.DefaultMutableTreeNode
public java.lang.Number getZeroValue()
throws NumberClassNotFoundException
NumberClassNotFoundException - if number class not supported
public java.lang.Number getOneValue()
throws NumberClassNotFoundException
NumberClassNotFoundException - if number class not supported
public java.lang.Number getTwoValue()
throws NumberClassNotFoundException
NumberClassNotFoundException - if number class not supported
public java.lang.Number addNumbers(java.lang.Number a,
java.lang.Number b)
throws NumberClassNotFoundException
a - the first numberb - the second number
NumberClassNotFoundException - if number class not supported
public java.lang.Number multiplyNumbers(java.lang.Number a,
java.lang.Number b)
throws NumberClassNotFoundException
a - the first numberb - the second number
NumberClassNotFoundException - if number class not supported
public boolean lessThan(java.lang.Number a,
java.lang.Number b)
throws NumberClassNotFoundException
a - the first numberb - the second number
NumberClassNotFoundException - if number class not supported
public boolean equals(java.lang.Number a,
java.lang.Number b)
throws NumberClassNotFoundException
a - the first numberb - the second number
NumberClassNotFoundException - if number class not supported
public java.text.NumberFormat getNumberFormat()
throws NumberClassNotFoundException
NumberClassNotFoundException - if number class not supported
|
|||||||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||||||