Common classes and interfaces in Javaapi

Source: Internet
Author: User
Tags stub

common classes and interfaces in the Java.lang package

Class

1. Integer: Theinteger class wraps a value of a primitive type in the object int . An Integer object of type contains a int field of type.

2. The Math: class contains methods for performing basic mathematical operations, such as elementary exponents, logarithms, square roots, and trigonometric functions.

3 Double: The class wraps a value of a base type in the object double . Each Double type of object contains one double type of field.

4 Object : is the root class of a class hierarchy. Each class is used Object as a superclass. All objects, including arrays, implement methods of this class.

5 String:: Class represents a String. All string literals (such as) in a Java program "abc" are implemented as instances of this class.

Strings are constants, and their values cannot be changed after they are created. The string relief area supports variable strings. Because the String object is immutable, it can be shared.

6 Void: The class is a placeholder class that is not instantiated and holds a reference to a class object that represents the Java keyword Void.

Interface

Appendable an object that can be added to a char sequence and value. If an instance of a class intends to Formatter receive the formatted output from, then the class must implement the appendable interface.

Charsequence is char a readable sequence of values. This interface provides uniform read-only access to many different kinds of char sequences. charthe value represents a character in the Basic multilingual Plane (BMP) or surrogate.

CloneableTo indicate that Object.clone() the method can legitimately copy the class instance by field.

The Runnable interface should be implemented by classes that intend to execute their instances through a thread. The class must define a run parameterless method called.

common classes and interfaces in the Java.applent package

class Applent is a small program that cannot be run alone but can be embedded in other applications.   

         AppletThe class must be a superclass of any embedded Web page or applet that is available in the Java applet viewer. Appletclass provides a standard interface between an applet and its operating environment.

Interface

Appletcontext This interface corresponds to the environment of the applet: the document that contains the applet and other applets in the same document.

Appletstub when an applet is first created, use the applet's setStub method to connect the applet stub to it. This stub acts as an interface between the applet and the browser environment or the applet viewer environment, and the application runs in this environment.

The AudioClip AudioClip Interface is a simple abstraction for playing audio clips. Multiple AudioClip items can be played simultaneously, and the resulting sound mixes together to produce a synthesized sound.

common classes and interfaces in the java.awt package

Class

button This class creates a label button. When the button is pressed, the application can perform an action. As depicted in the Solaris operating system, the " Quit " button shows three views:

The Color class is used to encapsulate colors in the default SRGB color space, or to encapsulate ColorSpace colors in any color space that is identified. Each color has an implicit alpha value of 1.0, or an explicit alpha value that is provided in the construction method. The alpha value defines the transparency of the color, which can be represented by a floating-point value within the range of 0.0-1.0 or 0-255. An alpha value of 1.0 or 255 means that the color is completely opaque, and an alpha value of 0 or 0.0 means that the color is completely transparent. The Color Color color component is never pre-multiplied by an alpha component when it is constructed with an explicit alpha value, or when a color/alpha component is obtained.

Font represents a typeface that can be used to render text in a visible way. Fonts provide the information needed to map a sequence of characters to a sequence of glyphs to Graphics render a sequence of glyphs on objects and Component objects.

ImageAn abstract class Image is a superclass that represents all classes of a graphics image. Images must be obtained in a platform-specific manner.

Interface

Paint

This Paint interface defines how the Graphics2D color mode is generated for the operation. Paintadd the class that implements the interface to the Graphics2D context so that the definition draw and the fill color mode used by the method.

An instance of the implemented Paint class must be read-only, because these objects are setPaint not copied when they are set as properties of a method, or Graphics2D when the object itself is copied Graphics2D .

Shape

ShapeThe interface provides the definition of an object that represents some geometric shapes. Shapeis a rule that is described by the PathIterator object, which can represent Shape the outline, and how the contour divides the plane into inner and outer points. Each Shape object provides a callback to get the bounding rectangle of the geometry, determines whether the point or rectangle is part or all Shape inside, and retrieves an Shape object that describes the trajectory path of the outline PathIterator .

common classes and interfaces in the java.net package

Class

Authenticator The Authenticator class represents an object that knows how to obtain network connection validation. Typically, it does this by prompting the user to enter information.

CacheRequest represents a channel that stores resources in Responsecache. Instances of this kind provide an OutputStream object that the protocol handler can call to store the resource data in the cache, and an abort () method that allows for interrupt and discard cache storage operations. If you encounter IOException while reading a response from the cache or writing a response to the cache, the current cache store operation is aborted.

