Class Platform


  • @GwtCompatible(emulated=true)
    final class Platform
    extends java.lang.Object
    Methods factored out so that they can be emulated differently in GWT.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private Platform()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) static <T> T[] newArray​(T[] reference, int length)
      Returns a new array of the given length with the same type as a reference array.
      (package private) static MapMaker tryWeakKeys​(MapMaker mapMaker)
      Configures the given map maker to use weak keys, if possible; does nothing otherwise (i.e., in GWT).
      • Methods inherited from class java.lang.Object

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

      • Platform

        private Platform()
    • Method Detail

      • newArray

        static <T> T[] newArray​(T[] reference,
                                int length)
        Returns a new array of the given length with the same type as a reference array.
        Parameters:
        reference - any array of the desired type
        length - the length of the new array
      • tryWeakKeys

        static MapMaker tryWeakKeys​(MapMaker mapMaker)
        Configures the given map maker to use weak keys, if possible; does nothing otherwise (i.e., in GWT). This is sometimes acceptable, when only server-side code could generate enough volume that reclamation becomes important.