public class ArrayTypeExtender extends Object
Constructor and Description |
---|
ArrayTypeExtender() |
Modifier and Type | Method and Description |
---|---|
static void |
extend(com.sun.tools.javac.util.Context context,
com.sun.source.tree.CompilationUnitTree compilingClass)
Array types in Java all share the same symbol,
Symtab.arrayClass . |
public static void extend(com.sun.tools.javac.util.Context context, com.sun.source.tree.CompilationUnitTree compilingClass)
Symtab.arrayClass
. For example, int[]
, String[]
,
Foo[]
, and long[][]
all share the same symbol instance. Also, Java has no base type for the array
class; there's no "java.lang.Array" to add extension methods to. Therefore, Manifold provides a substitute type for
the sole purpose of adding extension methods, namely manifold.rt.api.Array
. Extension classes extending
this class effectively extend Java's array class.Copyright © 2024. All rights reserved.