Package fmpp.tdd

Class Fragment

java.lang.Object
fmpp.tdd.Fragment

public class Fragment extends Object
Fragment extracted from a TDD expression.
  • Constructor Details

    • Fragment

      public Fragment(String text, int fragmentStart, int fragmentEnd, String fileName)
      Creates new TDD fragment.
      Parameters:
      text - the full TDD text that contains the fragment. (In extreme case the fragment and the full text is the same.)
      fragmentStart - the start index of the fragment in the text.
      fragmentEnd - the start index of the fragment in the text
      fileName - the name of the file the text comes from (for informational purposes only). It can be null if the source file is unknown or there is no source file.
  • Method Details

    • getFileName

      public String getFileName()
      Returns the name of the file the text comes from (for informational purposes only). It can be null if the source file is unknown or there is no source file.
    • getText

      public String getText()
      Returns the full TDD text that contains the fragmet.
    • getFragmentStart

      public int getFragmentStart()
      Returns the start index of the fragment in the text.
    • getFragmentEnd

      public int getFragmentEnd()
      Returns the end index (exclusive) of the fragment in the text.
    • toString

      public String toString()
      Returns the fragment text.
      Overrides:
      toString in class Object