| Home >> All >> java >> [ util Javadoc ] |
| | java.util.jar.* (7) | | java.util.logging.* (16) | | java.util.prefs.* (9) | | java.util.regex.* (4) |
| | java.util.zip.* (27) |
java.util: Javadoc index of package java.util.
Package Samples:
java.util.regex: Utility classes such as collections (maps, sets, lists, dictionaries and stacks), calendars, dates, locales, properties, timers, resource bundles and event objects.
java.util.zip: Utility classes such as collections (maps, sets, lists, dictionaries and stacks), calendars, dates, locales, properties, timers, resource bundles and event objects.
java.util.jar
java.util.logging
java.util.prefs
Classes:
FileHandler: A FileHandler publishes log records to a set of log files. A maximum file size can be specified; as soon as a log file reaches the size limit, it is closed and the next file in the set is taken. Configuration: Values of the subsequent LogManager properties are taken into consideration when a FileHandler is initialized. If a property is not defined, or if it has an invalid value, a default is taken without an exception being thrown. java.util.FileHandler.level - specifies the initial severity level threshold. Default value: Level.ALL . java.util.FileHandler.filter - specifies the name of a Filter ...
GregorianCalendar: This class represents the Gregorian calendar, that is used in most countries all over the world. It does also handle the Julian calendar for dates smaller than the date of the change to the Gregorian calendar. The Gregorian calendar differs from the Julian calendar by a different leap year rule (no leap year every 100 years, except if year is divisible by 400). This change date is different from country to country, and can be changed with setGregorianChange . The first countries to adopt the Gregorian calendar did so on the 15th of October, 1582. This date followed October the 4th, 1582 in the ...
LinkedHashMap: This class provides a hashtable-backed implementation of the Map interface, with predictable traversal order. It uses a hash-bucket approach; that is, hash collisions are handled by linking the new node off of the pre-existing node (or list of nodes). In this manner, techniques such as linear probing (which can cause primary clustering) and rehashing (which does not fit very well with Java's method of precomputing hash codes) are avoided. In addition, this maintains a doubly-linked list which tracks either insertion or access order. In insertion order, calling put adds the key to the end of traversal, ...
LogManager: The LogManager maintains a hierarchical namespace of Logger objects and manages properties for configuring the logging framework. There exists only one single LogManager per virtual machine. This instance can be retrieved using the static method getLogManager() 55 . Configuration Process: The global LogManager object is created and configured when the class java.util.logging.LogManager is initialized. The configuration process includes the subsequent steps: If the system property java.util.logging.manager is set to the name of a subclass of java.util.logging.LogManager , an instance of that subclass ...
Calendar: This class is an abstract base class for Calendars, which can be used to convert between Date objects and a set of integer fields which represent YEAR , MONTH , DAY , etc. The Date object represents a time in milliseconds since the Epoch. This class is locale sensitive. To get the Object matching the current locale you can use getInstance . You can even provide a locale or a timezone. getInstance returns currently a GregorianCalendar for the current date. If you want to convert a date from the Year, Month, Day, DayOfWeek, etc. Representation to a Date -Object, you can create a new Calendar with ...
Date: This class represents a specific time in milliseconds since the epoch. The epoch is 1970, January 1 00:00:00.0000 UTC. Date is intended to reflect universal time coordinate (UTC), but this depends on the underlying host environment. Most operating systems don't handle the leap second, which occurs about once every year or so. The leap second is added to the last minute of the day on either the 30th of June or the 31st of December, creating a minute 61 seconds in length. The representations of the date fields are as follows: Years are specified as the difference between the year and 1900. Thus, ...
Adler32: Computes Adler32 checksum for a stream of data. An Adler32 checksum is not as reliable as a CRC32 checksum, but a lot faster to compute. The specification for Adler32 may be found in RFC 1950. (ZLIB Compressed Data Format Specification version 3.3) From that document: "ADLER32 (Adler-32 checksum) This contains a checksum value of the uncompressed data (excluding any dictionary data) computed according to Adler-32 algorithm. This algorithm is a 32-bit extension and improvement of the Fletcher algorithm, used in the ITU-T X.224 / ISO 8073 standard. Adler-32 is composed of two sums accumulated per ...
Preferences: Preference node containing key value entries and subnodes. There are two preference node trees, a system tree which can be accessed by calling systemRoot() containing system preferences usefull for all users, and a user tree that can be accessed by calling userRoot() containing preferences that can differ between different users. How different users are identified is implementation depended. It can be determined by Thread, Access Control Context or Subject. This implementation uses the "java.util.prefs.PreferencesFactory" system property to find a class that implement PreferencesFactory and initialized ...
Hashtable: A class which implements a hashtable data structure. This implementation of Hashtable uses a hash-bucket approach. That is: linear probing and rehashing is avoided; instead, each hashed value maps to a simple linked-list which, in the best case, only has one node. Assuming a large enough table, low enough load factor, and / or well implemented hashCode() methods, Hashtable should provide O(1) insertion, deletion, and searching of keys. Hashtable is O(n) in the worst case for all of these (if all keys hash to the same bucket). This is a JDK-1.2 compliant implementation of Hashtable. As such, it ...
WeakHashMap: A weak hash map has only weak references to the key. This means that it allows the key to be garbage collected if it is not used otherwise. If this happens, the entry will eventually disappear from the map, asynchronously. A weak hash map makes most sense when the keys doesn't override the equals method: If there is no other reference to the key nobody can ever look up the key in this table and so the entry can be removed. This table also works when the equals method is overloaded, such as String keys, but you should be prepared to deal with some entries disappearing spontaneously. Other strange ...
IdentityHashMap: This class provides a hashtable-backed implementation of the Map interface, but uses object identity to do its hashing. In fact, it uses object identity for comparing values, as well. It uses a linear-probe hash table, which may have faster performance than the chaining employed by HashMap. WARNING: This is not a general purpose map. Because it uses System.identityHashCode and ==, instead of hashCode and equals, for comparison, it violated Map's general contract, and may cause undefined behavior when compared to other maps which are not IdentityHashMaps. This is designed only for the rare cases ...
LinkedHashSet: This class provides a hashtable-backed implementation of the Set interface, with predictable traversal order. It uses a hash-bucket approach; that is, hash collisions are handled by linking the new node off of the pre-existing node (or list of nodes). In this manner, techniques such as linear probing (which can cause primary clustering) and rehashing (which does not fit very well with Java's method of precomputing hash codes) are avoided. In addition, this maintains a doubly-linked list which tracks insertion order. Note that the insertion order is not modified if an add simply reinserts an element ...
Vector: The Vector classes implements growable arrays of Objects. You can access elements in a Vector with an index, just as you can in a built in array, but Vectors can grow and shrink to accommodate more or fewer objects. Vectors try to mantain efficiency in growing by having a capacityIncrement that can be specified at instantiation. When a Vector can no longer hold a new Object, it grows by the amount in capacityIncrement . If this value is 0, the vector doubles in size. Vector implements the JDK 1.2 List interface, and is therefore a fully compliant Collection object. The iterators are fail-fast - ...
TreeMap: This class provides a red-black tree implementation of the SortedMap interface. Elements in the Map will be sorted by either a user-provided Comparator object, or by the natural ordering of the keys. The algorithms are adopted from Corman, Leiserson, and Rivest's Introduction to Algorithms. TreeMap guarantees O(log n) insertion and deletion of elements. That being said, there is a large enough constant coefficient in front of that "log n" (overhead involved in keeping the tree balanced), that TreeMap may not be the best choice for small collections. If something is already sorted, you may want ...
ResourceBundle: A resource bundle contains locale-specific data. If you need localized data, you can load a resource bundle that matches the locale with getBundle . Now you can get your object by calling getObject or getString on that bundle. When a bundle is demanded for a specific locale, the ResourceBundle is searched in following order ( def. language stands for the two letter ISO language code of the default locale (see Locale.getDefault() ). baseName_ language code _ country code _ variant baseName_ language code _ country code baseName_ language code baseName_ def. language _ def. country _ def. variant ...
SocketHandler: A SocketHandler publishes log records to a TCP/IP socket. Configuration: Values of the subsequent LogManager properties are taken into consideration when a SocketHandler is initialized. If a property is not defined, or if it has an invalid value, a default is taken without an exception being thrown. java.util.SocketHandler.level - specifies the initial severity level threshold. Default value: Level.ALL . java.util.SocketHandler.filter - specifies the name of a Filter class. Default value: No Filter. java.util.SocketHandler.formatter - specifies the name of a Formatter class. Default value: java.util.logging.XMLFormatter ...
Collection: Interface that represents a collection of objects. This interface is the root of the collection hierarchy, and does not provide any guarantees about the order of its elements or whether or not duplicate elements are permitted. All methods of this interface that are defined to modify the collection are defined as optional . An optional operation may throw an UnsupportedOperationException if the data backing this collection does not support such a modification. This may mean that the data structure is immutable, or that it is read-only but may change ("unmodifiable"), or that it is modifiable but ...
Locale: Locales represent a specific country and culture. Classes which can be passed a Locale object tailor their information for a given locale. For instance, currency number formatting is handled differently for the USA and France. Locales are made up of a language code, a country code, and an optional set of variant strings. Language codes are represented by ISO 639:1988 w/ additions from ISO 639/RA Newsletter No. 1/1989 and a decision of the Advisory Committee of ISO/TC39 on August 8, 1997. Country codes are represented by ISO 3166 . Variant strings are vendor and browser specific. Standard variant ...
MemoryHandler: A MemoryHandler maintains a circular buffer of log records. Configuration: Values of the subsequent LogManager properties are taken into consideration when a MemoryHandler is initialized. If a property is not defined, or if it has an invalid value, a default is taken without an exception being thrown. java.util.MemoryHandler.level - specifies the initial severity level threshold. Default value: Level.ALL . java.util.MemoryHandler.filter - specifies the name of a Filter class. Default value: No Filter. java.util.MemoryHandler.size - specifies the maximum number of log records that are kept in the ...
PropertyResourceBundle: This class is a concrete ResourceBundle that gets it resources from a property file. This implies that the resources are strings. For more information about resource bundles see the class ResourceBundle . You should not use this class directly, or subclass it, but you get an object of this class automatically when you call ResourceBundle.getBundle() and there is a properties file. If there is also a class for this resource and the same locale, the class will be chosen. The properties file should have the name of the resource bundle, appended with the locale (e.g. _de and the extension .properties ...
HashMap: This class provides a hashtable-backed implementation of the Map interface. It uses a hash-bucket approach; that is, hash collisions are handled by linking the new node off of the pre-existing node (or list of nodes). In this manner, techniques such as linear probing (which can cause primary clustering) and rehashing (which does not fit very well with Java's method of precomputing hash codes) are avoided. Under ideal circumstances (no collisions), HashMap offers O(1) performance on most operations ( containsValue() is, of course, O(n)). In the worst case (all keys map to the same hash code -- very ...
Map: An object that maps keys onto values. Keys cannot be duplicated. This interface replaces the obsolete Dictionary abstract class. The map has three collection views, which are backed by the map (modifications on one show up on the other): a set of keys, a collection of values, and a set of key-value mappings. Some maps have a guaranteed order, but not all do. Note: Be careful about using mutable keys. Behavior is unspecified if a key's comparison behavior is changed after the fact. As a corollary to this rule, don't use a Map as one of its own keys or values, as it makes hashCode and equals have ...
Properties: A set of persistent properties, which can be saved or loaded from a stream. A property list may also contain defaults, searched if the main list does not contain a property for a given key. An example of a properties file for the german language is given here. This extends the example given in ListResourceBundle. Create a file MyResource_de.properties with the following contents and put it in the CLASSPATH. (The character \ u00e4 is the german umlaut) s1=3 s2=MeineDisk s3=3. M\ u00e4rz 96 s4=Die Diskette ''{1}'' enth\ u00e4lt {0} in {2}. s5=0 s6=keine Dateien s7=1 s8=eine Datei s9=2 s10={0,number} ...
ListResourceBundle: A ListResouceBundle provides an easy way, to create your own resource bundle. It is an abstract class that you can subclass. You should then overwrite the getContents method, that provides a key/value list. The key/value list is a two dimensional list of Object. The first dimension ranges over the resources. The second dimension ranges from zero (key) to one (value). The keys must be of type String, and they are case-sensitive. For example: public class MyResources extends ListResourceBundle { public Object[][] getContents() { return contents; } static final Object[][] contents = { // LOCALIZED ...
| Home | Contact Us | Privacy Policy | Terms of Service |