Package | Description |
---|---|
java.util |
Contains the collections framework, legacy collection classes, event model,
date and time facilities, random-number generator, and miscellaneous utility
classes.
|
Modifier and Type | Class and Description |
---|---|
class |
AbstractList<E>
This class provides a skeletal implementation of the
List
interface to minimize the effort required to implement this interface
backed by a "random access" data store (such as an array). |
class |
AbstractSequentialList<E>
This class provides a skeletal implementation of the List
interface to minimize the effort required to implement this interface
backed by a "sequential access" data store (such as a linked list).
|
class |
ArrayList<E>
Resizable-array implementation of the List interface.
|
class |
LinkedList<E>
Doubly-linked list implementation of the
List and Deque
interfaces. |
class |
Stack<E>
The
Stack class represents a last-in-first-out
(LIFO) stack of objects. |
class |
Vector<E>
The
Vector class implements a growable array of
objects. |
Modifier and Type | Method and Description |
---|---|
static <T> List<T> |
Arrays.asList(T... a)
Returns a fixed-size list backed by the specified array.
|
List<E> |
Vector.subList(int fromIndex,
int toIndex)
Returns a view of the portion of this List between fromIndex,
inclusive, and toIndex, exclusive.
|
List<E> |
List.subList(int fromIndex,
int toIndex)
Returns a view of the portion of this list between the specified
fromIndex, inclusive, and toIndex, exclusive.
|
List<E> |
ArrayList.subList(int fromIndex,
int toIndex)
Returns a view of the portion of this list between the specified
fromIndex , inclusive, and toIndex , exclusive. |
List<E> |
AbstractList.subList(int fromIndex,
int toIndex)
Returns a view of the portion of this list between the specified
fromIndex, inclusive, and toIndex, exclusive.
|
Modifier and Type | Method and Description |
---|---|
static <T> int |
Collections.binarySearch(List<? extends Comparable<? super T>> list,
T key)
Searches the specified list for the specified object using the binary
search algorithm.
|
static <T> int |
Collections.binarySearch(List<? extends T> list,
T key,
Comparator<? super T> c)
Searches the specified list for the specified object using the binary
search algorithm.
|
static <T> void |
Collections.copy(List<? super T> dest,
List<? extends T> src)
Copies all of the elements from one list into another.
|
static <T> void |
Collections.copy(List<? super T> dest,
List<? extends T> src)
Copies all of the elements from one list into another.
|
static <T> void |
Collections.fill(List<? super T> list,
T obj)
Replaces all of the elements of the specified list with the specified
element.
|
static int |
Collections.indexOfSubList(List<?> source,
List<?> target)
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.
|
static int |
Collections.indexOfSubList(List<?> source,
List<?> target)
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.
|
static int |
Collections.lastIndexOfSubList(List<?> source,
List<?> target)
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.
|
static int |
Collections.lastIndexOfSubList(List<?> source,
List<?> target)
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.
|
static <T> boolean |
Collections.replaceAll(List<T> list,
T oldVal,
T newVal)
Replaces all occurrences of one specified value in a list with another.
|
static void |
Collections.reverse(List<?> list)
Reverses the order of the elements in the specified list.
|
static void |
Collections.rotate(List<?> list,
int distance)
Rotates the elements in the specified list by the specified distance.
|
static void |
Collections.shuffle(List<?> list)
Randomly permutes the specified list using a default source of
randomness.
|
static void |
Collections.shuffle(List<?> list,
Random rnd)
Randomly permute the specified list using the specified source of
randomness.
|
static <T extends Comparable<? super T>> |
Collections.sort(List<T> list)
Sorts the specified list into ascending order, according to the
natural ordering of its elements.
|
static <T> void |
Collections.sort(List<T> list,
Comparator<? super T> c)
Sorts the specified list according to the order induced by the
specified comparator.
|
static void |
Collections.swap(List<?> list,
int i,
int j)
Swaps the elements at the specified positions in the specified list.
|
Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. Use of this specification is subject to license terms.