discovery.model
Class NarrativeModel

java.lang.Object
  extended by discovery.model.NarrativeModel

public class NarrativeModel
extends java.lang.Object

This class represents a Narrative. It has attributes relating to all of the fields in a narrative card, and also has a unique ID number, and stores the ID number of the task that it corresponds to.


Field Summary
static int ACTOR
           
static int DISPATCH
           
static int EXCEPTION
           
static int OBJECT
           
 
Constructor Summary
NarrativeModel()
          This is the empty constructor, which gives the narrative a unique ID number, but leaves all other attributes empty.
NarrativeModel(java.lang.Integer id, java.lang.Integer task, java.lang.String author, java.lang.String date, java.lang.String version, java.lang.String purpose, java.lang.String actors, java.lang.String objects, java.lang.String precons, java.lang.String postcons, java.lang.String desc, java.lang.String exceptions, java.lang.String concerns)
          This constructor supplies all of the narrative's attributes, including the ID number.
 
Method Summary
 java.lang.String getActors()
          Accessor method to get the actors for this narrative.
 java.lang.String getAuthor()
          Accessor method to get the author for this narrative.
 java.lang.String getConcerns()
          Accessor method to get the concerns for this narrative.
 java.lang.String getDate()
          Accessor method to get the date for this narrative.
 java.lang.String getDescription()
          Accessor method to get the description for this narrative.
 java.lang.String getExceptions()
          Accessor method to get the exceptions for this narrative.
 java.lang.Integer getID()
          Accessor method to get the ID number for this narrative.
 java.lang.String getObjects()
          Accessor method to get the objects for this narrative.
 java.lang.String getPostconditions()
          Accessor method to get the postconditions for this narrative.
 java.lang.String getPreconditions()
          Accessor method to get the preconditions for this narrative.
 java.lang.String getPurpose()
          Accessor method to get the purpose for this narrative.
 java.lang.Integer getTask()
          Accessor method to get the associated task's ID number for this narrative.
 java.lang.String getVersion()
          Accessor method to get the version of this narrative.
 void removeContent(java.lang.String content, int type)
          Mutator method to remove some automatically generated content from the narrative.
 void setActors(java.lang.String act)
          Mutator method to set the list of actors for this narrative.
 void setAuthor(java.lang.String a)
          Mutator method to set the author of this narrative.
 void setConcerns(java.lang.String c)
          Mutator method to set the concerns field for this narrative.
 void setDate(java.lang.String d)
          Mutator method to set the date field for this narrative.
 void setDescription(java.lang.String des)
          Mutator method to set the description field for this narrative.
 void setExceptions(java.lang.String e)
          Mutator method to set the exceptions field for this narrative.
 void setObjects(java.lang.String obj)
          Mutator method to set the list of objects for this narrative.
 void setPostconditions(java.lang.String post)
          Mutator method to set the postconditions field for this narrative.
 void setPreconditions(java.lang.String pre)
          Mutator method to set the preconditions field for this narrative.
 void setPurpose(java.lang.String p)
          Mutator method to set the purpose field for this narrative.
 void setTask(java.lang.Integer t)
          Mutator method to set the task that this narrative is associated with.
 void setVersion(java.lang.String v)
          Mutator method to set the version of this narrative.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DISPATCH

public static int DISPATCH

EXCEPTION

public static int EXCEPTION

ACTOR

public static int ACTOR

OBJECT

public static int OBJECT
Constructor Detail

NarrativeModel

public NarrativeModel()
This is the empty constructor, which gives the narrative a unique ID number, but leaves all other attributes empty. Mutator methods should be used to assign the rest of the attributes.


NarrativeModel

public NarrativeModel(java.lang.Integer id,
                      java.lang.Integer task,
                      java.lang.String author,
                      java.lang.String date,
                      java.lang.String version,
                      java.lang.String purpose,
                      java.lang.String actors,
                      java.lang.String objects,
                      java.lang.String precons,
                      java.lang.String postcons,
                      java.lang.String desc,
                      java.lang.String exceptions,
                      java.lang.String concerns)
This constructor supplies all of the narrative's attributes, including the ID number. This method should only be used by the NarrativeDataManager, otherwise ID number duplications could occur.

