org.globus.cog.gridshell.interfaces
Interface ShellHistory

All Superinterfaces:
Serializable
All Known Implementing Classes:
ShellHistoryImpl

public interface ShellHistory
extends Serializable


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
 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
 

Method Detail

appendHistory

public void appendHistory(Object newHistory)
If history is larger than 0, then it appends newHistory to the history which may override values

Parameters:
newHistory - - the history object to append

decPeekIndex

public boolean decPeekIndex()
Will decrement the peek index which ranges from -historySize to historySize

Returns:
- if it fails to decrement (because peek index goes out of range) returns false, else true

get

public Object get(int i)
           throws ShellHistoryException
returns if(i>0) the ith command since the shell is active. if(i <0) it is the ith command since the last submited command else returns null

Parameters:
i - - specifies which command to return
Returns:
- the ith command since the shell is active
Throws:
ShellHistoryException

getCount

public int getCount()
Gets the number of items in the history

Returns:

getHistory

public Object[] getHistory()
returns the history as Object[]

Returns:

getHistorySize

public int getHistorySize()
Gets the max items for the history

Returns:

getLast

public Object getLast()
               throws ShellHistoryException
Gets the last history value

Returns:
@throws ShellHistoryException - if now items in history
Throws:
ShellHistoryException

incPeekIndex

public boolean incPeekIndex()
Will increment the peek index which ranges from -historySize to historySize

Returns:
- if it fails to increment (because peek index goes out of range) returns false, else true

peek

public Object peek()
Looks at Object get(peekIndex) if peekIndex is 0 returns null

Returns:

setHistory

public void setHistory(Object[] value)
Set the history to a Object[]

Parameters:
value -

setHistoryAt

public void setHistoryAt(int i,
                         Object value)
                  throws ShellHistoryException
Set the history value at index i

Parameters:
i - - index to set the history at
value - - value to set
Throws:
ShellHistoryException - - if index is out of bounds

setHistorySize

public void setHistorySize(int value)
                    throws ShellHistoryException
Resizes the history and preserves as many history objects as permitted by the new history size

Parameters:
value -
Throws:
ShellHistoryException