The Cacheresponse represents the channel from which the Responsecache gets the resource. Instances of this kind provide inputstream that return the entity body and provide a getheaders () method that returns the associated response header.

The ContentHandler abstract class ContentHandler is URLConnection a Object superclass of all classes that are read from.

Cookiehandler

The Cookiehandler object provides a callback mechanism to hook an HTTP status management policy implementation to an HTTP protocol handler. The HTTP State management mechanism uses HTTP requests and responses to specify how stateful sessions are created.

Interface

contenthandlerfactory This interface defines the factory for the content handler. The implementation of this interface should map the MIME type to ContentHandler the instance.

Cookiepolicy Cookiepolicy implementation determines which cookie should be accepted and which cookie should be rejected. Three predefined policy implementations are available, namely Accept_all, Accept_none, and Accept_original_server.

Cookiestore represents the Cookiestore object for the cookie store. Cookies can be stored and obtained.

datagramsocketimplfactory This interface defines the factory used for datagram socket implementations. DatagramSocketclass uses it to create an actual socket implementation.

fileNameMap provides a simple interface for mapping between file names and MIME type strings.

common classes and interfaces in the JAVA.AWT.IMG package

Class

Affinetransformop

This class uses affine transformations to perform linear mappings from the source image or from Raster 2D coordinates to the target image or to the Raster 2D coordinates in. The type of interpolation used is specified by the construction method through an RenderingHints object or by one of the integer interpolation types defined in this class.

AreaAveragingScaleFilter This is a ImageFilter class that uses a simple area averaging algorithm for image scaling, which produces smoother results than its closest algorithm.

Bandcombineop This class uses an Raster arbitrary linear combination of band in a specified matrix pair.

BandedSampleModel

This class represents image data that is stored in band interleaved mode, and each sample of the pixel occupies one of the data elements of DataBuffer. This class is a subclass of ComponentSampleModel, but it provides an implementation that is more efficient than the implementation provided by ComponentSampleModel for accessing band interleaved image data. This class is typically used when working with images stored in different DataBuffer storage units for each band sample data. Because the access method is provided, the image data can be manipulated directly. Pixel spacing is the number of data array elements between two samples of the same band on the same scan line. The pixel spacing of the BandedSampleModel is 1. Scan line spacing is the number of data array elements between the given sample and the corresponding sample in the same column of the next scan row. The band offset represents the number of data array elements from the first data array element to the band first sample from the DataBuffer storage unit that holds each band. These band are numbered from 0 to N-1. The storage cell index represents the correspondence between the data buffer storage unit and the image data band. This class supports TYPE_BYTE ,,, TYPE_USHORT TYPE_SHORT TYPE_INT ,, TYPE_FLOAT and TYPE_DOUBLE data types.

BufferedImage

The bufferedimage subclass describes a buffer that has access to the image data Image . BufferedImagethe composition of the image data ColorModel Raster . Rasterthe SampleModel number and type of band must match the ColorModel required quantity and type to represent its color and alpha component. The BufferedImage upper-left corner coordinates for all objects are (0, 0). Therefore, anything used to construct BufferedImage Raster must satisfy: minx=0 and miny=0.

Interface

Bufferedimageop This interface describes the BufferedImage single-input/single-output operation performed on an object. It is composed AffineTransformOp of,,, ConvolveOp ColorConvertOp RescaleOp and LookupOp realized. These objects can be passed to one BufferedImageFilter in order to operate on the Imageproducer-imagefilter-imageconsumer paradigm BufferedImage .

ImageConsumer An object interface that is interested in image data through the ImageProducer interface. When you add a consumer to an image producer, the producer uses the method calls defined in this interface to pass all data about the image.

ImageObserver is used to receive an asynchronous update interface for image informational notifications when constructing an image.

imageproducer An interface to an object that can generate image data for images. Each image contains a imageproducer that is used to refactor an image when it is needed, such as when the new size of the image is scaled, or when the width or height of a request image is requested.

Rasterop This interface describes the single input/single output operation performed on the Raster object. This interface is implemented by classes such as Affinetransformop, Convolveop, and Lookupop. For specific classes that implement this interface, the Source and Destination objects must contain an appropriate number of band. Otherwise, an exception is thrown. This interface cannot be used to describe more complex operations, such as operations that accept multiple sources. Each class that implements this interface must indicate whether to allow in-place filtering operations (that is, the source object is equal to the action of the target object). Note that the limit on a single input operation means that the target pixel value before the operation is not used as input to the filter operation.

