public static <T>T splitEachLine(CharSequence self,Pattern pattern,@ClosureParams(value=FromString.class,options={"List<String>","String[]"},conflictResolutionStrategy=PickFirstResolver.class) Closure<T> closure){
  T result=null;
  for (  String line : new LineIterable(self)) {
    List vals=Arrays.asList(pattern.split(line));
    result=closure.call(vals);
  }
  return result;
}

public static < T > T splitEachLine ( CharSequence self , Pattern pattern , @ ClosureParams ( value = FromString . class , options = { "List<String>" , "String[]" } , conflictResolutionStrategy = PickFirstResolver . class ) Closure < T > closure ) { T result = null ; for ( String line : new LineIterable ( self ) ) { List vals = Arrays . asList ( pattern . split ( line ) ) ; result = closure . call ( vals ) ; } return result ; }
iterates through the given charsequence line by line , splitting each line using the given separator pattern . the list of tokens for each line is then passed to the given closure .
