Top Description Interfaces Classes
module java.base

Package java.util


Contains the collections framework, some internationalization support classes, a service loader, properties, random number generation, string parsing and scanning classes, base64 encoding and decoding, a bit array, and several miscellaneous utility classes. This package also contains legacy collection classes and legacy date and time classes.

Java Collections Framework

For an overview, API outline, and design rationale, please see:

For a tutorial and programming guide with examples of use of the collections framework, please see:

Since
1.0

Interface Summary

Modifier and TypeInterface and Description
public interface
Collection<
the type of elements in this collection
E
>

The root interface in the collection hierarchy.

public interface
Comparator<
the type of objects that may be compared by this comparator
T
>

A comparison function, which imposes a total ordering on some collection of objects.

public interface
Deque<
the type of elements held in this deque
E
>

A linear collection that supports element insertion and removal at both ends.

public interface
Enumeration<
the type of elements returned by this enumeration
E
>

An object that implements the Enumeration interface generates a series of elements, one at a time.

public interface
EventListener

A tagging interface that all event listener interfaces must extend.

public interface
Formattable

The Formattable interface must be implemented by any class that needs to perform custom formatting using the 's' conversion specifier of java.util.Formatter.

public interface
Iterator<
the type of elements returned by this iterator
E
>

An iterator over a collection.

public interface
List<
the type of elements in this list
E
>

An ordered collection, where the user has precise control over where in the list each element is inserted.

public interface
ListIterator<
the type of elements returned by this list iterator
E
>

An iterator for lists that allows the programmer to traverse the list in either direction, modify the list during iteration, and obtain the iterator's current position in the list.

public interface
Map<
the type of keys maintained by this map
K
,
the type of mapped values
V
>

An object that maps keys to values.

public interface
NavigableMap<
the type of keys maintained by this map
K
,
the type of mapped values
V
>

A SortedMap extended with navigation methods returning the closest matches for given search targets.

public interface
NavigableSet<
the type of elements maintained by this set
E
>

A SortedSet extended with navigation methods reporting closest matches for given search targets.

public interface
Observer

Deprecated since 9. This interface has been deprecated. See the Observable class for further information.
A class can implement the Observer interface when it wants to be informed of changes in observable objects.
public interface
PrimitiveIterator<
the type of elements returned by this PrimitiveIterator. The type must be a wrapper type for a primitive type, such as Integer for the primitive int type.
T
,
the type of primitive consumer. The type must be a primitive specialization of java.util.function.Consumer for T, such as java.util.function.IntConsumer for Integer.
T_CONS
>

A base type for primitive specializations of Iterator.

public interface
Queue<
the type of elements held in this queue
E
>

A collection designed for holding elements prior to processing.

public interface
RandomAccess

Marker interface used by List implementations to indicate that they support fast (generally constant time) random access.

public interface
SequencedCollection<
the type of elements in this collection
E
>

A collection that has a well-defined encounter order, that supports operations at both ends, and that is reversible.

public interface
SequencedMap<
the type of keys maintained by this map
K
,
the type of mapped values
V
>

A Map that has a well-defined encounter order, that supports operations at both ends, and that is reversible.

public interface
SequencedSet<
the type of elements in this sequenced set
E
>

A collection that is both a SequencedCollection and a Set.

public interface
Set<
the type of elements maintained by this set
E
>

A collection that contains no duplicate elements.

public interface
SortedMap<
the type of keys maintained by this map
K
,
the type of mapped values
V
>

A Map that further provides a total ordering on its keys.

public interface
SortedSet<
the type of elements maintained by this set
E
>

A Set that further provides a total ordering on its elements.

public interface
Spliterator<
the type of elements returned by this Spliterator
T
>

An object for traversing and partitioning elements of a source.

Class Summary

Modifier and TypeClass and Description
public abstract class
AbstractCollection<
the type of elements in this collection
E
>

This class provides a skeletal implementation of the Collection interface, to minimize the effort required to implement this interface.

public abstract class
AbstractList<
the type of elements in this list
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).

public abstract class
AbstractMap<
the type of keys maintained by this map
K
,
the type of mapped values
V
>

This class provides a skeletal implementation of the Map interface, to minimize the effort required to implement this interface.

public abstract class
AbstractQueue<
the type of elements held in this queue
E
>

