|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.globus.cog.gridshell.model.ShellHistoryImpl
| Field Summary | |
static int |
DEFAULT_HISTORY_SIZE
|
| Constructor Summary | |
ShellHistoryImpl()
|
|
ShellHistoryImpl(int historySize)
|
|
| Method Summary | |
void |
appendHistory(Object newHistory)
If history is larger than 0, then it appends newHistory to the history which may override values |
boolean |
decPeekIndex()
Will decrement the peek index which ranges from -historySize to historySize |
Object |
get(int i)
returns if(i>0) the ith command since the shell is active. |
int |
getCount()
Gets the number of items in the history |
Object[] |
getHistory()
returns the history as Object[] |
int |
getHistorySize()
Gets the max items for the history |
Object |
getLast()
Gets the last history value |
boolean |
incPeekIndex()
Will increment the peek index which ranges from -historySize to historySize |
static void |
main(String[] args)
main is used to test this class |
Object |
peek()
Looks at Object get(peekIndex) if peekIndex is 0 returns null |
void |
setHistory(Object[] value)
Set the history to a Object[] |
void |
setHistoryAt(int i,
Object value)
Set the history value at index i |
void |
setHistorySize(int value)
Resizes the history and preserves as many history objects as permitted by the new history size |
String |
toString()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int DEFAULT_HISTORY_SIZE
| Constructor Detail |
public ShellHistoryImpl()
public ShellHistoryImpl(int historySize)
| Method Detail |
public void appendHistory(Object newHistory)
ShellHistory
appendHistory in interface ShellHistorynewHistory - -
the history object to append
public Object get(int i)
throws ShellHistoryException
ShellHistory
get in interface ShellHistoryi - -
specifies which command to return
ShellHistoryExceptionpublic int getCount()
ShellHistory
getCount in interface ShellHistory
public Object getLast()
throws ShellHistoryException
ShellHistory
getLast in interface ShellHistoryShellHistoryException
public void setHistoryAt(int i,
Object value)
throws ShellHistoryException
ShellHistory
setHistoryAt in interface ShellHistoryi - -
index to set the history atvalue - -
value to set
ShellHistoryException - -
if index is out of bounds
public void setHistorySize(int value)
throws ShellHistoryException
ShellHistory
setHistorySize in interface ShellHistoryvalue -
ShellHistoryExceptionpublic int getHistorySize()
ShellHistory
getHistorySize in interface ShellHistorypublic String toString()
public Object peek()
ShellHistory
peek in interface ShellHistorypublic boolean incPeekIndex()
ShellHistory
incPeekIndex in interface ShellHistorypublic boolean decPeekIndex()
ShellHistory
decPeekIndex in interface ShellHistorypublic Object[] getHistory()
ShellHistory
getHistory in interface ShellHistorypublic void setHistory(Object[] value)
ShellHistory
setHistory in interface ShellHistoryvalue -
public static void main(String[] args)
throws ShellHistoryException
args - String[]
ShellHistoryException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||