databaseqert.blogg.se

Collection
Collection













collection

get public static  Map.Entry get( Map map,.Parameters: object - the object to get a value from index - the index to get Returns: the object at the specified index Throws: IndexOutOfBoundsException - if the index is invalid IllegalArgumentException - if the object type is invalid Number of entries) as a side effect of this method. Index (or to the end, if index exceeds the Index-th object in the Iterator/Enumeration, if there Iterator or Enumeration - the value returned is the.Returned by the collection's default iterator, if there is such an element. Collection - the value returned is the index-th object.If there is such an entry otherwise an IndexOutOfBoundsException Array - the index-th array entry is returned,.List - this method is equivalent to the list's get method.Map - the value returned is the Map.Entry in position.The supported types, and associated semantics are: IllegalArgumentException if object is not an IndexOutOfBoundsException if there is no such element or Returns the index-th value in object, throwing selectRejected public static  Collection selectRejected( Iterable inputCollection,.InputCollection or predicate are not null Returns: the outputCollection Since: 4.1 InputCollection and predicate are not null rejectedCollection - the collection to output rejected elements into, may not be null if the Type Parameters: O - the type of object the Iterable contains R - the type of the output Collection Parameters: inputCollection - the collection to get the input from, may be null predicate - the predicate to use, may be null outputCollection - the collection to output selected elements into, may not be null if the SelectRejected(inputCollection, predicate, rejectedCollection) Select(inputCollection, predicate, outputCollection)

Collection code#

Note: calling the method is equivalent to the following code snippet: If the input predicate is null, no elements are added to Selects all elements from inputCollection into an output and rejected collection,īased on the evaluation of the given predicate.Įlements matching the predicate are added to the outputCollection,Īll other elements are added to the rejectedCollection. containsAny public static  boolean containsAny( Collection coll1,.Parameters: coll1 - the first collection, must not be null coll2 - the second collection, must not be null Returns: true iff the intersection of the collections has the same cardinalityĪs the set of unique elements from the second collection Since: 4.0 Depending on the type ofĬollection provided, this method will be much faster than callingĬntainsAll(Collection) instead, though this will come at theĬost of an additional space complexity O(n). With a guaranteed runtime complexity of O(n + m). This method is intended as a replacement for ntainsAll(Collection) Intersection(, ) of coll1 and coll2 has the same cardinality as In other words, this method returns true iff the Which is the same behavior as ntainsAll(Collection). The cardinality of values in coll2 is not taken into account, Returns true iff all elements of coll2 are also contained















Collection