Package java.util

Interface Summary
Collection<E> sample code for java.util.Collection definition code for java.util.Collection The root interface in the collection hierarchy.
Comparator<T> sample code for java.util.Comparator definition code for java.util.Comparator A comparison function, which imposes a total ordering on some collection of objects.
Enumeration<E> sample code for java.util.Enumeration definition code for java.util.Enumeration An object that implements the Enumeration interface generates a series of elements, one at a time.
EventListener sample code for java.util.EventListener definition code for java.util.EventListener A tagging interface that all event listener interfaces must extend.
Formattable sample code for java.util.Formattable definition code for java.util.Formattable The Formattable interface must be implemented by any class that needs to perform custom formatting using the 's' conversion specifier of Formatter sample code for java.util.Formatter definition code for java.util.Formatter .
Iterator<E> sample code for java.util.Iterator definition code for java.util.Iterator An iterator over a collection.
List<E> sample code for java.util.List definition code for java.util.List An ordered collection (also known as a sequence).
ListIterator<E> sample code for java.util.ListIterator definition code for java.util.ListIterator 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.
Map<K,V> sample code for java.util.Map definition code for java.util.Map An object that maps keys to values.
Map.Entry<K,V> sample code for java.util.Map.Entry definition code for java.util.Map.Entry A map entry (key-value pair).
Observer sample code for java.util.Observer definition code for java.util.Observer A class can implement the Observer interface when it wants to be informed of changes in observable objects.
Queue<E> sample code for java.util.Queue definition code for java.util.Queue A collection designed for holding elements prior to processing.
RandomAccess sample code for java.util.RandomAccess definition code for java.util.RandomAccess Marker interface used by List implementations to indicate that they support fast (generally constant time) random access.
Set<E> sample code for java.util.Set definition code for java.util.Set A collection that contains no duplicate elements.
SortedMap<K,V> sample code for java.util.SortedMap definition code for java.util.SortedMap A map that further guarantees that it will be in ascending key order, sorted according to the natural ordering of its keys (see the Comparable interface), or by a comparator provided at sorted map creation time.
SortedSet<E> sample code for java.util.SortedSet definition code for java.util.SortedSet A set that further guarantees that its iterator will traverse the set in ascending element order, sorted according to the natural ordering of its elements (see Comparable), or by a Comparator provided at sorted set creation time.
 

