Java Reference
In-Depth Information
get, set, increment, or decrement an integer. Atomic variables are used
in the implementation of high-performance concurrent algorithms. For
each basic atomic variable class, such as
AtomicInteger
, there is a cor-
responding atomic field updater class, such as
AtomicIntegerFieldUpdater
,
that allows you to access a given field of an object atomically. These
classes also provide the
compareAndSet
operation that is the fundamental
operation in most lock-free and wait-free concurrent algorithms. It will
atomically set a variable to a new value only if the variable currently
holds an expected value.
25.9.2. Archive Files
java.util.jar
The
java.util.jar
package provides classes for reading and writing the
JAR
(Java ARchive) file format, which is based on the standard
ZIP
file
format with an optional manifest file.
JAR
files can be used to distrib-
ute the classes and resources of a
Package
as a single unit. The manifest
stores information about the
JAR
file contents and provides the specific-
ation information for the
Package
contained thereinas we discussed on
page
477
.
Archive files define a format for storing multiple files within a single file,
and allow for the compression of those original file contents. A full de-
scription of archive files, particularly the
JAR
format, is beyond the scope
of this topic. For illustration we briefly describe each of the classes with-
in the
java.util.jar
package:
•
Attributes
maps
Manifest
attribute names to associated string val-
ues.
•
Attributes. Name
represents an attribute's name. The main function
of this class is to define static
Attributes.Nam
e objects for each at-
tribute that a manifest may have. For example, the object corres-
ponding to the "Manifest-Version" attribute of a manifest is stored
in the static field
Attributes.Name.MANIFEST_VERSION
.
•
JarEntry
represents a
JAR
file entry.