| java.lang.Object org.jaffa.tools.patternmetaengine.FindSection
FindSection | public class FindSection (Code) | | Class for finding a section of text in a string based on a start and end string
author: PaulE |
FindSection | public FindSection(String source, String startStr, String endStr)(Code) | | Creates a new instance of FindSection
Parameters: source - Text to be searched Parameters: startStr - Start phrase to look for Parameters: endStr - End phrase to look for |
found | public boolean found()(Code) | | Was the section found in source
true if found |
getEndPos | public int getEndPos()(Code) | | Get end position of section. This is the location after the 'end' string's location.
end postion of section, returns -1 if section not found |
getFullSection | public String getFullSection()(Code) | | Get the found section, null if not found
The section text including the start and end strings |
getSection | public String getSection()(Code) | | Get the found section, null if not found
The section text excluding the start and end strings |
getSectionHead | public String getSectionHead()(Code) | | This returns the text that preceeds the found section.
If there is no section found, this returns the source string.
Note: getSectionHead() + getFullSection() + getSectionTail() == source
Header string, null if the section was the first thing in the source string |
getSectionTail | public String getSectionTail()(Code) | | This returns the text that follows the found section.
If there is no section found, this returns null.
Note: getSectionHead() + getFullSection() + getSectionTail() == source
Tail string, null if the section was not found or the last thing in the source string |
getStartPos | public int getStartPos()(Code) | | Get start position of section. This is the location where the 'start string' is found.
start postion of section, returns -1 if section not found |
main | public static void main(String[] args)(Code) | | Test rig
Parameters: args - the command line arguments |
|
|