Class Summary
AbstractCollection<E> sample code for java.util.AbstractCollection definition code for java.util.AbstractCollection This class provides a skeletal implementation of the Collection interface, to minimize the effort required to implement this interface.
AbstractList<E> sample code for java.util.AbstractList definition code for java.util.AbstractList 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).
AbstractMap<K,V> sample code for java.util.AbstractMap definition code for java.util.AbstractMap This class provides a skeletal implementation of the Map interface, to minimize the effort required to implement this interface.
AbstractQueue<E> sample code for java.util.AbstractQueue definition code for java.util.AbstractQueue This class provides skeletal implementations of some Queue sample code for java.util.Queue definition code for java.util.Queue operations.
AbstractSequentialList<E> sample code for java.util.AbstractSequentialList definition code for java.util.AbstractSequentialList 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).
AbstractSet<E> sample code for java.util.AbstractSet definition code for java.util.AbstractSet This class provides a skeletal implementation of the Set interface to minimize the effort required to implement this interface.
ArrayList<E> sample code for java.util.ArrayList definition code for java.util.ArrayList Resizable-array implementation of the List interface.
Arrays sample code for java.util.Arrays definition code for java.util.Arrays This class contains various methods for manipulating arrays (such as sorting and searching).
BitSet sample code for java.util.BitSet definition code for java.util.BitSet This class implements a vector of bits that grows as needed.
Calendar sample code for java.util.Calendar definition code for java.util.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 sample code for java.util.Calendar.fields definition code for java.util.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.
Collections sample code for java.util.Collections definition code for java.util.Collections This class consists exclusively of static methods that operate on or return collections.
Currency sample code for java.util.Currency definition code for java.util.Currency Represents a currency.
Date sample code for java.util.Date definition code for java.util.Date The class Date represents a specific instant in time, with millisecond precision.
Dictionary<K,V> sample code for java.util.Dictionary definition code for java.util.Dictionary The Dictionary class is the abstract parent of any class, such as Hashtable, which maps keys to values.
EnumMap<K extends Enum<K>,V> sample code for java.util.EnumMap definition code for java.util.EnumMap A specialized Map sample code for java.util.Map definition code for java.util.Map implementation for use with enum type keys.
EnumSet<E extends Enum<E>> sample code for java.util.EnumSet definition code for java.util.EnumSet A specialized Set sample code for java.util.Set definition code for java.util.Set implementation for use with enum types.
EventListenerProxy sample code for java.util.EventListenerProxy definition code for java.util.EventListenerProxy An abstract wrapper class for an EventListener class which associates a set of additional parameters with the listener.
EventObject sample code for java.util.EventObject definition code for java.util.EventObject The root class from which all event state objects shall be derived.
FormattableFlags sample code for java.util.FormattableFlags definition code for java.util.FormattableFlags FomattableFlags are passed to the Formattable.formatTo() sample code for java.util.Formattable.formatTo(java.util.Formatter, int, int, int) definition code for java.util.Formattable.formatTo(java.util.Formatter, int, int, int) method and modify the output format for Formattables sample code for java.util.Formattable definition code for java.util.Formattable .
Formatter sample code for java.util.Formatter definition code for java.util.Formatter An interpreter for printf-style format strings.
GregorianCalendar sample code for java.util.GregorianCalendar definition code for java.util.GregorianCalendar GregorianCalendar is a concrete subclass of Calendar and provides the standard calendar system used by most of the world.
HashMap<K,V> sample code for java.util.HashMap definition code for java.util.HashMap Hash table based implementation of the Map interface.
HashSet<E> sample code for java.util.HashSet definition code for java.util.HashSet This class implements the Set interface, backed by a hash table (actually a HashMap instance).
Hashtable<K,V> sample code for java.util.Hashtable definition code for java.util.Hashtable This class implements a hashtable, which maps keys to values.
IdentityHashMap<K,V> sample code for java.util.IdentityHashMap definition code for java.util.IdentityHashMap This class implements the Map interface with a hash table, using reference-equality in place of object-equality when comparing keys (and values).
LinkedHashMap<K,V> sample code for java.util.LinkedHashMap definition code for java.util.LinkedHashMap Hash table and linked list implementation of the Map interface, with predictable iteration order.
LinkedHashSet<E> sample code for java.util.LinkedHashSet definition code for java.util.LinkedHashSet Hash table and linked list implementation of the Set interface, with predictable iteration order.
LinkedList<E> sample code for java.util.LinkedList definition code for java.util.LinkedList Linked list implementation of the List interface.
ListResourceBundle sample code for java.util.ListResourceBundle definition code for java.util.ListResourceBundle ListResourceBundle is an abstract subclass of ResourceBundle that manages resources for a locale in a convenient and easy to use list.
Locale sample code for java.util.Locale definition code for java.util.Locale A Locale object represents a specific geographical, political, or cultural region.
Observable sample code for java.util.Observable definition code for java.util.Observable This class represents an observable object, or "data" in the model-view paradigm.
PriorityQueue<E> sample code for java.util.PriorityQueue definition code for java.util.PriorityQueue An unbounded priority queue sample code for java.util.Queue definition code for java.util.Queue based on a priority heap.
Properties sample code for java.util.Properties definition code for java.util.Properties The Properties class represents a persistent set of properties.
PropertyPermission sample code for java.util.PropertyPermission definition code for java.util.PropertyPermission This class is for property permissions.
PropertyResourceBundle sample code for java.util.PropertyResourceBundle definition code for java.util.PropertyResourceBundle PropertyResourceBundle is a concrete subclass of ResourceBundle that manages resources for a locale using a set of static strings from a property file.
Random sample code for java.util.Random definition code for java.util.Random An instance of this class is used to generate a stream of pseudorandom numbers.
ResourceBundle sample code for java.util.ResourceBundle definition code for java.util.ResourceBundle Resource bundles contain locale-specific objects.
Scanner sample code for java.util.Scanner definition code for java.util.Scanner A simple text scanner which can parse primitive types and strings using regular expressions.
SimpleTimeZone sample code for java.util.SimpleTimeZone definition code for java.util.SimpleTimeZone SimpleTimeZone is a concrete subclass of TimeZone that represents a time zone for use with a Gregorian calendar.
Stack<E> sample code for java.util.Stack definition code for java.util.Stack The Stack class represents a last-in-first-out (LIFO) stack of objects.
StringTokenizer sample code for java.util.StringTokenizer definition code for java.util.StringTokenizer The string tokenizer class allows an application to break a string into tokens.
Timer sample code for java.util.Timer definition code for java.util.Timer A facility for threads to schedule tasks for future execution in a background thread.
TimerTask sample code for java.util.TimerTask definition code for java.util.TimerTask A task that can be scheduled for one-time or repeated execution by a Timer.
TimeZone sample code for java.util.TimeZone definition code for java.util.TimeZone TimeZone represents a time zone offset, and also figures out daylight savings.
TreeMap<K,V> sample code for java.util.TreeMap definition code for java.util.TreeMap Red-Black tree based implementation of the SortedMap interface.
TreeSet<E> sample code for java.util.TreeSet definition code for java.util.TreeSet This class implements the Set interface, backed by a TreeMap instance.
UUID sample code for java.util.UUID definition code for java.util.UUID A class that represents an immutable universally unique identifier (UUID).
Vector<E> sample code for java.util.Vector definition code for java.util.Vector The Vector class implements a growable array of objects.
WeakHashMap<K,V> sample code for java.util.WeakHashMap definition code for java.util.WeakHashMap A hashtable-based Map implementation with weak keys.
 

