randoop
Class MSequence

Object
  extended by MSequence

public class MSequence
extends Object

A sequence that can be mutated (unlike a Sequence, which is immutable). The "M" stands for "Mutable".


Field Summary
Modifier and Type Field and Description
 List<MStatement> statements
           
 
Constructor Summary
Constructor and Description
MSequence()
           
 
Method Summary
Modifier and Type Method and Description
 void checkRep()
          Checks the following well-formedness properties for every statement in the list of statements: The number of inputs is the same as the input of inputs specified by the statement kind.
 MStatement getDeclaringStatement(MVariable v)
           
 int getIndex(MVariable v)
           
 List<MVariable> getInputs(int statementIndex)
           
 MStatement getStatement(int i)
           
 StatementKind getStatementKind(int statementIndex)
           
 List<Integer> getUses(MVariable v)
          Returns all the indices of statements where v is an input to the statement.
 MVariable getVariable(int i)
           
 Map<MVariable,MVariable> insert(int index, MSequence seq)
          inserts the statements making up the given sequence into this sequence, at the given index.
 MSequence makeCopy()
           
 int numInfluencingStatements(int maxIdx, List<MVariable> vars)
           
 int size()
           
 String toCodeString()
          A compilable (Java source code) representation of this sequence.
 Sequence toImmutableSequence()
           
 String toString()
           
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

statements

public List<MStatement> statements
Constructor Detail

MSequence

public MSequence()
Method Detail

checkRep

public void checkRep()
Checks the following well-formedness properties for every statement in the list of statements:


makeCopy

public MSequence makeCopy()

getUses

public List<Integer> getUses(MVariable v)
Returns all the indices of statements where v is an input to the statement.


numInfluencingStatements

public int numInfluencingStatements(int maxIdx,
                                    List<MVariable> vars)

toString

public String toString()
Overrides:
toString in class Object

getDeclaringStatement

public MStatement getDeclaringStatement(MVariable v)

getStatement

public MStatement getStatement(int i)

getIndex

public int getIndex(MVariable v)

size

public int size()

getVariable

public MVariable getVariable(int i)

toImmutableSequence

public Sequence toImmutableSequence()

toCodeString

public String toCodeString()
A compilable (Java source code) representation of this sequence.


insert

public Map<MVariable,MVariable> insert(int index,
                                       MSequence seq)
inserts the statements making up the given sequence into this sequence, at the given index. The parameter sequence is left unchanged. The receiver sequence is mutated. For convenience, returns a mapping from variables in the parameter sequence to their corresponding variables in the modified receiver sequence.

Parameters:
index - The index at which to insert the given sequence.
seq - The sequence to insert.
Returns:
A mapping from variables in the parameter sequence to their corresponding variables in this sequence.

getInputs

public List<MVariable> getInputs(int statementIndex)

getStatementKind

public StatementKind getStatementKind(int statementIndex)