Parameters:
id - the narrative's ID number
task - the ID number of the component that this narrative is associated with
author - the author of the narrative
date - the date when the narrative was created
version - the version of this narrative
purpose - the purpose of this narrative
actors - the actors associated with this narrative
objects - the objects associated with this narrative
precons - the preconditions for this narrative
postcons - the postconditions for this narrative
desc - the description for this narrative
exceptions - the exceptions for this narrative
concerns - the concerns for this narrative
Method Detail

setTask

public void setTask(java.lang.Integer t)
Mutator method to set the task that this narrative is associated with.

Parameters:
t - the ID number of the associated task

setAuthor

public void setAuthor(java.lang.String a)
Mutator method to set the author of this narrative.

Parameters:
a - the author

setVersion

public void setVersion(java.lang.String v)
Mutator method to set the version of this narrative.

Parameters:
v - the version

setPurpose

public void setPurpose(java.lang.String p)
Mutator method to set the purpose field for this narrative.

Parameters:
p - the purpose for this narrative

setPreconditions

public void setPreconditions(java.lang.String pre)
Mutator method to set the preconditions field for this narrative.

Parameters:
pre - the preconditions for this narrative

setPostconditions

public void setPostconditions(java.lang.String post)
Mutator method to set the postconditions field for this narrative.

Parameters:
post - the postconditions for this narrative

setDescription

public void setDescription(java.lang.String des)
Mutator method to set the description field for this narrative.

Parameters:
des - the description for this narrative

setExceptions

public void setExceptions(java.lang.String e)
Mutator method to set the exceptions field for this narrative.

Parameters:
e - the exceptions for this narrative

setConcerns

public void setConcerns(java.lang.String c)
Mutator method to set the concerns field for this narrative.

Parameters:
c - the concerns for this narrative

setActors

public void setActors(java.lang.String act)
Mutator method to set the list of actors for this narrative.

Parameters:
act - the actors for this narrative

setObjects

public void setObjects(java.lang.String obj)
Mutator method to set the list of objects for this narrative.

Parameters:
obj - the objects for this narrative

setDate

public void setDate(java.lang.String d)
Mutator method to set the date field for this narrative.

Parameters:
d - the date for this narrative

getID

public java.lang.Integer getID()
Accessor method to get the ID number for this narrative.

Returns:
the ID number for this narrative

getTask

public java.lang.Integer getTask()
Accessor method to get the associated task's ID number for this narrative.

Returns:
the associated task's ID number for this narrative

getAuthor

public java.lang.String getAuthor()
Accessor method to get the author for this narrative.

Returns:
the author for this narrative

getVersion

public java.lang.String getVersion()
Accessor method to get the version of this narrative.

Returns:
the version of this narrative

getPurpose

public java.lang.String getPurpose()
Accessor method to get the purpose for this narrative.

Returns:
the purpose for this narrative

getPreconditions

public java.lang.String getPreconditions()
Accessor method to get the preconditions for this narrative.

Returns:
the preconditions for this narrative

getPostconditions

public java.lang.String getPostconditions()
Accessor method to get the postconditions for this narrative.

Returns:
the postconditions for this narrative

getDescription

public java.lang.String getDescription()
Accessor method to get the description for this narrative.

Returns:
the description for this narrative

getExceptions

public java.lang.String getExceptions()
Accessor method to get the exceptions for this narrative.

Returns:
the exceptions for this narrative

getConcerns

public java.lang.String getConcerns()
Accessor method to get the concerns for this narrative.

Returns:
the concerns for this narrative

getActors

public java.lang.String getActors()
Accessor method to get the actors for this narrative.

Returns:
the actors for this narrative

getObjects

public java.lang.String getObjects()
Accessor method to get the objects for this narrative.

Returns:
the objects for this narrative

getDate

public java.lang.String getDate()
Accessor method to get the date for this narrative.

Returns:
the date for this narrative

removeContent

public void removeContent(java.lang.String content,
                          int type)
Mutator method to remove some automatically generated content from the narrative. The first parameter is the string to be removed, and the second parameter indicates what type of content it is, using the static integers in this class.

Parameters:
content - the string to be removed
type - the type of content that is to be removed