Package java.util
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
-
ClassDescriptionThis class provides a skeletal implementation of the
Collectioninterface, to minimize the effort required to implement this interface.AbstractList<E>This class provides a skeletal implementation of theListinterface to minimize the effort required to implement this interface backed by a "random access" data store (such as an array).AbstractMap<K,V> This class provides a skeletal implementation of theMapinterface, to minimize the effort required to implement this interface.An Entry maintaining a key and a value.An unmodifiable Entry maintaining a key and a value.This class provides skeletal implementations of someQueueoperations.This class provides a skeletal implementation of theListinterface to minimize the effort required to implement this interface backed by a "sequential access" data store (such as a linked list).AbstractSet<E>This class provides a skeletal implementation of theSetinterface to minimize the effort required to implement this interface.ArrayDeque<E>Resizable-array implementation of theDequeinterface.ArrayList<E>Resizable-array implementation of theListinterface.This class contains various methods for manipulating arrays (such as sorting and searching).This class consists exclusively of static methods for obtaining encoders and decoders for the Base64 encoding scheme.This class implements a decoder for decoding byte data using the Base64 encoding scheme as specified in RFC 4648 and RFC 2045.This class implements an encoder for encoding byte data using the Base64 encoding scheme as specified in RFC 4648 and RFC 2045.This class implements a vector of bits that grows as needed.TheCalendarclass is an abstract class that provides methods for converting between a specific instant in time and a set ofcalendar fieldssuch asYEAR,MONTH,DAY_OF_MONTH,HOUR, and so on, and for manipulating the calendar fields, such as getting the date of the next week.Calendar.Builderis used for creating aCalendarfrom various date-time parameters.Collection<E>The root interface in the collection hierarchy.This class consists exclusively of static methods that operate on or return collections.Comparator<T>A comparison function, which imposes a total ordering on some collection of objects.This exception may be thrown by methods that have detected concurrent modification of an object when such modification is not permissible.Represents a currency.The classDaterepresents a specific instant in time, with millisecond precision.Deque<E>A linear collection that supports element insertion and removal at both ends.Dictionary<K,V> TheDictionaryclass is the abstract parent of any class, such asHashtable, which maps keys to values.A state object for collecting statistics such as count, min, max, sum, and average.Unchecked exception thrown when duplicate flags are provided in the format specifier.Thrown by methods in theStackclass to indicate that the stack is empty.Enumeration<E>An object that implements the Enumeration interface generates a series of elements, one at a time.A specializedMapimplementation for use with enum type keys.A specializedSetimplementation for use with enum types.A tagging interface that all event listener interfaces must extend.EventListenerProxy<T extends EventListener>An abstract wrapper class for anEventListenerclass which associates a set of additional parameters with the listener.The root class from which all event state objects shall be derived.Unchecked exception thrown when a conversion and flag are incompatible.TheFormattableinterface must be implemented by any class that needs to perform custom formatting using the's'conversion specifier ofFormatter.FormattableFlags are passed to theFormattable.formatTo()method and modify the output format for Formattables.An interpreter for printf-style format strings.Enum forBigDecimalformatting.Unchecked exception thrown when the formatter has been closed.GregorianCalendaris a concrete subclass ofCalendarand provides the standard calendar system used by most of the world.HashMap<K,V> Hash table based implementation of theMapinterface.HashSet<E>This class implements theSetinterface, backed by a hash table (actually aHashMapinstance).Hashtable<K,V> This class implements a hash table, which maps keys to values.HexFormatconverts between bytes and chars and hex-encoded strings which may include additional formatting markup such as prefixes, suffixes, and delimiters.IdentityHashMap<K,V> This class implements theMapinterface with a hash table, using reference-equality in place of object-equality when comparing keys (and values).Unchecked exception thrown when a character with an invalid Unicode code point as defined byCharacter.isValidCodePoint(int)is passed to theFormatter.Unchecked exception thrown when the argument corresponding to the format specifier is of an incompatible type.Unchecked exception thrown when a format string contains an illegal syntax or a format specifier that is incompatible with the given arguments.Unchecked exception thrown when an illegal combination flags is given.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.Unchecked exception thrown when the format width is a negative value other than-1or is otherwise unsupported.Thrown by methods inLocaleandLocale.Builderto indicate that an argument is not a well-formed BCP 47 tag.Thrown by aScannerto 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.A state object for collecting statistics such as count, min, max, sum, and average.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 thePropertiesspecification.Iterator<E>An iterator over a collection.LinkedHashMap<K,V> Hash table and linked list implementation of theMapinterface, with well-defined encounter order.Hash table and linked list implementation of theSetinterface, with well-defined encounter order.LinkedList<E>Doubly-linked list implementation of theListandDequeinterfaces.List<E>An ordered collection, where the user has precise control over where in the list each element is inserted.ListIterator<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.ListResourceBundleis an abstract subclass ofResourceBundlethat manages resources for a locale in a convenient and easy to use list.ALocalerepresents a specific geographical, political, or cultural region.Builderis used to build instances ofLocalefrom values configured by the setters.Enum for locale categories.This enum provides constants to select a filtering mode for locale matching.Enum for specifying the type defined in ISO 3166.This class expresses a Language Range defined in RFC 4647 Matching of Language Tags.A state object for collecting statistics such as count, min, max, sum, and average.Map<K,V> An object that maps keys to values.Map.Entry<K,V> A map entry (key-value pair).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.Unchecked exception thrown when the format width is required.Signals that a resource is missing.NavigableMap<K,V> ASortedMapextended with navigation methods returning the closest matches for given search targets.NavigableSet<E>ASortedSetextended with navigation methods reporting closest matches for given search targets.Thrown by various accessor methods to indicate that the element being requested does not exist.This class consists ofstaticutility methods for operating on objects, or checking certain conditions before operation.Deprecated.Deprecated.This interface has been deprecated.Optional<T>A container object which may or may not contain a non-nullvalue.A container object which may or may not contain adoublevalue.A container object which may or may not contain anintvalue.A container object which may or may not contain alongvalue.PrimitiveIterator<T,T_CONS> A base type for primitive specializations ofIterator.An Iterator specialized fordoublevalues.An Iterator specialized forintvalues.An Iterator specialized forlongvalues.An unbounded priority queue based on a priority heap.ThePropertiesclass represents a persistent set of properties.This class is for property permissions.PropertyResourceBundleis a concrete subclass ofResourceBundlethat manages resources for a locale using a set of static strings from a property file.Queue<E>A collection designed for holding elements prior to processing.An instance of this class is used to generate a stream of pseudorandom numbers; its period is only 248.Marker interface used byListimplementations to indicate that they support fast (generally constant time) random access.Resource bundles contain locale-specific objects.ResourceBundle.Controldefines a set of callback methods that are invoked by theResourceBundle.getBundlefactory methods during the bundle loading process.A simple text scanner which can parse primitive types and strings using regular expressions.A collection that has a well-defined encounter order, that supports operations at both ends, and that is reversible.SequencedMap<K,V> A Map that has a well-defined encounter order, that supports operations at both ends, and that is reversible.SequencedSet<E>A collection that is both aSequencedCollectionand aSet.Error thrown when something goes wrong while locating, loading, or instantiating a service provider.A facility to load implementations of a service.Represents a service provider located byServiceLoader.Set<E>A collection that contains no duplicate elements.SimpleTimeZoneis a concrete subclass ofTimeZonethat represents a time zone for use with a Gregorian calendar.SortedMap<K,V> AMapthat further provides a total ordering on its keys.SortedSet<E>ASetthat further provides a total ordering on its elements.Spliterator<T>An object for traversing and partitioning elements of a source.A Spliterator specialized fordoublevalues.A Spliterator specialized forintvalues.A Spliterator specialized forlongvalues.A Spliterator specialized for primitive values.Static classes and methods for operating on or creating instances ofSpliteratorand its primitive specializationsSpliterator.OfInt,Spliterator.OfLong, andSpliterator.OfDouble.An abstractSpliterator.OfDoublethat implementstrySplitto permit limited parallelism.An abstractSpliterator.OfIntthat implementstrySplitto permit limited parallelism.An abstractSpliterator.OfLongthat implementstrySplitto permit limited parallelism.An abstractSpliteratorthat implementstrySplitto permit limited parallelism.A generator of uniform pseudorandom values (with period 264) applicable for use in (among other contexts) isolated parallel computations that may generate subtasks.Stack<E>TheStackclass represents a last-in-first-out (LIFO) stack of objects.StringJoineris used to construct a sequence of characters separated by a delimiter and optionally starting with a supplied prefix and ending with a supplied suffix.The string tokenizer class allows an application to break a string into tokens.A facility for threads to schedule tasks for future execution in a background thread.A task that can be scheduled for one-time or repeated execution by aTimer.TimeZonerepresents a time zone offset, and also figures out daylight savings.TheTooManyListenersExceptionException is used as part of the Java Event model to annotate and implement a unicast special case of a multicast Event Source.TreeMap<K,V> A Red-Black tree basedNavigableMapimplementation.TreeSet<E>ANavigableSetimplementation based on aTreeMap.Unchecked exception thrown when an unknown conversion is given.Unchecked exception thrown when an unknown flag is given.A class that represents an immutable universally unique identifier (UUID).Vector<E>TheVectorclass implements a growable array of objects.WeakHashMap<K,V> Hash table based implementation of theMapinterface, with weak keys.
Observerinterface have been deprecated.