This class provides skeletal implementations of some Queue operations.

public abstract class
AbstractSequentialList<
the type of elements in this list
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).

public abstract class
AbstractSet<
the type of elements maintained by this set
E
>

This class provides a skeletal implementation of the Set interface to minimize the effort required to implement this interface.

public class
ArrayDeque<
the type of elements held in this deque
E
>

Resizable-array implementation of the Deque interface.

public class
ArrayList<
the type of elements in this list
E
>

Resizable-array implementation of the List interface.

pack-priv class
ArrayPrefixHelpers

ForkJoin tasks to perform Arrays.parallelPrefix operations.

public class
Arrays

This class contains various methods for manipulating arrays (such as sorting and searching).

pack-priv class
ArraysParallelSortHelpers

Helper utilities for the parallel sort methods in Arrays.parallelSort.

public class
Base64

This class consists exclusively of static methods for obtaining encoders and decoders for the Base64 encoding scheme.

public class
BitSet

This class implements a vector of bits that grows as needed.

public abstract class
Calendar

The Calendar class is an abstract class that provides methods for converting between a specific instant in time and a set of calendar fields such as YEAR, MONTH, DAY_OF_MONTH, HOUR, and so on, and for manipulating the calendar fields, such as getting the date of the next week.

public class
Collections

This class consists exclusively of static methods that operate on or return collections.

pack-priv class
CollSer

A unified serialization proxy class for the immutable collections.

pack-priv class
ComparableTimSort

This is a near duplicate of TimSort, modified for use with arrays of objects that implement Comparable, instead of using explicit comparators.

pack-priv class
Comparators

Package private supporting class for Comparator.

public class
ConcurrentModificationException

This exception may be thrown by methods that have detected concurrent modification of an object when such modification is not permissible.

public class
Currency

Represents a currency.

public class
Date

The class Date represents a specific instant in time, with millisecond precision.

public abstract class
Dictionary<
the type of keys
K
,
the type of mapped values
V
>

The Dictionary class is the abstract parent of any class, such as Hashtable, which maps keys to values.

public class
DoubleSummaryStatistics

A state object for collecting statistics such as count, min, max, sum, and average.

pack-priv class
DualPivotQuicksort

This class implements powerful and fully optimized versions, both sequential and parallel, of the Dual-Pivot Quicksort algorithm by Vladimir Yaroslavskiy, Jon Bentley and Josh Bloch.

public class
DuplicateFormatFlagsException

Unchecked exception thrown when duplicate flags are provided in the format specifier.

public class
EmptyStackException

Thrown by methods in the Stack class to indicate that the stack is empty.

public class
EnumMap<
the enum type of keys maintained by this map
K extends Enum<K>
,
the type of mapped values
V
>

A specialized Map implementation for use with enum type keys.

public abstract class
EnumSet<
the enum type of elements maintained by this set
E extends Enum<E>
>

A specialized Set implementation for use with enum types.

public abstract class
EventListenerProxy<
the type of EventListener being wrapped
T extends EventListener
>

An abstract wrapper class for an EventListener class which associates a set of additional parameters with the listener.

public class
EventObject

The root class from which all event state objects shall be derived.

public class
FormatFlagsConversionMismatchException

Unchecked exception thrown when a conversion and flag are incompatible.

pack-priv class
FormatItem

A specialized objects used by FormatterBuilder that knows how to insert themselves into a concatenation performed by StringConcatFactory.

public class
FormatProcessor

Preview Second Preview of String Templates (JEP 459).

This Processor constructs a String result using Formatter specifications and values found in the StringTemplate.
public class
FormattableFlags

FormattableFlags are passed to the Formattable.formatTo() method and modify the output format for Formattables.

public class
Formatter

An interpreter for printf-style format strings.

pack-priv class
FormatterBuilder

This package private class supports the construction of the MethodHandle used by FormatProcessor.

public class
FormatterClosedException

Unchecked exception thrown when the formatter has been closed.

public class
GregorianCalendar

GregorianCalendar is a concrete subclass of Calendar and provides the standard calendar system used by most of the world.

public class
HashMap<
the type of keys maintained by this map
K
,
the type of mapped values
V
>

Hash table based implementation of the Map interface.

public class
HashSet<
the type of elements maintained by this set
E
>

This class implements the Set interface, backed by a hash table (actually a HashMap instance).

