Package org.openrefine.operations.utils
Interface CellValueSplitter
-
- All Superinterfaces:
Serializable
public interface CellValueSplitter extends Serializable
Provides different ways to split a cell value into multiple strings.- Author:
- Antonin Delpeuch
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static CellValueSplitterconstruct(ColumnSplitOperation.Mode mode, String separator, Boolean regex, int[] fieldLengths, Integer maxColumns)Constructs a CellValueSplitter according to the supplied settings.List<String>split(String source)static CellValueSplittersplitByLengths(int[] lengths)static CellValueSplittersplitByRegex(Pattern regex, int maxColumns)static CellValueSplittersplitBySeparator(String separator, int maxColumns)
-
-
-
Method Detail
-
construct
static CellValueSplitter construct(ColumnSplitOperation.Mode mode, String separator, Boolean regex, int[] fieldLengths, Integer maxColumns)
Constructs a CellValueSplitter according to the supplied settings.- Parameters:
mode- whether to split by separator or fixed lengthsseparator- the separator to use (set to null if using lengths)regex- whether to interpret the separator as a regular expressionfieldLengths- the lengths of the fields to extract (set to null if using a separator)maxColumns- the maximum number of values to extract (ignored for lengths)
-
splitByLengths
static CellValueSplitter splitByLengths(int[] lengths)
-
splitBySeparator
static CellValueSplitter splitBySeparator(String separator, int maxColumns)
-
splitByRegex
static CellValueSplitter splitByRegex(Pattern regex, int maxColumns)
-
-