|
JIVE Platform Release 0.3.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.buffalo.cse.jive.ui.search.AbstractJiveSearchQuery edu.buffalo.cse.jive.ui.search.ExecutionHistorySearchQuery edu.buffalo.cse.jive.ui.search.queries.InvariantViolatedSearchQuery
public class InvariantViolatedSearchQuery
An IJiveSearchQuery
that is used to check whether a class invariant
was violated. The check occurs at the return of each method of the class.
The query is capable of checking for invariant violations on a single
instance or over all instances of a class (if an instance number is not
provided).
Nested Class Summary | |
---|---|
protected class |
InvariantViolatedSearchQuery.AssignEventExporter
An exporter used to examine AssignEvent s and to determine if the
event is an assignment to a variable represented by a
JiveSearchPattern . |
Field Summary | |
---|---|
protected InvariantViolatedSearchQuery.AssignEventExporter |
assignmentExporter
An exporter used to examine AssignEvent s. |
protected Map<String,Value> |
instanceToLeftValueMap
A mapping between an instance number and a value currently assigned with the variable of the left search pattern. |
protected Map<String,Value> |
instanceToRightValueMap
A mapping between an instance number and a value currently assigned with the variable of the right search pattern. |
protected JiveSearchPattern |
leftPattern
A search pattern for the invariant's left operand. |
protected RelationalOperator |
operator
The invariant's relational operator. |
protected JiveSearchPattern |
rightPattern
A search pattern for the invariant's right operand. |
Constructor Summary | |
---|---|
InvariantViolatedSearchQuery(JiveSearchPattern leftPattern,
RelationalOperator operator,
JiveSearchPattern rightPattern)
Constructs a new search query with the supplied patterns and relational operator. |
Method Summary | |
---|---|
protected void |
checkForUpdates(AssignEvent event)
Checks if the instance-to-value maps need updating. |
protected boolean |
checkInvariantViolated(MessageSend event)
Checks whether the invariant was violated at the current point in the execution history. |
ImageDescriptor |
getImageDescriptor()
Returns an ImageDescriptor used to represent the search query's
result in the Search view's 'Show Previous Searches' tool bar action. |
String |
getResultLabel(int matchCount)
Returns a label describing the search result used in the Search view. |
Class<? extends Object> |
getResultType()
Returns the type of search result matches collected by the search query. |
void |
visit(EventOccurrence event)
Visits an EventOccurrernce (other than a
MessageSend ). |
void |
visit(MessageSend event)
Visits an occurrence of a MessageSend event. |
Methods inherited from class edu.buffalo.cse.jive.ui.search.ExecutionHistorySearchQuery |
---|
addMatch, performSearch |
Methods inherited from class edu.buffalo.cse.jive.ui.search.AbstractJiveSearchQuery |
---|
canRerun, canRunInBackground, createSearchResult, getLabel, getSearchResult, run |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected InvariantViolatedSearchQuery.AssignEventExporter assignmentExporter
AssignEvent
s.
protected JiveSearchPattern leftPattern
protected RelationalOperator operator
protected JiveSearchPattern rightPattern
protected Map<String,Value> instanceToLeftValueMap
protected Map<String,Value> instanceToRightValueMap
Constructor Detail |
---|
public InvariantViolatedSearchQuery(JiveSearchPattern leftPattern, RelationalOperator operator, JiveSearchPattern rightPattern)
leftPattern
- the left operandoperator
- the relational operatorrightPattern
- the right operandMethod Detail |
---|
public Class<? extends Object> getResultType()
IJiveSearchQuery
NOTE: This will be changed in the future. For now, return Event.class for a result containing matches of mixed event types or return the specific class literal for a result containing matches of a single event type (e.g., AssignEvent.class).
getResultType
in interface IJiveSearchQuery
getResultType
in class ExecutionHistorySearchQuery
public String getResultLabel(int matchCount)
IJiveSearchQuery
matchCount
- the number of matches thus far
public ImageDescriptor getImageDescriptor()
IJiveSearchQuery
ImageDescriptor
used to represent the search query's
result in the Search view's 'Show Previous Searches' tool bar action.
public void visit(EventOccurrence event)
SequenceModel.EventVisitor
EventOccurrernce
(other than a
MessageSend
).
event
- the event occurrence being visitedpublic void visit(MessageSend event)
SequenceModel.EventVisitor
MessageSend
event.
event
- the message send being visitedprotected void checkForUpdates(AssignEvent event)
event
- the event causing a change to a variableprotected boolean checkInvariantViolated(MessageSend event)
ReturnEvent
.
event
- the message send wrapping a return event
true
if the invariant is violated,
false
otherwise
|
JIVE Platform Release 0.3.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |