Class Sublists

java.lang.Object
com.java.pojo.internal.utils.Sublists

public final class Sublists extends Object
  • Method Details

    • subsequences

      public static <T> List<List<T>> subsequences(List<T> list)
      Given a list of objects, return a list of sublists, i-th sublist includes i-th element of the original list and all elements that follow it in the original list. All returned lists are read-only and backed by a copy of the original list, so later changes in the original list will not affect the returned sublists.
      Type Parameters:
      T - the type of list element
      Parameters:
      list - list of objects
      Returns:
      sublists of list