Search in sources :

Example 1 with CallElement

use of org.iobserve.analysis.userbehavior.data.CallElement in project iobserve-analysis by research-iobserve.

the class BranchModelCreator method setBranchSequence.

/**
 * Sets the passed events as branch sequence of the passed branch. The sequenceStartIndex
 * defines at which position of the passed events the branch sequence starts
 *
 * @param examinedBranch
 *            for that the branchSequence will be set
 * @param events
 *            represent the sequence to set
 * @param sequenceStartIndex
 *            states at which position of the passed events the branch sequence starts
 */
private void setBranchSequence(final Branch examinedBranch, final List<EntryCallEvent> events, final int sequenceStartIndex) {
    final List<ISequenceElement> branchSequence = new ArrayList<>();
    for (int j = sequenceStartIndex; j < events.size(); j++) {
        final EntryCallEvent callEvent = events.get(j);
        final CallElement callElement = new CallElement(callEvent.getClassSignature(), callEvent.getOperationSignature());
        callElement.setAbsoluteCount(1);
        branchSequence.add(callElement);
    }
    final ExitElement exitElement = new ExitElement();
    exitElement.setAbsoluteCount(1);
    branchSequence.add(exitElement);
    examinedBranch.setBranchSequence(branchSequence);
}
Also used : EntryCallEvent(org.iobserve.stages.general.data.EntryCallEvent) CallElement(org.iobserve.analysis.userbehavior.data.CallElement) ISequenceElement(org.iobserve.analysis.userbehavior.data.ISequenceElement) ArrayList(java.util.ArrayList) ExitElement(org.iobserve.analysis.userbehavior.data.ExitElement)

Aggregations

ArrayList (java.util.ArrayList)1 CallElement (org.iobserve.analysis.userbehavior.data.CallElement)1 ExitElement (org.iobserve.analysis.userbehavior.data.ExitElement)1 ISequenceElement (org.iobserve.analysis.userbehavior.data.ISequenceElement)1 EntryCallEvent (org.iobserve.stages.general.data.EntryCallEvent)1