tools.web
Class LineListSubset
java.lang.Object
tools.web.LineListSubset
public class LineListSubset
- extends java.lang.Object
This static utility class finds a subset of lines within a list of lines. Start
and stop indicators are used to define the subset.
For instance: "contains(blah)*2-4" finds the second line (*2) that contains the
text "blah". The target line is four above this (-4).
If a start indicator is not given, the first line begins the subset. If the stop
indicator is not given, the last line ends the subset.
|
Method Summary |
static int[] |
findStartStop(java.util.List<java.lang.String> lines,
java.lang.String startIndicator,
java.lang.String stopIndicator)
Find the start and stop index defining a subset within a list of lines. |
static void |
main(java.lang.String[] args)
|
static void |
sort(java.util.List<java.lang.String> lines,
java.lang.String sortSpec)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LineListSubset
public LineListSubset()
sort
public static void sort(java.util.List<java.lang.String> lines,
java.lang.String sortSpec)
findStartStop
public static int[] findStartStop(java.util.List<java.lang.String> lines,
java.lang.String startIndicator,
java.lang.String stopIndicator)
- Find the start and stop index defining a subset within a list of lines.
- Parameters:
lines - the list of linesstartIndicator - the start indicator or "" for first-linestopIndicator - the stop indicator or "" for last-line
- Returns:
- an array containing the start and stop indices
main
public static void main(java.lang.String[] args)
throws java.lang.Exception
- Throws:
java.lang.Exception