Package org.reactfx.util
Class Lists
- java.lang.Object
-
- org.reactfx.util.Lists
-
public final class Lists extends java.lang.Object
-
-
Constructor Summary
Constructors Modifier Constructor Description privateLists()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidcheckIndex(int index, int size)static voidcheckIndex(int min, int index, int max)static voidcheckPosition(int position, int size)static voidcheckPosition(int min, int position, int max)static voidcheckRange(int from, int to, int size)static voidcheckRange(int min, int from, int to, int max)static intcommonPrefixLength(java.util.List<?> l, java.util.List<?> m)static Tuple2<java.lang.Integer,java.lang.Integer>commonPrefixSuffixLengths(java.util.List<?> l1, java.util.List<?> l2)Returns the lengths of common prefix and common suffix of two lists.static intcommonSuffixLength(java.util.List<?> l, java.util.List<?> m)static <E> java.util.List<E>concat(java.util.List<? extends E>... lists)static <E> java.util.List<E>concat(java.util.List<java.util.List<? extends E>> lists)Returns a list that is a concatenation of the given lists.static <E> java.util.List<E>concatView(java.util.List<? extends E>... lists)static <E> java.util.List<E>concatView(java.util.List<java.util.List<? extends E>> lists)Returns a list that is a concatenation of the given lists.static booleanequals(java.util.List<?> list, java.lang.Object o)static <E> inthashCode(java.util.List<E> list)static booleanisNonEmptyRange(int from, int to, int size)static booleanisNonEmptyRange(int min, int from, int to, int max)static booleanisProperNonEmptyRange(int from, int to, int size)static booleanisProperNonEmptyRange(int min, int from, int to, int max)static booleanisProperRange(int from, int to, int size)static booleanisProperRange(int min, int from, int to, int max)static booleanisStrictlyInsideNonEmptyRange(int from, int to, int size)static booleanisStrictlyInsideNonEmptyRange(int min, int from, int to, int max)static booleanisStrictlyInsideRange(int from, int to, int size)static booleanisStrictlyInsideRange(int min, int from, int to, int max)static booleanisValidIndex(int index, int size)static booleanisValidIndex(int min, int index, int max)static booleanisValidPosition(int position, int size)static booleanisValidPosition(int min, int position, int max)static booleanisValidRange(int from, int to, int size)static booleanisValidRange(int min, int from, int to, int max)static <E,F>
java.util.List<F>mappedView(java.util.List<? extends E> source, java.util.function.Function<? super E,? extends F> f)static <E> java.util.Iterator<E>readOnlyIterator(java.util.Collection<? extends E> col)static java.lang.StringtoString(java.util.List<?> list)
-
-
-
Method Detail
-
hashCode
public static <E> int hashCode(java.util.List<E> list)
-
equals
public static boolean equals(java.util.List<?> list, java.lang.Object o)
-
toString
public static java.lang.String toString(java.util.List<?> list)
-
readOnlyIterator
public static <E> java.util.Iterator<E> readOnlyIterator(java.util.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> java.util.List<F> mappedView(java.util.List<? extends E> source, java.util.function.Function<? super E,? extends F> f)
-
concatView
@SafeVarargs public static <E> java.util.List<E> concatView(java.util.List<? extends E>... lists)
-
concatView
public static <E> java.util.List<E> concatView(java.util.List<java.util.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> java.util.List<E> concat(java.util.List<? extends E>... lists)
-
concat
public static <E> java.util.List<E> concat(java.util.List<java.util.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 toconcatView(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(java.util.List<?> l, java.util.List<?> m)
-
commonSuffixLength
public static int commonSuffixLength(java.util.List<?> l, java.util.List<?> m)
-
commonPrefixSuffixLengths
public static Tuple2<java.lang.Integer,java.lang.Integer> commonPrefixSuffixLengths(java.util.List<?> l1, java.util.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.
-
-