Class Lists

java.lang.Object
org.reactfx.util.Lists

public final class Lists extends Object
  • Constructor Details

    • Lists

      private Lists()
  • Method Details

    • hashCode

      public static <E> int hashCode(List<E> list)
    • equals

      public static boolean equals(List<?> list, Object o)
    • toString

      public static String toString(List<?> list)
    • readOnlyIterator

      public static <E> Iterator<E> readOnlyIterator(Collection<? extends E> col)
    • isValidIndex

      public static boolean isValidIndex(int index, int size)
    • isValidIndex

      public static boolean isValidIndex(int min, int index, int max)
    • checkIndex

      public static void checkIndex(int index, int size)
    • checkIndex

      public static void checkIndex(int min, int index, int max)
    • isValidPosition

      public static boolean isValidPosition(int position, int size)
    • isValidPosition

      public static boolean isValidPosition(int min, int position, int max)
    • checkPosition

      public static void checkPosition(int position, int size)
    • checkPosition

      public static void checkPosition(int min, int position, int max)
    • isValidRange

      public static boolean isValidRange(int from, int to, int size)
    • isValidRange

      public static boolean isValidRange(int min, int from, int to, int max)
    • checkRange

      public static void checkRange(int from, int to, int size)
    • checkRange

      public static void checkRange(int min, int from, int to, int max)
    • isNonEmptyRange

      public static boolean isNonEmptyRange(int from, int to, int size)
    • isNonEmptyRange

      public static boolean isNonEmptyRange(int min, int from, int to, int max)
    • isProperRange

      public static boolean isProperRange(int from, int to, int size)
    • isProperRange

      public static boolean isProperRange(int min, int from, int to, int max)
    • isProperNonEmptyRange

      public static boolean isProperNonEmptyRange(int from, int to, int size)
    • isProperNonEmptyRange

      public static boolean isProperNonEmptyRange(int min, int from, int to, int max)
    • isStrictlyInsideRange

      public static boolean isStrictlyInsideRange(int from, int to, int size)
    • isStrictlyInsideRange

      public static boolean isStrictlyInsideRange(int min, int from, int to, int max)
    • isStrictlyInsideNonEmptyRange

      public static boolean isStrictlyInsideNonEmptyRange(int from, int to, int size)
    • isStrictlyInsideNonEmptyRange

      public static boolean isStrictlyInsideNonEmptyRange(int min, int from, int to, int max)
    • mappedView

      public static <E, F> List<F> mappedView(List<? extends E> source, Function<? super E,? extends F> f)
    • concatView

      @SafeVarargs public static <E> List<E> concatView(List<? extends E>... lists)
    • concatView

      public static <E> List<E> concatView(List<List<? extends E>> lists)
      Returns a list that is a concatenation of the given lists. The returned list is a view of the underlying lists, without copying the elements. The returned list is unmodifiable. Modifications to underlying lists will be visible through the concatenation view.
    • concat

      @SafeVarargs public static <E> List<E> concat(List<? extends E>... lists)
    • concat

      public static <E> List<E> concat(List<List<? extends E>> lists)
      Returns a list that is a concatenation of the given lists. The returned list is a view of the underlying lists, without copying the elements. As opposed to concatView(List), the underlying lists must not be modified while the returned concatenation view is in use. On the other hand, this method guarantees balanced nesting if some of the underlying lists are already concatenations created by this method.
    • commonPrefixLength

      public static int commonPrefixLength(List<?> l, List<?> m)
    • commonSuffixLength

      public static int commonSuffixLength(List<?> l, List<?> m)
    • commonPrefixSuffixLengths

      public static Tuple2<Integer,Integer> commonPrefixSuffixLengths(List<?> l1, List<?> l2)
      Returns the lengths of common prefix and common suffix of two lists. The total of the two lengths returned is not greater than either of the list sizes. Prefix is prioritized: for lists [a, b, a, b], [a, b] returns (2, 0); although the two lists have a common suffix of length 2, the length of the second list is already included in the length of the common prefix.