类 $

java.lang.Object
cool.scx.common.util.$

public final class $ extends Object
未分类方法
  • 构造器详细资料

    • $

      public $()
  • 方法详细资料

    • sleep

      public static void sleep(long millis)
    • setTimeout

      public static Thread setTimeout(Runnable r, long l)
      延时执行代码 , 这种简单的方式 相比 ScheduledExecutorService , 一般能实现更低的内存占用
      参数:
      r - 待运行的内容
      l - 延时 (毫秒)
      返回:
      虚拟线程 可用 interrupt 实现终止
    • async

      public static CompletableFuture<Void> async(ScxRunnable<?> runnable)
    • async

      public static <T> CompletableFuture<T> async(Callable<T> callable)
    • await

      public static <T> T await(CompletableFuture<T> promise) throws Throwable
      抛出:
      Throwable
    • groupingBy

      public static <K, T> MultiMap<K,T> groupingBy(Iterable<T> list, Function<? super T,? extends K> keyFn)
    • groupingBy

      public static <K, V, T> MultiMap<K,V> groupingBy(Iterable<T> list, Function<? super T,? extends K> keyFn, Function<? super T,? extends V> valueFn)