Previous Page toc Index Next Page

Appendix C

The Java Class Library

This appendix provides a general overview of the classes available in the standard Java packages (that is, the classes that are guaranteed to be available in any Java implementation). This appendix is intended for general reference; for more specific information about each variable (its inheritance, variables, and methods), as well as the various exceptions for each package, see the API documentation from Sun at http://java.sun.com. A copy of the 1.0 API documentation is on the CD-ROM included with this book.

java.lang

The java.lang package contains the classes and interfaces that are the core of the Java language.

Interfaces

Cloneable Interface indicating that an object may be copied or cloned
Runnable Methods for classes that want to run as threads

Classes

Boolean Object wrapper for boolean values
Character Object wrapper for char values
Class Run-time representations of classes
ClassLoader Abstract behavior for handling loading of classes
Compiler System class that gives access to the Java compiler
Double Object wrapper for double values
Float Object wrapper for float values
Integer Object wrapper for int values
Long Object wrapper for long values
Math Utility class for math operations
Number Abstract superclass of all number classes (Integer, Float, and so on)
Object Generic Object class, at top of inheritance hierarchy
Process Abstract behavior for processes such as those spawned using methods in the System class
Runtime Access to the Java runtime
SecurityManager Abstract behavior for implementing security policies
String Character strings
StringBuffer Mutable strings
System Access to Java’s system-level behavior, provided in a platform-independent way.
Thread Methods for managing threads and classes that run in threads
ThreadDeath Class of object thrown when a thread is asynchronously terminated
ThreadGroup A group of threads
Throwable Generic exception class; all objects thrown must be a Throwable

java.util

The java.util package contains various utility classes and interfaces, including random numbers, system properties, and other useful classes.

Interfaces

Enumeration Methods for enumerating sets of values
Observer Methods for enabling classes to be observe Observable objects

Classes

BitSet A set of bits
Date The current system date, as well as methods for generating and parsing dates
Dictionary An abstract class that maps between keys and values (superclass of HashTable)
Hashtable A hash table
Observable An abstract class for observable objects
Properties A hash table that contains behavior for setting and retrieving persistent properties of the system or a class
Random Utilities for generating random numbers
Stack A stack (a last-in-first-out queue)
StringTokenizer Utilities for splitting strings into individual “tokens”
VectorA growable array of Objects

java.io

The java.io package provides input and output classes and interfaces for streams and files.

Interfaces

Classes

DataInput Methods for reading machine-independent typed input streams
DataOutput Methods for writing machine-independent typed output streams
FilenameFilterMethods for filtering file names
BufferedInputStream A buffered input stream
BufferedOutputStream A buffered output stream
ByteArrayInputStream An input stream from a byte array
ByteArrayOutputStream An output stream to a byte array
DataInputStream Enables you to read primitive Java types (ints, chars, booleans, and so on) from a sttream in a machine-independent way
DataOutputStream Enables you to write primitive Java data types (ints, chars, booleans, and so on) to a sttream in a machine-independent way
File Represents a file on the host’s file system
FileDescriptor Holds onto the UNIX-like file descriptor of a file or socket
FileInputStream An input stream from a file, constructed using a filename or descriptor
FileOutputStream An output stream to a file, constructed using a filename or descriptor
FilterInputStream Abstract class which provides a filter for input streams (and for adding stream futrctionality such as buffering)
FilterOutputStream Abstract class which provides a filter for output streams (and for adding stream functionality such as buffering)
InputStream An abstract class representing an input stream of bytes; the parent of all input streams in this package
LineNumberInputStream An input stream that keeps track of line numbers
OutputStream An abstract class representing an output stream of bytes; the parent of all output streams in this package
PipedInputStream A piped input stream, which should be connected to a PipedOutputStream to be useful
PipedOutputStream A piped output stream, which should be connected to a PipedInputStream to be useful (together they provide safe communication between threads)
PrintStream An output stream for printing (used by System.out.println(...))
.PushbackInputStream An input stream with a 1-byte push back buffer
RandomAccessFile Provides random access to a file, constructed from filenames, descriptors, or obects
SequenceInputStream Converts a sequence of input streams into a single input stream
StreamTokenizer Converts an input stream into a series of individual tokens
StringBufferInputStream An input stream from a String object

java.net

The java.net package contains classes and interfaces for performing network operations, such as sockets and URLs.

Interfaces

ContentHandlerFactory Methods for creating ContentHandler objects
SocketImplFactoryMethods for creating socket implementations (instance of the SocketImpl class)
URLStreamHandlerFactoryMethods for creating URLStreamHandler objects

Classes

