net.sourceforge.pavlov.user
Class AbstractStrategy

java.lang.Object
  extended by net.sourceforge.pavlov.user.AbstractStrategy
All Implemented Interfaces:
ActionListener, EventListener, Pluglet
Direct Known Subclasses:
BasicStrategy

public abstract class AbstractStrategy
extends Object
implements Pluglet

AbstractStrategy is the base class for a question selection strategy.


Field Summary
protected  Collection<QuestionData> questions
          List of questions to choose from.
protected  ResourceBroker rb
           
 
Constructor Summary
AbstractStrategy()
          Creates a new AbstractStrategy instance with no QuestionData to work on.
AbstractStrategy(Collection<QuestionData> questions)
          Creates a new AbstractStrategy instance to draw from the given Questions.
 
Method Summary
 void actionPerformed(ActionEvent e)
          Describe actionPerformed method here.
 String getName()
          Returns a short descriptive name for this strategy.
abstract  QuestionData getQuestion(Vector<QuestionData> exclusion)
          Returns the next question using the implemented strategy.
 void setQuestions(Collection<QuestionData> questions)
          Set the collection of questions to draw from.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sourceforge.pavlov.pluglets.Pluglet
getDescription
 

Field Detail

questions

protected Collection<QuestionData> questions
List of questions to choose from.


rb

protected ResourceBroker rb
Constructor Detail

AbstractStrategy

public AbstractStrategy()
Creates a new AbstractStrategy instance with no QuestionData to work on.


AbstractStrategy

public AbstractStrategy(Collection<QuestionData> questions)
Creates a new AbstractStrategy instance to draw from the given Questions.

Method Detail

setQuestions

public void setQuestions(Collection<QuestionData> questions)
Set the collection of questions to draw from.


getName

public String getName()
Returns a short descriptive name for this strategy. Override this method to name your strategy.

Specified by:
getName in interface Pluglet
Returns:
a String value

getQuestion

public abstract QuestionData getQuestion(Vector<QuestionData> exclusion)
Returns the next question using the implemented strategy.

Returns:
a QuestionData value

actionPerformed

public void actionPerformed(ActionEvent e)
Describe actionPerformed method here.

Specified by:
actionPerformed in interface ActionListener
Parameters:
e - an ActionEvent value