Klasse PairList<LeftT,RightT>
java.lang.Object
java.util.AbstractCollection<Pair<LeftT,RightT>>
java.util.AbstractList<Pair<LeftT,RightT>>
java.util.AbstractSequentialList<Pair<LeftT,RightT>>
java.util.LinkedList<Pair<LeftT,RightT>>
de.kamillionlabs.hateoflux.utility.pair.PairList<LeftT,RightT>
- Typparameter:
LeftT- the type of the left elements in the pairsRightT- the type of the right elements in the pairs
- Alle implementierten Schnittstellen:
Serializable,Cloneable,Iterable<Pair<LeftT,,RightT>> Collection<Pair<LeftT,,RightT>> Deque<Pair<LeftT,,RightT>> List<Pair<LeftT,,RightT>> Queue<Pair<LeftT,,RightT>> SequencedCollection<Pair<LeftT,RightT>>
A specialized list implementation that stores pairs of values.
Ordered collection of Pair objects, where each pair consists of a left element of type LeftT and a
right element of type RightT.
Use PairList when you need to manage an ordered sequence of related pairs without the constraints
of key-based collections like maps. This is particularly useful for scenarios where duplicate left elements
are permissible or when the relationship between elements doesn't fit a key-value paradigm.
- Siehe auch:
-
Feldübersicht
Von Klasse geerbte Felder java.util.AbstractList
modCount -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungbooleanAdds a new pair to the list.getLeft(int i) Retrieves the left element of the pair at the specified index.getLefts()Returns a list of all left elements in the pairs.getRight(int i) Retrieves the right element of the pair at the specified index.Returns a list of all right elements in the pairs.static <LeftT,RightT>
PairList<LeftT, RightT> of()Creates an emptyPairList.static <LeftT,RightT>
PairList<LeftT, RightT> Creates aPairListfrom a list of pairs.static <LeftT,RightT>
PairList<LeftT, RightT> Creates aPairListfrom two lists of left and right elements.static <LeftT,RightT>
PairList<LeftT, RightT> Creates aPairListfrom a map of left and right elements.static <LeftT,RightT>
PairList<LeftT, RightT> of(LeftT l1, RightT r1) Creates aPairListwith a single pair.static <LeftT,RightT>
PairList<LeftT, RightT> of(LeftT l1, RightT r1, LeftT l2, RightT r2) Creates aPairListwith two pairs.static <LeftT,RightT>
PairList<LeftT, RightT> of(LeftT l1, RightT r1, LeftT l2, RightT r2, LeftT l3, RightT r3) Creates aPairListwith three pairs.static <LeftT,RightT>
PairList<LeftT, RightT> of(LeftT l1, RightT r1, LeftT l2, RightT r2, LeftT l3, RightT r3, LeftT l4, RightT r4) Creates aPairListwith four pairs.static <LeftT,RightT>
PairList<LeftT, RightT> of(LeftT l1, RightT r1, LeftT l2, RightT r2, LeftT l3, RightT r3, LeftT l4, RightT r4, LeftT l5, RightT r5) Creates aPairListwith five pairs.static <LeftT,RightT>
PairList<LeftT, RightT> of(LeftT l1, RightT r1, LeftT l2, RightT r2, LeftT l3, RightT r3, LeftT l4, RightT r4, LeftT l5, RightT r5, LeftT l6, RightT r6) Creates aPairListwith six pairs.static <LeftT,RightT>
PairList<LeftT, RightT> of(LeftT l1, RightT r1, LeftT l2, RightT r2, LeftT l3, RightT r3, LeftT l4, RightT r4, LeftT l5, RightT r5, LeftT l6, RightT r6, LeftT l7, RightT r7) Creates aPairListwith seven pairs.static <LeftT,RightT>
PairList<LeftT, RightT> of(LeftT l1, RightT r1, LeftT l2, RightT r2, LeftT l3, RightT r3, LeftT l4, RightT r4, LeftT l5, RightT r5, LeftT l6, RightT r6, LeftT l7, RightT r7, LeftT l8, RightT r8) Creates aPairListwith eight pairs.static <LeftT,RightT>
PairList<LeftT, RightT> of(LeftT l1, RightT r1, LeftT l2, RightT r2, LeftT l3, RightT r3, LeftT l4, RightT r4, LeftT l5, RightT r5, LeftT l6, RightT r6, LeftT l7, RightT r7, LeftT l8, RightT r8, LeftT l9, RightT r9) Creates aPairListwith nine pairs.static <LeftT,RightT>
PairList<LeftT, RightT> of(LeftT l1, RightT r1, LeftT l2, RightT r2, LeftT l3, RightT r3, LeftT l4, RightT r4, LeftT l5, RightT r5, LeftT l6, RightT r6, LeftT l7, RightT r7, LeftT l8, RightT r8, LeftT l9, RightT r9, LeftT l10, RightT r10) Creates aPairListwith ten pairs.Von Klasse geerbte Methoden java.util.LinkedList
add, add, addAll, addAll, addFirst, addLast, clear, clone, contains, descendingIterator, element, get, getFirst, getLast, indexOf, lastIndexOf, listIterator, offer, offerFirst, offerLast, peek, peekFirst, peekLast, poll, pollFirst, pollLast, pop, push, remove, remove, remove, removeFirst, removeFirstOccurrence, removeLast, removeLastOccurrence, reversed, set, size, spliterator, toArray, toArrayVon Klasse geerbte Methoden java.util.AbstractSequentialList
iteratorVon Klasse geerbte Methoden java.util.AbstractList
equals, hashCode, listIterator, removeRange, subListVon Klasse geerbte Methoden java.util.AbstractCollection
containsAll, isEmpty, removeAll, retainAll, toStringVon Klasse geerbte Methoden java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitVon Schnittstelle geerbte Methoden java.util.Collection
parallelStream, removeIf, stream, toArrayVon Schnittstelle geerbte Methoden java.util.List
containsAll, equals, hashCode, isEmpty, iterator, listIterator, removeAll, replaceAll, retainAll, sort, subList
-
Methodendetails
-
toPairFlux
-
add
Adds a new pair to the list.- Parameter:
left- the left element of the pairright- the right element of the pair- Gibt zurück:
true(as specified byCollection.add(E))
-
getLeft
Retrieves the left element of the pair at the specified index.- Parameter:
i- the index of the pair- Gibt zurück:
- the left element of the pair at the specified index
-
getRight
Retrieves the right element of the pair at the specified index.- Parameter:
i- the index of the pair- Gibt zurück:
- the right element of the pair at the specified index
-
getLefts
Returns a list of all left elements in the pairs.- Gibt zurück:
- a list containing all left elements
-
getRights
Returns a list of all right elements in the pairs.- Gibt zurück:
- a list containing all right elements
-
of
Creates an emptyPairList.- Typparameter:
LeftT- the type of the left elements in the pairsRightT- the type of the right elements in the pairs- Gibt zurück:
- a new empty
PairList
-
of
Creates aPairListfrom a list of pairs.- Typparameter:
LeftT- the type of the left elements in the pairsRightT- the type of the right elements in the pairs- Parameter:
pairs- the list of pairs- Gibt zurück:
- a new
PairListcontaining the specified pairs
-
of
Creates aPairListfrom two lists of left and right elements.- Typparameter:
LeftT- the type of the left elements in the pairsRightT- the type of the right elements in the pairs- Parameter:
lefts- the list of left elementsrights- the list of right elements- Gibt zurück:
- a new
PairListcontaining pairs formed from the given lists - Löst aus:
IllegalArgumentException- if the lists are null or of different sizes
-
of
Creates aPairListfrom a map of left and right elements.- Typparameter:
LeftT- the type of the left elements in the pairsRightT- the type of the right elements in the pairs- Parameter:
pairs- the map containing pairs of left and right elements- Gibt zurück:
- a new
PairListcontaining pairs from the map
-
of
Creates aPairListwith a single pair.- Typparameter:
LeftT- the type of the left elements in the pairsRightT- the type of the right elements in the pairs- Parameter:
l1- the left element of the first pairr1- the right element of the first pair- Gibt zurück:
- a new
PairListcontaining the specified pair
-
of
Creates aPairListwith two pairs.- Typparameter:
LeftT- the type of the left elements in the pairsRightT- the type of the right elements in the pairs- Parameter:
l1- the left element of the first pairr1- the right element of the first pairl2- the left element of the second pairr2- the right element of the second pair- Gibt zurück:
- a new
PairListcontaining the specified pairs
-
of
public static <LeftT,RightT> PairList<LeftT,RightT> of(LeftT l1, RightT r1, LeftT l2, RightT r2, LeftT l3, RightT r3) Creates aPairListwith three pairs.- Typparameter:
LeftT- the type of the left elements in the pairsRightT- the type of the right elements in the pairs- Parameter:
l1- the left element of the first pairr1- the right element of the first pairl2- the left element of the second pairr2- the right element of the second pairl3- the left element of the third pairr3- the right element of the third pair- Gibt zurück:
- a new
PairListcontaining the specified pairs
-
of
public static <LeftT,RightT> PairList<LeftT,RightT> of(LeftT l1, RightT r1, LeftT l2, RightT r2, LeftT l3, RightT r3, LeftT l4, RightT r4) Creates aPairListwith four pairs.- Typparameter:
LeftT- the type of the left elements in the pairsRightT- the type of the right elements in the pairs- Parameter:
l1- the left element of the first pairr1- the right element of the first pairl2- the left element of the second pairr2- the right element of the second pairl3- the left element of the third pairr3- the right element of the third pairl4- the left element of the fourth pairr4- the right element of the fourth pair- Gibt zurück:
- a new
PairListcontaining the specified pairs
-
of
public static <LeftT,RightT> PairList<LeftT,RightT> of(LeftT l1, RightT r1, LeftT l2, RightT r2, LeftT l3, RightT r3, LeftT l4, RightT r4, LeftT l5, RightT r5) Creates aPairListwith five pairs.- Typparameter:
LeftT- the type of the left elements in the pairsRightT- the type of the right elements in the pairs- Parameter:
l1- the left element of the first pairr1- the right element of the first pairl2- the left element of the second pairr2- the right element of the second pairl3- the left element of the third pairr3- the right element of the third pairl4- the left element of the fourth pairr4- the right element of the fourth pairl5- the left element of the fifth pairr5- the right element of the fifth pair- Gibt zurück:
- a new
PairListcontaining the specified pairs
-
of
public static <LeftT,RightT> PairList<LeftT,RightT> of(LeftT l1, RightT r1, LeftT l2, RightT r2, LeftT l3, RightT r3, LeftT l4, RightT r4, LeftT l5, RightT r5, LeftT l6, RightT r6) Creates aPairListwith six pairs.- Typparameter:
LeftT- the type of the left elements in the pairsRightT- the type of the right elements in the pairs- Parameter:
l1- the left element of the first pairr1- the right element of the first pairl2- the left element of the second pairr2- the right element of the second pairl3- the left element of the third pairr3- the right element of the third pairl4- the left element of the fourth pairr4- the right element of the fourth pairl5- the left element of the fifth pairr5- the right element of the fifth pairl6- the left element of the sixth pairr6- the right element of the sixth pair- Gibt zurück:
- a new
PairListcontaining the specified pairs
-
of
public static <LeftT,RightT> PairList<LeftT,RightT> of(LeftT l1, RightT r1, LeftT l2, RightT r2, LeftT l3, RightT r3, LeftT l4, RightT r4, LeftT l5, RightT r5, LeftT l6, RightT r6, LeftT l7, RightT r7) Creates aPairListwith seven pairs.- Typparameter:
LeftT- the type of the left elements in the pairsRightT- the type of the right elements in the pairs- Parameter:
l1- the left element of the first pairr1- the right element of the first pairl2- the left element of the second pairr2- the right element of the second pairl3- the left element of the third pairr3- the right element of the third pairl4- the left element of the fourth pairr4- the right element of the fourth pairl5- the left element of the fifth pairr5- the right element of the fifth pairl6- the left element of the sixth pairr6- the right element of the sixth pairl7- the left element of the seventh pairr7- the right element of the seventh pair- Gibt zurück:
- a new
PairListcontaining the specified pairs
-
of
public static <LeftT,RightT> PairList<LeftT,RightT> of(LeftT l1, RightT r1, LeftT l2, RightT r2, LeftT l3, RightT r3, LeftT l4, RightT r4, LeftT l5, RightT r5, LeftT l6, RightT r6, LeftT l7, RightT r7, LeftT l8, RightT r8) Creates aPairListwith eight pairs.- Typparameter:
LeftT- the type of the left elements in the pairsRightT- the type of the right elements in the pairs- Parameter:
l1- the left element of the first pairr1- the right element of the first pairl2- the left element of the second pairr2- the right element of the second pairl3- the left element of the third pairr3- the right element of the third pairl4- the left element of the fourth pairr4- the right element of the fourth pairl5- the left element of the fifth pairr5- the right element of the fifth pairl6- the left element of the sixth pairr6- the right element of the sixth pairl7- the left element of the seventh pairr7- the right element of the seventh pairl8- the left element of the eighth pairr8- the right element of the eighth pair- Gibt zurück:
- a new
PairListcontaining the specified pairs
-
of
public static <LeftT,RightT> PairList<LeftT,RightT> of(LeftT l1, RightT r1, LeftT l2, RightT r2, LeftT l3, RightT r3, LeftT l4, RightT r4, LeftT l5, RightT r5, LeftT l6, RightT r6, LeftT l7, RightT r7, LeftT l8, RightT r8, LeftT l9, RightT r9) Creates aPairListwith nine pairs.- Typparameter:
LeftT- the type of the left elements in the pairsRightT- the type of the right elements in the pairs- Parameter:
l1- the left element of the first pairr1- the right element of the first pairl2- the left element of the second pairr2- the right element of the second pairl3- the left element of the third pairr3- the right element of the third pairl4- the left element of the fourth pairr4- the right element of the fourth pairl5- the left element of the fifth pairr5- the right element of the fifth pairl6- the left element of the sixth pairr6- the right element of the sixth pairl7- the left element of the seventh pairr7- the right element of the seventh pairl8- the left element of the eighth pairr8- the right element of the eighth pairl9- the left element of the ninth pairr9- the right element of the ninth pair- Gibt zurück:
- a new
PairListcontaining the specified pairs
-
of
public static <LeftT,RightT> PairList<LeftT,RightT> of(LeftT l1, RightT r1, LeftT l2, RightT r2, LeftT l3, RightT r3, LeftT l4, RightT r4, LeftT l5, RightT r5, LeftT l6, RightT r6, LeftT l7, RightT r7, LeftT l8, RightT r8, LeftT l9, RightT r9, LeftT l10, RightT r10) Creates aPairListwith ten pairs.- Typparameter:
LeftT- the type of the left elements in the pairsRightT- the type of the right elements in the pairs- Parameter:
l1- the left element of the first pairr1- the right element of the first pairl2- the left element of the second pairr2- the right element of the second pairl3- the left element of the third pairr3- the right element of the third pairl4- the left element of the fourth pairr4- the right element of the fourth pairl5- the left element of the fifth pairr5- the right element of the fifth pairl6- the left element of the sixth pairr6- the right element of the sixth pairl7- the left element of the seventh pairr7- the right element of the seventh pairl8- the left element of the eighth pairr8- the right element of the eighth pairl9- the left element of the ninth pairr9- the right element of the ninth pairl10- the left element of the tenth pairr10- the right element of the tenth pair- Gibt zurück:
- a new
PairListcontaining the specified pairs
-