Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.eireneh.bible.control
Interface Task  view Task download Task.java

All Known Implementing Classes:
AbstractTask

public interface Task

Action allows us to have a neutral interface that performs some general function given a set of inputs.

On the design of an Action:
Actions should have I18N built into their names.
We can ignore configuration matters. There is already a UI independant way of asking about the configuration and changing it.

Since they are used from the Web the actions ought to be integrated with the State object so that they can use a default Bible.

Distribution Licence:
Project B is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
The License is available on the internet here, by writing to Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA, Or locally at the Licence link below.
The copyright to this program is held by it's authors.

Version:
D0.I0.T0

Method Summary
 void calculate()
          Perform the action, and return the results in a String.
 int countParameters()
          How many parameters does this Action expect?
 java.lang.String[] getParams()
          Get the parameters we should use in any execute methods
 java.lang.String getResults()
          Perform the action, and return the results in a String.
 void getResults(org.w3c.dom.Node node)
          Perform the action, and return the results in the given Node.
 State getState()
          Get the State object that we should use to get the current users optional settings.
 boolean isTrimmed()
          If we are using XML output it would be good to know if we have overflowed and so the nextTask() is of particular relevance
 Task nextTask()
          What do we recommend that the user does next?.
 void setParams(java.lang.String[] params)
          Set the parameters we should use in any execute methods.
 void setState(State state)
          Set the State object that we should use to get the current users optional settings.
 

Method Detail

getState

public State getState()
Get the State object that we should use to get the current users optional settings.


setState

public void setState(State state)
Set the State object that we should use to get the current users optional settings.


getParams

public java.lang.String[] getParams()
Get the parameters we should use in any execute methods


setParams

public void setParams(java.lang.String[] params)
Set the parameters we should use in any execute methods. Calculation of the answer is not done here (hence no exception) it must be deferred until one of the execute methods is called. This enables us to create a list of primed Tasks quickly and only spend CPU on one when we know it is needed.


calculate

public void calculate()
               throws TaskException
Perform the action, and return the results in a String. This method does not take any notice of the users max verses setting since it only returns a reference to the answer.


getResults

public java.lang.String getResults()
Perform the action, and return the results in a String. This method does not take any notice of the users max verses setting since it only returns a reference to the answer.


getResults

public void getResults(org.w3c.dom.Node node)
                throws TaskException
Perform the action, and return the results in the given Node. This method onlye returns the first n verses of the full answer given by execute() (where n is defined by the current users settings).


isTrimmed

public boolean isTrimmed()
If we are using XML output it would be good to know if we have overflowed and so the nextTask() is of particular relevance


nextTask

public Task nextTask()
What do we recommend that the user does next?. It may well be that there is no obvious logical thing to do next - in which case we should return this, however is a view passage has resulted in a truncated view then the next query would be the remaining verses.


countParameters

public int countParameters()
How many parameters does this Action expect?