public class
Hashtable<
the type of keys maintained by this map
K
,
the type of mapped values
V
>

This class implements a hash table, which maps keys to values.

public class
HexFormat

HexFormat converts between bytes and chars and hex-encoded strings which may include additional formatting markup such as prefixes, suffixes, and delimiters.

public class
IdentityHashMap<
the type of keys maintained by this map
K
,
the type of mapped values
V
>

This class implements the Map interface with a hash table, using reference-equality in place of object-equality when comparing keys (and values).

pack-priv class
IllegalFormatArgumentIndexException

Unchecked exception thrown when the argument index is not within the valid range of supported argument index values.

public class
IllegalFormatCodePointException

Unchecked exception thrown when a character with an invalid Unicode code point as defined by Character#isValidCodePoint is passed to the Formatter.

public class
IllegalFormatConversionException

Unchecked exception thrown when the argument corresponding to the format specifier is of an incompatible type.

public class
IllegalFormatException

Unchecked exception thrown when a format string contains an illegal syntax or a format specifier that is incompatible with the given arguments.

public class
IllegalFormatFlagsException

Unchecked exception thrown when an illegal combination flags is given.

public class
IllegalFormatPrecisionException

Unchecked exception thrown when the precision is a negative value other than -1, the conversion does not support a precision, or the value is otherwise unsupported.

public class
IllegalFormatWidthException

Unchecked exception thrown when the format width is a negative value other than -1 or is otherwise unsupported.

public class
IllformedLocaleException

Thrown by methods in Locale and Locale.Builder to indicate that an argument is not a well-formed BCP 47 tag.

pack-priv class
ImmutableCollections

Container class for immutable collections.

public class
InputMismatchException

Thrown by a Scanner to indicate that the token retrieved does not match the pattern for the expected type, or that the token is out of range for the expected type.

public class
IntSummaryStatistics

A state object for collecting statistics such as count, min, max, sum, and average.

public class
InvalidPropertiesFormatException

Thrown to indicate that an operation could not complete because the input did not conform to the appropriate XML document type for a collection of properties, as per the Properties specification.

pack-priv class
JapaneseImperialCalendar

JapaneseImperialCalendar implements a Japanese calendar system in which the imperial era-based year numbering is supported from the Meiji era.

pack-priv class
JumboEnumSet<E extends Enum<E>>

Private implementation class for EnumSet, for "jumbo" enum types (i.e., those with more than 64 elements).

pack-priv class
KeyValueHolder<
the key type
K
,
the value type
V
>

An immutable container for a key and a value, suitable for use in creating and populating Map instances.

public class
LinkedHashMap<
the type of keys maintained by this map
K
,
the type of mapped values
V
>

Hash table and linked list implementation of the Map interface, with well-defined encounter order.

public class
LinkedHashSet<
the type of elements maintained by this set
E
>

Hash table and linked list implementation of the Set interface, with well-defined encounter order.

public class
LinkedList<
the type of elements held in this collection
E
>

Doubly-linked list implementation of the List and Deque interfaces.

public abstract class
ListResourceBundle

ListResourceBundle is an abstract subclass of ResourceBundle that manages resources for a locale in a convenient and easy to use list.

public class
Locale

A Locale object represents a specific geographical, political, or cultural region.

pack-priv class
public class
LongSummaryStatistics

A state object for collecting statistics such as count, min, max, sum, and average.

public class
MissingFormatArgumentException

Unchecked exception thrown when there is a format specifier which does not have a corresponding argument or if an argument index refers to an argument that does not exist.

public class
MissingFormatWidthException

Unchecked exception thrown when the format width is required.

public class
MissingResourceException

Signals that a resource is missing.

public class
NoSuchElementException

Thrown by various accessor methods to indicate that the element being requested does not exist.

public class
Objects

This class consists of static utility methods for operating on objects, or checking certain conditions before operation.

public class
Observable

Deprecated since 9. This class and the Observer interface have been deprecated.
This class represents an observable object, or "data" in the model-view paradigm.
public class
Optional<
the type of value
T
>

A container object which may or may not contain a non-null value.

public class
OptionalDouble

A container object which may or may not contain a double value.

public class
OptionalInt

A container object which may or may not contain an int value.

public class
OptionalLong

A container object which may or may not contain a long value.

