public static enum C.F extends Enum<C.F>
the namespace of function definitions relevant to Collection manipulation
| Modifier and Type | Method and Description |
|---|---|
static <L extends C.List<? super T>,T> |
add(int index,
T element)
Returns a function that add specified element into the argument list at specified position.
|
static <T> Lang.Predicate<Collection<? super T>> |
add(T element)
Returns a function that add the specified element into the argument collection and return
true if add successfully or false otherwise |
static <T> Lang.Predicate<Collection<? super T>> |
addAll(Collection<? extends T> source)
Returns a function that add all elements in the source collection specified into the destination collection as argument.
|
static <T> Lang.Predicate<C.List<? super T>> |
addAll(int index,
Collection<? extends T> source)
Returns a function that add all elements from the source collection specified into the argument list at the position specified
|
static <T> Lang.Predicate<Iterable<? extends T>> |
addAllTo(Collection<? super T> destination)
Returns a function that takes argument of type
Collection and add all elements inside into the specified collection. |
static <T> Lang.Predicate<Collection<? extends T>> |
addAllTo(int index,
C.List<? super T> destination)
Returns a function that add all elements from the argument collection into the destination list specified at the position specified
|
static <T> Lang.Predicate<T> |
addTo(Collection<? super T> destination)
Returns a function that add the argument to a collection specified and returns
true if added successfully or false otherwise |
static <L extends C.List<? super T>,T> |
addTo(int index,
L destination)
Returns a function that add the argument into the specified list at specified position.
|
static <T> Lang.Predicate<Collection<? extends T>> |
allContainsIn(Collection<? super T> collection)
Returns a predicate function that check if all element in the argument (a collection) contained in the collection specified
|
static <T> Lang.F1<T,C.Sequence<? super T>> |
appendTo(C.Sequence<? super T> sequence)
Returns a function that append the argument to a
C.Sequence specified |
static <T> Lang.F1<T,Deque<? super T>> |
appendTo(Deque<? super T> deque)
Returns a function that append the argument to a
Deque specified |
static <T> Lang.Transformer<Iterable<T>,Collection<T>> |
asCollection() |
static <T> Lang.Predicate<Collection<? super T>> |
contains(T element)
Returns a predicate function that check if the argument (collection) contains the element specified
|
static <T> Lang.Predicate<Collection<? super T>> |
containsAll(Collection<? extends T> collection)
Returns a predicate function that check if all element in the collection specified are contained in the argument collection
|
static <T> Lang.Predicate<T> |
containsIn(Collection<? super T> collection)
Returns a predicate function that check if the argument is contained in the collection specified
|
static <T> Lang.Processor<Deque<? super T>> |
dequeAppend(T element)
Returns a function that append specified element to argument deque
|
static <T> Lang.Processor<Deque<? super T>> |
dequePrepend(T element)
Returns a function that prepend specified element to argument deque
|
static <T> Lang.F1<Iterable<? extends T>,Void> |
forEachIterable(Lang.Visitor<? super T> visitor)
Returns a function that apply the visitor function specified on the argument (iterable)
|
static <T> Lang.F1<T,C.Sequence<? super T>> |
prependTo(C.Sequence<? super T> sequence)
Returns a function that prepend the argument to a
C.Sequence specified |
static <T> Lang.F1<T,Deque<? super T>> |
prependTo(Deque<? super T> deque)
Returns a function that prepend an element to a deque specified and return the deque instance
|
static <T> Lang.Predicate<Collection<? super T>> |
remove(T toBeRemoved)
Returns a function that remove the element specified from the argument collection.
|
static <T> Lang.Predicate<Collection<? super T>> |
removeAll(Collection<? extends T> source)
Returns a function that remove all elements in the
source collection from the argument collection. |
static <T> Lang.Predicate<Collection<? extends T>> |
removeAllFrom(Collection<? super T> fromCollection)
Returns a function that remove all elements in the argument collection from the
fromCollection specified. |
static <T> Lang.Predicate<T> |
removeFrom(Collection<? super T> collection)
Returns a function that remove the argument from a collection specified.
|
static <T> Lang.Predicate<Collection<? super T>> |
retainAll(Collection<? extends T> collection)
Returns a function that retains only elements contained in the specified collection in the argument collection.
|
static <T> Lang.Predicate<Collection<? extends T>> |
retainAllIn(Collection<? super T> collection)
Returns a function that retains only elements contained in the argument collection in the collection specified.
|
static <T> Lang.Processor<C.Sequence<? super T>> |
sequenceAppend(T element)
Returns a function that append specified element to argument sequence
|
static <T> Lang.Processor<C.Sequence<? super T>> |
sequencePrepend(T element)
Returns a function that preppend specified element to argument sequence
|
static C.F |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static C.F[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static C.F[] values()
for (C.F c : C.F.values()) System.out.println(c);
public static C.F valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic static <T> Lang.Transformer<Iterable<T>,Collection<T>> asCollection()
public static <T> Lang.Predicate<T> containsIn(Collection<? super T> collection)
Returns a predicate function that check if the argument is contained in the collection specified
T - the generic type of the element of the collectioncollection - the collection to be checked on against the argument when applying the prediateCollection.contains(Object),
contains(Object)public static <T> Lang.Predicate<Collection<? super T>> contains(T element)
Returns a predicate function that check if the argument (collection) contains the element specified
T - the type of the elementelement - the element to be checkedCollection.contains(Object),
containsIn(Collection)public static <T> Lang.Predicate<Collection<? extends T>> allContainsIn(Collection<? super T> collection)
Returns a predicate function that check if all element in the argument (a collection) contained in the collection specified
T - the generic type of the element of the collection or argumentcollection - the collection to be checked on against all elements in the argument when applying the functionCollection.containsAll(Collection),
containsAll(Collection)public static <T> Lang.Predicate<Collection<? super T>> containsAll(Collection<? extends T> collection)
Returns a predicate function that check if all element in the collection specified are contained in the argument collection
T - the element typecollection - the collection in which all elements will be checked if contained in the argument collection when applying the functionCollection.containsAll(Collection),
allContainsIn(Collection)public static <T> Lang.Predicate<T> addTo(Collection<? super T> destination)
Returns a function that add the argument to a collection specified and returns true if added successfully or false otherwise
T - the generic type of the collection elementsdestination - the collection into which the argument to be addedCollection.add(Object),
add(Object)public static <T> Lang.Predicate<Collection<? super T>> add(T element)
Returns a function that add the specified element into the argument collection and return true if add successfully or false otherwise
T - the element typeelement - the element to be added when applying the functionCollection.add(Object),
addTo(Collection)public static <L extends C.List<? super T>,T> Lang.F1<T,L> addTo(int index, L destination)
Returns a function that add the argument into the specified list at specified position. the function returns true if added successfully or false otherwise
L - the generic type of the listT - the generic type of the list elementdestination - a list into which the argument to be addedindex - specify the position where the argument can be addedList.add(int, Object),
add(int, Object)public static <L extends C.List<? super T>,T> Lang.F1<L,L> add(int index, T element)
Returns a function that add specified element into the argument list at specified position. The function returns the argument list after element added
L - the list typeT - the element typeindex - the location at where the element should be added toelement - the element the be added to the argument listList.add(int, Object),
#addTo(int, List)public static <T> Lang.Predicate<Iterable<? extends T>> addAllTo(Collection<? super T> destination)
Returns a function that takes argument of type Collection and add all elements inside into the specified collection. The function returns true if the collection specified has been changed as a result of adding elements
T - the generic type of the collection element and the argument collection elementdestination - the collection into which all elements in the argument collection will be added when applying the functionCollection.addAll(Collection),
addAll(Collection)public static <T> Lang.Predicate<Collection<? super T>> addAll(Collection<? extends T> source)
Returns a function that add all elements in the source collection specified into the destination collection as argument. The function returns true if the argument collection has been changes as a result of call.
T - the element typesource - the collection from which the elements will be added into the argument collection when applying the functionCollection.addAll(Collection),
addAllTo(Collection)public static <T> Lang.Predicate<Collection<? extends T>> addAllTo(int index, C.List<? super T> destination)
Returns a function that add all elements from the argument collection into the destination list specified at the position specified
T - the element typeindex - the position at where the element shall be inserted into the destination listdestination - the list into which the elements will be addedList.addAll(int, Collection),
addAll(int, Collection)public static <T> Lang.Predicate<C.List<? super T>> addAll(int index, Collection<? extends T> source)
Returns a function that add all elements from the source collection specified into the argument list at the position specified
T - the element typeindex - the position where the element should be insert in the argument listsource - the collection from which the elements to be get to added into the argument listList.addAll(int, Collection),
#addAllTo(int, List)public static <T> Lang.Predicate<T> removeFrom(Collection<? super T> collection)
Returns a function that remove the argument from a collection specified.
The function returns true if argument removed successfully or false otherwise
collection - the collection from which the argument to be removed when applying the function returnedCollection.remove(Object),
remove(Object)public static <T> Lang.Predicate<Collection<? super T>> remove(T toBeRemoved)
Returns a function that remove the element specified from the argument collection. The function returns true if the argument collection changed as a result of the call.
T - the element typetoBeRemoved - the element to be removed from the argument when applying the functionCollection.remove(Object),
removeFrom(Collection)public static <T> Lang.Predicate<Collection<? extends T>> removeAllFrom(Collection<? super T> fromCollection)
Returns a function that remove all elements in the argument collection from the fromCollection specified. The function returns true if the fromCollection changed as a result of call
T - the element typefromCollection - the collection from which elements will be removedCollection.removeAll(Collection),
removeAll(Collection)public static <T> Lang.Predicate<Collection<? super T>> removeAll(Collection<? extends T> source)
Returns a function that remove all elements in the source collection from the argument collection. The function returns true if the argument collection changed as a result of call
T - the element typesource - the collection in which elements will be used to remove from argument collectionCollection.removeAll(Collection),
removeAllFrom(Collection)public static <T> Lang.Predicate<Collection<? extends T>> retainAllIn(Collection<? super T> collection)
Returns a function that retains only elements contained in the argument collection in the collection specified. The function returns true if the collection specified changed as a result of call
T - the element typecollection - the collection in which elements will be retained/removedCollection.retainAll(Collection),
retainAll(Collection)public static <T> Lang.Predicate<Collection<? super T>> retainAll(Collection<? extends T> collection)
Returns a function that retains only elements contained in the specified collection in the argument collection. The function returns true if argument collection changes as a result of the call
T - the element typecollection - the collection in which elements will be used to check if argument collection element shall be retained or notCollection.retainAll(Collection),
retainAllIn(Collection)public static <T> Lang.F1<T,Deque<? super T>> prependTo(Deque<? super T> deque)
Returns a function that prepend an element to a deque specified and return the deque instance
T - the element typedeque - the deque to which the element argument will be prepend toDeque.addFirst(Object),
dequePrepend(Object)public static <T> Lang.Processor<Deque<? super T>> dequePrepend(T element)
Returns a function that prepend specified element to argument deque
T - the element typeelement - the element to be added to the head of the argument (deque type)Deque.addFirst(Object),
prependTo(Deque)public static <T> Lang.F1<T,Deque<? super T>> appendTo(Deque<? super T> deque)
Returns a function that append the argument to a Deque specified
T - the generic type of the argument/deque elementdeque - the deque to which the argument shall be append when applying the function returnedDeque.add(Object),
dequeAppend(Object)public static <T> Lang.Processor<Deque<? super T>> dequeAppend(T element)
Returns a function that append specified element to argument deque
T - the element typeelement - the element to be added to the tail of the argument (deque type)Deque.add(Object),
appendTo(Deque)public static <T> Lang.F1<T,C.Sequence<? super T>> prependTo(C.Sequence<? super T> sequence)
Returns a function that prepend the argument to a C.Sequence specified
T - the generic type of the argument/sequence elementsequence - the sequence to which the argument shall be prepend whene applying the functionC.Sequence.prepend(Object),
sequencePrepend(Object)public static <T> Lang.Processor<C.Sequence<? super T>> sequencePrepend(T element)
Returns a function that preppend specified element to argument sequence
T - the element typeelement - the element to be added to the head of the argument (sequence type)C.Sequence.prepend(Object),
#prependTo(Sequence)public static <T> Lang.F1<T,C.Sequence<? super T>> appendTo(C.Sequence<? super T> sequence)
Returns a function that append the argument to a C.Sequence specified
Note the function returns the sequence with the argument been removed
T - the generic type of the argument/sequence elementsequence - the sequence to which the argument shall be append when applying the functionC.Sequence.append(Iterable),
sequenceAppend(Object)public static <T> Lang.Processor<C.Sequence<? super T>> sequenceAppend(T element)
Returns a function that append specified element to argument sequence
T - the element typeelement - the element to be added to the tail of the argument (sequence type)C.Sequence.append(Iterable),
#appendTo(Sequence)public static <T> Lang.F1<Iterable<? extends T>,Void> forEachIterable(Lang.Visitor<? super T> visitor)
Returns a function that apply the visitor function specified on the argument (iterable)
T - the element typevisitor - the function to be used to loop through the argumentC.forEach(Iterable, org.osgl.Lang.Visitor)Copyright © 2014–2021 OSGL (Open Source General Library). All rights reserved.