Class ArrayTypeExtender

java.lang.Object
manifold.internal.javac.ArrayTypeExtender

public class ArrayTypeExtender extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ArrayTypeExtender

      public ArrayTypeExtender()
  • Method Details

    • extend

      public 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. 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.