Java Collections tutorial with example program
By candid | Posted :
Dec 17, 2015
| Updated :
Dec 17, 2015
Class Collections
public class Collections
extends Object
{
//
}
Since:
1.2
See Also:
Collection, Set, List, Map
Method Summary
Adds all of the specified elements to the specified collection.
Returns a view of a Deque as a Last-in-first-out (Lifo) Queue.
Searches the specified list for the specified object using the binary search algorithm.
Searches the specified list for the specified object using the binary search algorithm.
Returns a dynamically typesafe view of the specified collection.
Returns a dynamically typesafe view of the specified list.
Returns a dynamically typesafe view of the specified map.
Returns a dynamically typesafe view of the specified set.
Returns a dynamically typesafe view of the specified sorted map.
Returns a dynamically typesafe view of the specified sorted set.
Copies all of the elements from one list into another.
Returns true if the two specified collections have no elements in common.
Returns an enumeration that has no elements.
Returns an iterator that has no elements.
Returns the empty list (immutable).
Returns a list iterator that has no elements.
Returns the empty map (immutable).
Returns the empty set (immutable).
static Enumeration enumeration(Collection c)
Returns an enumeration over the specified collection.
Replaces all of the elements of the specified list with the specified element.
Returns the number of elements in the specified collection equal to the specified object.
Returns the starting position of the first occurrence of the specified target list within the specified source list, or -1 if there is no such occurrence.
Returns the starting position of the last occurrence of the specified target list within the specified source list, or -1 if there is no such occurrence.
Returns an array list containing the elements returned by the specified enumeration in the order they are returned by the enumeration.
Returns the maximum element of the given collection, according to the natural ordering of its elements.
Returns the maximum element of the given collection, according to the order induced by the specified comparator.
Returns the minimum element of the given collection, according to the natural ordering of its elements.
Returns the minimum element of the given collection, according to the order induced by the specified comparator.
Returns an immutable list consisting of n copies of the specified object.
Returns a set backed by the specified map.
Replaces all occurrences of one specified value in a list with another.
Reverses the order of the elements in the specified list.
Returns a comparator that imposes the reverse of the natural ordering on a collection of objects that implement the Comparable interface.
Returns a comparator that imposes the reverse ordering of the specified comparator.
Rotates the elements in the specified list by the specified distance.
Randomly permutes the specified list using a default source of randomness.
Randomly permute the specified list using the specified source of randomness.
Returns an immutable set containing only the specified object.
Returns an immutable list containing only the specified object.
Returns an immutable map, mapping only the specified key to the specified value.
Sorts the specified list into ascending order, according to the natural ordering of its elements.
Sorts the specified list according to the order induced by the specified comparator.
Swaps the elements at the specified positions in the specified list.
Returns a synchronized (thread-safe) collection backed by the specified collection.
Returns a synchronized (thread-safe) list backed by the specified list.
Returns a synchronized (thread-safe) map backed by the specified map.
Returns a synchronized (thread-safe) set backed by the specified set.
Returns a synchronized (thread-safe) sorted map backed by the specified sorted map.
Returns a synchronized (thread-safe) sorted set backed by the specified sorted set.
Returns an unmodifiable view of the specified collection.
Returns an unmodifiable view of the specified list.
Returns an unmodifiable view of the specified map.
Returns an unmodifiable view of the specified set.
Returns an unmodifiable view of the specified sorted map.
Returns an unmodifiable view of the specified sorted set.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Related Post
Facebook
twitter
google+
pinterest
Comments