org.activemath.learner.history
Class NopHistory

java.lang.Object
  extended by org.activemath.learner.history.NopHistory
All Implemented Interfaces:
LearnerHistory

public class NopHistory
extends Object
implements LearnerHistory

NoOpHistory is a trivial implementation of the LearnerHistory interface that only returns default values.


Method Summary
 boolean alreadySeen(String learnerId, String itemId)
          returns true if an ItemPresentedEvent for the item with the given itemId can ba found, false otherwise.
 ActivemathEvent fetchEvent(long id)
          returns the event stored in the history with the given id, or null if no such event exists
 List<ActivemathEvent> getHistoryEntries(ActivemathEvent event)
           
 List<ActivemathEvent> getHistoryEntries(ActivemathEvent event, int firstResult, int maxResults)
           
 List<ActivemathEvent> getHistoryEntries(HistoryQuery query)
          Should return a List of ActivemathEvents that match the supplied query.
 List<ActivemathEvent> getHistoryEntries(HistoryQuery query, int firstResult, int maxResults)
           
 int getNumResults(ActivemathEvent event)
           
 int getNumResults(HistoryQuery query)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

alreadySeen

public boolean alreadySeen(String learnerId,
                           String itemId)
Description copied from interface: LearnerHistory
returns true if an ItemPresentedEvent for the item with the given itemId can ba found, false otherwise.

Specified by:
alreadySeen in interface LearnerHistory

fetchEvent

public ActivemathEvent fetchEvent(long id)
Description copied from interface: LearnerHistory
returns the event stored in the history with the given id, or null if no such event exists

Specified by:
fetchEvent in interface LearnerHistory
Parameters:
id - The id of the event to fetch
Returns:
The event with the given id or null if there is no such event.

getHistoryEntries

public List<ActivemathEvent> getHistoryEntries(ActivemathEvent event,
                                               int firstResult,
                                               int maxResults)

getHistoryEntries

public List<ActivemathEvent> getHistoryEntries(ActivemathEvent event)

getHistoryEntries

public List<ActivemathEvent> getHistoryEntries(HistoryQuery query,
                                               int firstResult,
                                               int maxResults)
Specified by:
getHistoryEntries in interface LearnerHistory

getHistoryEntries

public List<ActivemathEvent> getHistoryEntries(HistoryQuery query)
Description copied from interface: LearnerHistory
Should return a List of ActivemathEvents that match the supplied query.

Specified by:
getHistoryEntries in interface LearnerHistory
Parameters:
query - The query that is to be made against the database
Returns:
A List of ActivemathEvents that match the given query

getNumResults

public int getNumResults(ActivemathEvent event)

getNumResults

public int getNumResults(HistoryQuery query)
Specified by:
getNumResults in interface LearnerHistory