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

Quick Search    Search Deep

com.eireneh.bible.control
Class SimplePassageTask  view SimplePassageTask download SimplePassageTask.java

java.lang.Object
  extended bycom.eireneh.bible.control.AbstractTask
      extended bycom.eireneh.bible.control.SimplePassageTask
All Implemented Interfaces:
Task

public abstract class SimplePassageTask
extends AbstractTask

SimplePassageTask is an easy way of writing Tasks that return a Passage in String or XML form.
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

Field Summary
protected  com.eireneh.bible.passage.Passage full
          The full Passage answer before being trimmed
protected  com.eireneh.bible.passage.Passage remainder
          The remainder left over during trimming
protected  com.eireneh.bible.passage.Passage trimmed
          The trimmed Passage answer
 
Fields inherited from class com.eireneh.bible.control.AbstractTask
params, state
 
Constructor Summary
SimplePassageTask()
           
 
Method Summary
 void calculate()
          Actually work out the answer
 int countParameters()
          How many parameters does this Action expect?
abstract  com.eireneh.bible.passage.Passage getPassage(State state, java.lang.String param)
          This is the simple method that all SimplePassageTasks have to implement.
 java.lang.String getResults()
          Perform the action, and return the results in a String.
 void getResults(org.w3c.dom.Node node)
          Perform the action.
 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?.
 
Methods inherited from class com.eireneh.bible.control.AbstractTask
getParams, getState, setParams, setState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

full

protected com.eireneh.bible.passage.Passage full
The full Passage answer before being trimmed


trimmed

protected com.eireneh.bible.passage.Passage trimmed
The trimmed Passage answer


remainder

protected com.eireneh.bible.passage.Passage remainder
The remainder left over during trimming

Constructor Detail

SimplePassageTask

public SimplePassageTask()
Method Detail

getPassage

public abstract com.eireneh.bible.passage.Passage getPassage(State state,
                                                             java.lang.String param)
                                                      throws TaskException
This is the simple method that all SimplePassageTasks have to implement. Get a passage based on user input.


calculate

public void calculate()
               throws TaskException
Actually work out the answer


getResults

public java.lang.String getResults()
Perform the action, and return the results in a String.


getResults

public void getResults(org.w3c.dom.Node node)
                throws TaskException
Perform the action.

Specified by:
getResults in interface Task
Overrides:
getResults in class AbstractTask

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

Specified by:
isTrimmed in interface Task
Overrides:
isTrimmed in class AbstractTask

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.

Specified by:
nextTask in interface Task
Overrides:
nextTask in class AbstractTask

countParameters

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