|
Keel 2.1RC2 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.keel.models.util.SequenceContext
A simple class an instance of which is stored in the "per user" context when a user is running a "sequence" type model. When a model returns a response with no inputs, control is transferred back to the sequence as of the appropriate sequence number.
| Field Summary | |
static java.lang.String |
CONTEXT_KEY |
private ModelResponse |
currentResponse |
private boolean |
mergeDefault |
private java.lang.String |
modelName |
private int |
seqStepNumseqStepNum is an int that indicates the current step in a sequence. |
private java.lang.String |
sequenceName |
private Configuration[] |
sequenceSteps |
| Constructor Summary | |
SequenceContext()Constructor for SequenceContext. |
|
SequenceContext(java.lang.String theSequenceName, int newSeq) |
|
SequenceContext(java.lang.String theSequenceName, int sequenceStep, Configuration[] children, ModelResponse res)Creates a new SequenceContext, using the passed in parameters to initialize itself. |
|
| Method Summary | |
private java.lang.String |
findModelName(Configuration[] children, int sequenceStep)This method gets the correct child node based on the sequenceStep, and returns the "name" attribute fro mthat node. |
ModelResponse |
getCurrentResponse()Returns the currentResponse. |
int |
getFirstSequenceStep(java.lang.String modelName)This convenience method will return the first sequence step found for a given model name. |
boolean |
getMergeResponsesDefault()Returns the value last set by setMergeDefault(...). |
java.lang.String |
getModelName() |
int |
getSeq()Deprecated. - use getSeqStepNum instead |
int |
getSeqStepNum() |
static SequenceContext |
getSequenceContext(Context context)Gets and returns the sequenceContext for the current sequence, using the context passed in to look up the current sequenceContext. |
static SequenceContext |
getSequenceContext(ModelRequest req)Gets and returns the sequenceContext for the current sequence, using the ModelRequest req to look up the current sequenceContext from the Context. |
java.lang.String |
getSequenceModel()Deprecated. - use getSequenceName() instead |
java.lang.String |
getSequenceName()Returns the name of the sequence |
Configuration[] |
getSequenceSteps() |
static ModelResponse |
mergeResponse(ModelResponse base, ModelResponse layer) |
void |
setCurrentResponse(ModelResponse newResponse)Sets the currentResponse. |
void |
setMergeResponsesDefault(boolean mergeDefault)This method sets the value that will be returned by a call to getMergeDefault() |
void |
setModelName(java.lang.String string) |
void |
setSeq(int seq)Deprecated. - use setSeqStepNum instead |
void |
setSeqStepNum(int i) |
void |
setSequenceModel(java.lang.String sequenceModel)Deprecated. - use setSequenceName instead |
void |
setSequenceName(java.lang.String string) |
void |
setSequenceSteps(Configuration[] configurations) |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final java.lang.String CONTEXT_KEY
private java.lang.String sequenceName
private java.lang.String modelName
private int seqStepNum
private transient ModelResponse currentResponse
private Configuration[] sequenceSteps
private boolean mergeDefault
| Constructor Detail |
public SequenceContext()
public SequenceContext(java.lang.String theSequenceName,
int newSeq)
public SequenceContext(java.lang.String theSequenceName,
int sequenceStep,
Configuration[] children,
ModelResponse res)
theSequenceName -sequenceStep - - one based int which indicates which is the "current" element in the sequence.children - - An array of Configuration elements. Each element in the Configuration[] represents a step in the sequence.res - - The current response object.| Method Detail |
private java.lang.String findModelName(Configuration[] children,
int sequenceStep)
children -sequenceStep -public int getFirstSequenceStep(java.lang.String modelName)
modelName -
public static SequenceContext getSequenceContext(ModelRequest req)
throws ModelException
req -ModelException
public static SequenceContext getSequenceContext(Context context)
throws ModelException
context -ModelExceptionpublic int getSeq()
public java.lang.String getSequenceName()
public java.lang.String getSequenceModel()
public void setSeq(int seq)
public void setSequenceModel(java.lang.String sequenceModel)
public ModelResponse getCurrentResponse()
public void setCurrentResponse(ModelResponse newResponse)
throws ModelException
ModelException
public static ModelResponse mergeResponse(ModelResponse base,
ModelResponse layer)
throws ModelException
ModelExceptionpublic Configuration[] getSequenceSteps()
public void setSequenceSteps(Configuration[] configurations)
configurations -public int getSeqStepNum()
public void setSeqStepNum(int i)
i -public void setSequenceName(java.lang.String string)
string -public void setMergeResponsesDefault(boolean mergeDefault)
mergeDefault -public boolean getMergeResponsesDefault()
public java.lang.String getModelName()
public void setModelName(java.lang.String string)
string -
|
Keel 2.1RC2 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||