Add List.bounds()

This commit is contained in:
Reinhard Pointner 2016-12-22 20:32:44 +08:00
parent 22da08544c
commit 6090fab9eb
1 changed files with 5 additions and 0 deletions

View File

@ -28,6 +28,7 @@ import java.util.regex.Pattern;
import java.util.stream.IntStream;
import java.util.stream.Stream;
import org.codehaus.groovy.runtime.DefaultGroovyMethods;
import org.codehaus.groovy.runtime.typehandling.DefaultTypeTransformation;
import com.ibm.icu.text.Transliterator;
@ -543,6 +544,10 @@ public class ExpressionFormatMethods {
return concat(self, other);
}
public static List<?> bounds(Iterable<?> self) {
return asList(DefaultGroovyMethods.min(self), DefaultGroovyMethods.max(self));
}
/**
* Episode utilities (EXPERIMENTAL)
*/