| |
|
| java.util.LinkedList client.CommandHistory
CommandHistory | final public class CommandHistory extends java.util.LinkedList (Code) | | Class to manage the history of messages/commands from the user
Is in the form of a fixed length stack that drops items from
the end of the stack when the maximum length is reached exends
the linked list class; all items on the list are Strings
author: Joseph Monti countjoe@users.sourceforge.net version: 0.8 |
CommandHistory | CommandHistory(int s)(Code) | | |
add | public void add(String s)(Code) | | Adds a string to the list and checks to see
if the new item breached the maximum size of the list
also sets the current to be -1 to reset the current position
Parameters: s - the string to be added |
getDown | public String getDown()(Code) | | retrieves the next newest item from the list
while stopping that the bottom and decrementing
the current item
the appropriate item from the list, or null if at bottom |
getUp | public String getUp()(Code) | | retrives the next oldest item from the list
while stopping at the top and incrementing
the current item
the appropriate item from the list, or null if at top |
|
|
|