Package org.biojava.bio.program.tagvalue
Class RegexSplitter
- java.lang.Object
-
- org.biojava.bio.program.tagvalue.RegexSplitter
-
- All Implemented Interfaces:
ChangeTable.Splitter
public class RegexSplitter extends Object implements ChangeTable.Splitter
A ValueChanger.Splitter that splits a line of text using a regular expression, returning one value per match.
A list of values is generated by effectively executing:
matcher = pattern.matcher(value.toString()); while(matcher.find()) { values.add(matcher.group(matchGroup); }
- Since:
- 1.3
- Author:
- Matthew Pocock
-
-
Constructor Summary
Constructors Constructor Description RegexSplitter(Pattern pattern, int matchGroup)
Create a new RegexSplitter with a pattern.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List
split(Object value)
Produce a list of values from an old value.
-
-
-
Constructor Detail
-
RegexSplitter
public RegexSplitter(Pattern pattern, int matchGroup)
Create a new RegexSplitter with a pattern.- Parameters:
pattern
- the Pattern used to split valuesmatchGroup
- the group to pull out - use 0 to pull out the whole match
-
-
Method Detail
-
split
public List split(Object value)
Description copied from interface:ChangeTable.Splitter
Produce a list of values from an old value.
It is strongly recommended that this method is re-entrant and does not modify the state of the Splitter in a way that would affect future return -values.
- Specified by:
split
in interfaceChangeTable.Splitter
- Parameters:
value
- the old value Object- Returns:
- a List of value Objects produced by splitting the old value Object
-
-