public class
PriorityQueue<
the type of elements held in this queue
E
>

An unbounded priority queue based on a priority heap.

public class
Properties

The Properties class represents a persistent set of properties.

public class
PropertyPermission

This class is for property permissions.

pack-priv class
PropertyPermissionCollection

A PropertyPermissionCollection stores a set of PropertyPermission permissions.

public class
PropertyResourceBundle

PropertyResourceBundle is a concrete subclass of ResourceBundle that manages resources for a locale using a set of static strings from a property file.

public class
Random

An instance of this class is used to generate a stream of pseudorandom numbers; its period is only 248.

pack-priv class
RegularEnumSet<E extends Enum<E>>

Private implementation class for EnumSet, for "regular sized" enum types (i.e., those with 64 or fewer enum constants).

public abstract class
ResourceBundle

Resource bundles contain locale-specific objects.

pack-priv class
ReverseOrderDequeView<E>

Provides a reverse-ordered view of any Deque.

pack-priv class
ReverseOrderListView<E>

Provides a reverse-ordered view of a List.

pack-priv class
ReverseOrderSortedMapView<K, V>

Provides a reversed-ordered view of a SortedMap.

pack-priv class
ReverseOrderSortedSetView<E>

Provides a reversed-ordered view of a SortedSet.

public class
Scanner

A simple text scanner which can parse primitive types and strings using regular expressions.

public class
ServiceConfigurationError

Error thrown when something goes wrong while locating, loading, or instantiating a service provider.

public class
ServiceLoader<
The type of the service to be loaded by this loader
S
>

A facility to load implementations of a service.

public class
SimpleTimeZone

SimpleTimeZone is a concrete subclass of TimeZone that represents a time zone for use with a Gregorian calendar.

public class
Spliterators

Static classes and methods for operating on or creating instances of Spliterator and its primitive specializations Spliterator.OfInt, Spliterator.OfLong, and Spliterator.OfDouble.

public class
SplittableRandom

A generator of uniform pseudorandom values (with period 264) applicable for use in (among other contexts) isolated parallel computations that may generate subtasks.

public class
Stack<
Type of component elements
E
>

The Stack class represents a last-in-first-out (LIFO) stack of objects.

public class
StringJoiner

StringJoiner is used to construct a sequence of characters separated by a delimiter and optionally starting with a supplied prefix and ending with a supplied suffix.

public class
StringTokenizer

The string tokenizer class allows an application to break a string into tokens.

pack-priv class
TaskQueue

This class represents a timer task queue: a priority queue of TimerTasks, ordered on nextExecutionTime.

public class
Timer

A facility for threads to schedule tasks for future execution in a background thread.

public abstract class
TimerTask

A task that can be scheduled for one-time or repeated execution by a Timer.

pack-priv class
TimerThread

This "helper class" implements the timer's task execution thread, which waits for tasks on the timer queue, executions them when they fire, reschedules repeating tasks, and removes cancelled tasks and spent non-repeating tasks from the queue.

public abstract class
TimeZone

TimeZone represents a time zone offset, and also figures out daylight savings.

pack-priv class
TimSort<T>

A stable, adaptive, iterative mergesort that requires far fewer than n lg(n) comparisons when running on partially sorted arrays, while offering performance comparable to a traditional mergesort when run on random arrays.

public class
TooManyListenersException

The TooManyListenersException Exception is used as part of the Java Event model to annotate and implement a unicast special case of a multicast Event Source.

public class
TreeMap<
the type of keys maintained by this map
K
,
the type of mapped values
V
>

A Red-Black tree based NavigableMap implementation.

public class
TreeSet<
the type of elements maintained by this set
E
>

A NavigableSet implementation based on a TreeMap.

pack-priv class
Tripwire

Utility class for detecting inadvertent uses of boxing in java.util classes.

public class
UnknownFormatConversionException

Unchecked exception thrown when an unknown conversion is given.

public class
UnknownFormatFlagsException

Unchecked exception thrown when an unknown flag is given.

public class
UUID

A class that represents an immutable universally unique identifier (UUID).

public class
Vector<
Type of component elements
E
>

The Vector class implements a growable array of objects.

public class
WeakHashMap<
the type of keys maintained by this map
K
,
the type of mapped values
V
>

Hash table based implementation of the Map interface, with weak keys.