Enum Summary
Formatter.BigDecimalLayoutForm sample code for java.util.Formatter.BigDecimalLayoutForm definition code for java.util.Formatter.BigDecimalLayoutForm  
 

Exception Summary
ConcurrentModificationException sample code for java.util.ConcurrentModificationException definition code for java.util.ConcurrentModificationException This exception may be thrown by methods that have detected concurrent modification of an object when such modification is not permissible.
DuplicateFormatFlagsException sample code for java.util.DuplicateFormatFlagsException definition code for java.util.DuplicateFormatFlagsException Unchecked exception thrown when duplicate flags are provided in the format specifier.
EmptyStackException sample code for java.util.EmptyStackException definition code for java.util.EmptyStackException Thrown by methods in the Stack class to indicate that the stack is empty.
FormatFlagsConversionMismatchException sample code for java.util.FormatFlagsConversionMismatchException definition code for java.util.FormatFlagsConversionMismatchException Unchecked exception thrown when a conversion and flag are incompatible.
FormatterClosedException sample code for java.util.FormatterClosedException definition code for java.util.FormatterClosedException Unchecked exception thrown when the formatter has been closed.
IllegalFormatCodePointException sample code for java.util.IllegalFormatCodePointException definition code for java.util.IllegalFormatCodePointException Unchecked exception thrown when a character with an invalid Unicode code point as defined by Character.isValidCodePoint(int) sample code for java.lang.Character.isValidCodePoint(int) definition code for java.lang.Character.isValidCodePoint(int) is passed to the Formatter sample code for java.util.Formatter definition code for java.util.Formatter .
IllegalFormatConversionException sample code for java.util.IllegalFormatConversionException definition code for java.util.IllegalFormatConversionException Unchecked exception thrown when the argument corresponding to the format specifier is of an incompatible type.
IllegalFormatException sample code for java.util.IllegalFormatException definition code for java.util.IllegalFormatException Unchecked exception thrown when a format string contains an illegal syntax or a format specifier that is incompatible with the given arguments.
IllegalFormatFlagsException sample code for java.util.IllegalFormatFlagsException definition code for java.util.IllegalFormatFlagsException Unchecked exception thrown when an illegal combination flags is given.
IllegalFormatPrecisionException sample code for java.util.IllegalFormatPrecisionException definition code for java.util.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.
IllegalFormatWidthException sample code for java.util.IllegalFormatWidthException definition code for java.util.IllegalFormatWidthException Unchecked exception thrown when the format width is a negative value other than -1 or is otherwise unsupported.
InputMismatchException sample code for java.util.InputMismatchException definition code for java.util.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.
InvalidPropertiesFormatException sample code for java.util.InvalidPropertiesFormatException definition code for java.util.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 sample code for java.util.Properties definition code for java.util.Properties specification.
MissingFormatArgumentException sample code for java.util.MissingFormatArgumentException definition code for java.util.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.
MissingFormatWidthException sample code for java.util.MissingFormatWidthException definition code for java.util.MissingFormatWidthException Unchecked exception thrown when the format width is required.
MissingResourceException sample code for java.util.MissingResourceException definition code for java.util.MissingResourceException Signals that a resource is missing.
NoSuchElementException sample code for java.util.NoSuchElementException definition code for java.util.NoSuchElementException Thrown by the nextElement method of an Enumeration to indicate that there are no more elements in the enumeration.
TooManyListenersException sample code for java.util.TooManyListenersException definition code for java.util.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.
UnknownFormatConversionException sample code for java.util.UnknownFormatConversionException definition code for java.util.UnknownFormatConversionException Unchecked exception thrown when an unknown conversion is given.
UnknownFormatFlagsException sample code for java.util.UnknownFormatFlagsException definition code for java.util.UnknownFormatFlagsException Unchecked exception thrown when an unknown flag is given.