org.activemath.webapp.feedback
Class HintHistory

java.lang.Object
  extended by org.activemath.webapp.feedback.HintHistory

public class HintHistory
extends Object


Constructor Summary
HintHistory(int size)
           
 
Method Summary
 List getList()
           
 Therapy getTherapyAt(int pos)
          gets the Therapy at the specified index from this HintHistory.
 Iterator hintIterator()
          returns an iterator over the items in the hint history
 Therapy peek()
          peeks at the most recent item in the history.
 void push(Therapy t)
          pushes the given therapy to the start of this HintHistory, hereby possibly kicking out an older entry.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HintHistory

public HintHistory(int size)
Method Detail

peek

public Therapy peek()
peeks at the most recent item in the history.

Returns:
the most recent item in this history, or null if there was none.

getTherapyAt

public Therapy getTherapyAt(int pos)
gets the Therapy at the specified index from this HintHistory.

Parameters:
pos - the position of the desired element in the list
Returns:
The desired therapy, or null if ther was none.

push

public void push(Therapy t)
pushes the given therapy to the start of this HintHistory, hereby possibly kicking out an older entry. This would happen if the new list size would be greater than the specified maximum size.

Parameters:
t - The therapy to add to this HintHistory.

hintIterator

public Iterator hintIterator()
returns an iterator over the items in the hint history

Returns:
an iterator over a clone of the internal list.

getList

public List getList()
Returns: