Previous Page TOC Next Page See Page

B

Die System API von Java

Dieser Anhang bietet Ihnen eine detaillierte Inhaltsangabe des Application Programming Interface (API) von Java. Das Java API ist eine Sammlung von Klassen, die von Java-Entwicklern entwickelt worden sind. Es soll Ihnen bei der Entwicklung Ihrer eigenen Klassen, Applets und Anwendungen helfen.

Die Klassen des Java API sind in Pakete gruppiert, von denen jedes verschiedene Klassen und Schnittstellen haben kann. Darüber hinaus können die Items verschiedene Eigenschaften wie Felder und/oder Methoden haben.

Es ist möglich, in Java zu programmieren, ohne viel über das API zu wissen. Jede Klasse, die Sie entwickeln, wird aber zumindest von einer Klasse innerhalb des API abhängen. Wenn Sie komplexere Programme entwickeln, in denen sich Zeichenketten, Sockets und graphische Schnittstellen befinden, ist es sehr hilfreich, wenn Sie die Ihnen von Sun zur Verfügung gestellten Objekte und die Eigenschaften dieser Objekte kennen.

Der folgende Anhang listet die Objekte auf, die im Java API definiert sind, zusammen mit ihren Oberklassen, Schnittstellen, Methoden und Feldern – sofern anwendbar. Dabei sind aber einige Details zu bedenken:

Denken Sie abschließend daran, daß diese Information (genauso wie Erklärungen jeden Feldes und jeder Methode) auch in zusammengefaßter Form unter http://www.javasoft.com/JDK-1.0/api/packages.html vorhanden sind. Sie können sich unter http://www.javasoft.com/ auch den Java-Quell-Code selbt herunterladen.

java.applet

Obwohl es das kleinste ist, ist dieses Paket als ein Ergebnis der Applet-Klasse am bemerkswertesten. Es ist voll von nützlichen Methoden. Die Applet-Klasse legt das Fundament für alle Applets und kann Ihnen die Informationen geben, die die Umgebung des Applets über die AppletContext Schnittstelle betreffen.

Klassen

Applet extends java.awt.Panel
Methoden

void destroy( )

AppletContext getAppletContext( )

String getAppletInfo( )

AudioClip getAudioClip(URL url, String name)

AudioClip getAudioClip(URL url)

URL getCodeBase( )

URL getDocumentBase( )

Image getImage(URL url, String name)

Image getImage(URL url)

String getParameter(String name)

String[][] getParameterInfo( )

void init( )

Boolean isActive( )

void play(URL url, String name)

void play(URL url)

void resize(Dimension d)

void resize(int width, int height)

void setStub(AppletStub stub)

void showStatus(String msg)

void start( )

void stop( )

Interfaces

AppletContext
Methoden

Applet getApplet(String name)

Enumeration getApplets( )

AudioClip getAudioClip(URL url)

Image getImage(URL url)

void showDocument(URL url, String target)

void showDocument(URL url)

void showStatus(String status)

AppletStub
Methoden

void appletResize(int width, int height)

AppletContext getAppletContext( )

URL getCodeBase( )

URL getDocumentBase( )

String getParameter(String name)

Boolean isActive( )

AudioClip
Methoden

void loop( )

void play( )

void stop( )

B.1 java.awt

Das Java Abstract Window Toolkit (AWT) besteht aus Quellen, mit denen Sie interessante, attraktive und nützliche Schnittstellen für Ihre Applets erstellen können. Das AWT enthält nicht nur Verwaltungsklassen wie GridBagLayout, sondern auch einige konkrete interaktive Tools wie Button und TextField. Was aber viel wichtiger ist, ist die Tatsache, daß Sie mit der Graphics-Klasse über ungeahnte graphische Möglichkeiten verfügen. Sie haben damit die Möglichkeit, Formen zu erzeugen und Bilder anzuzeigen.

B.1.1 Klassen

BorderLayout implements LayoutManager
Methoden

BorderLayout( )

BorderLayout(int hgap, int vgap)

void addLayoutComponent(String name, Component comp)

void layoutContainer(Container target)

Dimension minimumLayoutSize(Container target)

Dimension preferredLayoutSize(Container target)

void removeLayoutComponent(Component comp)

String toString( )

Button extends Component
Methoden

Button( )

Button(String label)

synchronized void addNotify( )

String getLabel( )

protected String paramString( )

void setLabel(String label)

Canvas extends Component
Methoden

Canvas( )

synchronized void addNotify( )

void paint(Graphics g)

CardLayout implements LayoutManager
Methoden

CardLayout( )

CardLayout(int hgap, int vgap)

void addLayoutComponent(String name, Component comp)

void first(Container parent)

void last(Container parent)

void layoutContainer(Container parent)

Dimension minimumLayoutSize(Container parent)

void next(Container parent)

Dimension preferredLayoutSize(Container parent)

void previous(Container parent)

void removeLayoutComponent(Component comp)

void show(Container parent, String name)

String toString( )

Checkbox extends Component
Methoden

Checkbox( )

Checkbox(String label)

Checkbox(String label, CheckboxGroup group, Boolean state)

synchronized void addNotify( )

CheckboxGroup getCheckboxGroup( )

String getLabel( )

Boolean getState( )

protected String paramString( )

void setCheckboxGroup(CheckboxGroup g)

void setLabel(String label)

void setState(Boolean state)

CheckboxGroup
Methoden

CheckboxGroup( )

Checkbox getCurrent( )

synchronized void setCurrent(Checkbox box)

String toString( )

CheckboxMenuItem extends MenuItem
Methoden

CheckboxMenuItem(String label)

synchronized void addNotify( )

Boolean getState( )

String paramString( )

void setState(Boolean state)

Choice extends Component
Methoden

Choice( )

synchronized void addItem(String item)

synchronized void addNotify( )

int countItems( )

String getItem(int index)

int getSelectedIndex( )

String getSelectedItem( )

protected String paramString( )

void select(String str)

synchronized void select(int pos)

final Color
Felder

final black

final blue

final cyan

final darkGray

final gray

final green

final lightGray

final magenta

final orange

final pink

final red

final white

final yellow

Methoden

Color(int rgb)

Color(float red_value, float green_value, float blue_value)

Color(int red_value, int green_value, int blue_value)

Color brighter( )

Color darker( )

Boolean equals(Object obj)

int getBlue( )

static Color getColor(String nm, int v)

static Color getColor(String nm, Color v)

static Color getColor(String nm)

int getGreen( )

static Color getHSBColor(float hue, float saturation, float brightness)

int getRed( )

int getRGB( )

int hashCode( )

static int HSBtoRGB(float hue, float saturation, float brightness)

static float[] RGBtoHSB(int red, int green, int blue, float hsbvals[])

String toString( )

abstract Component implements ImageObserver
Methoden

Boolean action(Event evt, Object what)

void addNotify( )

Rectangle bounds( )

int checkImage(Image image, int width, int height, ImageObserver observer)

int checkImage(Image image, ImageObserver observer)

Image createImage(int width, int height)

Image createImage(ImageProducer producer)

void deliverEvent(Event e)

synchronized void disable( )

void enable(Boolean cond)

synchronized void enable( )

Boolean gotFocus(Event evt, Object what)

Boolean handleEvent(Event evt)

synchronized boolean inside(int x, int y)

Boolean keyDown(Event evt, int key)

Boolean keyUp(Event evt, int key)

void list(PrintStream out, int indent)

void list(PrintStream out)

void list( )

Component locate(int x, int y)

Boolean lostFocus(Event evt, Object what)

Boolean mouseDown(Event evt, int x, int y)

Boolean mouseDrag(Event evt, int x, int y)

Boolean mouseEnter(Event evt, int x, int y)

Boolean mouseExit(Event evt, int x, int y)

Boolean mouseMove(Event evt, int x, int y)

Boolean mouseUp(Event evt, int x, int y)

Color getBackground( )

synchronized ColorModel getColorModel( )

Font getFont( )

FontMetrics getFontMetrics(Font f)

Color getForeground( )

Graphics getGraphics( )

Container getParent( )

ComponentPeer getPeer( )

Toolkit getToolkit( )

synchronized void hide( )

Boolean imageUpdate(Image img, int flags, int x, int y, int width, int height)

void invalidate( )

Boolean isEnabled( )

Boolean isShowing( )

Boolean isValid( )

Boolean isVisible( )

void layout( )

Point location( )

Dimension minimumSize( )

void move(int x, int y)

void nextFocus( )

void paint(Graphics g)

void paintAll(Graphics g)

protected String paramString( )

Boolean postEvent(Event e)

Boolean prepareImage(Image image, int width, int height, ImageObserver observer)

Dimension preferredSize( )

Boolean prepareImage(Image image, ImageObserver observer)

void print(Graphics g)

void printAll(Graphics g)

void repaint(int x, int y, int width, int height)

void repaint(long tm, int x, int y, int width,

void repaint(long tm)

void repaint( )

synchronized void removeNotify( )

void requestFocus( )

synchronized void reshape(int x, int y, int width, int height)

void resize(Dimension d)

void resize(int width, int height)

synchronized void setBackground(Color c)

synchronized void setFont(Font f)

synchronized void setForeground(Color c)

void show(boolean cond)

synchronized void show( )

Dimension size( )

String toString( )

void update(Graphics g)

void validate( )

Container extends Component
Methoden

Container( )

synchronized Component add(String name, Component comp)

synchronized Component add(Component comp, int pos)

Component add(Component comp)

synchronized void addNotify( )

int countComponents( )

void deliverEvent(Event e)

synchronized Component getComponent(int num) throws ArrayIndexOutOfBounds-
Exception

synchronized Component[] getComponents( )

LayoutManager getLayout( )

synchronized void layout( )

void list(PrintStream out, int indent)

Component locate(int x, int y)

synchronized Dimension minimumSize( )

void paintComponents(Graphics g)

protected String paramString( )

synchronized Dimension preferredSize( )

void printComponents(Graphics g)

synchronized void remove(Component comp)

synchronized void removeNotify( )

void setLayout(LayoutManager mgr)

synchronized void validate( )

Dialog extends Window
Methoden

Dialog(Frame parent, String title, Boolean modal)

Dialog(Frame parent, boolean modal)

synchronized void addNotify( )

Boolean isModal( )

Boolean isResizable( )

protected String paramString( )

void setTitle(String title)

Dimension
Felder

int height

int width

Methoden
Dimension( )

Dimension(Dimension d)

Dimension(int width, int height)

String toString( )

Event
Felder

final static int ACTION_EVENT

final static int ALT_MASK

Object arg

int clickCount

final static int CTRL_MASK

final static int DOWN

Event evt

final static int F1

final static int F2

final static int F3

final static int F4

final static int F5

final static int F6

final static int F7

final static int F8

final static int F9

final static int F10

final static int F11

final static int F12

final static int GOT_FOCUS

final static int HOME

int id

int key

final static int KEY_ACTION

final static int KEY_ACTION_RELEASE

final static int KEY_PRESS

final static int KEY_RELEASE

final static int LEFT

final static int LIST_DESELECT

final static int LIST_SELECT

final static int LOAD_FILE

final static int LOST_FOCUS

final static int META_MASK

int modifiers

final static int MOUSE_DOWN

final static int MOUSE_DRAG

final static int MOUSE_ENTER

final static int MOUSE_EXIT

final static int MOUSE_MOVE

final static int MOUSE_UP

final static int PGDN

final static int PGUP

final static int RIGHT

final static int SAVE_FILE

final static int SCROLL_ABSOLUTE

final static int SCROLL_LINE_DOWN

final static int SCROLL_LINE_UP

final static int SCROLL_PAGE_DOWN

final static int SCROLL_PAGE_UP

final static int SHIFT_MASK

Object target

final static int UP

long when

final static int WINDOW_DEICONIFY

final static int WINDOW_DESTROY

final static int WINDOW_EXPOSE

final static int WINDOW_ICONIFY

final static int WINDOW_MOVED

int x

int y

Methoden

Event(Object target, int id, Object arg)

Event(Object target, long when, int id, int x, int y, int key, int modifiers)

Event(Object target, long when, int id, int x, int y, int key, int modifiers, Object arg)

Boolean controlDown( )

Boolean metaDown( )

protected String paramString( )

Boolean shiftDown( )

String toString( )

void translate(int x, int y)

FileDialog extends Dialog
Felder

final static LOAD

final static SAVE

Methoden

FileDialog(Frame parent, String title, int mode)

FileDialog(Frame parent, String title)

synchronized void addNotify( )

String getDirectory( )

String getFile( )

FilenameFilter getFilenameFilter( )

int getMode( )

protected String paramString( )

void setDirectory(String dir)

void setFile(String file)

FlowLayout implements LayoutManager
Felder

final static int CENTER

final static int LEFT

final static int RIGHT

Methoden
FlowLayout( )

FlowLayout(int align)

FlowLayout(int align, int hgap, int vgap)

void addLayoutComponent(String name, Component comp)

void layoutContainer(Container target)

Dimension minimumLayoutSize(Container target)

Dimension preferredLayoutSize(Container target)

void removeLayoutComponent(Component comp)

String toString( )

Font
Felder

final static int BOLD

final static int ITALIC

protected String name

final static int PLAIN

protected int size

protected int style

Methoden

Font(String name, int style, int size)

Boolean equals(Object obj)

String getFamily( )

static Font getFont(String nm)

static Font getFont(String nm, Font font)

String getName( )

int getSize( )

int getStyle( )

int hashCode( )

Boolean isBold( )

Boolean isItalic( )

Boolean isPlain( )

String toString( )

FontMetrics
Felder

protected Font font

Methoden

protected FontMetrics(Font f)

int bytesWidth(byte data[], int offset, int len)

int charsWidth(char data[], int offset, int len)

int charWidth(char ch)

int charWidth(int ch)

int getAscent( )

int getDescent( )

Font getFont( )

int getHeight( )

int getMaxAdvance( )

int getMaxAscent( )

int getMaxDecent( )

int getMaxDescent( )

int[] getWidths( )

int stringWidth(String str)

String toString( )

Frame extends Window implements MenuContainer
Felder

final static int CROSSHAIR_CURSOR

final static int DEFAULT_CURSOR

final static int E_RESIZE_CURSOR

final static int HAND_CURSOR

final static int MOVE_CURSOR

final static int NE_RESIZE_CURSOR

final static int NW_RESIZE_CURSOR

final static int N_RESIZE_CURSOR

final static int SE_RESIZE_CURSOR

final static int SW_RESIZE_CURSOR

final static int S_RESIZE_CURSOR

final static int TEXT_CURSOR

final static int WAIT_CURSOR

final static int W_RESIZE_CURSOR

Methoden

Frame( )

Frame(String title)

synchronized void addNotify( )

synchronized void dispose( )

int getCursorType( )

Image getIconImage( )

MenuBar getMenuBar( )

String getTitle( )

Boolean isResizable( )

protected String paramString( )

synchronized void remove(MenuComponent m)

void setCursor(int cursorType)

void setIconImage(Image image)

synchronized void setMenuBar(MenuBar mb)

void setResizable(Boolean resizable)

void setTitle(String title)

abstract Graphics
Methoden

protected Graphics( )

abstract void clearRect(int x, int y, int width, int height)

abstract void clipRect(int x, int y, int width, int height)

abstract void copyArea(int x, int y, int width,

Graphics create(int x, int y, int width, int height)

abstract Graphics create( )

void draw3DRect(int x, int y, int width, int height, Boolean raised)

abstract void drawArc(int x, int y, int width, int height, int startAngle, int arcAngle)

abstract void drawLine(int x1, int y1, int x2, int y2)

abstract void drawOval(int x, int y, int width, int height)

void drawRect(int x, int y, int width, int height)

abstract void drawRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight)

void fill3DRect(int x, int y, int width, int height, Boolean raised)

abstract void fillOval(int x, int y, int width, int height)

abstract void fillRect(int x, int y, int width, int height)

abstract void fillRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight)

abstract void dispose( )

void drawBytes(byte data[], int offset, int length, int x, int y)

void drawChars(char data[], int offset, int length, int x, int y)

abstract Boolean drawImage(Image img, int x, int y, int width, int height, Color bgcolor, ImageObserver observer)

abstract Boolean drawImage(Image img, int x, int y, Color bgcolor, ImageObserver observer)

abstract Boolean drawImage(Image img, int x, int y, int width, int height, ImageObserver observer)

abstract Boolean drawImage(Image img, int x, int y, ImageObserver observer)

void drawPolygon(Polygon p)

abstract void drawPolygon(int xPoints[], int yPoints[], int nPoints)

abstract void drawString(String str, int x, int y)

abstract void fillArc(int x, int y, int width, int height, int startAngle,int arcAngle)

void fillPolygon(Polygon p)

abstract void fillPolygon(int xPoints[], int yPoints[], int nPoints)

void finalize( )

abstract Rectangle getClipRect( )

abstract Color getColor( )

abstract Font getFont( )

abstract FontMetrics getFontMetrics(Font f)

FontMetrics getFontMetrics( )

abstract void setColor(Color c)

abstract void setFont(Font f)

abstract void setPaintMode( )

abstract void setXORMode(Color c1)

abstract void translate(int x, int y)

String toString( )

GridBagConstraints implements Cloneable
Felder

int anchor

final static int BOTH

final static int CENTER

final static int EAST

int fill

int gridheight

int gridwidth

int gridx

int gridy

final static int HORIZONTAL

Insets insets

int ipadx

int ipady

final static int NONE

final static int NORTH

final static int NORTHEAST

final static int NORTHWEST

final static int RELATIVE

final static int REMAINDER

final static int SOUTH

final static int SOUTHEAST

final static int SOUTHWEST

final static int VERTICAL

double weightx

double weighty

final static int WEST

Methoden

GridBagConstraints( )

Object clone( )

GridBagLayout implements LayoutManager
Felder

double columnWeights[]

int columnWidths[]

protected Hashtable comptable

protected GridBagConstraints defaultConstraints

protected GridBagLayoutInfo layoutInfo

protected final static int MAXGRIDSIZE

protected final static int MINSIZE

protected final static int PREFERREDSIZE

int rowHeights[]

double rowWeights[]

Methoden

GridBagLayout( )

void addLayoutComponent(String name, Component comp)

protected void AdjustForGravity(GridBagConstraints constraints, Rectangle r)

protected void ArrangeGrid(Container parent)

protected void DumpConstraints(GridBagConstraints constraints)

protected void DumpLayoutInfo(GridBagLayoutInfo s)

GridBagConstraints getConstraints(Component comp)

int[][] getLayoutDimensions( )

protected GridBagLayoutInfo GetLayoutInfo(Container parent, int sizeflag)

Point getLayoutOrigin( )

double[][] getLayoutWeights( )

protected Dimension GetMinSize(Container parent, GridBagLayoutInfo info)

void layoutContainer(Container parent)

Point location(int x, int y)

protected GridBagConstraints lookupConstraints(Component comp)

Dimension minimumLayoutSize(Container parent)

Dimension preferredLayoutSize(Container parent)

void removeLayoutComponent(Component comp)

void setConstraints(Component comp, GridBagConstraints
constraints)

String toString( )

GridLayout implements LayoutManager
Methoden

GridLayout(int rows, int cols)

GridLayout(int rows, int cols, int hgap, int vgap)

void addLayoutComponent(String name, Component comp)

void layoutContainer(Container parent)

Dimension minimumLayoutSize(Container parent)

Dimension preferredLayoutSize(Container parent)

void removeLayoutComponent(Component comp)

String toString( )

abstract Image
Felder

final static Object UndefinedProperty

Methoden

Image( )

abstract Graphics getGraphics( )

abstract int getHeight(ImageObserver observer)

abstract Object getProperty(String name)

abstract void flush( )

abstract ImageProducer getSource( )

abstract int getWidth(ImageObserver observer)

Insets implements Cloneable
Felder

int bottom

int left

int right

int top

Methoden

Insets(int top, int left, int bottom, int right)

Object clone( )

String toString( )

Label extends Component
Felder

final static int CENTER

final static int RIGHT

Methoden

Label( )

Label(String label)

Label(String label, int alignment)

synchronized void addNotify( )

int getAlignment( )

String getText( )

protected String paramString( )

void setAlignment(int alignment)

void setText(String label)

List extends Component
Methoden

List( )

List(int rows, Boolean multipleSelections)

synchronized void addItem(String item, int index)

synchronized void addItem(String item)

synchronized void addNotify( )

int countItems( )

String getItem(int index)

synchronized void removeNotify( )

synchronized void replaceItem(String newValue, int index)

Boolean allowsMultipleSelections( )

synchronized void clear( )

synchronized void delItem(int position)

synchronized void delItems(int start, int end)

synchronized void deselect(int index)

int getRows( )

synchronized int getSelectedIndex( )

synchronized int[] getSelectedIndexes( )

synchronized String getSelectedItem( )

synchronized String[] getSelectedItems( )

int getVisibleIndex( )

synchronized Boolean isSelected(int index)

void makeVisible(int index)

Dimension minimumSize( )

Dimension minimumSize(int rows)

protected String paramString( )

Dimension preferredSize( )

Dimension preferredSize(int rows)

synchronized void select(int index)

void setMultipleSelections(Boolean v)

MediaTracker
Felder

final static int ABORTED

final static int COMPLETE

final static int ERRORED

Methoden

MediaTracker(Component comp)

synchronized void addImage(Image image, int id, int width, int height)

void addImage(Image image, int id)

synchronized Boolean checkAll(Boolean load)

Boolean checkAll( )

synchronized Boolean checkID(int id, Boolean load)

Boolean checkID(int id)

synchronized Object[] getErrorsAny( )

synchronized Object[] getErrorsID(int id)

synchronized Boolean isErrorAny( )

synchronized Boolean isErrorID(int id)

int statusAll(Boolean load)

int statusID(int id, Boolean load)

synchronized Boolean waitForAll(long ms) throws InterruptedException

void waitForAll( ) throws InterruptedException

synchronized Boolean waitForID(int id, long ms) throws InterruptedException

void waitForID(int id) throws InterruptedException

Menu extends MenuItem implements MenuContainer
Methoden

Menu(String label)

Menu(String label, Boolean tearOff)

void add(String label)

synchronized MenuItem add(MenuItem mi)

synchronized void addNotify( )

void addSeparator( )

int countItems( )

MenuItem getItem(int index)

Boolean isTearOff( )

synchronized void remove(MenuComponent item)

synchronized void remove(int index)

synchronized void removeNotify( )

MenuBar extends MenuComponent implements MenuContainer
Methoden

MenuBar( )

synchronized Menu add(Menu m)

synchronized void addNotify( )

int countMenus( )

Menu getHelpMenu( )

Menu getMenu(int i)

synchronized void remove(MenuComponent m)

synchronized void remove(int index)

void removeNotify( )

synchronized void setHelpMenu(Menu m)

MenuComponent
Methoden

MenuComponent( )

MenuContainer getParent( )

MenuComponentPeer getPeer( )

Font getFont( )

protected String paramString( )

Boolean postEvent(Event evt)

void removeNotify( )

void setFont(Font f)

String toString( )

MenuItem extends MenuComponent
Methoden

MenuItem(String label)

synchronized void addNotify( )

void disable( )

void enable(Boolean cond)

void enable( )

String getLabel( )

Boolean isEnabled( )

String paramString( )

void setLabel(String label)

Panel extends Container
Methoden

Panel( )

synchronized void addNotify( )

Point

Felder

int x

int y

Methoden

Point (int x, int y)

Boolean equals(Object obj)

int hashCode( )

void move(int x, int y)

String toString( )

void translate(int x, int y)

Polygon
Felder

int npoints

int xpoints[]

int ypoints[]

Methoden

Polygon( )

Polygon(int xpoints[], int ypoints[], int npoints)

void addPoint(int x, int y)

Rectangle getBoundingBox( )

Boolean inside(int x, int y)

Rectangle
Felder

int height

int width

int x

int y

Methoden

Rectangle( )

Rectangle(Dimension d)

Rectangle(int x, int y, int width, int height)

Rectangle(int width, int height)

Rectangle(Point p)

Rectangle(Point p, Dimension d)

void add(Rectangle r)

void add(Point pt)

void add(int newx, int newy)

Boolean equals(Object obj)

void grow(int h, int v)

int hashCode( )

Boolean inside(int x, int y)

Rectangle intersection(Rectangle r)

Boolean intersects(Rectangle r)

Boolean isEmpty( )

void move(int x, int y)

void reshape(int x, int y, int width, int height)

void resize(int width, int height)

String toString( )

void translate(int x, int y)

Rectangle union(Rectangle r)

Scrollbar extends Component
Felder

final static int HORIZONTAL

final static int VERTICAL

Methoden

Scrollbar( )

Scrollbar(int orientation)

Scrollbar(int orientation, int value, int visible, int minimum, int maximum)

synchronized void addNotify( )

int getLineIncrement( )

int getMaximum( )

int getMinimum( )

int getOrientation( )

int getPageIncrement( )

int getValue( )

int getVisible( )

protected String paramString( )

void setLineIncrement(int l)

void setPageIncrement(int l)

void setValue(int value)

void setValues(int value, int visible, int minimum, int maximum)

TextArea extends TextComponent
Methoden

TextArea( )

TextArea(int rows, int cols)

TextArea(String text)

TextArea(String text, int rows, int cols)

synchronized void addNotify( )

void appendText(String str)

int getColumns( )

int getRows( )

void insertText(String str, int pos)

Dimension minimumSize( )

Dimension minimumSize(int rows, int cols)

protected String paramString( )

Dimension preferredSize( )

Dimension preferredSize(int rows, int cols)

void replaceText(String str, int start, int end)

TextComponent extends Component
Methoden

String getSelectedText( )

int getSelectionEnd( )

int getSelectionStart( )

Boolean isEditable( )

protected String paramString( )

void select(int selStart, int selEnd)

void selectAll( )

void setEditable(Boolean t)

TextField extends TextComponent
Methoden

TextField( )

TextField(int cols)

TextField(String text)

TextField(String text, int cols)

synchronized void addNotify( )

Boolean echoCharIsSet( )

int getColumns( )

char getEchoChar( )

Dimension minimumSize( )

Dimension minimumSize(int cols)

protected String paramString( )

Dimension preferredSize( )

Dimension preferredSize(int cols)

void setEchoCharacter(char c)

Toolkit
Methoden

Toolkit( )

protected abstract ButtonPeer createButton(Button target)

protected abstract CanvasPeer createCanvas(Canvas target)

abstract int checkImage(Image image, int width, int height, ImageObserver observer)

abstract CheckboxPeer createCheckbox(Checkbox target)

abstract Image createImage(ImageProducer producer)

protected abstract CheckboxMenuItemPeer
createCheckboxMenuItem(CheckboxMenuItem target)

protected abstract ChoicePeer createChoice(Choice target)

protected abstract LabelPeer createLabel(Label target)

protected abstract ListPeer createList(List target)

protected abstract MenuPeer createMenu(Menu target)

protected abstract MenuBarPeer createMenuBar(MenuBar target)

protected abstract MenuItemPeer createMenuItem(MenuItem target)

protected abstract PanelPeer createPanel(Panel target)

abstract Boolean prepareImage(Image image, int width, int height,ImageObserver observer)

protected abstract ScrollbarPeer createScrollbar(Scrollbar target)

protected abstract TextAreaPeer createTextArea(TextArea target)

protected abstract TextFieldPeer createTextField(TextField target)

protected abstract WindowPeer createWindow(Window target)

protected abstract DialogPeer createDialog(Dialog target)

protected abstract FileDialogPeer createFileDialog(FileDialog target)

protected abstract FramePeer createFrame(Frame target)

abstract ColorModel getColorModel( )

static synchronized Toolkit getDefaultToolkit( )

abstract String[] getFontList( )

abstract FontMetrics getFontMetrics(Font f)

abstract Image getImage(URL url)

abstract Image getImage(String filename)

abstract int getScreenResolution( )

abstract Dimension getScreenSize( )

abstract void sync( )

Window extends Container
Methoden

Window(Frame parent)

synchronized void addNotify( )

synchronized void dispose( )

Toolkit getToolkit( )

final String getWarningString( )

synchronized void pack( )

synchronized void show( )

void toBack( )

void toFront( )

B.1.2 Schnittstellen

LayoutManager

void addLayoutComponent(String name, Component comp)

void layoutContainer(Container parent)

Dimension minimumLayoutSize(Container parent)

Dimension preferredLayoutSize(Container parent)

void removeLayoutComponent(Component comp)

MenuContainer
Methoden

Font getFont( )

Boolean postEvent(Event evt)

void remove(MenuComponent comp)

B.2 java.awt.image

java.awt.image ist sehr eng mit dem java.awt-Paket verbunden, Dieses Paket enthält Tools, mit denen Sie Bilder, die über das Netzwerk kommen, behandeln und manipulieren können. Da alle Klassen und Schnittstellen in diesem Paket eng miteinander verbunden sind, werden Sie sehen, daß viele Methoden mehrere Male erscheinen.

B.2.1 Klassen

abstract ColorModel

Felder

protected int pixel_bits

Methoden

ColorModel(int bits)

abstract int getAlpha(int pixel)

abstract int getBlue(int pixel)

abstract int getGreen(int pixel)

int getPixelSize( )

abstract int getRed(int pixel)

int getRGB(int pixel)

static ColorModel getRGBdefault( )

CropImageFilter extends ImageFilter
Methoden

CropImageFilter(int x, int y, int w, int h)

void setDimensions(int width, int height)

void setPixels(int x, int y, int w, int h, ColorModel model, int pixels[], int offset, int scansize)

void setPixels(int x, int y, int w, int h, ColorModel model, byte
pixels[], int offset, int scansize)

void setProperties(Hashtable props)

DirectColorModel extends ColorModel
Methoden

DirectColorModel(int bits, int rmask, int gmask, int bmask)

DirectColorModel(int bits, int rmask, int gmask, int bmask, int amask)

final int getAlpha(int pixel)

final int getAlphaMask( )

final int getBlue(int pixel)

final int getBlueMask( )

final int getGreen(int pixel)

final int getGreenMask( )

final int getRed(int pixel)

final int getRedMask( )

final int getRGB(int pixel)

FilteredImageSource extends Object implements ImageProducer
Methoden

FilteredImageSource(ImageProducer orig, ImageFilter imgf)

synchronized void addConsumer(ImageConsumer ic)

synchronized Boolean isConsumer(ImageConsumer ic)

void startProduction(ImageConsumer ic)

synchronized void removeConsumer(ImageConsumer ic)

void requestTopDownLeftRightResend(ImageConsumer ic)

ImageFilter implements ImageConsumer, Cloneable

Felder

protected ImageConsumer consumer

Methoden

ImageFilter( )

Object clone( )

ImageFilter getFilterInstance(ImageConsumer ic)

void imageComplete(int status)

void resendTopDownLeftRight(ImageProducer ip)

void setColorModel(ColorModel model)

void setDimensions(int width, int height)

void setHints(int hints)

void setPixels(int x, int y, int width, int height, ColorModel model, int pixels[], int offset, int scansize)

void setPixels(int x, int y, int w, int h, ColorModel model, byte
pixels[], int offset, int scansize)

void setProperties(Hashtable props)

IndexColorModel extends ColorModel
Methoden

IndexColorModel(int bits, int size, byte r[], byte g[], byte b[])

IndexColorModel(int bits, int size, byte r[], byte g[], byte b[], int trans)

IndexColorModel(int bits, int size, byte r[], byte g[], byte b[],
byte a[])

final int getAlpha(int pixel)

final void getAlphas(byte a[])

final int getBlue(int pixel)

final void getBlues(byte b[])

final int getGreen(int pixel)

final void getGreens(byte g[])

final int getMapSize( )

final int getRed(int pixel)

final void getReds(byte r[])

final int getRGB(int pixel)

final int getTransparentPixel( )

MemoryImageSource implements ImageProducer
Methoden

MemoryImageSource(int w, int h, ColorModel cm, byte pix[], int offset, int scan)

MemoryImageSource(int w, int h, ColorModel cm, byte pix[], int offset, int scan, Hashtable props)

MemoryImageSource(int w, int h, ColorModel cm, int pix[], int offset, int scan)

MemoryImageSource(int w, int h, ColorModel cm, int pix[], int offset, int scan, Hashtable props)

MemoryImageSource(int w, int h, int pix[], int offset, int scan)

MemoryImageSource(int w, int h, int pix[], int offset, int scan, Hashtable props)

synchronized void addConsumer(ImageConsumer ic)

synchronized Boolean isConsumer(ImageConsumer ic)

void startProduction(ImageConsumer ic)

synchronized void removeConsumer(ImageConsumer ic)

void requestTopDownLeftRightResend(ImageConsumer ic)

PixelGrabber implements ImageConsumer
Methoden

PixelGrabber(Image img, int x, int y, int w, int h, int pix[], int offset, int scansize)

PixelGrabber(ImageProducer ip, int x, int y, int w, int h, int pix[], int offset, int scansize)

synchronized Boolean grabPixels(long ms) throws InterruptedException

Boolean grabPixels( ) throws InterruptedException

void setColorModel(ColorModel model)

void setDimensions(int width, int height)

void setHints(int hints)

void setPixels(int srcX, int srcY, int srcW, int srcH, ColorModel model, byte pixels[], int srcOff, int srcScan)

void setProperties(Hashtable props)

synchronized int status( )

void setPixels(int srcX, int srcY, int srcW, int srcH, ColorModel model, int pixels[], int srcOff, int srcScan)

synchronized void imageComplete(int status)

RGBImageFilter extends ImageFilter
Felder

protected Boolean canFilterIndexColorModel

protected ColorModel newmodel

protected ColorModel origmodel

Methoden
RGBImageFilter( )

IndexColorModel filterIndexColorModel(IndexColorModel icm)

void filterRGBPixels(int x, int y, int w, int h, int pixels[], int offset, int scansize)

void setColorModel(ColorModel model)

void substituteColorModel(ColorModel oldcm, ColorModel newcm)

void setPixels(int x, int y, int width, int height, ColorModel model, int pixels[], int offset, int scansize)

void setPixels(int x, int y, int width, int height, ColorModel model, byte pixels[], int offset, int scansize)

abstract int filterRGB(int x, int y, int rgb)

B.3 java.awt.peer

Die Schnittstellen, die in diesem Paket enthalten sind, dienen als Vermittler zwischen Ihrem Code und dem Computer, auf dem Ihr Code läuft. Es ist zwar nützlich zu verstehen, was die peers tun, Sie werden aber höchstwahrscheinlich nicht direkt mit diesem Paket arbeiten müssen.

B.3.1 Schnittstellen (Interfaces)

ButtonPeer extends ComponentPeer
Methoden

abstract void setLabel(String label)

CanvasPeer extends ComponentPeer
CheckboxMenuItemPeer extends MenuItemPeer
Methoden

abstract void setState(Boolean t)

CheckboxPeer extends ComponentPeer

abstract void setCheckboxGroup(CheckboxGroup g)

abstract void setLabel(String label)

abstract void setState(Boolean state)

ChoicePeer extends ComponentPeer

abstract void addItem(String item, int index)

abstract void select(int index)

ComponentPeer
Methoden

abstract int checkImage(Image img, int w, int h, ImageObserver o)

abstract Image createImage(int width, mint height)

abstract Image createImage(ImageProducer producer)

abstract void disable( )

abstract void dispose( )

abstract void enable( )

abstract ColorModel getColorModel( )

abstract FontMetrics getFontMetrics(Font font)

abstract Graphics getGraphics( )

abstract Toolkit getToolkit( )

abstract Boolean handleEvent(Event e)

abstract void hide( )

abstract Dimension minimumSize( )

abstract void nextFocus( )

abstract void paint(Graphics g)

abstract Dimension preferredSize( )

abstract Boolean prepareImage(Image img, int w, int h, ImageObserver o)

abstract void print(Graphics g)

abstract void repaint(long tm, int x, int y, int width, int height)

abstract void requestFocus( )

abstract void reshape(int x, int y, int width, int height)

abstract void setBackground(Color c)

abstract void setFont(Font f)

abstract void setForeground(Color c)

abstract void show( )

ContainerPeer extends ComponentPeer
Methoden

abstract Insets insets( )

DialogPeer extends WindowPeer
Methoden

abstract void setResizable(Boolean resizeable)

abstract void setTitle(String title)

FileDialogPeer extends DialogPeer

abstract void setDirectory(String dir)

abstract void setFile(String file)

abstract void setFilenameFilter(FilenameFilter filter)

FramePeer extends WindowPeer

abstract void setCursor(int cursorType)

abstract void setIconImage(Image im)

abstract void setMenuBar(MenuBar mb)

abstract void setResizable(Boolean resizeable)

abstract void setTitle(String title)

LabelPeer extends ComponentPeer
Methoden

abstract void setAlignment(int alignment)

abstract void setText(String label)

ListPeer extends ComponentPeer
Methoden

abstract void addItem(String item, int index)

abstract void clear( )

abstract void delItems(int start, int end)

abstract void deselect(int index)

abstract int[] getSelectedIndexes( )

abstract void makeVisible(int index)

abstract Dimension minimumSize(int v)

abstract Dimension preferredSize(int v)

abstract void select(int index)

abstract void setMultipleSelections(Boolean v)

MenuBarPeer extends MenuComponentPeer
Methoden

abstract void addHelpMenu(Menu m)

abstract void addMenu(Menu m)

abstract void delMenu(int index)

MenuComponentPeer
Methoden

abstract void dispose( )

MenuItemPeer extends MenuComponentPeer

abstract void disable( )

abstract void enable( )

abstract void setLabel(String label)

MenuPeer extends MenuItemPeer

abstract void addItem(MenuItem item)

abstract void addSeparator( )

abstract void delItem(int index)

PanelPeer extends ContainerPeer
ScrollbarPeer extends ComponentPeer
Methoden

abstract void setLineIncrement(int l)

abstract void setPageIncrement(int l)

abstract void setValue(int value)

abstract void setValues(int value, int visible, int minimum, int maximum)

TextAreaPeer extends TextComponentPeer

abstract void insertText(String txt, int pos)

abstract Dimension minimumSize(int rows, int cols)

abstract Dimension preferredSize(int rows, int cols)

abstract void replaceText(String txt, int start, int end)

TextComponentPeer extends ComponentPeer
Methoden

abstract int getSelectionEnd( )

abstract int getSelectionStart( )

abstract String getText( )

abstract void select(int selStart, int selEnd)

abstract void setEditable(Boolean editable)

abstract void setText(String l)

TextFieldPeer extends TextComponentPeer
Methoden

abstract Dimension minimumSize(int cols)

abstract Dimension preferredSize(int cols)

abstract void setEchoCharacter(char c)

WindowPeer extends ContainerPeer
Methoden

abstract void toBack( )

abstract void toFront( )

B.3.2 Schnittstellen (Interfaces)

ImageConsumer
Felder

final static int COMPLETESCANLINES

final static int IMAGEABORTED

final static int IMAGEERROR

final static int RANDOMPIXELORDER

final static int SINGLEFRAME

final static int SINGLEFRAMEDONE

final static int SINGLEPASS

final static int STATICIMAGEDONE

final static int TOPDOWNLEFTRIGHT

Methoden

abstract void setColorModel(ColorModel model)

abstract void setDimensions(int width, int height)

abstract void setHints(int hintflags)

abstract void setPixels(int x, int y, int w, int h, ColorModel model, byte pixels[], int offset, int scansize)

abstract void setPixels(int x, int y, int w, int h, ColorModel model, int pixels[], int offset, int scansize)

abstract void imageComplete(int status)

ImageObserver
Felder

final static int ABORT

final static int ALLBITS

final static int ERROR

final static int FRAMEBITS

final static int HEIGHT

final static int SOMEBITS

final static int WIDTH

Methoden

abstract Boolean imageUpdate(Image img, int infoflags, int x, int y, int widfinal static int PROPERTIES)

ImageProducer
Methoden

abstract void addConsumer(ImageConsumer ic)

abstract Boolean isConsumer(ImageConsumer ic)

abstract void removeConsumer(ImageConsumer ic)

