Package org.reactfx.util
Class Lists
java.lang.Object
org.reactfx.util.Lists
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
checkIndex
(int index, int size) static void
checkIndex
(int min, int index, int max) static void
checkPosition
(int position, int size) static void
checkPosition
(int min, int position, int max) static void
checkRange
(int from, int to, int size) static void
checkRange
(int min, int from, int to, int max) static int
commonPrefixLength
(List<?> l, List<?> m) commonPrefixSuffixLengths
(List<?> l1, List<?> l2) Returns the lengths of common prefix and common suffix of two lists.static int
commonSuffixLength
(List<?> l, List<?> m) static <E> List
<E> static <E> List
<E> Returns a list that is a concatenation of the given lists.static <E> List
<E> concatView
(List<? extends E>... lists) static <E> List
<E> concatView
(List<List<? extends E>> lists) Returns a list that is a concatenation of the given lists.static boolean
static <E> int
static boolean
isNonEmptyRange
(int from, int to, int size) static boolean
isNonEmptyRange
(int min, int from, int to, int max) static boolean
isProperNonEmptyRange
(int from, int to, int size) static boolean
isProperNonEmptyRange
(int min, int from, int to, int max) static boolean
isProperRange
(int from, int to, int size) static boolean
isProperRange
(int min, int from, int to, int max) static boolean
isStrictlyInsideNonEmptyRange
(int from, int to, int size) static boolean
isStrictlyInsideNonEmptyRange
(int min, int from, int to, int max) static boolean
isStrictlyInsideRange
(int from, int to, int size) static boolean
isStrictlyInsideRange
(int min, int from, int to, int max) static boolean
isValidIndex
(int index, int size) static boolean
isValidIndex
(int min, int index, int max) static boolean
isValidPosition
(int position, int size) static boolean
isValidPosition
(int min, int position, int max) static boolean
isValidRange
(int from, int to, int size) static boolean
isValidRange
(int min, int from, int to, int max) static <E,
F> List <F> mappedView
(List<? extends E> source, Function<? super E, ? extends F> f) static <E> Iterator
<E> readOnlyIterator
(Collection<? extends E> col) static String
-
Constructor Details
-
Lists
private Lists()
-
-
Method Details
-
hashCode
-
equals
-
toString
-
readOnlyIterator
-
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
-
concatView
-
concatView
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
-
concat
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
-
commonSuffixLength
-
commonPrefixSuffixLengths
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.
-