Package manifold.rt.api
Class Array
- java.lang.Object
-
- manifold.rt.api.Array
-
public final class Array extends Object
Container for Java array type extensions. An extension class that extends this class effectively extends all Java array types such as:Object[],String[],int[],int[][], etc. Note the@Thisparameter must be declared as typeObjectsince both reference and primitive component types apply.
Seepackage myproject.extensions.manifold.rt.api.Array; import java.lang.reflect.Array; import manifold.ext.rt.api.Extension; import manifold.ext.rt.api.This; @Extension public class MyArrayExtension { public static final String myMethod(@This Object array) { return "Size of array: " + Array.getLength(array); } } // usage String[] strings = new String[] {"a", "b", "c"}; strings.myMethod();manifold.ext.rt.extensions.manifold.rt.api.Array.ManArrayExtfor implementations of builtin Array extension methods.