?? stacknode.java
字號:
/**
* This is the node for the stack.
* It includes an object field to store the value, and a reference to
* store the pointer to the next node.
*
* @author Rachel Chen 0122070
* @version 1.0 2003/3/22
*/
public class StackNode
{
/** The variable to store the value of the node. */
private Object element;
/** The variable to store the reference to the next node. */
private StackNode next;
/**
* The constructor for this class.
* It initializes the fields element and next to null.
*/
public StackNode()
{
element = null;
next = null;
}
/**
* The constructor for this class. <p>
* It initializes the fields element and next to the parameters given.
*
* @param it The value for the node.
* @param nextEle The reference to the next node.
*/
public StackNode( Object it, StackNode nextEle )
{
element = it;
next = nextEle;
}
/**
* The constructor for this class. <p>
* It initializes the fields element to the parameters given and next to null.
*
* @param it The value for the node.
*/
public StackNode( Object it )
{
element = it;
next = null;
}
/**
* The constructor for this class. <p>
* It initializes the fields element and next to the parameters given.
*
* @param nextEle The reference to the next node.
*/
public StackNode( StackNode nextEle )
{
next = nextEle;
}
/**
* Give the next node of the current node.
*
* @return The reference of the next node.
*/
public StackNode next()
{
return next;
}
/**
* Set the next field of the current node to the parameter.
*
* @param nextEle The given node.
* @return The set reference of the next node.
*/
public StackNode setNext( StackNode nextEle )
{
return next = nextEle;
}
/**
* Give the value of the current node.
*
* @return The value of the node.
*/
public Object element()
{
return element;
}
/**
* Set the value of the current node.
*
* @param it The value to be set.
* @return The set value.
*/
public Object setElement( Object it )
{
return element = it;
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -