| java.lang.Object org.jaffa.util.SplitString
SplitString | public class SplitString (Code) | | This class splits a String based on a separator. It then sets the prefix and suffix.
|
Constructor Summary | |
public | SplitString(String source, String separator) Creates an instance with the source String and separator. | public | SplitString(String source, String separator, boolean findFirst) Creates an instance with the source String and separator. |
Method Summary | |
public String | getPrefix() Returns the prefix String that was created as a result of the split. | public String | getSuffix() Returns the suffix String that was created as a result of the split. | public boolean | isValid() The definition of a valid split is one where either there was
no split in the string, or the splitter resulted in two new
strings. |
SplitString | public SplitString(String source, String separator)(Code) | | Creates an instance with the source String and separator. The source String will be split based on the separator.
This a short hand version of SplitString(source, separator, true)
Parameters: source - The source String. Parameters: separator - The separator used for splitting the source String. |
SplitString | public SplitString(String source, String separator, boolean findFirst)(Code) | | Creates an instance with the source String and separator. The source String will be split based on the separator.
Parameters: source - The source String. Parameters: separator - The separator used for splitting the source String. Parameters: findFirst - If true splits based on first occurence of seperator, if falsesplit is done on the last occurence. |
getPrefix | public String getPrefix()(Code) | | Returns the prefix String that was created as a result of the split.
the prefix String that was created as a result of the split. |
getSuffix | public String getSuffix()(Code) | | Returns the suffix String that was created as a result of the split.
the suffix String that was created as a result of the split. |
isValid | public boolean isValid()(Code) | | The definition of a valid split is one where either there was
no split in the string, or the splitter resulted in two new
strings. (i.e the separator should not start or end the string)
a true if the split is valid. |
|
|