Package nl.basjes.parse.useragent.utils
Class Splitter
java.lang.Object
nl.basjes.parse.useragent.utils.Splitter
- Direct Known Subclasses:
ListSplitter,VersionSplitter,WordSplitter
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateSplitList(char[] characters) createSplitList(String characters) intfindEndOfString(char[] chars, int offset) Find the end of the stringintfindNextSplitStart(char[] chars, int offset) Find the start offset of next splitintfindSplitEnd(char[] chars, int startOffset) intfindSplitStart(char[] chars, int split) Find the start offset of splitgetFirstSplits(String value, int split) getSingleSplit(String value, int split) getSingleSplit(String value, List<org.apache.commons.lang3.tuple.Pair<Integer, Integer>> splitList, int split) getSplitRange(String value, int firstSplit, int lastSplit) getSplitRange(String value, List<org.apache.commons.lang3.tuple.Pair<Integer, Integer>> splitList, int first, int last) getSplitRange(String value, List<org.apache.commons.lang3.tuple.Pair<Integer, Integer>> splitList, WordRangeVisitor.Range range) getSplitRange(String value, WordRangeVisitor.Range range) protected abstract booleanisEndOfStringSeparator(char c) protected abstract booleanisSeparator(char c)
-
Constructor Details
-
Splitter
public Splitter()
-
-
Method Details
-
isSeparator
protected abstract boolean isSeparator(char c) -
isEndOfStringSeparator
protected abstract boolean isEndOfStringSeparator(char c) -
findNextSplitStart
public int findNextSplitStart(char[] chars, int offset) Find the start offset of next split- Parameters:
chars- The input in which we are seekingoffset- The start offset from where to seek- Returns:
- The offset of the next split
-
findEndOfString
public int findEndOfString(char[] chars, int offset) Find the end of the string- Parameters:
chars- The input in which we are seekingoffset- The start offset from where to seek- Returns:
- The offset of the last character of the last split.
-
findSplitStart
public int findSplitStart(char[] chars, int split) Find the start offset of split- Parameters:
chars- The input in which we are seekingsplit- The split number for which we are looking for the start- Returns:
- The offset or -1 if it does not exist
-
findSplitEnd
public int findSplitEnd(char[] chars, int startOffset) -
getSingleSplit
-
getSingleSplit
-
getFirstSplits
-
getSplitRange
-
getSplitRange
-
getSplitRange
-
getSplitRange
-
createSplitList
-
createSplitList
-