common classes and interfaces in the Java.io package

Class

An abstract representation of the file and directory path names.

An instance of the filedescriptor file descriptor class is used as an opaque handle to some structure of the underlying machine, which represents another source or receiver of an open file, open socket, or byte. The main practical use of a file descriptor is to create a FileInputStream or FileOutputStream .

FileInputStream

FileInputStream Gets the input bytes from a file in the file system. Which files are available depends on the host environment.

FileInputStream used to read raw byte streams such as data. To read a character stream, consider using theFileReader

FileOutputStream

The file output stream is File the output stream used to write data to or FileDescriptor . Whether a file is available or can be created depends on the underlying platform. In particular, some platforms allow only one FileOutputStream(or other file to write to the object) to open a file for writing at a time. In this case, if the file involved is already open, the construction method in this class will fail.

FileOutputStreamA stream used to write raw bytes such as data. To write a character stream, consider using the FileWriter .

FileReader

A handy class for reading character files. The construction method of this class assumes that both the default character encoding and the default byte buffer size are appropriate. To specify these values yourself, you can first construct a inputstreamreader on the FileInputStream.

FileReaderUsed to read a character stream. To read the original byte stream, consider using theFileInputStream

Interface

closeable closeable is a data source or destination that can be closed. Call the Close method to free resources saved by the object (such as open files).

Datainput The datainput interface is used to read bytes from a binary stream and refactor based on all Java primitive type data. It also provides tools for data refactoring based on the UTF-8 modified version format String .

DataOutput The dataoutput interface is used to convert data from any Java base type to a sequence of bytes and write those bytes to a binary stream. It also provides a tool for String converting to the UTF-8 modified format and writing the resulting series bytes.

FilenameFilter class instances that implement this interface are available for filter file names. The file dialog component of the Abstract Window Toolkit uses these instances to filter the File list catalog list in the methods of the class.

flushable flushable is the destination where data can be refreshed. The Flush method is called to write all buffered output to the underlying stream.

common classes and interfaces in the Java.util package

Class

The Date class Date represents a specific instantaneous, accurate to milliseconds.

ArrayList The implementation of a variable array of size for the List interface. All optional list operations are implemented and all elements, including null , are allowed. In addition to implementing the list interface, this class provides methods to manipulate the size of the array used internally to store the list. (This class is roughly equivalent to the Vector class, except that this class is not synchronized.) )

Dictionary The Dictionary class is the abstract parent class for any class (such as) that can map keys to corresponding values Hashtable . Each key and each value is an object. In any Dictionary object, each key is associated with at most one value. Given a Dictionary and a key, you can find the associated element. Any non- null object can be used as a key or a value.

HashMap

The implementation of a hash table-based Map interface. This implementation provides all the optional mapping operations and allows null values and null keys to be used. (TheHashMap class is roughly the same as Hashtable except for non-synchronous and null-allowed use.) This class does not guarantee the order of the mappings, especially because it does not guarantee that the order is constant.

Stack

the Stack class represents a last-in, first-out (LIFO) object heap. It extends the class vector by five operations, allowing the vector to be treated as a stack. It provides the usual push and pop operations, and the peek method that takes the stack vertex, the empty method that tests if the stack is null, the find item in the stack, and the distance to the top of the stack. Search method.

Interface

Collection

The root interface in the hierarchy. Collection represents a set of objects, also known as Collection elements. Some collection allow duplicate elements, while others do not. Some of the collection are orderly, while others are unordered. The JDK does not provide any direct implementation of this interface: it provides more specific sub-interfaces (such as Set and List) implementations. This interface is often used to pass collection and operate these collection where it is required to be the most universal.

Comparator

A comparison function that forces the overall ordering of an object collection. You can pass Comparator to the sort method, such as Collections.sort or Arrays.sort , allowing for precise control over the sort order. You can also use Comparator to control the order of certain data structures, such as 有序 set or 有序映射 , or to provide sorting for objects that are not 自然顺序 collection.

Map

Mapping entries (key-value pairs). The Map.entryset method returns the collection view of the map, where the elements belong to this class. The only way to get a mapping item reference is through an iterator to this collection view. These map.entry objects are valid only during iterations, or, more specifically, if the underlying mappings are modified after an iterator returns an item, the behavior of some of the mappings is indeterminate, except through setValue Perform actions on the map item.

Common classes and interfaces in Javaapi

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.