TMST.representation
Class Task

java.lang.Object
  extended byEntityType
      extended byTMST.representation.Task

public class Task
extends EntityType

Class describing tasks. Task describes what to do. Parameters a task may hold:

See Also:
Serialized Form

Constructor Summary
Task(Entity ent)
          Cosntructor for encpsulating an entity as a psm (to be allowed to use psm methods on it)
Task(TMST tmst, java.lang.String name, java.lang.String description)
          Constructor, calls the super class constructor only with knowledge model and name as parameters Parameters a task may takes:
 
Method Summary
 Action[] getActions()
          Method for getting all actions part the task
 Cost getCost()
          Method returning the cost entity of this task.
 float getCostValue()
          Method returning the cost entity of this task.
 Goal[] getGoals()
          Method returning all goals of the Task.
 Input[] getInputs()
          Method for getting all input part the task
 java.util.ArrayList getInputsString()
          Method for getting all input-entities as strings
 Output[] getOutputs()
          Method for getting all output entities part the task
 java.lang.String getOutputString()
          Method for getting the output entity as a string - this method assume that there is only one output.
 ProblemSolvingMethod[] getProblemSolvingMethods()
          Method which returns all of the problem solving methods related to this particular task
 boolean isActivated()
          Method for checking whether a task is activated or not.
 boolean isInitialProblem()
          Method returning true if the this task is the initial problem and thus the root node in the task structure tree, and false if otherwise.
 boolean isSolutionPart()
          Method for checking whether a task is part of the solution or not.
 boolean isSpacePart()
          Method for checking whether a task is part of the solution space or not.
static boolean matches(Entity value)
          Method which has to be overriden (from the class EntityType)
 void setAction(Action action)
          Method for adding an action to the task
 void setActions(Action[] actions)
          Method for adding a set of actions to the task
 void setAsActivated()
          Method for setting a task as activated.
 void setAsSolutionPart()
          Method for setting a task as activated.
 void setAssumption(Assumption ass)
          Method for setting the assumptions related to the task.
 void setAssumptions(Assumption[] ass)
          Method for setting the assumptions related to the task.
protected  void setCost(float costValue)
          Method for setting the cost of a task.
 void setGoal(Goal goal)
          Method for adding a goal to the Task.
 void setGoals(Goal[] goals)
          Method for adding a set of goals to the Task.
 void setInput(Input in)
          Method for adding Input to the task
 void setInputs(Input[] ins)
          Method for adding a set of inputs to the task
 void setOutput(Output out)
          Method for adding output to the task
 void setOutputs(Output[] outs)
          Method for adding a set of outputs to the task
 void setProblemSolvingMethod(ProblemSolvingMethod psm)
          Method for adding one problem solving method to the Task.
 void setProblemSolvingMethods(ProblemSolvingMethod[] psms)
          Method for adding a set of problem solving methods to the task.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Task

public Task(TMST tmst,
            java.lang.String name,
            java.lang.String description)
     throws NameAlreadyExistException
Constructor, calls the super class constructor only with knowledge model and name as parameters Parameters a task may takes:

Parameters:
tmst - The TMST this Task is a part of.
name - The name of the task.
description - The description of the task.

Task

public Task(Entity ent)
     throws EntityTypeNotMatchedException
Cosntructor for encpsulating an entity as a psm (to be allowed to use psm methods on it)

Parameters:
ent - The entity to encapsulate.
Method Detail

setGoal

public void setGoal(Goal goal)
Method for adding a goal to the Task.

Parameters:
goal - The goal which is being addded to the task.

setGoals

public void setGoals(Goal[] goals)
Method for adding a set of goals to the Task.

Parameters:
goals - The set of goals which is to be added to the task.

getGoals

public Goal[] getGoals()
                throws java.lang.Exception
Method returning all goals of the Task. Changed by Kari because it caused a class-cast exception

Returns:
Goal[] The goals belonging to the task.
Throws:
java.lang.Exception

setAssumption

public void setAssumption(Assumption ass)
Method for setting the assumptions related to the task.

Parameters:
ass - The assumptions which apply for the task.

setAssumptions

public void setAssumptions(Assumption[] ass)
Method for setting the assumptions related to the task.

Parameters:
ass - The assumptions which apply for the task.

setProblemSolvingMethod

public void setProblemSolvingMethod(ProblemSolvingMethod psm)
Method for adding one problem solving method to the Task.

Parameters:
psm - The problem solving method to add to the task.

setProblemSolvingMethods

public void setProblemSolvingMethods(ProblemSolvingMethod[] psms)
Method for adding a set of problem solving methods to the task.

Parameters:
psms - The set of problem solving methods to add to the task.

getProblemSolvingMethods

public ProblemSolvingMethod[] getProblemSolvingMethods()
Method which returns all of the problem solving methods related to this particular task

Returns:
ProblemSolvingMethod[] The problem solving methods.

setInput

public void setInput(Input in)
Method for adding Input to the task

Parameters:
in - The input to add to the task

setInputs

public void setInputs(Input[] ins)
Method for adding a set of inputs to the task

Parameters:
ins - The set of inputs to add to the task

getInputs

public Input[] getInputs()
Method for getting all input part the task

Returns:
Input[] All Input entities related to the task

getInputsString

public java.util.ArrayList getInputsString()
Method for getting all input-entities as strings

Returns:
ArrayList A list of input-entities as strings

setOutput

public void setOutput(Output out)
Method for adding output to the task

Parameters:
out - The output to add to the task

setOutputs

public void setOutputs(Output[] outs)
Method for adding a set of outputs to the task

Parameters:
outs - The set of outputs to add to the task

getOutputs

public Output[] getOutputs()
Method for getting all output entities part the task

Returns:
Output[] All Output entities related to the task

getOutputString

public java.lang.String getOutputString()
Method for getting the output entity as a string - this method assume that there is only one output.

Returns:
String The name of the output entity

setAction

public void setAction(Action action)
Method for adding an action to the task

Parameters:
action - The action to add to the task

setActions

public void setActions(Action[] actions)
Method for adding a set of actions to the task

Parameters:
actions - The set of actions to add to the task

getActions

public Action[] getActions()
Method for getting all actions part the task

Returns:
Action[] All action entities related to the task

setCost

protected void setCost(float costValue)
                throws AlreadyHasValueException
Method for setting the cost of a task. Takes a float as parameter.

Throws:
AlreadyHasValueException

getCost

public Cost getCost()
             throws AlreadyHasValueException
Method returning the cost entity of this task.

Returns:
Cost
Throws:
AlreadyHasValueException

getCostValue

public float getCostValue()
                   throws AlreadyHasValueException
Method returning the cost entity of this task.

Returns:
Cost
Throws:
AlreadyHasValueException

setAsActivated

public void setAsActivated()
Method for setting a task as activated.


setAsSolutionPart

public void setAsSolutionPart()
Method for setting a task as activated.


isSpacePart

public boolean isSpacePart()
Method for checking whether a task is part of the solution space or not.

Returns:
boolean The method returns true if part of the solution space and false if not.

isSolutionPart

public boolean isSolutionPart()
Method for checking whether a task is part of the solution or not.

Returns:
boolean The method returns true if part of the solution and false if not.

isActivated

public boolean isActivated()
Method for checking whether a task is activated or not.

Returns:
boolean The method returns true if activated and false if not.

isInitialProblem

public boolean isInitialProblem()
Method returning true if the this task is the initial problem and thus the root node in the task structure tree, and false if otherwise.

Returns:
boolean True if this task is the initial problem, else false.

matches

public static boolean matches(Entity value)
Method which has to be overriden (from the class EntityType)