ContentHandlerAbstract behavior for reading data from a URL connection and constructing the appropriate local object, based on MIME types
DatagramPacketA datagram packet (UDP)
DatagramSocketA datagram socket
InetAddressAn object representation of an Internet host (host name, IP address)
ServerSocketA server-side socket
SocketA socket
SocketImplAn abstract class for specific socket implementations
URLAn object representation of a URL
URLConnectionAbstract behavior for a socket that can handle various Web-based protocols (http, ftp, and so on)
URLEncoderTurns strings into x-www-form-urlencoded format
URLStreamHandlerAbstract class for managing streams to object referenced by URLs

java.awt

The java.awt package contains the classes and interfaces that make up the Abstract Windowing Toolkit.

Interfaces

LayoutManagerMethods for laying out containers
MenuContainerMethods for menu-related containers

Classes

BorderLayoutA layout manager for arranging items in border formation
ButtonA UI pushbutton
CanvasA canvas for drawing and performing other graphics oper-ations
CardLayoutA layout manager for HyperCard-like metaphors
CheckboxA checkbox
CheckboxGroupA group of exclusive checkboxes (radio buttons)
CheckboxMenuItemA toggle menu item
ChoiceA popup menu of choices
ColorAn abstract representation of a color
ComponentThe abstract generic class for all UI components
ContainerAbstract behavior for a component that can hold other components or containers
DialogA window for brief interactions with users
DimensionAn object representing width and height
EventAn object representing events caused by the system or based on user input
FileDialogA dialog for getting filenames from the local file system
FlowLayoutA layout manager that lays out objects from left to right in rows
FontAn abstract representation of a font
FontMetricsAbstract class for holding information about a specific font’s character shapes and height and width information
FrameA top-level window with a title
GraphicsAbstract behavior for representing a graphics context, and for drawing and painting shapes and objects
GridBagConstraintsConstraints for components laid out using GridBagLayout
GridBagLayouA layout manager that aligns components horizontally and vertically based on their values from GridBagConstraints
GridLayoutA layout manager with rows and columns; elements are added to each cell in the grid
ImageAn abstract representation of a bitmap image
InsetsDistances from the outer border of the window; used to lay out components
LabelA text label for UI components
ListA scrolling list
MediaTrackerA way to keep track of the status of media objects being loaded over the Net
MenuA menu, which can contain menu items and is a container on a menubar
MenuBarA menubar (container for menus)
MenuComponentThe abstract superclass of all menu elements
MenuItemAn individual menu item
PanelA container that is displayed
PointAn object representing a point (x and y coordinates)
PolygonAn object representing a set of points
RectangleAn object representing a rectangle (x and y coordinates for the top corner, plus width and height)
ScrollbarA UI scrollbar object
TextAreaA multiline, scrollable, editable text field
TextComponentThe superclass of all editable text components
TextFieldA fixed-size editable text field
ToolkitAbstract behavior for binding the abstract AWT classes to a platform-specific toolkit implementation

Window A top-level window, and the superclass of the Frame and Dialog classes

java.awt.image

The java.awt.image package is a subpackage of the AWT that provides classes for managing bitmap images.

Interfaces

ImageConsumerMethods for receiving image created by an ImageProducer
ImageObserverMethods to track the loading and construction of an image

ImageProducerMethods for producing image data received by an ImageConsumer

Classes

ColorModelAn abstract class for managing color information for images
CropImageFilterA filter for cropping images to a particular size
DirectColorModelA specific color model for managing and translating pixel color values
FilteredImageSourceAn ImageProducer that takes an image and an ImageFilter object, and produces an image for an ImageConsumer
ImageFilterA filter that takes image data from an ImageProducer, modifies it in some way, and hands it off to an ImageConsumer
IndexColorModelA specific color model for managing and translating color values in a fixed-color map
MemoryImageSourceAn image producer that gets its image from memory; used after constructing an image by hand
PixelGrabberAn ImageConsumer that retrieves a subset of the pixels in an image
RGBImageFilterAbstract behavior for a filter that modifies the RGB values of pixels in RGB images

java.awt.peer

The java.awt.peer package is a subpackage of AWT that provides the (hidden) platform-specific AWT classes (for example, Motif, Macintosh, Windows 95) with platform-independent interfaces to implement. Thus, callers using these interfaces need not know which platform’s window system these hidden AWT classes are currently implementing.

Each class in the AWT that inherits from either Component or MenuComponent has a corresponding peer class. Each of those classes is the name of the Component with -Peer added (for example, ButtonPeer, DialogPeer, and WindowPeer). Because each one provides similar behavior, they are not enumerated here.

java.applet

The java.appletpackage provides applet-specific behavior.

Interfaces

AppletContextMethods to refer to the applet’s context
AppletStubMethods for implementing applet viewers
AudioClipMethods for playing audio files

Classes

AppletThe base applet class


Previous Page toc Index Next Page