abstract void requestTopDownLeftRightResend(ImageConsumer abstract void startProduction(ImageConsumer ic)

B.4 java.io

Das java.io-Paket dient als Standard Input/Output-Bibliothek für Java. Mit diesem Paket können Sie Datenströme auf verschiedene Weise erstellen und bearbeiten. Sie können damit auch Datentypen, die so einfach wie String und so komplex wie StreamTokenizer sind, verwenden. Es ist aber auch sinnvoll, den Code genauer zu studieren, da dieses Paket sehr von dem basic InputStream- und OutputStream-Klassen und von Schnittstellen abhängt.

B.4.1 Klassen

BufferedInputStream extends FilterInputStream
Felder

protected byte buf[]

protected int count

protected int marklimit

protected int markpos

protected int pos

Methoden

BufferedInputStream(InputStream in)

BufferedInputStream(InputStream in, int size)

synchronized int available( ) throws IOException

synchronized void mark(int readlimit)

Boolean markSupported( )

synchronized int read(byte b[], int offset, int len) throws IOException

synchronized int read( ) throws IOException

synchronized void reset( ) throws IOException

synchronized long skip(long num) throws IOException

BufferedOutputStream extends FilterOutputStream
Felder

protected byte buf[]

protected int count

Methoden

BufferedOutputStream(OutputStream out)

BufferedOutputStream(OutputStream out, int size)

synchronized void flush( ) throws IOException

synchronized void write(byte b[], int offset, int len) throws IOException

synchronized void write(int b) throws IOException

ByteArrayInputStream extends InputStream
Felder

protected byte buf[]

protected int count

protected int pos

Methoden

ByteArrayInputStream(byte buf[])

ByteArrayInputStream(byte buf[], int offset, int length)

synchronized int available( )

synchronized int read(byte b[], int offset, int len)

synchronized int read( )

synchronized void reset( )

synchronized long skip(long num)

ByteArrayOutputStream extends OutputStream
Felder

protected byte buf[]

protected int count

Methoden

ByteArrayOutputStream( )

ByteArrayOutputStream(int size)

synchronized void reset( )

int size( )

synchronized byte[] toByteArray( )

String toString(int hibyte)

String toString( )

synchronized void write(int b)

synchronized void write(byte b[], int offset, int len)

synchronized void writeTo(OutputStream out) throws IOException

DataInputStream extends FilterInputStream implements DataInput
Methoden

DataInputStream(InputStream in)

final int read(byte b[], int offset, int len) throws IOException

final int read(byte b[]) throws IOException

final Boolean readBoolean( ) throws IOException

final byte readByte( ) throws IOException

final char readChar( ) throws IOException

final double readDouble( ) throws IOException

final float readFloat( ) throws IOException

final void readFully(byte b[], int offset, int len) throws IOException

final void readFully(byte b[]) throws IOException

final int readInt( ) throws IOException

final String readLine( ) throws IOException

final long readLong( ) throws IOException

final short readShort( ) throws IOException

final int readUnsignedByte( ) throws IOException

final int readUnsignedShort( ) throws IOException

final static String readUTF(DataInput in) throws IOException

final String readUTF( ) throws IOException

final int skipBytes(int num) throws IOException

DataOutputStream extends FilterOutputStream implements DataOutput
Felder

protected int written

Methoden

DataOutputStream(OutputStream out)

void flush( ) throws IOException

final int size( )

synchronized void write(byte b[], int offset,int len) throws IOException

synchronized void write(int b) throws IOException

final void writeBoolean(Boolean v) throws IOException

final void writeByte(int v) throws IOException

final void writeBytes(String s) throws IOException

final void writeChar(int v) throws IOException

final void writeChars(String s) throws IOException

final void writeDouble(double v) throws IOException

final void writeFloat(float v) throws IOException

final void writeInt(int v) throws IOException

final void writeLong(long v) throws IOException

final void writeShort(int v) throws IOException

final void writeUTF(String str) throws IOException

File
Felder

final static String pathSeparator

final static char pathSeparatorChar

final static String separator

final static char separatorChar

Methoden

File(String path)

File(File dir, String name)

File(String path, String name)

Boolean canRead( )

Boolean canWrite( )

Boolean delete( )

Boolean equals(Object obj)

Boolean exists( )

String getAbsolutePath( )

String getName( )

String getParent( )

String getPath( )

int hashCode( )

Boolean isAbsolute( )

Boolean isDirectory( )

Boolean isFile( )

long lastModified( )

long length( )

String[] list(FilenameFilter filter)

String[] list( )

Boolean mkdir( )

Boolean mkdirs( )

Boolean renameTo(File dest)

String toString( )

FileDescriptor
Felder

final static FileDescriptor err

final static FileDescriptor in

final static FileDescriptor out

Methoden

FileDescriptor( )

Boolean valid( )

FileInputStream extends InputStream
Methoden

FileInputStream(FileDescriptor descriptorObject)

FileInputStream(File file) throws FileNotFoundException

FileInputStream(String name) throws FileNotFoundException

int available( ) throws IOException

void close( ) throws IOException

protected void finalize( ) throws IOException

final FileDescriptor getFD( ) throws IOException

int read(byte b[], int offset, int len) throws IOException

int read(byte b[]) throws IOException

int read( ) throws IOException

long skip(long num) throws IOException

FileOutputStream extends OutputStream
Methoden

FileOutputStream(FileDescriptor fdObj)

FileOutputStream(File file) throws IOException

FileOutputStream(String name) throws IOException

void close( ) throws IOException

protected void finalize( ) throws IOException

final FileDescriptor getFD( ) throws IOException

void write(byte b[], int offset, int len) throws IOException

void write(byte b[]) throws IOException

void write(int b) throws IOException

FilterInputStream extends InputStream
Felder

protected InputStream in

Methoden

FilterInputStream(InputStream in)

int available( ) throws IOException

void close( ) throws IOException

synchronized void mark(int readlimit)

Boolean markSupported( )

int read(byte b[], int offset, int len) throws IOException

int read(byte b[]) throws IOException

int read( ) throws IOException

synchronized void reset( ) throws IOException

long skip(long num) throws IOException

FilterOutputStream extends OutputStream
Felder

protected OutputStream out

Methoden

FilterOutputStream(OutputStream out)

void close( ) throws IOException

void flush( ) throws IOException

void write(byte b[], int offset, int len) throws IOException

void write(byte b[]) throws IOException

void write(int b) throws IOException

abstract InputStream

Methoden

InputStream( )

int available( ) throws IOException

void close( ) throws IOException

synchronized void mark(int readlimit)

Boolean markSupported( )

abstract int read( ) throws IOException

int read(byte b[], int offset, int len) throws IOException

int read(byte b[]) throws IOException

synchronized void reset( ) throws IOException

long skip(long num) throws IOException

LineNumberInputStream extends FilterInputStream
Methoden

LineNumberInputStream(InputStream in)

int available( ) throws IOException

int getLineNumber( )

void mark(int readlimit)

int read(byte b[], int offset, int len) throws IOException

int read( ) throws IOException

void reset( ) throws IOException

void setLineNumber(int lineNumber)

long skip(long num) throws IOException

abstract OutputStream

Methoden

OutputStream( )

void close( ) throws IOException

void flush( ) throws IOException

void write(byte b[], int offset, int len) throws IOException

void write(byte b[]) throws IOException

abstract void write(int b) throws IOException

PipedInputStream extends InputStream
Methoden

PipedInputStream( )

PipedInputStream(PipedOutputStream src) throws IOException

void close( ) throws IOException

void connect(PipedOutputStream src) throws IOException

synchronized int read(byte b[], int offset, int len) throws IOException

synchronized int read( ) throws IOException

PipedOutputStream extends OutputStream
Methoden

PipedOutputStream( )

PipedOutputStream(PipedInputStream snk) throws IOException

void close( ) throws IOException

void connect(PipedInputStream snk) throws IOException

void write(byte b[], int offset, int len) throws IOException

void write(int b) throws IOException

PrintStream extends FilterOutputStream
Methoden

PrintStream(OutputStream out)

PrintStream(OutputStream out, Boolean autoflush)

Boolean checkError( )

void close( )

void flush( )

void print(Boolean b)

void print(double d)

void print(float f)

void print(long l)

void print(int i)

void print(char c)

synchronized void print(char s[])

synchronized void print(String s)

void print(Object obj)

synchronized void println(Boolean b)

synchronized void println(double d)

synchronized void println(float f)

synchronized void println(long l)

synchronized void println(int i)

synchronized void println(char c)

synchronized void println(char s[])

synchronized void println(String s)

synchronized void println(Object obj)

void println( )

void write(byte b[], int offset, int len)

void write(int b)

PushbackInputStream extends FilterInputStream
Felder

protected int pushBack

Methoden

PushbackInputStream(InputStream in)

int available( ) throws IOException

Boolean markSupported( )

int read(byte bytes[], int offset, int length) throws IOException

int read( ) throws IOException

void unread(int ch) throws IOException

RandomAccessFile implements DataOutput, DataInput
Methoden

RandomAccessFile(File file, String mode) throws IOException

RandomAccessFile(String name, String mode) throws IOException

void close( ) throws IOException

final FileDescriptor getFD( ) throws IOException

long getFilePointer( ) throws IOException

long length( ) throws IOException

int read(byte b[]) throws IOException

int read(byte b[], int offset, int len) throws IOException

int read( ) throws IOException

final Boolean readBoolean( ) throws IOException

final byte readByte( ) throws IOException

final char readChar( ) throws IOException

final double readDouble( ) throws IOException

final float readFloat( ) throws IOException

final void readFully(byte b[], int offset, int len) throws IOException

final void readFully(byte b[]) throws IOException

final int readInt( ) throws IOException

final String readLine( ) throws IOException

final long readLong( ) throws IOException

final short readShort( ) throws IOException

final int readUnsignedByte( ) throws IOException

final int readUnsignedShort( ) throws IOException

final String readUTF( ) throws IOException

void seek(long pos) throws IOException

int skipBytes(int num) throws IOException

void write(byte b[], int offset, int len) throws IOException

void write(byte b[]) throws IOException

final void writeBoolean(Boolean v) throws IOException

final void writeByte(int v) throws IOException

final void writeBytes(String s) throws IOException

final void writeChar(int v) throws IOException

final void writeChars(String s) throws IOException

final void writeDouble(double v) throws IOException

final void writeFloat(float v) throws IOException

final void writeInt(int v) throws IOException

final void writeLong(long v) throws IOException

final void writeShort(int v) throws IOException

final void writeUTF(String str) throws IOException

SequenceInputStream extends InputStream
Methoden

SequenceInputStream(InputStream s1, InputStream s2)

SequenceInputStream(Enumeration e)

void close( ) throws IOException

int read(byte buf[], int pos, int len) throws IOException

int read( ) throws IOException

StreamTokenizer
Felder

double nval

String sval

final static int TT_EOF

final static int TT_EOL

final static int TT_NUMBER

final static int TT_WORD

Methoden

StreamTokenizer(InputStream I)

void commentChar(int ch)

void eolIsSignificant(Boolean flag)

int lineno( )

void lowerCaseMode(Boolean fl)

int nextToken( ) throws IOException

void ordinaryChar(int ch)

void ordinaryChars(int low, int hi)

void parseNumbers( )

void pushBack( )

void quoteChar(int ch)

void resetSyntax( )

void slashSlashComments(Boolean flag)

void slashStarComments(Boolean flag)

String toString( )

void whitespaceChars(int low, int hi)

void wordChars(int low, int hi)

StringBufferInputStream extends InputStream
Felder

protected String buffer

protected int count

protected int pos

Methoden

StringBufferInputStream(String s)

synchronized int available( )

synchronized int read(byte b[], int offset, int len)

synchronized int read( )

synchronized void reset( )

synchronized long skip(long num)

B.4.2 Schnittstellen (Interfaces)

DataInput
Methoden

abstract Boolean readBoolean( ) throws IOException

abstract byte readByte( ) throws IOException

abstract char readChar( ) throws IOException

abstract double readDouble( ) throws IOException

abstract float readFloat( ) throws IOException

abstract void readFully(byte b[], int offset, int len) throws IOException

abstract void readFully(byte b[]) throws IOException

abstract int readInt( ) throws IOException

abstract long readLong( ) throws IOException

abstract short readShort( ) throws IOException

abstract int readUnsignedByte( ) throws IOException

abstract int readUnsignedShort( ) throws IOException

abstract String readUTF( ) throws IOException

abstract int skipBytes(int num) throws IOException

DataOutput
Methoden

abstract void write(byte b[], int offset, int len) throws IOException

abstract void write(byte b[]) throws IOException

abstract void write(int b) throws IOException

abstract void writeBoolean(Boolean v) throws IOException

abstract void writeByte(int v) throws IOException

abstract void writeBytes(String s) throws IOException

abstract void writeChar(int v) throws IOException

abstract void writeChars(String s) throws IOException

abstract void writeDouble(double v) throws IOException

abstract void writeFloat(float v) throws IOException

abstract void writeInt(int v) throws IOException

abstract void writeLong(long v) throws IOException

abstract void writeShort(int v) throws IOException

abstract void writeUTF(String str) throws IOException

FilenameFilter
Methoden

abstract Boolean accept(File dir, String name)

B.5 java.lang

Diese Klassen sind das »Herz« von Java. Hier bekommen Sie nicht nur die Grunddatentypen wie Integer und String, sondern auch Mittel für die Fehlerbehandlung durch die Throwable- und Error-Klassen. Darüber hinaus versorgen Sie der SecurityManager und System-Klassen mit einigen Steuerungsmöglichkeiten für das Java Laufzeit-System.

B.5.1 Klassen

Boolean
Felder

final static Boolean FALSE

final static char MAX_VALUE

final static char MIN_VALUE

final static Boolean TRUE

Methoden

Boolean(String s)

Boolean(Boolean value)

Boolean BooleanValue( )

Boolean equals(Object obj)

static Boolean getBoolean(String name)

int hashCode( )

String toString( )

static Boolean valueOf(String s)

Character
Felder

Character(char value)

char charValue( )

static int digit(char ch, int radix)

Boolean equals(Object obj)

static char forDigit(int digit, int radix)

int hashCode( )

static Boolean isDigit(char ch)

static Boolean isLowerCase(char ch)

static Boolean isSpace(char ch)

static Boolean isUpperCase(char ch)

final static int MAX_RADIX

final static int MIN_RADIX

static char toLowerCase(char ch)

String toString( )

static char toUpperCase(char ch)

Klasse
Methoden

static Class forName(String className) throws ClassNotFoundException

ClassLoader getClassLoader( )

Class[] getInterfaces( )

String getName( )

Class getSuperclass( )

Boolean isInterface( )

Object newInstance( ) throws InstantiationException, IllegalAccessException

String toString( )

ClassLoader

protected ClassLoader( )

abstract Class loadClass(String name, Boolean resolve) throws ClassNotFoundException

final Class defineClass(byte data[], int offset, int length)

final Class findSystemClass(String name) throws ClassNotFoundExcept

final void resolveClass(Class c)

Compiler
Methoden

static Object command(Object any)

static Boolean compileClass(Class clazz)

static Boolean compileClasses(String string)

static void disable( )

static void enable( )

Double extends Number
Felder

final static double MAX_VALUE

final static double MIN_VALUE

final static double NaN

final static double NEGATIVE_INFINITY

final static double POSITIVE_INFINITY

Methoden

Double(double value)

Double(String s) throws NumberFormatException

static long doubleToLongBits(double value)

double doubleValue( )

Boolean equals(Object obj)

float floatValue( )

int hashCode( )

int intValue( )

Boolean isInfinite( )

static Boolean isInfinite(double v)

Boolean isNaN( )

static Boolean isNaN(double v)

static double longBitsToDouble(long bits)

long longValue( )

String toString( )

static String toString(double d)

static Double valueOf(String s) throws NumberFormatException

Float extends Number
Felder

final static float MAX_VALUE

final static float MIN_VALUE

final static float NaN

final static float NEGATIVE_INFINITY

final static float POSITIVE_INFINITY

Felder

Float(String s) throws NumberFormatException

Float(double value)

Float(float value)

double doubleValue( )

Boolean equals(Object obj)

static int floatToIntBits(float value)

float floatValue( )

int hashCode( )

static float intBitsToFloat(int bits)

int intValue( )

Boolean isInfinite( )

static Boolean isInfinite(float v)

Boolean isNaN( )

static Boolean isNaN(float v)

long longValue( )

String toString( )

static String toString(float f)

static Float valueOf(String s) throws NumberFormatException

Integer extends Number
Felder

final static int MAX_VALUE

final static int MIN_VALUE

Methoden

Integer(int value)

Integer(String s) throws NumberFormatException

double doubleValue( )

Boolean equals(Object obj)

float floatValue( )

static Integer getInteger(String nm, Integer val)

static Integer getInteger(String nm, int val)

static Integer getInteger(String nm)

int hashCode( )

int intValue( )

long longValue( )

static int parseInt(String s) throws NumberFormatException

static int parseInt(String s, int radix) throws NumberFormatException

String toString( )

static String toString(int i)

static String toString(int i, int radix)

static Integer valueOf(String s) throws NumberFormatException

static Integer valueOf(String s, int radix) throws NumberFormatException

Long extends Number
Felder

final static long MAX_VALUE

final static long MIN_VALUE

Methoden

Long(String s) throws NumberFormatException

Long(long value)

double doubleValue( )

Boolean equals(Object obj)

float floatValue( )

static Long getLong(String nm, Long val)

static Long getLong(String nm, long val)

static Long getLong(String nm)

int hashCode( )

int intValue( )

long longValue( )

static long parseLong(String s) throws NumberFormatException

static long parseLong(String s, int radix) throws NumberFormatException

String toString( )

static String toString(long i)

static String toString(long i, int radix)

static Long valueOf(String s) throws NumberFormatException

static Long valueOf(String s, int radix) throws NumberFormatException

Math
Felder

final static double E

final static double PI

Methoden

static double abs(double a)

static float abs(float a)

static long abs(long a)

static int abs(int a)

static double acos(double a)

static double asin(double a)

static double atan(double a)

static double atan2(double a, double b)

static double ceil(double a)

static double cos(double a)

static double exp(double a)

static double floor(double a)

static double IEEEremainder(double f1, double f2)

static double log(double a) throws ArithmeticException

static double max(double a, double b)

static float max(float a, float b)

static long max(long a, long b)

static int max(int a, int b)

static double min(double a, double b)

static float min(float a, float b)

static long min(long a, long b)

static int min(int a, int b)

static double pow(double a, double b) throws ArithmeticException

static synchronized double random( )

static double rint(double a)

static long round(double a)

static int round(float a)

static double sin(double a)

static double sqrt(double a) throws ArithmeticException

static double tan(double a)

abstract Number
Methoden

Number( )

abstract double doubleValue( )

abstract float floatValue( )

abstract int intValue( )

abstract long longValue( )

Objekt
Methoden

Object( )

protected Object clone( ) throws CloneNotSupportedException

Boolean equals(Object obj)

protected void finalize( ) throws Throwable

final Class getClass( )

int hashCode( )

final void notify( )

final void notifyAll( )

String toString( )

final void wait( ) throws InterruptedException

final void wait(long timeout, int nanos) throws InterruptedException

final void wait(long timeout) throws InterruptedException

Process
Methoden

Process( )

abstract void destroy( )

abstract int exitValue( )

abstract InputStream getErrorStream( )

abstract InputStream getInputStream( )

abstract OutputStream getOutputStream( )

abstract int waitFor( ) throws InterruptedException

Runtime
Methoden

Process exec(String cmdarray[], String envp[]) throws IOException

Process exec(String cmdarray[]) throws IOException

Process exec(String command, String envp[]) throws IOException

Process exec(String command) throws IOException

void exit(int status)

long freeMemory( )

void gc( )

InputStream getLocalizedInputStream(InputStream in)

OutputStream getLocalizedOutputStream(OutputStream out)

static Runtime getRuntime( )

synchronized void load(String filename)

synchronized void loadLibrary(String libname)

void runFinalization( )

long totalMemory( )

void traceInstructions(Boolean on)

void traceMethodCalls(Boolean on)

abstract SecurityManager
Felder

protected Boolean inCheck

Methoden

protected SecurityManager( )

void checkAccept(String host, int port)

void checkAccess(ThreadGroup g)

void checkAccess(Thread g)

void checkConnect(String host, int port, Object context)

void checkConnect(String host, int port)

void checkCreateClassLoader( )

void checkDelete(String file)

void checkExec(String cmd)

void checkExit(int status)

void checkLink(String lib)

void checkListen(int port)

void checkPackageAccess(String pkg)

void checkPackageDefinition(String pkg)

void checkPropertiesAccess( )

void checkPropertyAccess(String key, String def)

void checkPropertyAccess(String key)

void checkRead(String file, Object context)

void checkRead(String file)

void checkRead(FileDescriptor fd)

void checkSetFactory( )

Boolean checkTopLevelWindow(Object window)

void checkWrite(String file)

void checkWrite(FileDescriptor fd)

protected int classDepth(String name)

protected int classLoaderDepth( )

protected ClassLoader currentClassLoader( )

protected Class[] getClassContext( )

Boolean getInCheck( )

Object getSecurityContext( )

protected Boolean inClass(String name)

protected Boolean inClassLoader( )

String
Methoden

String( )

String(StringBuffer buffer)

String(byte ascii[], int hibyte)

String(byte ascii[], int hibyte, int offset, int count)

String(char value[], int offset, int count)

String(char value[])

String(String value)

char charAt(int index)

int compareTo(String anotherString)

Boolean equals(Object anObject)

Boolean equalsIgnoreCase(String anotherString)

void getBytes(int srcBegin, int srcEnd, byte dst[], int dstBegin)

void getChars(int srcBegin, int srcEnd, char dst[], int dstBegin)

int length( )

Boolean regionMatches(Boolean ignoreCase, int toffset, String other, int offset, int len)

Boolean regionMatches(int toffset, String other, int offset, int len)

String concat(String str)

static String copyValueOf(char data[])

static String copyValueOf(char data[], int offset, int count)

Boolean endsWith(String suffix)

int hashCode( )

int indexOf(String str, int fromIndex)

int indexOf(String str)

int indexOf(int ch, int fromIndex)

int indexOf(int ch)

String intern( )

int lastIndexOf(String str, int fromIndex)

int lastIndexOf(String str)

int lastIndexOf(int ch, int fromIndex)

int lastIndexOf(int ch)

String replace(char oldChar, char newChar)

Boolean startsWith(String prefix)

Boolean startsWith(String prefix, int toffset)

String substring(int beginIndex, int endIndex)

String substring(int beginIndex)

char[] toCharArray( )

String toLowerCase( )

String toString( )

String toUpperCase( )

String trim( )

static String valueOf(double d)

static String valueOf(float f)

static String valueOf(long l)

static String valueOf(int i)

static String valueOf(char c)

static String valueOf(Boolean b)

static String valueOf(char data[], int offset, int count)

static String valueOf(char data[])

static String valueOf(Object obj)

StringBuffer
Methoden

StringBuffer(String str)

StringBuffer(int length)

StringBuffer( )

int capacity( )

synchronized char charAt(int index)

synchronized void ensureCapacity(int minimumCapacity)

synchronized void getChars(int srcBegin, int srcEnd, char dst[], int dstBegiint length( )

synchronized void setLength(int newLength)

StringBuffer append(double d)

StringBuffer append(float f)

StringBuffer append(long l)

StringBuffer append(int i)

synchronized StringBuffer append(char c)

StringBuffer append(Boolean b)

synchronized StringBuffer append(char str[], int offset, int len)

synchronized StringBuffer append(char str[])

synchronized StringBuffer append(String str)

synchronized StringBuffer append(Object obj)

StringBuffer insert(int offset, double d)

StringBuffer insert(int offset, float f)

StringBuffer insert(int offset, long l)

StringBuffer insert(int offset, int i)

synchronized StringBuffer insert(int offset, char c)

StringBuffer insert(int offset, Boolean b)

synchronized StringBuffer insert(int offset, char str[])

synchronized StringBuffer insert(int offset, Object obj)

synchronized StringBuffer insert(int offset, String str)

synchronized void setCharAt(int index, char ch)

String toString( )

System
Felder

static PrintStream err

static InputStream in

static PrintStream out

Methoden

static void arraycopy(Object src, int src_position, Object dst, int dst_posistion, int length)

static SecurityManager getSecurityManager( )

static void setSecurityManager(SecurityManager s)

static void exit(int status)

static void gc( )

static String getenv(String name)

static Properties getProperties( )

static String getProperty(String key, String def)

static String getProperty(String key)

static void load(String filename)

static void loadLibrary(String libname)

static void runFinalization( )

static void setProperties(Properties props)

Thread implements Runnable
Felder

final static int MAX_PRIORITY

final static int MIN_PRIORITY

final static int NORM_PRIORITY

Methoden

Thread( )

Thread(Runnable target)

Thread(Runnable target, String name)

Thread(ThreadGroup group, Runnable target)

Thread(ThreadGroup group, Runnable target, String name)

Thread(ThreadGroup group, String name)

Thread(String name)

static int activeCount( )

int countStackFrames( )

static Thread currentThread( )

void destroy( )

static int enumerate(Thread tarray[])

final String getName( )

final int getPriority( )

final ThreadGroup getThreadGroup( )

void interrupt( )

static Boolean interrupted( )

Boolean isInterrupted( )

final synchronized void join(long millis, int nanos) throws InterruptedException

final synchronized void join(long millis) throws InterruptedException

final void resume( )

void run( )

final void setName(String name)

final void setPriority(int newPriority)

static void sleep(long millis, int nanos) throws InterruptedException

static void sleep(long millis) throws InterruptedException

synchronized void start( )

final synchronized void stop(Throwable o)

final void stop( )

final void suspend( )

static void yield( )

void checkAccess( )

static void dumpStack( )

final Boolean isDaemon( )

final void join( ) throws InterruptedException

final void setDaemon(Boolean on)

String toString( )

ThreadGroup

ThreadGroup(String name)

ThreadGroup(ThreadGroup parent, String name)

synchronized int activeCount( )

synchronized int activeGroupCount( )

final void checkAccess( )

final synchronized void destroy( )

int enumerate(ThreadGroup list[], Boolean recurse)

int enumerate(ThreadGroup list[])

int enumerate(Thread list[], Boolean recurse)

int enumerate(Thread list[])

final int getMaxPriority( )

final String getName( )

final ThreadGroup getParent( )

final Boolean isDaemon( )

synchronized void list( )

final Boolean parentOf(ThreadGroup g)

final synchronized void resume( )

final void setDaemon(Boolean daemon)

final synchronized void setMaxPriority(int pri)

final synchronized void stop( )

final synchronized void suspend( )

String toString( )

void uncaughtException(Thread t, Throwable e)

Throwable
Methoden

Throwable( )

Throwable(String message)

Throwable fillInStackTrace( )

String getMessage( )

void printStackTrace(PrintStream s)

void printStackTrace( )

String toString( )

Interfaces
Cloneable
Runnable
Methoden

abstract void run( )

B.6 java.net

Genauso sehr wie Java eine netzwerkbasierende Sprache ist, genauso nützlich ist auch dieses kleine Paket. Vor allem können Sie damit mit anderen Informationsquellen kommunizieren – indem Sie Sockets erstellen, sich zu diesen verbinden oder von URLs Gebrauch machen.

B.6.1 Klassen

abstract ContentHandler

Methoden

ContentHandler( )

abstract Object getContent(URLConnection urlc) throws IOException

DatagramPacket
Methoden

DatagramPacket(byte ibuf[], int ilength)

DatagramPacket(byte ibuf[],int ilength, InetAddress iaddr, int iport)

InetAddress getAddress( )

byte[] getData( )

int getLength( )

int getPort( )

DatagramSocket
Methoden

DatagramSocket(int port) throws SocketException

DatagramSocket( ) throws SocketException

protected synchronized void finalize( )

int getLocalPort( )

synchronized void receive(DatagramPacket p) throws IOException

void send(DatagramPacket p) throws IOException

final InetAddress

Methoden

static synchronized InetAddress[] getAllByName(String host) throws UnknownHostException

static InetAddress getLocalHost( ) throws UnknownHostException

Boolean equals(Object obj)

byte[] getAddress( )

static synchronized InetAddress getByName(String host) throws UnknownHostExction

String getHostName( )

int hashCode( )

String toString( )

ServerSocket
Methoden

ServerSocket(int port) throws IOException

ServerSocket(int port, int count) throws IOException

Socket accept( ) throws IOException

void close( ) throws IOException

InetAddress getInetAddress( )

int getLocalPort( )

String toString( )

static synchronized void setSocketFactory(SocketImplFactory fac) throws IOException

Socket
Methoden

Socket(InetAddress address, int port, Boolean stream) throws IOException

Socket(InetAddress address, int port) throws IOException

Socket(String host, int port, Boolean stream) throws IOException

Socket(String host, int port) throws UnknownHostException, IOException

synchronized void close( ) throws IOException

InetAddress getInetAddress( )

InputStream getInputStream( ) throws IOException

int getLocalPort( )

OutputStream getOutputStream( ) throws IOException

int getPort( )

static synchronized void setSocketImplFactory(SocketImplFactory fac) throws IOException

String toString( )

abstract SocketImpl
Felder

protected InetAddress address

protected FileDescriptor fd

protected int localport

protected int port

Methoden

SocketImpl( )

protected abstract void accept(SocketImpl s) throws IOException

protected abstract int available( ) throws IOException

protected abstract void bind(InetAddress host, int port) throws IOException

protected abstract void close( ) throws IOException

protected abstract void connect(InetAddress address, int port) throws IOException

protected abstract void connect(String host, int port) throws IOException

protected abstract void create(Boolean stream) throws IOException

FileDescriptor getFileDescriptor( )

protected InetAddress getInetAddress( )

protected abstract InputStream getInputStream( ) throws IOException

protected int getLocalPort( )

protected abstract OutputStream getOutputStream( ) throws IOException

protected int getPort( )

protected abstract void listen(int count) throws IOException

String toString( )

URL

URL(String protocol, String host, int port, String file) throws MalformedURLException

URL(URL context, String spec) throws MalformedURLException

URL(String spec) throws MalformedURLException

URL(String protocol, String host, String file) throws MalformedURLException

int getPort( )

String getProtocol( )

Boolean equals(Object obj)

final Object getContent( ) throws IOException

String getFile( )

String getHost( )

String getRef( )

int hashCode( )

URLConnection openConnection( ) throws IOException

final InputStream openStream( ) throws IOException

Boolean sameFile(URL other)

protected void set(String protocol, String host, int port, String file, String static synchronized void setURLStreamHandlerFactory(URLStreamHandlerFactory fac)

String toExternalForm( )

String toString( )

abstract URLConnection
Felder

protected Boolean allowUserInteraction

protected Boolean connected

protected Boolean doInput

protected Boolean doOutput

protected long ifModifiedSince

protected URL url

protected Boolean useCaches

Methoden

abstract void connect( ) throws IOException

Boolean getAllowUserInteraction( )

Object getContent( ) throws IOException

String getContentEncoding( )

int getContentLength( )

String getContentType( )

long getDate( )

Boolean getDoInput( )

Boolean getDoOutput( )

long getExpiration( )

String getHeaderField(int num)

String getHeaderField(String name)

long getHeaderFieldDate(String name, long Default)

int getHeaderFieldInt(String name, int Default)

String getHeaderFieldKey(int num)

InputStream getInputStream( ) throws IOException

long getLastModified( )

OutputStream getOutputStream( ) throws IOException

URL getURL( )

void setAllowUserInteraction(Boolean allowuserinteraction)

static void setDefaultAllowUserInteraction(Boolean default)

void setDoInput(Boolean doinput)

void setDoOutput(Boolean dooutput)

String toString( )

URLConnection(URL url)

static Boolean getDefaultAllowUserInteraction( )

static String getDefaultRequestProperty(String key)

Boolean getDefaultUseCaches( )

long getIfModifiedSince( )

String getRequestProperty(String key)

Boolean getUseCaches( )

static synchronized void setContentHandlerFactory(ContentHandlerFactory fac)

static void setDefaultRequestProperty(String key, String value)

void setDefaultUseCaches(Boolean defaultusecaches)

void setIfModifiedSince(long ifmodifiedsince)

void setRequestProperty(String key, String value)

void setUseCaches(Boolean usecaches)

static String guessContentTypeFromName(String fname)

static String guessContentTypeFromStream(InputStream is) throws IOException

URLEncoder
Methoden

static String encode(String s)

abstract URLStreamHandler

Methoden

URLStreamHandler( )

abstract URLConnection openConnection(URL url) throws IOException

void parseURL(URL url, String spec, int start, int limit)

void setURL(URL url, String protocol, String host, int port, String file, String ref)

String toExternalForm(URL url)

Interfaces
ContentHandlerFactory
Methoden

abstract ContentHandler createContentHandler(String mimetype)

SocketImplFactory

abstract SocketImpl createSocketImpl( )

URLStreamHandlerFactory
Methoden

abstract URLStreamHandler CreateURLStreamHandler(String proto

B.7 java.util

Dieses Paket ist eine Sammlung nützlicher Klassen, die nicht in eines der anderen Pakete gepaßt haben. Unter diesen »handlichen« Klassen befindet die Date-Klasse, mit der Sie Operationen mit dem Datum bearbeiten und verwalten können. Die Hashtable-Klasse und Klassen, um ADTs zu entwickeln wie etwa Stack und Vector.

B.7.1 Klassen

BitSet implements java.lang.Cloneable
Methoden

BitSet( )

BitSet(int nbits)

void and(BitSet set)

void clear(int bit)

Object clone( )

Boolean equals(Object obj)

Boolean get(int bit)

int hashCode( )

void or(BitSet set)

void set(int bit)

int size( )

String toString( )

void xor(BitSet set)

Date
Methoden

Date( )

Date(int year, int month, int date)

Date(int year, int month, int date, int hrs, int min)

Date(String s)

Date(int year, int month, int date, int hrs, int min, int sec)

Boolean after(Date when)

Boolean before(Date when)

Boolean equals(Object obj)

int getDate( )

int getDay( )

int getHours( )

int getMinutes( )

int getMonth( )

int getSeconds( )

long getTime( )

int getTimezoneOffset( )

int getYear( )

int hashCode( )

static long parse(String s)

void setDate(int date)

void setHours(int hours)

void setMinutes(int minutes)

void setMonth(int month)

void setSeconds(int seconds)

void setTime(long time)

void setYear(int year)

String toGMTString( )

String toLocaleString( )

String toString( )

static long UTC(int year, int month, int date, int hrs, int min, int sec)

abstract Dictionary

Dictionary( )

abstract Enumeration elements( )

abstract Object get(Object key)

abstract Boolean isEmpty( )

abstract Enumeration keys( )

abstract Object put(Object key, Object value)

abstract Object remove(Object key)

abstract int size( )

Hashtable extends Dictionary implements java.lang.Cloneable

Hashtable( )

Hashtable(int initialCapacity)

Hashtable(int initialCapacity, float loadFactor)

synchronized void clear( )

synchronized Object clone( )

synchronized Boolean contains(Object value)

synchronized Boolean containsKey(Object key)

synchronized Enumeration elements( )

synchronized Object get(Object key)

Boolean isEmpty( )

synchronized Enumeration keys( )

synchronized Object put(Object key, Object value)

protected void rehash( )

synchronized Object remove(Object key)

int size( )

synchronized String toString( )

Observable

Observable( )

synchronized void addObserver(Observer o)

protected synchronized void clearChanged( )

synchronized int countObservers( )

synchronized void deleteObserver(Observer o)

synchronized void deleteObservers( )

synchronized Boolean hasChanged( )

synchronized void notifyObservers(Object arg)

void notifyObservers( )

protected synchronized void setChanged( )

Properties extends Hashtable

Felder

protected Properties defaults

Methoden

Properties( )

Properties(Properties defaults)

String getProperty(String key, String defaultValue)

String getProperty(String key)

void list(PrintStream out)

synchronized void load(InputStream in) throws IOException

Enumeration propertyNames( )

synchronized void save(OutputStream out, String header)

Random

Random( )

Random(long seed)

double nextDouble( )

float nextFloat( )

synchronized double nextGaussian( )

int nextInt( )

long nextLong( )

synchronized void setSeed(long seed)

Stack extends Vector

Stack( )

Boolean empty( )

Object peek( )

Object pop( )

Object push(Object item)

int search(Object o)

StringTokenizer implements Enumeration

StringTokenizer(String str)

StringTokenizer(String str, String delim)

StringTokenizer(String str, String delim, Boolean returnTokens)

int countTokens( )

Boolean hasMoreElements( )

Boolean hasMoreTokens( )

Object nextElement( )

String nextToken(String delim)

String nextToken( )

Vector implements java.lang.Cloneable
Felder

protected int elementCount

protected Object elementData[]

Methoden

Vector( )

Vector(int initialCapacity)

Vector(int initialCapacity, int capacityIncrement)

final synchronized void addElement(Object obj)

final int capacity( )

protected int capacityIncrement

synchronized Object clone( )

final Boolean contains(Object elem)

final synchronized void copyInto(Object anArray[])

final synchronized Object elementAt(int index)

final synchronized Enumeration elements( )

final synchronized void ensureCapacity(int minCapacity)

final synchronized Object firstElement( )

final synchronized int indexOf(Object elem, int index)

final int indexOf(Object elem)

final synchronized void insertElementAt(Object obj, int index)

final Boolean isEmpty( )

final synchronized Object lastElement( )

final synchronized int lastIndexOf(Object elem, int index)

final int lastIndexOf(Object elem)

final synchronized void removeAllElements( )

final synchronized Boolean removeElement(Object obj)

final synchronized void removeElementAt(int index)

final synchronized void setElementAt(Object obj, int index)

final synchronized void setSize(int newSize)

final int size( )

final synchronized String toString( )

final synchronized void trimToSize( )

B.7.2 Schnittstellen (Interfaces)

Enumeration
Methoden

abstract Boolean hasMoreElements( )

abstract Object nextElement( )

Observer

abstract void update(Observable o, Object arg)

B.8 sun.tools.debug

Das sun.tools.debug-Paket ist für remote Debugging mit dem Java Debugger (JDB) geeignet. Wenn Sie diese Klassen untersuchen, werden Sie den Prozeß verstehen lernen. Für die Erstellung von normalem Code wird dieses Paket nicht benötigt. Mit diesem Paket bekommen Sie das Fundament, um einen nützlicheren und anwenderfreundlicheren Debugger zu entwicklen – etwas, das von Sun offen gefördert wird.

B.8.1 Klassen

RemoteArray extends RemoteObject
Methoden

String arrayTypeName(int type)

final RemoteValue getElement(int index) throws Exception

final RemoteValue[] getElements(int beginIndex, int endIndex) throws Exception

final RemoteValue[] getElements( ) throws Exception

final int getElementType( ) throws Exception

final int getSize( )

String typeName( )

String description( )

String toString( )

RemoteBoolean extends RemoteValue
Methoden

Boolean get( )

String toString( )

String typeName( )

RemoteByte extends RemoteValue
Methoden

byte get( )

String toString( )

String typeName( )

RemoteChar extends RemoteValue
Methoden

char get( )

String toString( )

String typeName( )

RemoteClass extends RemoteObject
Methoden

void catchExceptions( ) throws Exception

String clearBreakpoint(int pc) throws Exception

String clearBreakpointLine(int lineno) throws Exception

String clearBreakpointMethod(RemoteField method) throws Exception

String description( )

RemoteObject getClassLoader( ) throws Exception

RemoteField getField(String name) throws Exception

RemoteField getField(int num) throws Exception

RemoteField[] getFelder( ) throws Exception

RemoteValue getFieldValue(String name) throws Exception

RemoteValue getFieldValue(int num) throws Exception

RemoteField getInstanceField(int num) throws Exception

RemoteField[] getInstanceFelder( ) throws Exception

RemoteClass[] getInterfaces( ) throws Exception

RemoteField getMethod(String name) throws Exception

String[] getMethodNames( ) throws Exception

RemoteField[] getMethoden( ) throws Exception

String getName( ) throws Exception

InputStream getSourceFile( ) throws Exception

String getSourceFileName( )

RemoteField[] getStaticFelder( ) throws Exception

RemoteClass getSuperclass( ) throws Exception

void ignoreExceptions( ) throws Exception

Boolean isInterface( ) throws Exception

String setBreakpointLine(int lineno) throws Exception

String setBreakpointMethod(RemoteField method) throws Exception

String toString( )

String typeName( ) throws Exception

RemoteDebugger
Methoden

RemoteDebugger(String host, String password, DebuggerCallback client, Boolean verbose) throws Exception

RemoteDebugger(String javaArgs, DebuggerCallback client, Boolean verbose) throws Exception

void close( )

RemoteClass findClass(String name) throws Exception

int freeMemory( ) throws Exception

void gc(RemoteObject save_list[]) throws Exception

RemoteObject get(Integer id)

String[] getExceptionCatchList( ) throws Exception

String getSourcePath( ) throws Exception

void itrace(Boolean traceOn) throws Exception

String[] listBreakpoints( ) throws Exception

RemoteClass[] listClasses( ) throws Exception

RemoteThreadGroup[] listThreadGroups(RemoteThreadGroup tg) throws Exception

RemoteThreadGroup run(int argc, String argv[]) throws Exception

void setSourcePath(String pathList) throws Exception

int totalMemory( ) throws Exception

void trace(Boolean traceOn) throws Exception

RemoteDouble extends RemoteValue
Methoden

double get( )

String toString( )

String typeName( )

RemoteField extends Field

Methoden

String getModifiers( )

String getName( )

String getType( )

Boolean isStatic( )

String toString( )

RemoteFloat extends RemoteValue

Methoden

float get( )

String toString( )

String typeName( )

RemoteInt extends RemoteValue
Methoden

int get( )

RemoteInt(int i)

String toString( )

String typeName( )

RemoteLong extends RemoteValue
Methoden

long get( )

String toString( )

String typeName( )

RemoteObject extends RemoteValue
Methoden

String description( )

final RemoteClass getClazz( )

RemoteField getField(String name) throws Exception

RemoteField getField(int num) throws Exception

RemoteField[] getFelder( ) throws Exception

RemoteValue getFieldValue(String name) throws Exception

RemoteValue getFieldValue(int num) throws Exception

final int getId( )

String toString( )

String typeName( ) throws Exception

RemoteShort extends RemoteValue
Methoden

short get( )

String toString( )

String typeName( )

RemoteStackFrame extends StackFrame
Methoden

int getLineNumber( )

RemoteStackVariable getLocalVariable(String name) throws Exception

RemoteStackVariable[] getLocalVariables( ) throws Exception

String getMethodName( )

int getPC( )

RemoteClass getRemoteClass( )

RemoteStackVariable extends LocalVariable
Methoden

String getName( )

RemoteValue getValue( )

Boolean inScope( )

RemoteString extends RemoteObject
Methoden

String description( )

String toString( )

String typeName( )

String typeName( )

RemoteThread extends RemoteObject
Methoden

void cont( ) throws Exception

void down(int nFrames) throws Exception

RemoteStackFrame[] dumpStack( ) throws Exception

RemoteStackFrame getCurrentFrame( ) throws Exception

int getCurrentFrameIndex( )

String getName( ) throws Exception

RemoteStackVariable getStackVariable(String name) throws Exception

RemoteStackVariable[] getStackVariables( ) throws Exception

String getStatus( ) throws Exception

Boolean isSuspended( )

void next( ) throws Exception

void resetCurrentFrameIndex( )

void resume( ) throws Exception

void setCurrentFrameIndex(int iFrame)

void step(Boolean skipLine) throws Exception

void stop( ) throws Exception

void suspend( ) throws Exception

void up(int nFrames) throws Exception

RemoteThreadGroup extends RemoteObject
Methoden

String getName( ) throws Exception

RemoteThread[] listThreads(Boolean recurse) throws Exception

void stop( ) throws Exception

RemoteValue
Methoden

String description( )

static int fromHex(String hexStr)

final int getType( )

final Boolean isObject( )

static String toHex(int num)

abstract String typeName( ) throws Exception

StackFrame
Methoden

StackFrame( )

String toString( )

LocalVariable

Die sun.tools.debug.LocalVariable-Klasse ist keine public-Klasse, aber ziemlich beschränkt auf den Gebrauch innerhalb des sun.tools.debug-Pakets. Das liegt an der Tatsache, daß die Klasse selbst und alle ihre Felder als »friendly« (es wurden also keine Zugangsmodifizierer angegeben) definiert werden. Obwohl es nicht für den Gebrauch von Java-Entwicklern gedacht ist, ist hier denoch aufgeführt, da diese Klasse von anderen Klassen in diesem Paket abhängt.

Felder

Boolean methodArgument;

String name;

String signature;

int slot;

B.8.2 Schnittstelle (Interface)

DebuggerCallback

abstract void breakpointEvent(RemoteThread t)

abstract void exceptionEvent(RemoteThread t, String errorText) throws Exception

abstract void printToConsole(String text) throws Exception

abstract void quitEvent( ) throws Exception

abstract void threadDeathEvent(RemoteThread t) throws Exception

B.9 Ausnahmen

Ausnahmen geben Ihnen ein Mittel an die Hand, mit dem Sie gewöhnliche Laufzeitprobleme, die bei der Ausführung Ihres Programmes auftreten, handhaben können. Ausnahmen werden von Methoden aufgeworfen und mit try-catch-Blöcken gehandhabt.

Alle Ausnahmen stammen von java.lang ab und bestehen nur aus zwei Konstruktionsmethoden. Deshalb werden hier nur die Konstruktionsmethoden für java.lang.Exception aufgelistet. Wenn nicht anders notiert, werden alle Ausnahmen ohne Parameter oder mit einer beschreibenden Zeichenkette als Parameter erstellt.

B.9.1 java.awt.

AWTException

AWTException(String message)

B.9.2 java.io

EOFException extends IOException

FileNotFoundException extends IOException

IOException extends java.lang.Exception

InterruptedIOException extends IOException

UTFDataFormatException extends IOException

B.9.3 java.lang

ArithmeticException extends RuntimeException

ArrayIndexOutOfBoundsException extends IndexOutOfBoundsException

Constructors

ArrayIndexOutOfBoundsException( )

ArrayIndexOutOfBoundsException(int invalid_index)

ArrayIndexOutOfBoundsException(String message)

ArrayStoreException extends RuntimeException

ClassCastException extends RuntimeException

ClassNotFoundException extends Exception

CloneNotSupportedException extends Exception

Exception extends Throwable
Methoden

Exception(String mesage)

Exception( )

IllegalAccessException extends Exception

IllegalArgumentException extends RuntimeException

IllegalMonitorStateException extends RuntimeException

IllegalThreadStateException extends RuntimeException

IndexOutOfBoundsException extends RuntimeException

InstantiationException extends Exception

InterruptedException extends Exception

NegativeArraySizeException extends RuntimeException

NoSuchMethodException extends Exception

NullPointerException extends RuntimeException

NumberFormatException extends IllegalArgumentException

RuntimeException extends Exception

SecurityException extends RuntimeException

StringIndexOutOfBoundsException extends IndexOutOfBoundsException

Constructors

StringIndexOutOfBoundsException( )

StringIndexOutOfBoundsException(int invalid_index)

StringIndexOutOfBoundsException(String)

java.net

MalformedURLException extends java.lang.IOException

ProtocolException extends java.lang.IOException

SocketException extends java.lang.IOException

UnknownHostException extends java.lang.IOException

UnknownServiceException extends java.lang.IOException

java.util

EmptyStackException extends java.lang.RuntimeException

Constructors

EmptyStackException( )

NoSuchElementException extends java.lang.RuntimeException

B.10 Fehler

Während Fehler und Ausnahmen beide auf der java.lang.Throwable-Klasse basieren, können Sie mit Errors kritischere Laufzeitfehler behandeln. Fehler können genauso wie Ausnahmen behandelt werden, aber wenn Sie das Problem nicht genau verstehen oder eine geeignete Art zur Lösung gefunden haben, sollten Sie keine Fehlerbehandlung in Ihren Code mit aufnehmen.

Ähnlich wie Ausnahmen stammen alle Fehler von java.lang.Errors ab. Die meisten Fehler enthalten nur eine einzige Konstruktionsmethode und meistens auch nur ErrorName( ) und ErrorName(String message). Es sind alle Fehler aufgelistet, die mit den hier genannten Konstruktionsprinzipien nicht übereinstimmen.

B.10.1 java.awt

AWTError extends java.lang.Error

Constructors

AWTError( )

B.10.2 java.lang

AbstractMethodError extends IncompatibleClassChangeError

ClassCircularityError extends LinkageError

ClassFormatError extends LinkageError

Error extends Throwable

Methoden

Error(String mesage)

Error( )

IllegalAccessError extends IncompatibleClassChangeError

IncompatibleClassChangeError extends LinkageError

InstantiationError extends IncompatibleClassChangeError

InternalError extends VirtualMachineError

LinkageError extends Error

NoClassDefFoundError extends LinkageError

NoSuchFieldError extends IncompatibleClassChangeError

NoSuchMethodError extends IncompatibleClassChangeError

OutOfMemoryError extends VirtualMachineError

StackOverflowError extends VirtualMachineError

ThreadDeath extends Error

Constructors

ThreadDeath( )

UnknownError extends VirtualMachineError

UnsatisfiedLinkError extends LinkageError

VerifyError extends LinkageError

VirtualMachineError extends Error

alMachineError extends Error


(c) 1997 Que
Ein Imprint des Markt&Technik Buch- und Software- Verlag GmbH
Elektronische Fassung des Titels: Special Edition: Java, ISBN: 3-8272-1001-1

Previous Page Page Top TOC Next Page See Page