net.mtu.eggplant.dbc
Class CodeModification

java.lang.Object
  extended bynet.mtu.eggplant.dbc.CodeFragment
      extended bynet.mtu.eggplant.dbc.CodeModification
All Implemented Interfaces:
Comparable

public class CodeModification
extends CodeFragment

Used for representing a modification to code, rather than just a chunck of code to be inserted.

Version:
$Revision: 1.6 $

Constructor Summary
CodeModification(CodePoint start, String searchText, String replaceText, CodeFragmentType type)
           
 
Method Summary
 String getReplaceText()
           
 String getSearchText()
           
 int instrumentLine(int offset, StringBuffer line)
          Instrument the given line.
 
Methods inherited from class net.mtu.eggplant.dbc.CodeFragment
compareTo, equals, getCode, getLocation, getType, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CodeModification

public CodeModification(CodePoint start,
                        String searchText,
                        String replaceText,
                        CodeFragmentType type)
Parameters:
start - the start of the region to modify
searchText - what to find in the region
replaceText - what to replace search with
type - the type of assertion this is
PreConditions
(start != null), (searchText != null), (replaceText != null)
Method Detail

getSearchText

public final String getSearchText()

getReplaceText

public final String getReplaceText()

instrumentLine

public int instrumentLine(int offset,
                          StringBuffer line)
Description copied from class: CodeFragment
Instrument the given line.

Overrides:
instrumentLine in class CodeFragment
Parameters:
offset - how many characters have been added to this line since it was pulled from the file
line - the line to modify
Returns:
the new offset