100% found this document useful (3 votes)
113 views438 pages

Java Program Lama Dili TCOBAN WwwJavaDiliCom

Uploaded by

www.javadili.com
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
100% found this document useful (3 votes)
113 views438 pages

Java Program Lama Dili TCOBAN WwwJavaDiliCom

Uploaded by

www.javadili.com
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd

1

o m
i.c
JAVA PROGRAMLAMA DİLİ
(1.1 SÜRÜMÜ)

dil
Dr. M. Turhan Çoban
TÜBİTAK Marmara Araştırma Merkezi
va
Enerji Sistemleri ve Çevre Araştırma Enstitüsü
Email : turhan@[Link]
ja
w.
ww

1
2

İNDEKS

m
BÖLÜM 1 : JAVAYA GİRİŞ

1.1 Niçin Java programlama Dili


1.2 Java programını yazma ve çalıştırma
1.3 Java Programlama dili temel değişken türleri

o
1.3.1 Boolean değişken türü
1.3.2 char (harf) değişken türü
1.3.3 Tam sayı değişken türleri (byte, short,int,long)

i.c
1.3.4 Gerçek sayı değişken türleri (byte, short,int,long)
1.3.5 String değişkeni
1.4 Aritmetik işlemler
1.5 Javada Mantıksal işlemler
1.6 Java Dilinin temel komutları
1.6.1 if - elseif - else mantıksal karşılaştırma yapısı
1.6.2 while tekrarlama yapısı
1.6.3 for tekrarlama yapısı
1.6.4 switch - case yapısı

dil
BÖLÜM 2 : METOTLAR VE OBJECT KULLANIMI
2.1 Java API Kütüphanesi
2.2 Metotlar
va
2.3 Nesne (Object) tanımı ve metodlarda kullanımı
2.3 Metodların kendi kendini çağırması (Recusion)
2.4 Aynı adlı metodların bir arada kullanılması (overloading)
2.5 Metod (method) ve sınıf değişkenleri

BÖLÜM 3 : SINIF (CLASS) YAPILARINA GİRİŞ


ja

3.1 Sınıf yapısının genel tanımı


3.2 Kurucu ( constructor ) metot
3.3 Diğer metotlar
3.4 this deyiminin kullanımı
w.

3.5 sınıf değişkenlerinin dış dünyadan gizlenmesi


3.6 Sınıflarda Kalıtım (inheritance)
3.7 Sınıfları başka bir sınıfta nesne olarak çağırarak bir araya getirme (composition)
3.8 Kalıtım yoluyla alt sınıfa bağlanmış üst sınıf referansı üzerinden alt sınıfı çağırma
3.9 nesneyi dinamik olarak silmek finalize() metodu
ww

BÖLÜM 4 : BOYUTLU DEGİŞKEN VE NESNELER (ARRAYS)


4.1 tek boyutlu değişkenler
4.2 tek boyutlu nesne tipi değişkenler
4.3 Çok boyutlu değişkenler
4.4 Boyutlu değişkenlerin metodlara aktarımı

2
3

BÖLÜM 5 : SINIFLARDA HİYERARŞİ, ABSTRACT SINIF VE


İNTERFACE

m
5.1 Abstract sınıf
5.2 Interface

BÖLÜM 6 : GRAFİKLER, FONTLAR VE RENKLER

o
6.1 Graphics sınıfı
6.2 Renk kontrolü

i.c
6.3 Yazı Kontrolu
6.4 Çizgi çizimi
6.5 Dikdörtgen çizimi
6.6 Oval ve açılı oval çizimi
6.7 Polygon çizimi
6.8 Resim gösterimi

dil
BÖLÜM 7: Grafik Applet Oluşturma Metotları, Grafik Kullanıcısı
Arabirim programları (GUI)

7.1 Graphic Kullanıcısı Arabirim programları, GUI, (Graphics User Interface)


7.2 Label (Etiket) sınıfı
7.3 Button (Düğme) sınıfı
va
7.4 TextField(YazımAlanı) sınıfı
7.5 TextArea(YazımAlanı) sınıfı
7.6 Choice (Seçim) sınıfı
7.7 CheckBox ve CheckBoxGroup sınıfları
7.8 Mouse(Fare) kontrolu
7.8.1 [Link] programı ve apleti
7.9 List sınıfı, listeden seçim
ja

7.10 FlowLayout sınıfı kullanarak GUI formatlanması


7.11 BorderLayout sınıfı kullanarak GUI formatlanması
7.12 GridLayout sınıfı kullanarak GUI formatlanması
7.13 Panel sınıfı
w.

8. JAVADA HATA ANALİZİ VE YAKALANMASI

9. PARELEL KULLANIM (MULTITHREADING)

10. JAVA GİRDİ - ÇIKTI PROGRAMLANMASI


ww

10.1 Javanın I/O (Girdi çıktı ) kütüphanesinde yer alan sınıflar ve interface’ler
10.2 File (Dosya) sınıfı
10.3 Ardışık (Sequential) dosya yaratılması
10.4 Raslantısal Ulaşım Dosyası Oku (Random Access File)

11 GELİŞMİŞ JAVA BİLGİ İŞLEME YAPILARI

3
4

11.1 Vector Sınıfı

m
12 ÖRNEKLERLE SAYISAL ANALİZ

EK A TEXT SINIFI
EK B JAVA KÜTÜPHANESİ İNDEKSİ
EK C JAVADA KULLANILAN METODLARIN LİSTESİ

o
i.c
dil
ja va
w.
ww

4
5

JAVA PROGRAMLAMA DİLİ

m
BÖLÜM 1 : Javaya Giriş
1.1 Niçin Java programlama Dili

o
Java Programlama dili şu anda dünyadaki en popüler programlama dillerinden biri haline
gelmiştir. Java SUN bilgisayar şirketince orijinal olarak elektrikli ev araçlarının birbiriyle

i.c
haberleşmesini sağlamayı amaçlayan bir proje içerisinde 1991 yılında geliştirilmeye başlandı.
Orijinal adı bu dilin yaratıcısı James Gosling tarafından Oak olarak konulan programlama dili
daha sonra bu isimde başka bir programlama dili olduğu keşfedilince o anda bir kahvehanede
kahve içen programlama gurubu tarafından kahve markasından esinlenerek Java olarak
değiştirildi. Akıllı elektronik ev araçları pazarı SUN gurubunun tahminlerinden çok daha
yavaş bir gelişme gösteriyordu. Bu yüzden Java dili projesi ticari bir geliştirme projesi olarak
büyük olasılıkla iptal edilecekti. 1993 Yılında "World Wide Web" büyük bir atılım göstererek

yaşama umudu sağladı.


dil
bütün dünyaya yayılmaya başladı. Javanın Dinamik Web sayfaları hazırlamadaki büyük
potansiyelini gören SUN şirketi projeyi bu tarafa yönlendirdi ve bu javaya yeni bir canlılık ve

Mayıs 1995 de SUN javayı büyük bir konferansta tanıttı. Program iş dünyası tarafından derhal
büyük bir ilgiyle karşılandı. Java Modern bilgisayar dünyasının ses, grafik işlem, haberleşme
gibi ihtiyaçlarına cevap verebilen ve Ticari gayeler için hazırlanan bir Program dili olarak
va
daha önceki bilgisayar dillerinin hiç birinin kapsayamadığı özellikleri içermekteydi. Bunun
yanı sıra dil komut yapısı olarak C++ diline çok yakın olması da öğrenilmesini
kolaylaştırıyordu. SUN Javayı "World Wide Web" de kullanmak isteyen herkese ücretsiz
olarak sundu. Java internette yayınlanmasının ardından çok büyük bir patlama yaşadı. 1997 ye
gelindiğinde dünyadaki bütün bilgisayar okullarında temel bilgisayar dili olarak gösterilmeye
başlandı. Dünyada şu anda hala en çok kullanılan bilgisayar dili olan C++ dilinin yapılan
hataları tam olarak denetlememesi programın çalışma hızını arttırma yönünden iyi bir özellik
ja

olsa da profesyonel programcılar dışında kullanılmasını sınırlandırıcı bir etki yapıyordu. Java
ise bütün hataları bildiren yapısı ve modern bilgisayarın bütün fonksiyonlarına ulaşabilen
kütüphaneleriyle programcıların çok daha kolaylıkla öğrenebileceği bir dildir.

Javanın diğer önemli bir temel özelliği Nesne kökenli (object oriented) bir dil olmasıdır.
w.

Nesne kökenli diller, nesneleri gerçek dünyadakine daha benzer bir yapıda tanımlayarak
anlaşılmalarını kolaylaştırırlar. Nesneleri gerçek dünyadaki gibi masa, sandalye, bilgisayar,
gerçek gaz, ısı eşanjörü gibi tanımlayarak programlamak insan beyninin anlaması açısından
çok daha kolaydır. Bundan önceki tam nesnel kökenli programlama dillerinden hiçbiri çok
yaygınlık kazanmamıştı. Bu tür dillere Smalltalk,u Örnek verebiliriz. C++ nesnel kökenli
programlama yapabilen bir dildir. Fakat yapısal (structural) bir programlama dili olan C
ww

dilinin bir uzantısı olarak geliştirildiğinden tam anlamıyla nesnel kökenli bir dil olduğu
söylenemez.

Java dilini geleceğin dili yapan diğer bir özelliği de çok kullanımlı (multi-tasking) ve paralel
kullanımlı(multi-treading) bir dil olmasıdır. Çok kullanımlılık birden fazla işlemin aynı anda
yapılabilmesinin tanımıdır. Paralel kullanımlılık ise birden fazla programın aynı anda
hafızayı beraber kullanarak kullanılabilmesidir. Örnek olarak World ve Excel programlarının
Windows NT ortamında aynı anda kullanılmasıdır. ADA gibi bazı eski Program dillerinde

5
6

çok kullanımlılık programlanabiliyordu. Paralel kullanım olanaklarını sunan ilk bilgisayar dili
ise javadır. Paralel kullanım paralel programlama kavramından ayrıdır ve karıştırılmamalıdır.

m
Paralel programlanmada birden fazla Bilgi işlem Ünitesine (CPU ) ayrı programlar veya bir
programın ayrı parçaları gönderilir. Paralel kullanımda ise bir CPU nun kullanım zamanı
küçük parçalara ayrılarak değişik Program veya Program parçacıkları bu zaman paketçiklerini
paylaşarak kullanırlar.

o
Javayı önemli bir Program dili haline getiren önemli özelliklerinden biri de kullanılan
bilgisayardan bağımsız olmasıdır. Javada yazılan bir Program Unix, Machintosh, Windows 95
veya Windows NT veya herhangi bir 32 bit makinada hiç değiştirilmeden kullanılabilir. Java
programlarının grafikleri "Wold Wide Web" sayfalarının programlama dili olan html

i.c
(hypertext markup language) ile aktarılır. Bu yüzden html ve java programlarını birlikte
kullanmak ve java programlarını gerçek zamanda www sayfalarında göstermek mümkündür.
Kendi web sayfanızı veya webde yazılmış kitabınızı bütün dünyaya aktarırken yaptığınız
analizleri de bu kitabın dinamik bir parçası olarak sunabilirsiniz. Bu Türkiye gibi ülkelerin
dünyaya kapılarını daha kolay açmaları açısından oldukça önemli bir özelliktir.

1.2 Java programını yazma ve çalıştırma

dil
Her programda olduğu gibi java programlarında da ilk evre programı yazmaktır. Java
programları her editör programıyla yazılabilirler. Örneğin Unix sistemlerinde vi veya emacs,
windows 95 ve windows NT de DOS Edit, veya Windows Notedefteri programları
kullanılabilir. programı direk içinde yazıp çalıştırabilen Microsoft Visual J++, Symantec
Visual Café, JPad gibi Java geliştirme paketleri de mevcuttur.
va
Şüphesiz programı yazmadan önce Java compilerının bir kopyasını edinmeniz de gerekir.
Java geliştirme seti (Java Developers kit - JDK) SUN bilgisayar şirketinin
[Link] veya
[Link]
internet adreslerinden bedava çekilebilir. Çekme zahmeti çekmek istemiyorsanız SUN bu
programları CD formatında da satmaktadır.
ja

Java programı [Link] seklinde editörle yazılır. Java programınız yazıldıktan sonra ilk step
java derleyici (compiler) programıyla [Link] ara bilgisayar kodunu oluşturmaktır.
Java programını yazarken dikkat etmeniz gereken diğer bir özellik de javanın nesne sınıfının
ismiyle dosyadaki isminin aynı olmasıdır. Bilgisayar konsol ekranında (DOS veya UNIX
w.

Console)

javac [Link]

Komutunu bilgisayara gönderdiğinizde programınızda hata yoksa java derleyicisi [Link]


dosyasını yaratır. Eğer programınızda hata varsa hataların listesini verir. Editör programına
geri dönüp hataları düzeltmeniz ve sonra bu komutu tekrar denemeniz gerekecektir. Java
ww

programları iki ortam için yaratılabilir. Birincisi Konsol ortamıdır (DOS, Unix console gibi).
İkincisi ise Pencere (Applet) ortamıdır. Eğer Program konsol ortamında yazılmışsa
java isim
komutu kullanılarak sonuçlar ekranda görülebilir. Eğer Program applet ortamında yazılmışsa
html diline [Link] dosyası açılır. En basit şekilde html dosyası şu şekilde tanımlanabilir :

6
7

<html>
<applet code="[Link]" wıdth=200 heıght=50>

m
</applet>
</html>

daha sonra bu dosya konsoldan


appletviewer [Link]

o
komutuyla çalıstırılabilir. Yahut herhangi bir browser programına yüklenerek görülebilir.

Aşağıdaki listede ilk konsol programımız [Link] görülmektedir. Listedeki satır


numaraları (1:) programın bir parçası değildir. Sadece programların izlenmesini

i.c
kolaylaştırmak amacıyla verilmiştir.

1: import [Link].*; //java girdi cikti sinifini cagir


2:
3: class Hosgeldiniz
4: {

dil
5: public static void main(String args[])
6: {
7: [Link]("Java Sinifina Hos Geldiniz!");
8: }
9: }
Şekil 1.2.1 Hoş[Link] konsol programı
va
bu programı çalıştırmak için

javac [Link]
java Hosgeldiniz

komutlarını konsolda vermemiz yeterlidir


konsol çıktısı olarak:
ja

Java Sinifina Hos Geldiniz!

Yazısını alırız.
w.

Şimdi bu programdaki satırlara tek göz atalım.


import [Link].*; Bu deyim java konsol girdi çıktı kütüphanesindeki metodları
programımıza aktarır.
//java girdi cikti sinifini cagir // işaretiyle başlayan yazılar bilgisayar tarafından
kullanılamaz sadece programı okuyanı bilgilendirmek amacı taşır /* ..... */ işaretleriyle de
verilebilir. Örneğin :
ww

/* Bu kısımda yazılanlarla bilgisayar ilgilenmez


Sadece insanların programı anlaması içindir
*/

class Hosgeldiniz Class (sınıf) nesne kökenli programlama yapısının temel taşıdır. Her
Class'ın kendine özgü bir ismi olması gerekir. Daha önce yazılmış Class'lar import deyimiyle

7
8

programa çağırılabilirler. Yeniden yazılmaları gerekmez. Class yapısı e tanımlamaları


üzerinde daha sonraki bölümlerde çok daha detaylı bilgi verilecektir.

m
{ } başlatma ve bitirme : Tüm Program parçacıkları { işaretiyle başlar ve } işaretiyle son
bulur.

public static void main(String args[]) diğer dillerde fonksiyon (function), subroutine,

o
procedure gibi adlarla anılan Program parçacığının başlığı. Bu Program parçacıkları javada
Metot (Method) adıyla anılır. Metotların girdileri ve çıktıları olabilir. Bu metodun adı main
(ana Program) dır. String değişken türü args[] değişkeni girdi olarak girebilir. Bu methotta
void çıktı türü kullanılmıştır. Void kelimesi bu methotdan hiçbir çıktı alınmayacağını belirtir.

i.c
public metoda dışarıdan ulaşılabilme izni verir.

[Link]("Java Sinifina Hos Geldiniz!"); Bu satır [Link] sınıfından println


metodunu alıştırır. Bu metot method girişinde gönderilen String tipi değişkeni konsol çıktısına
aktarır. Fortran dilindeki write(*,*) veya print*, c dilindeki scanf, c++ dilindeki cout<<
terimlerinin javadaki tam karşılığıdır.

2: import [Link].*;
3:
dil
İlk applet programımız [Link] listesi Şekil 1.2.2 de verilmiştir

1: import [Link];

4: public class HosgeldinizApplet extends Applet


5: {
va
6: public void paint(Graphics g)
7: {
8: [Link]("Java sinifina hos geldiniz!",25,35);
9: }
10: }
Şekil 1.2.2 [Link] programı
ja

bu programı çalıştırmak için

javac [Link]
appletviewer [Link]
w.

komutlarını konsolda vermemiz yeterlidir. Ebette [Link] dosyasının


yukarıda belirtildiği gibi hazırlanmış olması da gerekir. Fakat Konsol programlarından farklı
olarak sonucu konsol yerine Applette görürüz. Aynı sonucu appletviewer deyimini
kullanmadan bir browser programı çağırarak da elde edebiliriz. Çıktı görüntüsü aşağıdaki
gibi olacaktır.
ww

8
9

m
Bu programında temel olarak bazı farklılıklar dışında bir önceki programa benzediğini
gözlemleyebiliriz.

import [Link];
import [Link].*;

o
deyimleri java kütüphanesindeki Applet ve pencere(awt) sınıf programlarını programımıza
aktarır.
public class HosgeldinizApplet extends Applet deyimi HosgeldinizApplet isimli sınıfı
(class) yaratır. Bu sınıf tüm Applet sınıfının bir devamı olarak tanımlanmaktadır (extends

i.c
Applet) diğer bir deyimle Applet sınıfının bütün metotları extends deyimiyle
HosgeldinizApplet sınıfımızın içine kopyalanmıştır.

public void paint(Graphics g) deyimi appletin grafik olarak çizilmesini sağlar. Bu Metot
Graphics sınıfı g nesnesini girdi olarak kullanır. Metodun çıktısı yoktur.

[Link]("Java sinifina hos geldiniz!",25,35); Bu terim Appletin x = 25, y=35

dil
noktasına Java sinifina hos geldiniz! Yazısını çizer. DrawString Grafik sınıfı g nesnesine ait
bir metotdur.

1.3 Java Programlama dili temel değişken türleri


Programlama dillerinde rakamlar bilgisayar belleğinin temel depolama birimlerine yazılırlar.
Temel bilgisayar bellek birimi bit olarak adlandırılır. Bir bilgisayar belleğindeki tek bir
transistörden oluşmuştur. Bu transistörden akım geçiyorsa tansistörün veya bitin bellek değeri
va
1 (bir) veya true (doğru) olarak alınır. Eğer akım geçmiyor veya düşük düzeyde bir akım
geçiyorsa transistörün bellek değeri 0 (sıfır) veya false(yanlış) olarak alınır. Bilgisayar bit
birimleri bir araya gelerek bilgisayar temel değişken türlerini yazabileceğimiz bir sistem
oluştururlar. Değişken türü bilgisayar tarafından bilinmelidir, çünkü aynı bit topluluğu bir
harfi simgeleyebileceği gibi bir rakamı da simgeleyebilir. Java dilinde Şekil 1.3.1 de görülen
değişken türleri mevcuttur . Şimdi bu değişken türlerinin bazılarını daha detaylı inceleyelim:
ja

1.3.1 Boolean değişken türü


Boolean değişken türü mantık işlemlerinde kullanılır. Sadece true veya false değerleri alır.
True doğru false yanlış anlamı taşır. Mantık değişkenlerine doğrudan true veya false değerleri
yüklenebileceği gibi diğer değişkenleri mantık işlemlerini kullanarak karşılaştırarak ta
değerleri programların içinde hesaplanabilir.
w.

Değişken Türü Türkçe karşılığı Bit Sınır Değerleri


büyüklüğü
boolean Mantık değişkeni 1 true(doğru) , false(yanlış)
char harf değişkeni 16 '\u0000' den '\uFFFF'
byte tam sayı değişkeni 8 -128 den 127 e
short tam sayı değişkeni 16 -32768 den 32767 e
ww

int tam sayı değişkeni 32 -2157483648 den 2147483647 e


long tam sayı değişkeni 64 -9223372036854775808 den
9223372036854775808 e
float Gerçek sayı değişkeni 32 -3.40292347e+38 den
3.40292347e+38 e
double Gerçek sayı değişkeni 64 -1.7976931348623157e+308 den
1.7976931348623157e+308 e
Şekil 1.3.1 Java Temel Değişken türleri

9
10

Aşağıdaki küçük program parçası mantık değişkeni ilk mantık değiskeni'ni tanımlamakta ve

m
doğru değerini bu değişkene yüklemektedir.

boolean ilkmantıkdegiskeni;
ilkmantikdegiskeni=true;
1.3.2 char (harf) değişken türü

o
char değişken türü harflerin tanımlanmasında kullanılır. Harfler java dilinde ISO Unicode
kodu ile bilgisayara aktarılır. Unicode 4 hekzagonal (16 tabanlı) sayının bir araya gelmesiyle
oluşur. Hekzagonal sayı sisteminin onlu ve ikili sayı sistemiyle eşitliği şöyledir :
Heksagonal Onlu İkili

i.c
0 0 0000
1 1 0001
2 2 0010
3 3 0011
4 4 0100
5 5 0101

dil
6 6 0110
7 7 0111
8 8 1000
9 9 1001
A 10 1010
B 11 1011
C 12 1100
va
D 13 1101
E 14 1110
F 15 1111

ISO Unicode da tanımlanan '\u0041' kodu 'A' harfi anlamına gelir. Veya '\u03E1' kodu 'a'
harfini tanımlar. ISO Unicode karakter setinin ilk iki rakamı sıfır olduğunda ASCII karakter
ja

koyunu tanımlar. Unicode hakkında daha ayrıntılı bilgi için http:\\[Link] internet
adresini ziyaret edebilirsiniz. Aşağıdaki küçük program parçacığı char tipi A1, A2 ve
alpha1,alpha2 değişkenlerine A ve a harflerini yüklemektedir.

char A1,A2;
w.

char alpha1,alpha2;
A1='\u0041';
A2='A';
alpha1='\u03E1';
alpha2='a';
ww

Burada şunu kaydedelim alpha1 değişkenini her ortamda doğru olarak görebiliriz, fakat
alpha2 değişkeni bazı ortamlarda görülmeyebilir.

1.3.3 Tam sayı değişken türleri (byte, short,int,long)

Tam sayı değişkenler hafızada işgal ettikleri yere göre byte(8 bit), short(16 bit), int(32 bit) ve
long(64 bit) adını alırlar. Bir bitlik hafızaya sadece iki rakamın (0 veya 1) yazılabileceği göz
önüne alınırsa örneğin sekiz bitlik byte türü tamsayı değişkenine 256 sayı (ikili sayı eşiti

10
11

11111111) yazılabileceği ortaya çıkar. Bitlerden biri + veya - işareti için kullanıldığından
byte değişkeninin sınır değerleri -128den 127 e kadardır (toplam 256 sayı). Eğer bir tamsayı

m
değişkenin sadece artı değerlerini kullanmak istersek unsigned terimini kullanırız. Örneğin
unsigned byte tipi tamsayı değişkenin sınır değerleri 0 dan 256 ya kadardır. Tamsayı
değişken türleri içinde en fazla kullanılan int türüdür. Aşağıdaki küçük program parçacığında
int türü ilktamsayi değişkenine 32 rakamı yüklenecektir.

o
int ilktamsayi;
ilktamsayi=32;

bu iki satırlık program parçacığı tek bir satır olarak

i.c
int ilktamsayi=32;

şeklinde de yazılabilirdi.

1.3.4 Gerçek sayı değişken türleri (byte, short,int,long)

0
16
1
8
0
22
4
1
21
2
1
20
1
0
dil
Gerçek sayı sistemleri de 0 ve 1 bitleri kullanılarak oluşturulabilir. Gerçek sayıların
tamsayıdan küçük kısımları 2 li tabanda eksi üstler kabul edilerek oluşturulur. Örnek olarak
16 bitlik gerçek bir sayıyı ikili sistemdeki bilgisayar belleğinde şu şekilde gösterebiliriz :

+ \ - 24 23 2-1
0.5
1
2-2
0.25
0
2-3
0.125
1
2-4
00.065
0
+\- 24

1
16
1
23
8
0
22
4
0
21
2
0
20
1
1
va
Yukarıda 16 bitle temsil edilen sayı : +16+4+2+0.5+0.125)*10-(6+1) = 22.625e-7 rakamıdır.
Gerçek sayı değişkende yeterli hassasiyeti sağlayabilmek için genelde 64 bit uzunluğundaki
double değişken türü kullanılır. Javadaki Matematik kütüphaneleri de double değişken türü
için tanımlanmıştır. Aşağıdaki küçük program parçacığında double türü ilkgercekdegisken
değişkenine 22.625e-7 sayısını yüklüyoruz.
ja

Double ilkgerçekdegisken;
ilkgerceldegisken=22.625e-7;

1.3.5 String değişkeni


w.

String değişkeni yazı yazdırma işleri için kullanılır. Aslında temel değişken türlerinden
değildir. Java dilinde char değişken türü kullanılarak tanımlanmış bir nesne tipi değişkendir.
Aşağıdaki küçük program parçacığında bu değişken tütünün kullanılmasını görüyoruz.

String a="ali";
ww

String c="veli";
String d;
d=a+b; // d nin değeri "ali veli"
[Link](d); // bu satır ali veli çıktısı verir

String türü sabitler her zaman " işaretleri arasına yazılırlar ve + işaretiyle bir araya
getirilebilirler.

11
12

1.4 Aritmetik işlemler

m
Javadaki temel aritmetik işlemler şunlardır :
+ toplama
- çıkarma
* çarpma
/ bölme

o
% tamsayılar için bölmede kalan (modül)

Şekil 1.4.1 deki program örneği int tamsayı kullanarak bu aritmetik işlemlerin yapılmasını
göstermektedir.

i.c
1: import [Link].*; //java girdi cikti sinifini cagir
2:
3: class Aritmetik
4: {
5: public static void main(String args[])
6: {
7:
8:
9:
10:
11:
12:
13:
int sayi1,sayi2;

sayi2=3;
toplama = sayi1+sayi12;
cikarma = sayi1-sayi2;
carpma = sayi1*sayi2;
dil
int toplama,cikarma,carpma,bolme,kalan;
sayi1=2;
va
14: bolme=sayi1/sayi2;
15: kalan=sayi1%sayi2;
16: [Link]("sayi1 + sayi2 ="+toplama);
17: [Link]("sayi1 - sayi2 ="+cikarma);
18: [Link]("sayi1 * sayi2 ="+carpma);
19: [Link]("sayi1 / sayi2 ="+bolme);
ja

20: [Link]("sayi1 % sayi2 ="+kalan);


21: }
22: }
Şekil 1.4.1 [Link] konsol programı
w.

sayi1 + sayi2 =5
sayi1 - sayi2 =-1
sayi1 * sayi2 =6
sayi1 / sayi2 =0
sayi1 % sayi2 =2
Şekil 1.4.2 [Link] konsol programı çıktısı
ww

Java ve C dillerinde temel aritmetik işlemlerinin yanı sıra bu işlemlerin kısaltılmış sembolleri
de oldukça sık kullanılır. Bu işlemler :

++ bir ilave et
-- bir çıkar
+= sağ taraftaki rakamı ilave et
-= sağ taraftaki rakamı çıkar
*= sağ taraftaki rakamla çarp

12
13

/= sağ taraftaki rakama böl


%= sağ taraftaki rakama bölüp kalanını al işlemleridir.

m
++ ve -- işlemleri değişkenden önce veya sonra gelebilir. Bu iki şeklin değişken tek başlarına
kullanıldığında bir farklılıkları yoktur, fakat ikinci bir değişkenle birlikte tek bir deyimde
kullanıldıklarında ikinci değişkenin değeri değişir. Aşağıdaki iki program parçacığına göz
atalım.

o
int a=2;
int c;
c=a++; // a nın değeri 3 c nin değeri 2

i.c
Şekil 1.4.2 ++ işlemcisinin değişkenden sonra kullanılması

int a=2;
int c;
c=++a; // a nın değeri 3 c nin değeri 3
Şekil 1.4.2 ++ işlemcisinin değişkenden önce kullanılması

dil
a değişkeninin değeri başlangıçta 2 ise görüldüğü gibi hem ++a işleminde hem de a++
işleminde değeri 3 e çıkmaktadır. Ancak c değişkeninin değeri c=a++ işleminde 2 olarak
kalırken (önce değeri yükle sonra arttır), c=++a işleminde 3 olmaktadır(önce arttır, sonra
değeri yükle). ++ ve -- işlemleri genelde tam sayı değişkenler için kullanılır.

Şekil 1.4.3 de aritmetik işlemleri gösteren bir program verilmiştir. Şekil 1.4.4 Bu programın
va
sonuçlarını vermektedir. Programı basamak basamak takip ederek sonuçların doğruluğunu
elde hesaplayarak kontrol edebilirsiniz.

import [Link].*;
public class Aritmetik1
{ public static void main(String[] args)
{
ja

int sayi1=1;
int sayi2=2;
sayi1+=sayi2;
[Link]("sayi1+= : "+ sayi1);
sayi1-=sayi2;
w.

[Link]("sayi1-= : "+ sayi1);


sayi1*=sayi2;
[Link]("sayi1*= : "+ sayi1);
sayi1/=sayi2;
[Link]("sayi1/= : "+ sayi1);
ww

}
}
Şekil 1.4.3 [Link] aritmetik işlem örneği

sayi1+= : 3
sayi1-= : 1
sayi1*= : 2

13
14

sayi1/= : 1
Şekil 1.4.4 Aritmetik1 sınıfının sonuçları

m
1.5 Javada Mantıksal işlemler

Javadaki temel değişken türlerine bakarken boolean türü değişkenleri tanımlamıştık. Tam sayı
ve gerçek değişkenlerin aritmetik işlemlerde kullanılabildiği gibi boolean değişkenler de

o
mantıksal işlemlerde kullanılabilirler. Mantıksal işlem işlemcileri şunlardır :

Mantıksal İşlemci Anlamı


&& ve

i.c
|| veya
> büyüktür
< küçüktür
== eţittir
>= büyük ve eţittir
<= küçük ve eţittir
! değildir
!= eşit değildir

dil
Şekil 1.5.1 java dilindeki mantıksal işlemler

Mantıksal işlemleri pekiştirmek amacıyla Şekil 1.5.2 de bir örnek verilmiştir. Şekil 1.5.3 bu
örnek problemin sonucunu vermektedir. Satır satır proğramı takip ederek sonucuları kontrol
ediniz.

import [Link].*;
va
public class booleanvar
{ public static void main(String[] args)
{
boolean b1,b2;
b1=true;
b2=false;
ja

[Link]("b1 : "+ b1+" b2 : "+b2);


[Link]("b1 && b2 "+ (b1&&b2) );
[Link]("b1 || b2 "+ (b1||b2) );
int sayı1,sayı2;
sayı1=1;
w.

sayı2=2;
[Link]("sayi 1 : "+sayi1);
[Link]("sayi 2 : "+sayi2);
b1=(sayi1 > sayi2);
[Link]("sayi1 > sayi2 "+ b1 );
b1=(sayi1 < sayi2);
[Link]("sayi1 < sayi2 "+ b1 );
ww

b1=(sayi1 == sayi2);
[Link]("sayi1 == sayi2 "+ b1 );
b1=(sayi1 >= sayi2);
[Link]("sayi1 >= sayi2 "+ b1 );
b1=(sayi1 <= sayi2);
[Link]("sayi1 <= sayi2 "+ b1 );
b1=(sayi1 != sayi2);

14
15

[Link]("sayi1 != sayi2 "+ b1 );


}

m
}
Şekil 1.5.2 Java mantıksal işlemleri örnek problemi [Link]

b1 : true b2 : false

o
b1 && b2 false
b1 || b2 true
sayi 1 : 1
sayi 2 : 2

i.c
1 > 2 false
1 < 2 true
1 == 2 false
1 >= 2 false
1 <= 2 true
1 != 2 true

1.6 Java Dilinin temel komutları


dil
Ţekil 1.5.3 Java mantıksal işlemleri örnek problemini [Link]'nın sonuçları

Bilgisayar dillerinde değişkenlerden sonraki en temel yapı temel dil komutlarıdır. Şimdi bu
komut yapılarına tek tek göz atalım.
va
1.6.1 if - elseif - else mantıksal karşılaştırma yapısı

Bu yapı proğramda karar mekanizmalarını oluşturmak için kullanılır. Temel yapısı :

if( boolean değişken yada sabit)


{ boolean degişken veya sabitin değeri true olduğunda yapılan işlemler}
ja

else if( boolean değişken yada sabit)


{ boolean degişken veya sabitin değeri true olduğunda yapılan işlemler}
else
{ yukardaki boolean değişken vede sabitlerin hiçbiri true değerine eşit değilse
yapılacak olan işlemler}
w.

else if yapısı probleme göre istenilen sayıda olabilir. If ve else yapısı sadece bir tane olarak
kullanılır. Küçük bir örnek programla bu yapının çalışmasını inceleyebiliriz.

import [Link].*; // giris çikis


import Text; // okuma sinifi
ww

class ifyapisi
{
public static void main (String args[]) throws IOException
{
double not;
//
DataInputStream cin=new DataInputStream([Link]);

15
16

[Link]("Ogrencinin notunu giriniz : ");


not=[Link](cin);

m
if( not >= 90)
{ [Link]("A"); }
else if(not >=75)
{ [Link]("B"); }
else if(not >=60)

o
{ [Link]("C"); }
else if(not >=50)
{ [Link]("D"); }
else if(not >=40)

i.c
{ [Link]("E"); }
else
{ [Link]("F"); }
}
}
Şekil [Link] if yapısını gösteren [Link] programı

Ogrencinin notunu giriniz :


53
D
dil
Şekil [Link] if yapısını gösteren [Link] programının çıktısı

Bu programda öğrenci notu girdi olduğundan girilen nota göre bilgisayar A,B,C,D,E veya F
va
notlarından birini verecektir. Bu ilk programımızda if ve else if parantezlerinin içinde direk
olarak boolean sabit kullanılmıştır. Parantez içi boolean değişken de olabilir.

Şekil [Link] deki program parçası a degiskeninin degeri : true yazısını yazdıracaktır.

boolean a=true;
if(a)
ja

{[Link]("a degişkeninin değeri : true");}


else
{[Link]("a degişkeninin değeri : false");}
Şekil [Link] if yapısının boolean değişkeniyle kullanılması.
w.

if - elseif - else yapıları iç içe girmiş yapılar veya basit mantıkların && (ve), ||(veya)
işlemleriyle bağlanmasıyla daha kompleks mantıksal şartlar oluşturulabilir. Şekil [Link] de iç
içe geçmis ve Şekil [Link] de && terimiyle bağlanmış iki proğram parçacığı görüyorsunuz.

double x = 7.0;
double y = 3.0;
ww

if(x > 5)
{
if(y>5) { [Link]("x ve y besten buyuktur.");}
elseif(y==5) { [Link]("x besten buyuktur ve y bese esittir.");}
else { [Link]("x besten buyuktur ve y besten kucuktur.");}
}
else

16
17

{
if(y>5) { [Link]("x besten kucuktur veya esittir ve y 5 den buyuktur.");}

m
elseif(y==5) { [Link]("x besten kucuktur veya esittir ve y bese esittir.");}
else { [Link]("x besten kucuktur veya esıttır ve y besten kucuktur.");
}
}
Şekil [Link] İç içe geçmiş if yapısı

o
double x = 7.0;
double y = 3.0;
if(x > 5 && y> 5) { [Link]("x ve y besten buyuktur.");}

i.c
else if(x > 5 && y==5) { [Link]("x besten buyuktur ve y bese esittir.");}
else if(x>5 && y<5) { [Link]("x besten buyuktur ve y besten kucuktur.");}
else if(x< && y>5) { [Link]("x besten kucuktur ve y 5 den buyuktur.");}
else if(x < 5 && y==5) { [Link]("x besten kucuktur ve y bese esittir.");}
}
}

dil
Şekil [Link] && (ve) deyimiyle bağlanmış if yapısı

Yukarıdaki roğram parçecıklarından da görebildiğimiz gibi her türlü kompleks mantığı


bilgisayar programlarına aktarmamız mümkündür. İf-else if-else yapıları programlamada en
çok kullanılan yapı taşlarıdır.

1.6.2 while tekrarlama yapısı


va
While en çok kullanılan tekrarlama yapılarından biridir. ( ) içindeki boolean terim true
(doğru) olduğu sürece yeniden işlemi döndürür. Eğer programda boolean işlemi suçlandıracak
bir ifade yoksa sonsuza dek veya program baţka bir metodla durdurulana dek devam eder.

while( boolean değişken yada sabit)


{ boolean degişken veya sabitin değeri true olduğunda yapılan işlemler}
ja

örneğin :

while(true)
w.

{ [Link]("Bu yazı surekli olarak tekrar edecektir");}

yapısı sonsuz bir döngü oluşturur. Aşağıdaki program ise sayı 1000 den büyük veya 1000 e
eşit olduğunda durur.

int sayı=2;
while(sayı <= 1000)
ww

{ sayı *= 2; }

While tekrarlama yapısı bazen biraz daha farklı bir yapı içinde verilebilir. Aşağıda gösterilen
bu yeni yapı, bir önceki while yapısına göre daha ender kullanılar.

do

17
18

{
boolean degişken veya sabitin değeri true olduğunda yapılan işlemler.

m
Bu paranteze boolean değerinin ne olduğuna bakılmaksızın en az bir kere girilir
}
while( boolean değişken yada sabit)

o
Şekil [Link] de dowhile döngüsünün kullanıldığı bir [Link] programı
görülmektedir

i.c
import [Link];
import [Link];
public class dowhileApplet
{
public void paint(Graphics g)
{

dil
int saydirici=1;
int x=25;
do {
[Link]([Link](saydırıcı),x,25);
x += 15;
} while(++saydirici <= 10);
}
va
}
Ţekil [Link] [Link]

Bu program calıstığında appletviewer Şekil [Link] deki sonucu verecektir.


ja
w.

Şekil [Link] [Link] sınıfının aplletviewer daki görünümü

1.6.3 for tekrarlama yapısı

for tekrarlama yapısıgenellikle sayıları belli bir düzen içinde arttırmak için kullanılır. Genel
yapısı Şekil [Link] de gösterilmiş[Link] sayı saydırmaya dönük uygulamalarda
ww

en fazla kullanılan yapıdır.

for(baslangıç değerleri ; boolean değişken veya sabiti ; tekrarlama değişkeni artışı)


{ boolean değişken veya sabiti true (doğru) olduğunda yapılan işlemler }

Şekil [Link] for tekrarlama yapısı

18
19

Şekil [Link] de 1 den yüze kadar sayıların toplamını hesaplayan bir konsol programı

m
verilmiştir.

import [Link].*;
class foryapisi
{

o
public static void main(String args[])
{
int toplam=0;
for(int sayi=1;sayi<=100;sayi++)

i.c
{ toplam+=sayi;}
[Link]("1 den 100 e sayilarin toplami : "+toplam);
}
}
Şekil [Link] [Link] konsol proğramı

dil
[Link] kompile edildiğinde
1 den 100 e sayilarin toplami : 5050
sonucunu verecektir.

import [Link]; // java applet sinifi


import [Link]; // Java grafik sinifi
va
public class faizOraniApplet extends Applet
{
public void paint( Graphics g)
{
double ilkYatanPara=100e6;//yuz milyon lira
double paraMiktari=ilkYatanPara;
double faizOrani=0.85;//yuzde seksenbes
ja

int y=40;
[Link]("Yil",25,25);
[Link]("paraMiktari",100,25);
for(int yil=1; yil<=10 ; yil++)
{
w.

paraMiktari*=(1.0+faizOrani);
[Link](" "+yil,25,y);
[Link](" "+paraMiktari,100,y);
// not: drawString terimi daima String turu
// degiskenle baslamali veya string e donusturulmelidir.
y+=15;
ww

} // for dongusunun sonu


} // paint metodunun sonu
} // faizOraniApplet sinifinin sonu
Şekil [Link] [Link] programı

Şekil [Link] de yine for döngüsünün uygulaması konusunda bir örnek problem verilmiştir.
Programı nasıl çalıştığını inceleyiniz. Ilk iki faiz oranını elde hesaplayınız. Programı
çalıştırarak sonuçları kontrol ediniz. Program sonuçları Şekil [Link] de listelenmiştir.

19
20

o m
i.c
[Link] [Link] appletinin appletviewer browser programında görünümü

1.6.4 switch - case yapısı

dil
Switch case yapısı çeşitli alternatifler içeren bir tablodan seçme yapma türü işlerde kullanılır.
Temel yapısı Şekil [Link] de verilmiştir.

switch( degişken ismi)


va
{
case değişkenin alacağı deger :
bu değer oluştuğunda yapılacak işlemler
break; // bu deyim döngünün bitmesini sağlar.
case değişkenin alacağı başka bir değer :
bu değer oluştuğunda yapılacak işlemler
break; // bu deyim döngünün bitmesini sağlar.
ja

................
default :
eğer yukarıdaki case kutularından hiçbirine girilemediyse
yapılacak işlemler
w.

break;
}
Şekil [Link] switch - case yapısı

Şekil [Link] de verilen [Link] proğramı switch deyiminin nasıl kullanıldığını


göstemektedir. Switch yapısı şu ana kadar bahsedilen yapılar içinde en az kulanılanıdır.
ww

import [Link]; // java applet sinifini cagir


import [Link].*; // java pencere kullanma sinifini cagir
import [Link].*; // java pencereyi dinleme sinifini cagir

public class switchApplet extends Applet implements ActionListener


{
//sinif degiskenleri

20
21

Label kutubasligi; //Label sinifi degiskeni (nesnesi) kutubasligi


TextField kutugirdisi;//Textfield sinifi degiskeni (nesnesi) kutugirdisi

m
char not;
int Asayisi=0,Bsayisi=0,Csayisi=0,Dsayisi=0,Esayisi=0,Fsayisi=0;
// pencereyi baslatma metodu
public void init()
{

o
kutubasligi=new Label("Ogrencinin notunu giriniz (A B C.. : ");
add(kutubasligi);//kutubasligini pencereye yaz
kutugirdisi=new TextField(5);
add(kutugirdisi);//kutuyu pencereye yerlestir

i.c
// kutuya yeni ilave edilecek komutlari bekle
// her yeni komutta actionPerformed metodunu calistir.
[Link](this);
}

public void paint(Graphics g)


{

dil
[Link]("Her harf notun toplami : ",25,40);
[Link]("A : "+Asayisi,25,55);
[Link]("B : "+Bsayisi,25,70);
[Link]("C : "+Csayisi,25,85);
[Link]("D : "+Dsayisi,25,100);
[Link]("E : "+Esayisi,25,115);
[Link]("F : "+Fsayisi,25,130);
va
}

// girdi alanindaki olan olaylari dinleme metodu


public void actionPerformed(ActionEvent e)
{
ja

//ogrencinin notunu pencereden oku


String not1=[Link]();
not=[Link](0);
showStatus(""); // sonuç bolgesindeki yazıyı sil
[Link](""); //kutudaki harfi sil
w.

switch(not)
{
case 'A': case 'a':
++Asayisi;
break;
case 'B': case 'b':
++Bsayisi;
ww

break;
case 'C': case 'c':
++Csayisi;
break;
case 'D': case 'd':
++Dsayisi;
break;

21
22

case 'E': case 'e':


++Esayisi;

m
break;
case 'F': case 'f':
++Fsayisi;
break;
default:

o
showStatus("yanlis not tanimlandi yeni bir not giriniz.");
break;
} // switch deyiminin sonu
repaint();//pencereyi yeniden paint metoduna gore ciz

i.c
}

}
Şekil [Link] switch - case yapısı örneği [Link]

Şekil [Link] switch - case yapısı örneği [Link] appletinin sonuçlari

dil
va
JAVA PROGRAMLAMA DİLİ
ja

HAFTA 1

ALIŞTIRMALAR

1. Notdefteri programını kullanarak [Link] proğramını incele. Konsole (MS Dos) ortamında aşağıdaki
komutları kullanarak calıştır :
w.

javac [Link]
java Hosgeldiniz

import [Link].*;
class Hosgeldiniz { public static void main (String args[]) {
[Link]("Java Sinifina Hos Geldiniz!");
}
ww

2. Notdefteri programını kullanarak [Link] proğramını incele. Yıne not defteriyle


[Link] programını incele. Konsole (MS Dos) ortamında aşağıdaki komutları kullanarak calıştır:
javac [Link]
appletviewer [Link]

import [Link];import [Link].*;

22
23

public class HosgeldinizApplet extends Applet { public void


paint(Graphics g) { [Link]("Java sinifina hos

m
geldiniz!",25,25); }}

3. Notdefteri programını kullanarak [Link] proğramını incele. Konsole (MS Dos) ortamında aşağıdaki
komutları kullanarak calıştır :
javac [Link]
java ikitamsayitopla

o
import [Link].*; //giris çikis import Text;
class ikitamsayitopla {
public static void main (String args[]) throws IOException
{

i.c
int sayi1,sayi2;
int toplam=0;
//
DataInputStream cin=new DataInputStream([Link]);
[Link]("Bir tam sayi giriniz : ");
sayi1=[Link](cin);
[Link]("Ikinci bir tamsayi giriniz : ");
sayi2=[Link](cin);

dil
toplam=sayi1+sayi2;
[Link]("Iki tam sayinin toplami : "+toplam);
}
}

4. Notdefteri programını kullanarak [Link] proğramını incele. Yine not defteriyle


[Link] programını incele. Konsole (MS Dos) ortamında aşağıdaki komutları kullanarak
calıştır :
va
javac tamsayitoplaApplet .java
appletviewer [Link]

import [Link]; // java applet sinifini cagirimport [Link].*;


// java pencere kullanma sinifini cagirimport [Link].*; // java
pencereyi dinleme sinifini cagir
public class tamsayitoplaApplet extends Applet implements ActionListener
ja

{
//sinif degiskenleri
Label kutubasligi; //Label sinifi degiskeni (nesnesi) kutubasligi
TextField kutugirdisi;//Textfield sinifi degiskeni (nesnesi)
kutugirdisi
int sayi;
w.

int toplam;

// pencereyi baslatma metodu


public void init()
{
kutubasligi=new Label("Bir tamsayi giriniz : ");
add(kutubasligi);//kutubasligini pencereye yaz
kutugirdisi=new TextField(10);
ww

add(kutugirdisi);//kutuyu pencereye yerlestir


toplam=0;
// kutuya yeni ilave edilecek komutlari bekle
// her yeni komutta actionPerformed metodunu calistir.
[Link](this);
}

// girdi alanindaki olan olaylari dinleme metodu


public void actionPerformed(ActionEvent e)

23
24

{
//sayiyi pencereden oku

m
Integer sayi1=new Integer([Link]() );
sayi=[Link]();
// sayiyi okutma islemini asagidaki deyimle de yapabiliriz
// sayi=[Link]( [Link]() );
toplam+=sayi; // veya toplam=toplam+sayi;
repaint();//pencereyi yeniden paint metoduna göre ciz
}

o
public void paint(Graphics g)
{
[Link]("Su ana kadarki sayilarin toplami : "+toplam,25,50);

i.c
}
}

aşağıdaki komutları kullanarak calıştır :


javac [Link]
java dortArtıIslem
dil
5. Notdefteri programını kullanarak [Link] proğramını incele. Konsole (MS Dos) ortamında
va
import [Link].*; //giris çikis import Text;
class dortArtiIslem
{
public static void main (String args[]) throws IOException
{
int sayi1,sayi2;
ja

//
DataInputStream cin=new DataInputStream([Link]);
[Link]("Bir tam sayi giriniz : ");
sayi1=[Link](cin);
[Link]("Ikinci bir tam sayi giriniz : ");
sayi2=[Link](cin);
w.

[Link]("Iki tam sayinin toplami : "+(sayi1+sayi2));


[Link]("Iki tam sayinin farki : "+(sayi1-sayi2));
[Link]("Iki tam sayinin carpimi : "+(sayi1*sayi2));
[Link]("Iki tam sayinin bolumu : "+(sayi1/sayi2));
[Link]("Iki tam sayinin kalani : "+(sayi1%sayi2));
// Matematik tipi degisken islemleri :
// + : topla
ww

// - : cikar
// * : carp
// / : bol
// % : bolumun kalani
// += : kendisi ve sag tarafindaki ile topla
// sayi1+=3 ve sayi1=sayi1+3 ayni islemdir
// -= : kendisinden sag tarafindakini cikar
// sayi1-=3 ve sayi1=sayi1-3 ayni islemdir
// *= : kendisi ve sag tarafindakini carp
// sayi1*=3 ve sayi1=sayi1*3 ayni islemdir

24
25

// /= : kendisini sag tarafindakine bol


// sayi1/=3 ve sayi1=sayi1/3 ayni islemdir

m
// %= : kendisini sag tarafindakine bol kalanini ver
// sayi1%=3 ve sayi1=sayi1%3 ayni islemdir
// ++ : kendisine bir ekle
// sayi1++ ve sayi1=sayi1+1 ayni islemdir
// ++ : kendisine bir ekle
// ++sayi1 ve sayi1=sayi1+1 ayni islemdir
// -- : kendisinden bir cikar

o
// sayi1-- ve sayi1=sayi1-1 ayni islemdir
// -- : kendisinden bir cikar
// --sayi1 ve sayi1=sayi1-1 ayni islemdir
boolean mantik1,mantik2;

i.c
mantik1=true; // dogru
mantik2=false;//yanlis
[Link]("dogru ve yanlis : "+(mantik1 && mantik2));
[Link]("dogru veya yanlis : "+(mantik1 || mantik2));
mantik1=( sayi1 > sayi2 );
mantik2=( sayi1 < sayi2 );
// Boolean (mantik) tipi degisken islemleri :
// > : buyuktur

dil
// < : kucuktur
// == : esittir
// >= : buyuk veya esittir
// <= : kucuk veya esittir
// ! : mantigi tersine cevirme
// != : esit degildir
// && : ve
// || : veya
mantik1=( sayi1 > sayi2 );
va
mantik2=( sayi1 < sayi2 );
[Link]("sayi1 buyuktur sayi2 : "+mantik1);
[Link]("sayi 1 kucuktur sayi2 : "+mantik2);
}
}

Bir tam sayi giriniz : 3


Ikinci bir tam sayi giriniz : 2
ja

Iki tam sayinin toplami : 5


Iki tam sayinin farki : 1
Iki tam sayinin carpimi : 6
Iki tam sayinin bolumu : 1
Iki tam sayinin kalani : 1
dogru ve yanlis : false
w.

dogru veya yanlis : true


sayi1 buyuktur sayi2 : true
sayi 1 kucuktur sayi2 : false

6. Notdefteri programını kullanarak [Link] proğramını incele. Yine not defteriyle


[Link] programını incele. Konsole (MS Dos) ortamında aşağıdaki komutları kullanarak
calıştır :
ww

javac gercekSayiOrtalamaApplet .java


appletviewer [Link]

import [Link]; // java applet sinifini cagir


import [Link].*; // java pencere kullanma sinifini cagir
import [Link].*; // java pencereyi dinleme sinifini cagir
public class gercekSayiOrtalamaApplet extends Applet implements
ActionListener
{
//sinif degiskenleri

25
26

Label kutubasligi; //Label sinifi degiskeni (nesnesi) kutubasligi


TextField kutugirdisi;// Textfield sinifi degiskeni (nesnesi)

m
kutugirdisi
double sayi; // Gerçel degisken sayi
double toplam; // Gerçel degisken toplam
double carpim; // Gerçel degisken carpim
double aritmetikOrtalama; // Gerçel degisken aritmetik ortalama
double geometrikOrtalama; // Gerçel degisken geometrik ortalama
int sayici; // tam sayi degisken toplam rakam sayisini sayici

o
// pencereyi baslatma metodu
// pencere ilk basladiginda
// degiskenler buradaki degerleri alirlar
public void init()

i.c
{
kutubasligi=new Label("Bir sayi giriniz : ");
add(kutubasligi);
kutugirdisi=new TextField(10);
add(kutugirdisi);
toplam=0;
carpim=1.0;
aritmetikOrtalama=0;

dil
geometrikOrtalama=0;
sayici=0;
[Link](this);
}

// girdi alanindaki olan olaylari dinleme metodu


// Her yeni rakam girildiginde bu metod çagirilir
public void actionPerformed(ActionEvent e)
{
va
sayici++;
Double sayi1=new Double([Link]() );
sayi=[Link]();
toplam+=sayi; // veya toplam=toplam+sayi;
aritmetikOrtalama=toplam/sayici;
carpim*=sayi; // veya carpim=carpim*sayi;
geometrikOrtalama=[Link](carpim,(1.0/sayici));//carpimin koku
[Link](" ");//kutudaki rakami sil
ja

repaint();//pencereyi yeniden paint metoduna göre ciz


}

public void paint(Graphics g)


{
// drawString Metodundaki eksen sistemi
w.

// -----------------------> x ekseni
// |
// |
// |
// V y ekseni
[Link]("Su ana kadarki sayilarin toplami : "+toplam,25,50);
[Link]("Su ana kadarki sayilarin aritmetik ortalamasi :
"+aritmetikOrtalama,25,65);
ww

[Link]("Su ana kadarki sayilarin geometrik ortalamasi :


"+geometrikOrtalama,25,80);
}
}

26
27

o m
7. Notdefteri programını kullanarak bessayı[Link] proğramını incele. Konsole (MS Dos) ortamında aşağıdaki

i.c
komutları kullanarak calıştır :
javac bessayı[Link]
java bessayıtopla

import [Link].*; // giris çikis import Text; // okuma sinifi


class bessayitopla { public static void main (String args[]) throws
IOException
{

dil
double sayi;
double toplam=0;
int saydirici=0;
//
DataInputStream cin=new DataInputStream([Link]);
while( saydirici < 5)
{
[Link]("Bir tam sayi giriniz : ");
va
sayi=[Link](cin);
toplam+=sayi;
saydirici++;
}
[Link]("sayilarin toplami : "+toplam);
}
}
ja

Bir tam sayi giriniz : 1


Bir tam sayi giriniz : 2
Bir tam sayi giriniz : 3
Bir tam sayi giriniz : 4
Bir tam sayi giriniz : 5
sayilarin toplami : 15.0
w.

8. Notdefteri programını kullanarak [Link] programını incele. Konsole (MS Dos) ortamında
aşağıdaki komutları kullanarak calıştır :
javac [Link]
java StringDegisken

import [Link].*; //giris çikis sinifini cagir class StringDegisken


ww

public class StringDegisken


{
public static void main (String args[]) throws IOException
{
String s1,s2,s3,s4;
int i1;
String s;
s1="Ali ";
s2="Veli ";

27
28

s3="49";
s4=" Elli";

m
s=s1+s2+s3+s4;
[Link](s);
i1=49;
s=s1+s2+i1+s4;
[Link](s);
}
}

o
Ali Veli 49 Elli
Ali Veli 49 Elli

i.c
9. alıstırma 7 deki bessayi [Link] programini iyice anladiktan sonra birden yüze (100) kadar sayiların
ortalamasini hesaplayan birdenyü[Link] program ve sinifini (Konsole) yaz ve calistir.

import [Link].*; // giris cikis


import Text; // okuma sinifi

class birdenyuzeortalama
{
public static void main (String args[])
{
double sayi=1;
double toplam=0;
while( sayi <= 100)
{

}
toplam+=sayi++;
dil
va
[Link]("sayilarin toplami : "+toplam);
[Link]("sayilarin ortalamasi : "+toplam/100.0);
}
}

sayilarin toplami : 5050.0


sayilarin ortalamasi : 50.5
ja

JAVA PROGRAMLAMA HAFTA 2 UYGULAMA

Hafta 2 yeni java dosyalari

[Link]
w.

[Link]
[Link]
[Link]
[Link]

//if deyiminin kullanimiimport [Link]; // java applet sinifini


cagirimport [Link].*; // java pencere kullanma sinifini
cagirimport [Link].*; // java pencereyi dinleme sinifini cagir
ww

public class karsilastirmaApplet extends Applet implements ActionListener


{
Label soru1; //kullaniciya birinci degeri girme sorusu sorar
TextField girdi1; //birinci degeri girme kutusu
Label soru2; //kullaniciya ikinci degeri girme sorusunu sorar
TextField girdi2; //ikinci degeri girme kutusu
int sayi1,sayi2; //girilen iki sayi

28
29

//graphic kullanici baglantisindaki ilk degerleri tanimla


public void init()

m
{
soru1=new Label("Bir sayi giriniz ");
girdi1=new TextField(10);
soru2=new Label("Ikinci bir sayi giriniz");
girdi2=new TextField(10);
add(soru1); //soru1 yazisini applete cizer
add(girdi1);//girdi1 kutusunu applete cizer

o
add(soru2); //soru2 yazisini applete cizer
[Link](this);
// soru2 den sonra girdi (return) tusunu bekler
// girdi(return) tusundan sonra actionPerformed

i.c
// metoduna gider
add(girdi2); //girdi2 kutusunu applete cizer
}

// sonuclari applete yazdir


public void paint(Graphics g)
{
[Link]("Karsilastirma sonuclari : ",70,75);

dil
if(sayi1 == sayi2)
[Link](sayi1+" == "+sayi2,100,90);
if(sayi1 != sayi2)
[Link](sayi1+" != "+sayi2,100,105);
if(sayi1 < sayi2)
[Link](sayi1+" < "+sayi2,100,120);
if(sayi1 > sayi2)
[Link](sayi1+" > "+sayi2,100,135);
if(sayi1 <= sayi2)
va
[Link](sayi1+" <= "+sayi2,100,150);
if(sayi1 >= sayi2)
[Link](sayi1+" >= "+sayi2,100,165);
}

// eger girdi(return) tusuna basildiysa bu


// metodu cagir
public void actionPerformed( ActionEvent e)
ja

{
// sayi 1 i girdi kutusundan oku
sayi1=[Link]([Link]());
// sayi 2 i girdi kutusundan oku
sayi2=[Link]([Link]());
repaint();
w.

}
}
ww

29
30

o m
i.c
[Link]

import [Link].*; //java girdi cikti sinifini cagir


class whileyapisi

dil
{ public static void main(String args[])
{
int sayi=2;
while(sayi<=1000)
{
sayi*=2;
[Link]("sayi = "+sayi);
}//while yapisinin sonu
va
}
}

sayi = 4
sayi = 8
sayi = 16
sayi = 32
sayi = 64
ja

sayi = 128
sayi = 256
sayi = 512
sayi = 1024

[Link]
w.

[Link]
[Link]
[Link]

Bu dosyaları çalıştır ve içeriklerini incele

Ödev problem 1
ww

bir java konsol programı ([Link]) yazarak On kişilik bir sınıftaki


kişilerin ağırlıklarını girdi olarak giriniz.
Ağırlıkları 40 kg dan az olanları zayıf olarak,
Ağırlıkları 40 kilo ile 80 kilo arasında olanları normal,
Agırlıkları 80 kg in üstünde olanları sişman katagorisinde sınıflarsak
her sınıfta kaç kişi olduğunu yazdırınız.
Dosyanızın adı [Link], sınıfınızın adı : agirlık olacaktır.
Bilmediğiniz yapıları örnek problemleri inceleyerek öğrenebilirsiniz.

30
31

JAVA PROGRAMLAMA DİLİ


HAFTA 3

m
Bu haftaki yeni java dosyaları

YILDIZ~1 JAV 324 03/05/98 20:55 [Link]

o
import [Link];import [Link];
public class yildiz3forApplet extends Applet
{
public void paint(Graphics g)

i.c
{
int x,y;
for(y=15;y <= 150;y+=15)
{
for(x=15;x <= y;x+=15)
{
[Link]("*",x,y);
}

dil
}
}
}
ja va

YILDIZ~2 JAV 366 02/05/98 23:37 [Link]


w.

import [Link];import [Link];


public class yildiz1whileApplet extends Applet
{
public void paint(Graphics g)
{
int i=1;
int x=15;
ww

while(i++ <= 11) //i degeri birden 11 a kadar degisir


{
[Link]("*",x,x);
x += 15; // x degeri her i icin 15 artiyor
}
}
}

31
32

o m
i.c
YILDIZ~3 JAV 404 02/05/98 23:36 [Link]

import [Link];import [Link];


public class yildiz2forApplet extends Applet{ public void paint(Graphics
g) { int i;

dil
int x=0;
for(i=1;i <= 11;i++) //i degeri birden 11 a kadar degisir
{
x += 15; // x degeri her i icin 15 artiyor
[Link]("*",x,x);
[Link]("*",x,(180-x));
}
}
}
ja va
w.

YILDIZ~4 JAV 698 03/05/98 1:13 [Link]


ww

import [Link];
import [Link];
public class yildiz2whileApplet extends Applet
{
public void paint(Graphics g)
{
int i=1;
int x=0;

32
33

while(i++ <= 11) //i degeri birden 11 a kadar degisir


{

m
x += 15; // x degeri her i icin 15 artiyor
[Link]("*",x,15); // x lineer degisken y 15
[Link]("*",15,x); // x 15 y lineer de§isken
[Link]("*",x,165); // x lineer degisken y 165
[Link]("*",165,x); // x 165 y lineer de§isken
[Link]("*",x,x); // \ ciz
[Link]("*",x,(180-x)); // / ciz

o
}
}
}

i.c
dil
va
YILDIZ~5 JAV 366 02/05/98 23:10 [Link]
ja

import [Link];
import [Link];
public class yildiz1forApplet extends Applet
{
public void paint(Graphics g)
w.

{
int i;
int x=25;
for(i=1;i <= 10;i++) //i degeri birden 10 a kadar degisir
{
[Link]("*",x,x);
x += 15; // x degeri her i icin 15 artiyor
ww

}
}
}

33
34

o m
i.c
KILO~1 JAV 556 02/05/98 13:18 [Link]

import [Link].*; // giris çikis


import Text; // okuma sinifi

class kilo
{

double kilo; // dil


public static void main (String args[]) throws IOException
{

DataInputStream cin=new DataInputStream([Link]);


[Link]("kilonuzu giriniz : ");
kilo=[Link](cin);
va
if( kilo <= 40)
{ [Link]("zayif"); }
else if( kilo>40 && kilo<80 )
{ [Link]("normal"); }
else
{ [Link]("sisman"); }
}
}
ja

kilonuzu giriniz : 45
normal

kilonuzu giriniz : 95
sisman
w.

PIAPPL~1 JAV 369 03/05/98 21:27 [Link]

import [Link];import [Link];


public class piApplet extends Applet
{
ww

public void paint(Graphics g)


{
int i;
double pi=0;
int artieksi=-1;
for(i=1;i < 5000000;i++)
{
artieksi*=-1;
pi+=4/(2.0*i-1.0)*artieksi;
}

34
35

[Link]("pi : "+pi,25,25);
}

m
}

o
ALIŞTIRMALAR

i.c
1. Java applet programı kullanarak aşağıdaki şekli applet de çizdiriniz :

**********
*********
********
*******
******

dil
*****
****
***
**
*

import [Link];import [Link];


public class H3A1 extends Applet
va
{
public void paint(Graphics g)
{
int x,y;
for(x=15;x <= 150;x+=15)
{
for(y=15;y <= x;y+=15)
{
[Link]("*",x,y);
ja

}
}
}
}
w.
ww

35
36

2. Java applet programı kullanarak aşağıdaki şekli appletde çizdiriniz

m
**********
* *
* *
**********

import [Link];

o
import [Link];

public class H3A2 extends Applet


{

i.c
public void paint(Graphics g)
{
int x,y;
for(x=15;x <= 150;x+=15)
{
[Link]("*",x,15);
[Link]("*",x,60);
}

dil
for(y=15;y <= 60;y+=15)
{
[Link]("*",15,y);
[Link]("*",150,y);
}

}
}
ja va

3. java konsol programı kullanarak bir sayinin faktoriyelini hesaplayiniz.


n!=n*(n-1)*(n-2)….[Link] 4!= 4*3*2*1 3!=3*2*1
w.

import [Link].*;
import Text;
class faktoriyel
{
public static void main(String args[]) throws IOException
{
long faktoriyel=1;
ww

DataInputStream cin=new DataInputStream([Link]);


int faktoriyelsayi;
[Link]("Bir tamsayi giriniz:");
faktoriyelsayi=[Link](cin);
for(int sayi=1;sayi<=faktoriyelsayi;sayi++)
{ faktoriyel*=sayi;}
[Link](faktoriyelsayi+" faktoriyel: "+faktoriyel);
}
}

36
37

m
Bir tamsayi giriniz: 4
4 faktoriyel: 24

4. Java konsol programı kullanarak asağıdaki formulü hesaplayınız

ex = 1 + x /1! + x2 / 2! + x3 / 3! + x4 / 4! + ..

o
not : e=2.7182818

import [Link].*;
import Text;

i.c
class H3A4
{
public static void main(String args[]) throws IOException
{
double faktoriyel=1;
double x;
double us=1;
double exponent=1;
DataInputStream cin=new DataInputStream([Link]);
[Link]("Bir sayi giriniz:");
x=[Link](cin);
for(double sayi=1;sayi<=200;sayi++)
{
faktoriyel*=sayi;
us*=x;
exponent+=us/faktoriyel;
}
dil
va
[Link]("exp("+x+") = "+exponent);
[Link]("gercek exp("+x+") = "+[Link](x));
}
}

Bir sayi giriniz: 3


exp(3.0) = 20.08553692318766
ja

gercek exp(3.0) = 20.08553692318767


w.
ww

37
38

BÖLÜM 2 : METOTLAR VE OBJECT KULLANIMI

m
2.1 Java API Kütüphanesi

Gerçek problemlerin boyutları genelde birinci bölümde gördüğümüz problemlere göre çok
daha büyüktür. Bu yüzden genelde programlar küçük parçalara bölünerek daha kolaylıkla

o
anlaşılır şekle getirilmeye çalışılır. Buna böl parçala ve yönet tekniği de diyebiliriz. Bu küçük
parçalara javada metot adi verilir. Java programları yeni metotları içeren java
sınıflarıyla(class) java sınıf kütüphanelerinde yer alan metotların birleşmesinden oluşur. Java
kütüphanesinde matematik işlemlerinden grafik, ses, giriş çıkış işlemleri, yanlış kontrolu gibi

i.c
birçok konularda yazılmış metotlar mevcuttur. Java metotlar kolleksiyonu Java API Adini
alir. Java sınıf kütüphanesi adi da verilir. Java API dosyalarındaki metodlarin sadece
isimlerinin listesi yaklaşık 200 sayfa boyutunda bir liste tuttuğundan burada sadece yeri
geldiğine programları kullanırken örneklerde gerekli API isimlerini göreceğiz. Şu ana kadar
kullandığımız java programlarında [Link], [Link] ve [Link] API paketlerini kullandık.
[Link] paketi appletleri oluşturma, appletlere giriş çıkısları ve ses dosyalarını applet

dil
içerisinde çalıştırmayı sağlar. [Link] pencere(window) ortamındaki tüm programlama
sınıflarını ve metodlarını içerir. Bu metodları ilerideki bölümlerde daha detaylı inceleyeceğiz.
[Link] paketi javaya dışarıdan(dosya,ekran v.b) bilgi giriş çıkışını ayarlar. Java dilinde en çok
kullanılan API sınıfı Math sınıfıdır. Bu sınıf(class) [Link] paketinde yer alır. [Link]
paketi java programı açılırken otomatik olarak çağırılır. Bütün diğer paketler import deyimi
kullanılarak programa ilave edilirler. Math sınıfında tanımlanan metodların bazıları Şekil 2.1
de listelenmiştir. Tablodaki x veya y değişkenleri double değişken türündendir. Math
sınıfında(class) iki tane de sabit tanımlanmıştır. Bu sabitlerden birisi [Link]
va
3.14159265358979323846 (pi) sayısına eşittir. Diğeri Math.E 2.7182818284590452354 (e)
sayısına eşittir.

Metod Tanım Örnek


Abs(x) x değişekeninin mutlak değeri [Link](9.2) = 9.2
türkçesi : Mutlak [Link](-9.2) = 9.2
ja

Ceil(x) x degişkenini bir üst tamsayıya [Link](9.2) = 10


dönüştürür (türkçesi : tavan) [Link](-9.8) = -9
Floor(x) x değişkenini bir alt tamsayıya [Link](9.2) = 9
dönüştürür. (türkçesi : taban) [Link](-9.8) = -10
Cos(x) x in trigonometrik cosünisü [Link](1.0)=0.54030230568
(x radyan cinsinden
w.

tanımlanmıştır.)
Sin(x) x in trigonometrik sinüsü [Link](1.0)=0.8414709840709
(x radyan cinsinden
tanımlanmıştır.)
Tan(x) x in trigonometrik tanjantı [Link](1.0)=1.557040724655
(x radyan cinsinden
tanımlanmıştır.)
ww

Acos(x) x in trigonometrik cosünisünün [Link](0.54030230568)=1.0


tersi
(sonuç radyan cinsindendir)
Asin(x) x in trigonometrik sinüsü [Link](0.8414709840709)=1.
(x radyan cinsinden 0
tanımlanmıştır.)
Atan(x) x in trigonometrik tanjantı 4.0*[Link](1.0)=3.14159265
(x radyan cinsinden 359

38
39

tanımlanmıştır.)
exp(x) e(2.7182818284590452354) nin [Link](1.0) =2.718281828459

m
x inci kuvveti [Link](2.0) =7.389056098931
Log(x) e tabanına göre logaritma [Link](2.718281828459)=1.0
Pow(x,y) x in y inci kuvveti [Link](3,2)=9.0
Max(x,y) x ve y nin büyük olanı [Link](2.3,12.7)=12.7
min(x,y) x ve y nin küçük olanı [Link](2.3,12.7)=2.3
Random() Raslantısal sayı (0 ile 1 arasinda) [Link]() = 0 ila bir

o
arasında her sayı çıkabilir
Şekil 2.1.1 Math sınıfında(class) çalışan metotlardan bazıları

i.c
Ţekil 2.2 de Math sınıfındaki metodları kullanan Matematik1 sınıfını görüyoruz.
Bu programın sonuçları şekil 2.3 de gösterilmektedir.

import [Link].*; // giris cikis


import Text; // okuma sinifi

dil
class matematik1
{
public static void main (String args[]) throws IOException
{
double x,y;
// DataInputStream sinifi cin nesnesini tanimla
DataInputStream cin=new DataInputStream([Link]);
[Link]("Bir gercek sayi giriniz : ");
x=[Link](cin);
va
[Link]("Bir gercek sayi giriniz : ");
y=[Link](cin);
[Link]("Statik Matematik kutuphanesi Math de ");
[Link]("en cok kullanilan metodlar :" );
// [Link](3.2)=3.2 [Link](-3.2)=3.2
[Link]("[Link]("+x+") = "+[Link](x));
// [Link](9.2)=10 [Link](-9.8)=-9
// [Link](x) x den buyuk en kucuk tam say ya yuvarlar
ja

[Link]("[Link]("+x+") = "+[Link](x));
// [Link](9.2)=9 [Link](-9.8)=-10
// [Link](x) x den kucuk en buyuk tam say ya yuvarlar
[Link]("[Link]("+x+") = "+[Link](x));
// Trigonometrik fonksiyonlar sin(x) cos(x) tan(x) x:radyan
// [Link] pi sayisi
w.

[Link]("[Link] = "+[Link]);
[Link]("[Link]("+x+") = "+[Link](x));
[Link]("[Link]("+x+") = "+[Link](x));
[Link]("[Link]("+x+") = "+[Link](x));
//Trigonometrik fonksiyonlar asin(y) acos(y) atan(y)
// asin,acos,atan : radyan
[Link]("[Link]("+y+") = "+[Link](y));
ww

[Link]("[Link]("+y+") = "+[Link](y));
[Link]("[Link]("+y+") = "+[Link](y));
// [Link](x) dogal logaritma (e) taban na gore
// Math.E e sayisi = 2.718281828...
[Link]("Math.E = "+Math.E);
[Link]("[Link]("+x+") = "+[Link](x));
// [Link](x,y) x in y inci kuvveti
[Link]("[Link]("+x+","+y+" ) = "+[Link](x,y));
// [Link](x) Math.E=e=2.718281828.. in x inci kuvveti
[Link]("[Link]("+x+" ) = "+[Link](x));

39
40

// [Link](x) x in kare koku


[Link]("[Link]("+x+" ) = "+[Link](x));

m
// Maximum - minimum functions
// [Link](x,y) [Link](x,y)
[Link]("[Link]("+x+","+y+" ) = "+[Link](x,y));
[Link]("[Link]("+x+","+y+" ) = "+[Link](x,y));
}
}
Şekil 2.1.2 Math sınıfında(class) çalışan metotlardan bazılarını gösteren

o
[Link] programı

Bir gercek sayi giriniz : 9.2

i.c
Bir gercek sayi giriniz : 0.6
Statik Matematik kutuphanesi Math de
en cok kullanilan metodlar :
[Link](9.2) = 9.2
[Link](9.2) = 10.0
[Link](9.2) = 9.0
[Link] = 3.141592653589793
[Link](9.2) = -0.9748436214041636

dil
[Link](9.2) = 0.22288991410024764
[Link](9.2) = -0.22864171155902654
[Link](0.6) = 0.9272952180016123
[Link](0.6) = 0.6435011087932844
[Link](0.6) = 0.5404195002705842
Math.E = 2.718281828459045
[Link](9.2) = 2.2192034840549946
[Link](9.2,0.6 ) = 3.7868028596424734
[Link](9.2 ) = 9897.129058743905
va
[Link](9.2 ) = 3.03315017762062
[Link](9.2,0.6 ) = 9.2
[Link](9.2,0.6 ) = 0.6
Şekil 2.1.3 [Link] programının sonuçları

2.2 Metotlar
ja

Metotlar java programlarının ana parçalarıdır. Metodlar sınıfların(class) içinde yer alan küçük
program parçacıklarıdır. Metodların çogunda değişken parametreler metodlar ve sınıflar
arasında iletişimi sağlarlar. Ayrıca her metodun kendine özgü değişkenleri de vardır. Metod
yapısının ana sebebi programları modüler hale getirmektir. Aynı zamanda aynı program
parçacığının tekrarlanmasını önlemeyi de sağlar. Her metod çağrıldığı proğram parçacığına
w.

belli bir değişkeni aktarabilir. Metodların tanımlarında aktardıkları değişken türü tanımlanır.
Eğer metod hiçbir değişken aktarmıyorsa void sözcüğüyle tanımlanır. Metodların genel
tanımı aşağıdaki gibidir. Parantez içindeki terimler kullanılmıyabilir.

(public) (static) sınıf değişken türü sınıf ismi( sınıf değişken girdi listesi)
{
sınıf içinde geçerli degişken tanımları
ww

Metodun ana gövdesi


return metod çıktı değişkeni
}
Şekil 2.2.1 Genel Metot tanımı

Örnek olarak aşağıdaki metodu verebiliriz :

40
41

m
Public static double metotornegi(int x,double y)
{
double z = 3.5;
double f ;
f = z*x*x+y;

o
return f;
}

Bu metoddaki x ve y gerçek (double) değişkenleri metodun girdi

i.c
değişkenleridir. z ve f değişkenleri metodun yerel
değişkenleridir ve bu metod dışında tanımları yoktur. Metod f
değişkeninin değerini çıktı olarak metodun dışina
aktarmaktadır. Eğer yukarıdaki metod aynı sınıfın içindeki
başka bir metotda veya main metodunda aşağıdaki gibi bir
örnekte kullanılırsa

double z = 2.5;
double r ;
int i = 3;
r = metodornegi(i,z);
[Link](“r = “+r);
dil
va
r = 34 sonucuna ulaşılır.

Şimdi aynı metodun dinamik metod olarak bir appletin içinde kullanılmasını görelim.

import [Link].*;
ja

public class metotornegi1


{
// sayinin karesi static metodu
public static double kare(double x)
{
return x*x;
w.

public static void main(String[] args) throws IOException


{
double sayi;
DataInputStream cin=new DataInputStream([Link]);
[Link]("Bir tam sayi giriniz : ");
sayi=[Link](cin);
ww

[Link]("girilen sayinin karesi : "+kare(sayi));

}
Şekil 2.2.2 [Link] programında kare metodunun kullanılması

41
42

import [Link]; // java applet sinifini cagir

m
import [Link].*; // java pencere kullanma sinifini cagir

public class metodornegi2 extends Applet


{
double sayi=5; // Gercek degisken sayi

// sayinin karesi dinamik metodu

o
public double kare(double x)
{
return x*x;
}

i.c
public void paint(Graphics g)
{
[Link](sayi+"nin karesi = "+kare(sayi),25,50);
}
}

dil
va
Şekil 2.2.3 [Link] programında kare metodunun kullanılması

Şekil 2.2.3 de tanımlanan public double kare(double x) metodu,


public void paint(Graphics g) metodundaki
[Link](sayi+"nin karesi = "+kare(sayi),25,50);
işleminde çağırılmıştır. Bilgisayar kare(sayi) ifadesini
ja

gördüğünde metodun içine gider, orada tanımlanan tüm işlemleri


yaptıktan sonra return kelimesinin karşısındaki işlemleri
çağırıldığı yere geri iletir. Metodorneği1 java programında
çağırılan kare(sayi) metodunda sadece sayının kendisiyle
çarpımı return kelimesinin karşısına yazıldığından, kare(sayı)
w.

ifadesi sayı*sayı ifadesiyle eşdeğerdir. Burada kare


metodundandaki değişken adının sayı değil x olarak verildiğini
de burada not edelim. Sayı değişkeni metodun girişinde x
degişkenine yüklenir. Gerekli işlemler metodda yapıldıktan
sonra sadece metodun sonuçları return deyimiyle geri döner.

2.3 Nesne (Object) tanımı ve metodlarda kullanımı


ww

Birinci bölümde temel değişken türlerini (double,int,boolean


v.b.) nasıl tanımladığımızı görmüştük. Nesne tipi
proğramlamanın en önemli özelliği kendi değişken türlerimizi
yaratabilmemizdir. İlerideki bölümlerde kendi değişken
türlerimizi sınıf (class) yapısını kullanarak nasıl
yaratacağımızı daha detaylı olarak inceleyeceğiz. Bu bölümde

42
43

nesnelerin program içindeki tanımlanmasına göz atalım. Daha


önce tanımladığımız bazı applet programlarında nesne tanımları

m
zaten geçmişti. Örneğin daha önceki programlarımızda bilgi
okutmak için kullandığımız

DataInputStream cin=new DataInputStream([Link]);

o
Terimi DataInputStream sınıfından(class) cin nesnesini
tanımlar. Bu tanımı yaparken [Link] nesnesini girdi olarak
kullanır. Nesne(object) tanımı yaparken aynı metodlarda olduğu
gibi değişken veya nesneleri girdi olarak tanımlamamız

i.c
mümkündür. Yukarıdaki tanımda [Link] nesnesini tanımda
girdi olarak kullanmaktadır.
Diğer bir örnek olarak yine daha önceki örnek problemlerde
kullandığımız Label sınıfından(class) kutubasligi nesnesinin
tanımını ve TextField sınıfından(class) kutugirdisi nesnesini
gösterebiliriz.

dil
Label kutubasligi; //Label sinifi degiskeni (nesnesi) kutubasligi
kutubasligi=new Label("Ogrencinin notunu giriniz (A B C.. : ");

TextField kutugirdisi;//Textfield sinifi degiskeni (nesnesi) kutugirdisi


kutugirdisi=new TextField(5);
va
Bu örneklerde de görüldüğü gibi Nesne tanımı şu şekilde
yapılmaktadır:

Sınıf (class) ismi nesne(object) ismi;


nesne(object) ismi = new Sınıf (class) ismi(değişken veya
nesne girdi listesi)
ja

Nesne tanımını daha iyi anlamak için metotornegi2 sınıfını


yazdığımız programı biraz değiştirerek metodornegi3 ve
metodornegi3a sınıflarını olusturalım ve kare metodumuzu
metodornegi3a sınıfına yerlestirelim.
w.

import [Link]; // java applet sinifini cagir


import [Link].*; // java pencere kullanma sinifini cagir

class metodornegi3a
{
// sayinin karesi dinamik metodu
public double kare(double x)
{
ww

return x*x;
}
}

public class metodornegi3 extends Applet implements ActionListener


{
double sayi=5; // Gercek degisken sayi
metodornegi3a nesne1=new metodornegi3a();
public void paint(Graphics g)

43
44

{
[Link](sayi+"nin karesi = "+[Link](sayi),25,50);

m
}
}

Şekil 2.2.4 [Link] programında kare metodunun kullanılması

[Link] programında iki tane sınıf(class)

o
yaratılmıştır. İlk sınıf metodornegi3a da kare metodu
tanımlanmıştır. İkinci sınıf(class) metodornegi3 de ise
metodornegi3a sınıfı nesne1 nesnesi tanımlanmış, ve kare
metodu nesne1 nesnesi üzerinden [Link](sayi) olarak

i.c
çağırılmıştır. Bu metod nesne1 nesnesi için bilgisayar
belleğinde bir yer ayırır. Kare metodunu çağırırken bu yerin
adresini kullanır. [Link] programında kare(sayı)
dogrudan kullanılmıştı. Çunku kare metodu aynı sınıfın(class)
içinde tanımlanmıştı. [Link] programında ise kare
metodu ayrı bir sınıf(class) ta tanımlandığından yerinin
tanımlanması gerekir. Bu bizim kendi odamızın yatak odasını

dil
tanımlarken sadece yatak odası dememizle baska bir evin yatak
odasını tanımlarken Ahmet beyin evinin yatak odası dememiz
gibidir. Metotlar statik olarak da tanımlanabilirler. Statik
olarak tanımlanan metodlar nesne kullanılmadan direk olarak
sınıf(class) adları kullanılarak çağırılabilirler.

import [Link]; // java applet sinifini cagir


va
import [Link].*; // java pencere kullanma sinifini cagir

class metotornegi4a
{
// sayinin karesi dinamik metodu
public static double kare(double x)
{
return x*x;
ja

}
}

public class metotornegi4 extends Applet


{
double sayi=5; // Gercek degisken sayi
w.

public void paint(Graphics g)


{
[Link](sayi+"nin karesi = "+ [Link](sayi),25,50);
}
}

Şekil 2.2.5 [Link] programında static kare metodunun kullanılması


ww

Görüldüğü gibi metodornegi4 sınıfında(class) kare metodu


[Link](sayi) olarak tanımlanmış ve ek bir nesne
adresi kullanılmamıştır. Static olarak tanımlanan metodların
kendikendine yeterli metodlar olaması gerekir. Yani içinde
bulunduğu sınıfla veya baska sınıflarla direk olarak veri
alışverişi olamaz. Girdileri sadece girdi parantezleri ()
arasinda verilen değiş[Link] metodlar ise kendi

44
45

sınıfları ve diğer sınıflarla değişik yollardan bilgi ve


değişken aktarımı yapabilirler

m
[Link] ve [Link] programlarında iki
sınıf(class) aynı dosyada yer almiştı. Her sinifi ayri bir
dosyada da tanımlamak mumkündür. Bu yapıldığında diğer dosya
import(ithal) terimiyle diğer programa aktarılır. Şekil 2.2.6

o
ve 2.2.7 de Şekil 2.2.5 de verilen programın iki ayrı dosyada
yazılımını görüyoruz.

i.c
class metotornegi6
{
// sayinin karesi dinamik metodu
public double kare(double x)
{
return x*x;
}
}

dil
Şekil 2.2.6 [Link] programında static kare metodunun tanımlanması

import [Link]; // java applet sinifini cagir


import [Link].*; // java pencere kullanma sinifini cagir
import metodornegi6; // metodornegi6 sınıfını çağır
va
public class metodornegi7 extends Applet
{
double sayi=5; // Gercek degisken sayi
metodornegi6 x=new metodornegi();
public void paint(Graphics g)
{
[Link](sayi+"nin karesi = "+ [Link](sayi),25,50);
}
ja

Şekil 2.2.7 [Link] programında kare metodunun metodornegi6 sınıfı x


nesnesi üzerinden kullanılışı.

2.3 Metodların kendi kendini çağırması (Recusion)


w.

Bazı problemlerin çözümünde bir metodun kendi kendini çağırması yararlı olabilir. Java bir
metodun kendi kendini çağırmasına izin verir. Burada dikkatli olunması gereken nokta
sonsuza kadar bu kendi kendine çağırılmanın engellenmesidir. Kendi kendini çağıran
programlarda mutlaka bir döngü çıkış şartı tanımlanmalıdır.
ww

Daha önceki alıştırmalarımızda faktoriyel sınıfı tanımlanmıştı. Önce bu programdaki


faktoriyel hesabını ayrı metod haline dönüştürelim.

import [Link].*;
import Text;
class faktoriyel
{

45
46

public static void main(String args[]) throws IOException


{

m
long faktoriyel=1;
DataInputStream cin=new DataInputStream([Link]);
int faktoriyelsayi;
[Link]("Bir tamsayi giriniz:");
faktoriyelsayi=[Link](cin);
for(int sayi=1;sayi<=faktoriyelsayi;sayi++)
{ faktoriyel*=sayi;}

o
[Link](faktoriyelsayi+" faktoriyel: "+faktoriyel);
}
}
Şekil 2.3.1 Metod kullanılmadan faktoriyel hesaplayan [Link] programı

i.c
import [Link].*;
import Text;

class faktoriyel1
{

dil
public static long faktoriyel(int x)
{
long faktoriyel=1;
for(int sayi=1;sayi<=x;sayi++)
{ faktoriyel*=sayi;}
return faktoriyel;
}

public static void main(String args[]) throws IOException


va
{
DataInputStream cin=new DataInputStream([Link]);
int faktoriyelsayi;
[Link]("Bir tamsayi giriniz:");
faktoriyelsayi=[Link](cin);
[Link](faktoriyelsayi+" faktoriyel:" +
faktoriyel(faktoriyelsayi));
}
ja

}
Şekil 2.3.2 for döngülü faktoriyel metodunu kullarak faktoriyel hesaplayan
[Link] programı

İkinci olarak faktoriyeli kendi kendini çağıran proğram yardımcılığı ile hesaplayalım.
w.

import [Link].*;
import Text;

class faktoriyel2
{
public static long faktoriyel(int x)
{
ww

if( x <= 1 )
return 1;
else
return x * faktoriyel( x – 1);
}

public static void main(String args[]) throws IOException


{
DataInputStream cin=new DataInputStream([Link]);

46
47

int faktoriyelsayi;
[Link]("Bir tamsayi giriniz:");

m
faktoriyelsayi=[Link](cin);
[Link](faktoriyelsayi+" faktoriyel:" +
faktoriyel(faktoriyelsayi));
}
}

o
Bir tamsayi giriniz: 4
4 faktoriyel:24

Şekil 2.3.3 kendi kendini çağıran (recursive) faktoriyel metodunu kullarak faktoriyel

i.c
hesaplayan [Link] programı

Bu programı çalıştırdığımızda faktoriyel hesabı şu şekilde yapılacaktır :


5! Æ 5 * 4! Æ 4 * 3! Æ 3 * 2! Æ 2 * 1! Æ 1 faktoriyel metodu 1 e ulastığında tekrar
kendisini çağırmıyacağından geriye dogru yaptığı hesapları göndermeye başlıyacaktır.
1 Æ (2*1!(=1)) = 2 Æ (3 * 2!(=2)) = 6Æ(4*3!(=6))=24Æ(5*4!(24))=120Æ5!(=120)
sonuç 120 olarak ana programa gönderilir.

dil
2.4 Aynı adlı metodların bir arada kullanılması (overloading)

Java aynı adlı metodların aynı sınıf içerisinda kullanılmasına izin verir. Aynı sınıfta(class)
kullanılan metodların girdi değişkenlerinin değişken türlerinin veya değişken sayılarının farklı
olması gerekir. Java aynı isimli ve ayni degişkentürlü iki metodu birbirinden ayıramaz.
Örneğin
va
Public double Ametodu(double Adeğişkeni)
Ve
Public double Ametodu(double Bdeğişkeni)
Veya
Public int Ametodu(double Cdeğişkeni)
Java tarafindan ayırt edilemez
Fakat
ja

Public double Ametodu(double Adeğişkeni)


Ve
Public double Ametodu(int Bdeğişkeni)

Java tarafından ayırt edilir ve birlikte aynı sınıfın (class) içinde yer alabilir. Eğer birbirinin
w.

tam olarak eşiti metotlar değişik sınıflarda yer alıyorsa bunun herhangi bir sakıncası yoktur.
Bu ahmet beyin veya mehmet beyin değişik yatak odaları varsa ikisinin de yatak odalarındaki
aynı eşyalar turunden tanımlanmaları bir karışıklık yaratmaz.

Şekil2.4.1 de [Link] programı görülmektedir. Bu programda daha önceki


programlarda da kullandığımız kare metodunu int ve double girdi değişkenleriyle iki kere
ww

aynı sınıfın içerisinde tanımlayacağız.

import [Link];
import [Link];

public class ayniisimliikimetod extends Applet


{

47
48

// void tipi paint metodu


public void paint( Graphics g)

m
{
[Link](“ 7 nin karesi = “+kare(7),25,25);
[Link]( 7.5 un karesi = “+kare(7.5),25,40);
}

o
// int tipi kare metodu
int kare(int x)
{
return x*x;

i.c
}

// double tipi kare metodu


double kare(double x)
{
return x*x;
}
}

dil
Şekil 2.4.1 [Link] programı
va
Şekil 2.4.2 [Link] programıyla [Link] ın gösterilmesi

Bu programda parantez içerisinde 7 (tamsayı) verildiğinde java tamsayi metodu kare(int x),
ja

7.5(gerçek sayı) verildiğinde gerçeksayi metodu kare(double x) i çağırır.

2.5 Metod (method) ve sınıf değişkenleri

Metodların içinde kullanılan değişkenler sadece metodlara aittir. O metodun dışında tanımları
w.

yoktur. Eğer değişkenler metodların dışında sınıf(class) değişkenleri olarak tanımlanırsa


metoda da aynen aktarılırlar. Sınıf değişkeniyle aynı isimde bir değişken mettotta da
tanımlanmişsa bu değişken metodun içinde kullanılan metodun degişkenidir

import [Link];
import [Link];
ww

public class metotvesinifdeg extends Applet


{
//buradaki değişkenler tüm sınıfa aittir
double x ;
int y ;

void metod1( Graphics g) //metoda hi‡ bir de§iŸken girmiyor


{
x=5.5;

48
49

y=6;
[Link]("metod1 in ici : x = "+x+" y = "+y,25,40);

m
}

public void paint(Graphics g)


{
x = 2.5;
y = 3;
[Link]("metod1 in disi : x = "+x+" y = "+y,25,25);

o
metod1(g);
[Link]("metod1 in disi : x = "+x+" y = "+y,25,55);
}

i.c
}
Şekil 2.5.1 [Link] programında metod değişkenlerinin sınıfa aktarılması

Metod1 in disi : x=2.5 y=3


Metod1 in ici : x=5.5 y=6
Metod1 in disi : x=5.5 y=6
Şekil 2.5.2 [Link] programının sonuçları

import [Link];
import [Link]; dil
public class metotvesinifdeg1 extends Applet
{
va
//buradaki değişkenler tüm sınıfa aittir
double x ;
int y ;

void metod1( Graphics g) //metoda hi‡ bir de§iŸken girmiyor


{
double x;
int y;
ja

x=5.5;
y=6;
[Link]("metod1 in ici : x = "+x+" y = "+y,25,40);
}

public void paint(Graphics g)


w.

{
x = 2.5;
y = 3;
[Link]("metod1 in disi : x = "+x+" y = "+y,25,25);
metod1(g);
[Link]("metod1 in disi : x = "+x+" y = "+y,25,55);
}
ww

Şekil 2.5.3 [Link] programında metod değişkenlerinin sınıfa


aktarılması

49
50

Metod1 in disi : x=2.5 y=3


Metod1 in ici : x=5.5 y=6

m
Metod1 in disi : x=2.5 y=3
Şekil 2.5.4 [Link] programının sonuçları

Şekil 2.5.1 deki metodvesinifdeg sınıfındaki metot1 metodunun içinde değiştirilen x ve y


değişkenleri tüm tüm sınıfa(class) aittir. Bu yüzden paint metodundaki drawString metodu

o
tekrar çağırıldığında x ve y nin değerlerinin değiştiğini görürüz.

Şekil 2.5.2 deki metodvesinifdeg1 sınıfındaki metod1 metodunun içinde ise yerel değişkenler
x ve y tanımlanmıştır. Bu yüzden metod1 in içindeki x ve y değişkenlerinin değişmesi paint

i.c
metodundaki drawString metodu tekrar çağırıldığında x ve y nin degerlerinin değişmediği
görülür.

Nesne tanımı yapıldığında Bilgisayar bu nesne için bir adres yaratır. Yeni adres yarat komutu
new komutudur.

// java kutuphanelerinde tanimli bir sinifin cagirilip

import [Link].*;

class Point1
{ dil
// nesne olarak tanimlanmasi ve adres paylasimi
//java girdi cikti sinifini cagir
import [Link]; //Point sinifini cagir

public static void main(String args[])


{
//Point sinifi x,y koordinatli bir nokta tanimlar
va
Point nokta1,nokta2;
nokta1=new Point(100,100);
nokta2=nokta1;
// nokta1 ve nokta2 bilgisayarda ayni
// adres kutusunu paylasiyor
[Link]("nokta1 ve nokta2 ayni degerleri tasiyor");
[Link]("ve ayn bilgisayar adresini paylasiyor");
[Link]("nokta 1 : "+nokta1.x+" , "+nokta1.y);
ja

[Link]("nokta 2 : "+nokta2.x+" , "+nokta2.y);


nokta1.x=200;
nokta1.y=200;
[Link]("nokta1 in degeri degistirildi");
[Link]("nokta 1 : "+nokta1.x+" , "+nokta1.y);
[Link]("nokta 2 : "+nokta2.x+" , "+nokta2.y);
w.

// nokta1 ve nokta2 nin degerleri ayni fakat bilgisayarda


// degisik adreslerde tanimlanmis
nokta1=new Point(100,100);
nokta2=new Point(100,100);
[Link]("nokta1 ve nokta2 ayni degerleri tasiyor");
[Link]("fakat ayni bilgisayar adresini paylasmiyor");
[Link]("nokta 1 : "+nokta1.x+" , "+nokta1.y);
[Link]("nokta 2 : "+nokta2.x+" , "+nokta2.y);
ww

nokta1.x=200;
nokta1.y=200;
[Link]("nokta1 in degeri degistirildi");
[Link]("nokta 1 : "+nokta1.x+" , "+nokta1.y);
[Link]("nokta 2 : "+nokta2.x+" , "+nokta2.y);
}
}

50
51

Şekil 2.5.5 [Link] programda nokta1 ve nokta2 nesnelerinin yaratılması ve adres


paylaşımı.

m
[Link] da verilen
Point nokta1,nokta2;
nokta1=new Point(100,100);

o
nokta2=nokta1;

tanımında Point sınıfından(class) nokta1 ve nokta2 değişkenleri tanımlanmış, nokta1


değişkeni için yeni(new) adres tanımlanmış, nokta2 değişkenine de aynı adresi (nokta1 in

i.c
adresini) kullanması soylenmiştir. Bu yüzden proğramda nokta1 e yeni deger verildiğinde
nokta2 nin değeri de aynı değeri alır.

daha sonra kullanılan


nokta1=new Point(100,100);
nokta2=new Point(100,100);
deyimi ile ise nokta1 ve nokta2 için iki ayrı adres yaratılmıştır. Bu yüzden nokta1

JAVA PROGRAMLA DİLİ


HAFTA 4

Bu haftaki incelenecek programlar :

MATEMA~1 JAV 2.436


dil
değiştiğinde nokta2 eski değerinde kalır.

10/05/98 1:48 [Link]


va
METOD1~1 JAV 443 09/05/98 23:46 [Link]
METOD1~2 JAV 1.595 10/05/98 0:42 [Link]
METOD2~1 JAV 505 10/05/98 0:11 [Link]
METOD3~1 JAV 402 10/05/98 0:11 [Link]
METOD3~2 JAV 184 10/05/98 0:13 [Link]
METOD3~3 JAV 1.683 10/05/98 0:54 [Link]
METOD4~1 JAV 377 10/05/98 0:08 [Link]
METOD4~2 JAV 189 10/05/98 0:13 [Link]
ja

METOD4~3 JAV 1.514 10/05/98 1:02 [Link]


POINT1~1 JAV 1.699 10/05/98 2:17 [Link]

Bu haftaki alistırmalar

ALISTIRMA 1
w.

a) Math kütüphanesindeki [Link]() metodunu kullanarak static zar


metodunu yazınız. Bu metodu H4A1a sınıfında(class) tanımlayiniz.
Not : 1-den 6 ya kadar tesadüfi (random) sayıları
1+(int)([Link]()*6) formülü ile hesaplayabiliriz.
public class H4A1a
{
public static int zar()
ww

{
return 1+(int)([Link]()*6);
}
}

b) H4A1b sinifinda(class) java konsol ana metodu (public void main) yazarak
zar degerini yazdiriniz.
import [Link].*; // giris cikis
import H4A1a;

51
52

class H4A1b

m
{
public static void main (String args[]) throws IOException
{
[Link]("zar degeri : "+[Link]());
}
}

o
c) H4A1c sinifinda java konsol ana metodunda (public void main) metodunda
yüz(100) kere zar attırarak ortalamasını hesaplayınız.
Not : for veya while döngüsü kullanabilirsiniz.

i.c
import [Link].*; // giris cikis
import H4A1a;

class H4A1c
{
//yuz zarin ortalamasi
public static void main (String args[]) throws IOException
{

dil
double ortalama;
double toplam=0;
for(int sayi=0;sayi<100;sayi++)

{
toplam+=[Link]();
}
ortalama=toplam/100.0;
[Link]("100 zarin ortalamasi = "+ortalama);
va
}
}

d) H4A1d sinifinda java konsol ana metodunda (public void main)


bin(1000) kere zar attırarak her rakamın kac kere geldigini bulunuz ve
yazdırınız.
Not : switch – case deyimi bu tür programlar için idealdir
ja

import [Link].*; // giris cikis


import H4A1a;

public class H4A1d


{
w.

//bin zar atiminda her zar kac kere gelir


public static void main (String args[]) throws IOException
{
int zardegeri;
int zar1,zar2,zar3,zar4,zar5,zar6;
int zaratimsayisi=0;
zar1=0;
ww

zar2=0;
zar3=0;
zar4=0;
zar5=0;
zar6=0;
while(zaratimsayisi<1000)
{
zardegeri=[Link]();
switch(zardegeri)
{

52
53

case 1:
zar1++;

m
break;
case 2:
zar2++;
break;
case 3:
zar3++;
break;

o
case 4:
zar4++;
break;
case 5:

i.c
zar5++;
break;
case 6:
zar6++;
break;
}
zaratimsayisi++;
}

dil
[Link]("toplam zar 1 sayisi : "+zar1);
[Link]("toplam zar 2 sayisi : "+zar2);
[Link]("toplam zar 3 sayisi : "+zar3);
[Link]("toplam zar 4 sayisi : "+zar4);
[Link]("toplam zar 5 sayisi : "+zar5);
[Link]("toplam zar 6 sayisi : "+zar6);
}
}
va
ALIŞTIRMA 2

a) [Link] programini incele ve calistir.


b) [Link] programindaki zar metodunu [Link] sınıfına yerlestir.
[Link] programindaki zar metodunu sil ve import H4A2b; deyimini
ekle.
c) [Link] programını H4A2c olarak değiştir. sinifindan yeni nesne z
yi [Link] programına ekle ve Paint methodunda çağırılan zar metodunda
ja

gerekli değişiklikleri yap. Programi yeni sekliyle calıştır.

import [Link].*;
import [Link];
import [Link].*;
w.

public class zarApplet extends Applet implements ActionListener


{
int toplamzaratisi=0;
int toplam=0;
TextField ilkzar,ikincizar;
Button salla; //zar atma d gmesi
int zar1,zar2;
ww

public static int zar()


{
return 1+(int)([Link]()*6);
}

public void init()


{
//programi baslat
ilkzar=new TextField(10); // Textfield sinifi ilkzar nesnesini yarat

53
54

add(ilkzar); // ilk zar nesnesini pencereye ekle


ikincizar=new TextField(10);// Textfield sinifi ikincizar nesnesini yarat

m
add(ikincizar); // ikinci zar nesnesini pencereye ekle
salla=new Button("Zari salla ve at");
add(salla);
[Link](this);
}

public void actionPerformed(ActionEvent e)

o
{
zar1=zar();
zar2=zar();
[Link]([Link](zar1));

i.c
[Link]([Link](zar2));
toplam+=(zar1+zar2);
toplamzaratisi++;
repaint();
}

public void paint( Graphics g)


{

dil
[Link]("toplam = "+toplam+" Atilan zar sayisi =
"+toplamzaratisi,25,50);
}
}

public class H4A2b


{
va
public static int zar()
{
return 1+(int)([Link]()*6);
}
}
ja

import [Link].*;
import [Link];
import [Link].*;
import H4A2b;

public class H4A2c extends Applet implements ActionListener


w.

{
int toplamzaratisi=0;
int toplam=0;
TextField ilkzar,ikincizar;
Button salla; //zar atma d gmesi
int zar1,zar2;
H4A2b z=new H4A2b();
public void init()
ww

{
//programi baslat
ilkzar=new TextField(10); // Textfield sinifi ilkzar nesnesini yarat
add(ilkzar); // ilk zar nesnesini pencereye ekle
ikincizar=new TextField(10);// Textfield sinifi ikincizar nesnesini yarat
add(ikincizar); // ikinci zar nesnesini pencereye ekle
salla=new Button("Zari salla ve at");
add(salla);
[Link](this);

54
55

m
public void actionPerformed(ActionEvent e)
{
zar1=[Link]();
zar2=[Link]();
[Link]([Link](zar1));
[Link]([Link](zar2));
toplam+=(zar1+zar2);

o
toplamzaratisi++;
repaint();
}

i.c
public void paint( Graphics g)
{
[Link]("toplam = "+toplam+" Atilan zar sayisi =
"+toplamzaratisi,25,50);
}
}

JAVA PROGRAMLAMA DİLİ


HAFTA 5
dil
va
Geçen Haftanın Alıştırmaları :

H4A2B~1 JAV 99 19/05/98 22:18 [Link]


H4A2C~1 JAV 1.117 19/05/98 22:04 [Link]
H4A1B~1 JAV 212 19/05/98 23:43 [Link]
H4A1A~1 JAV 99 19/05/98 22:18 [Link]
H4A1C~1 JAV 424 19/05/98 22:35 [Link]
H4A1D~1 JAV 1.255 19/05/98 22:53 [Link]
ja

Bu haftaki incelenecek problemler :

FAKTOR~1 JAV 448 02/05/98 22:32 [Link]

import [Link].*;
w.

import Text;
class faktoriyel
{
public static void main(String args[]) throws IOException
{
int faktoriyel=1;
DataInputStream cin=new DataInputStream([Link]);
ww

int faktoriyelsayi;
[Link]("Bir tamsayi giriniz:");
faktoriyelsayi=[Link](cin);
for(int sayi=1;sayi<=faktoriyelsayi;sayi++)
{ faktoriyel*=sayi;}
[Link](faktoriyelsayi+" faktoriyel: "+faktoriyel);
}
}

55
56

FAKTOR~2 JAV 404 20/05/98 0:17 [Link]

m
import [Link];
import [Link];

public class faktoriyeltesti extends Applet


{
public void paint(Graphics g)
{

o
int y=25;
for(long i=0;i<=10;i++)
{
[Link](i+"! = "+faktoriyel(i),25,y);

i.c
y+=15;
}
}

public long faktoriyel(long sayi)


{
if(sayi <=1) return 1;
else return sayi*faktoriyel(sayi - 1);

dil
}

FIBONA~1 JAV 463 20/05/98 0:26 [Link]


va
import [Link];
import [Link];

public class fibonachitesti1 extends Applet


{
public void paint(Graphics g)
{
int y=25;
ja

for(long i=0;i<=15;i++)
{
[Link]("Fibonachi("+i+") = "+fibonachi(i),25,y);
y+=15;
}
}
w.

public long fibonachi(long sayi)


{
if(sayi <=0) return 0;
else if(sayi ==1) return 1;
else return fibonachi(sayi - 1)+fibonachi(sayi - 2);
}
ww

56
57

o m
i.c
FIBONA~2 JAV

import [Link].*;
1.063

import [Link];
import [Link].*;
dil
20/05/98 0:47 [Link]

public class fibonachitesti2 extends Applet implements ActionListener


va
{
Label rakametiketi,sonucetiketi;
TextField rakam,sonuc;

public void init()


{
rakametiketi=new Label("Bir tamsayi giriniz : ");
rakam=new TextField(10);
ja

[Link](this);
sonucetiketi=new Label("Fibonachi degeri : ");
sonuc=new TextField(10);
[Link](false);
add(rakametiketi);
add(rakam);
w.

add(sonucetiketi);
add(sonuc);
}

public void actionPerformed( ActionEvent e)


{
long sayi;
long fibonachisayisi;
ww

sayi=[Link]([Link]());
showStatus("Fibonachi hesaplan yor....");
fibonachisayisi=fibonachi(sayi);
showStatus("Fibonachi hesaplandi....");
[Link]([Link](fibonachisayisi));
}

public long fibonachi(long sayi)


{
if(sayi <=0) return 0;

57
58

else if(sayi ==1) return 1;


else return fibonachi(sayi - 1)+fibonachi(sayi - 2);

m
}

o
i.c
FAKTOR~3 JAV 522 20/05/98 1:12 [Link]

import [Link].*;
import Text;

class faktoriyel2
{

{
if( x <= 1 )
return 1;
else
dil
public static long faktoriyel(int x)

return x * faktoriyel( x - 1);


va
}

public static void main(String args[]) throws IOException


{
DataInputStream cin=new DataInputStream([Link]);
int faktoriyelsayi;
[Link]("Bir tamsayi giriniz:");
faktoriyelsayi=[Link](cin);
ja

[Link](faktoriyelsayi+" faktoriyel:" +
faktoriyel(faktoriyelsayi));
}
}
w.

Bu haftaki alıştırmalar :

ALIŞTIRMA 1

Bir kürenin hacmini hesaplayacak bir applet programı yazınız. Kürenin hacmi
küreHacmi isimli metod tarafından hesaplansın. Applet bir girdi alanına
kürenin yariçapını sorsun ve yarıçap girildiğinde yeni küre hacmi ekranda
ww

gösterilsin.
Not : Kürenin hacmi : (4.0/3.0)*[Link]*[Link](r,3);

import [Link]; // java applet sinifini cagir


import [Link].*; // java pencere kullanma sinifini cagir
import [Link].*; // java pencereyi dinleme sinifini cagir
public class H5A1 extends Applet implements ActionListener
{
// bu sinif kupun hacmini hesaplar

58
59

//=====================================================
// sinif degiskenleri

m
// bu degiskenler tum s n fa aittir
Label kutubasligi; //Label sinifi degiskeni (nesnesi) kutubasligi
TextField kutugirdisi;// Textfield sinifi degiskeni (nesnesi)
kutugirdisi
double yaricap; // Gercek degisken yar cap
double hacim; // Gercek degisken hacim
//=====================================================

o
// pencereyi baslatma metodu
// pencere ilk basladiginda
// degiskenler buradaki degerleri alirlar
public void init()

i.c
{
kutubasligi=new Label("Kubun yaricapini (m)giriniz : ");
add(kutubasligi);
kutugirdisi=new TextField(10);
add(kutugirdisi);
yaricap=0;
hacim=0;
[Link](this);

dil
}
//=====================================================
// girdi alanindaki olan olaylari dinleme metodu
// Her yeni rakam girildiginde bu metod cagirilir
public void actionPerformed(ActionEvent e)
{
Double sayi1=new Double([Link]() );
yaricap=[Link]();
hacim=kubunhacmi(yaricap);
va
[Link](" ");//kutudaki rakami sil
repaint();//pencereyi yeniden paint metoduna gore ciz
}
//=====================================================
// paint (boya=pencereye ciz metodu)
public void paint(Graphics g)
{
[Link](yaricap+" m capindaki kubun hacmi : "+hacim+" m^3",25,50);
ja

}
//=====================================================
//kubun hacmini hesaplama metodu
public double kubunhacmi(double r)
{
return (4.0/3.0)*[Link]*r*r*r;
w.

}
}
ww

59
60

ALIŞTIRMA 2

m
Bir dik üçgenin hipotenüsünü hesaplayan bir applet programı yazınız.
Program dik üçgenin iki dik kenarını applet de girsin ve hipotenus
metoduyla hesaplasın ve sonucu applete yazdırsın.
Not : Dik üçgenin hipotenüsü :
Hipotenüs = [Link](dikkkenar1*dikkenar1+dikkenar2*dikkenar2);

import [Link]; // java applet sinifini cagir

o
import [Link].*; // java pencere kullanma sinifini cagir
import [Link].*; // java pencereyi dinleme sinifini cagir
public class H5A2 extends Applet implements ActionListener
{

i.c
// bu s n f dik ucgenin hipotenusunu hesaplar
//=====================================================
// sinif degiskenleri
// bu degiskenler tum s n fa aittir
Label kutubasligi1; //Label sinifi degiskeni (nesnesi)
kutubasligi1
TextField kutugirdisi1; // Textfield sinifi degiskeni (nesnesi)
kutugirdisi1

dil
Label kutubasligi2; //Label sinifi degiskeni (nesnesi)
kutubasligi2
TextField kutugirdisi2; // Textfield sinifi degiskeni (nesnesi)
kutugirdisi2
double dikkenar1; // Gercek degisken dikkenar1
double dikkenar2; // Gercek degisken dikkenar1
//=====================================================
// pencereyi baslatma metodu
// pencere ilk basladiginda
va
// degiskenler buradaki degerleri alirlar
public void init()
{
kutubasligi1=new Label("Birinci dik kenari giriniz : ");
add(kutubasligi1);
kutugirdisi1=new TextField(10);
add(kutugirdisi1);
kutubasligi2=new Label("Ikinci dik kenari giriniz : ");
ja

add(kutubasligi2);
kutugirdisi2=new TextField(10);
add(kutugirdisi2);
dikkenar1=0;
dikkenar2=0;
[Link](this);
w.

}
//=====================================================
// girdi alanindaki olan olaylari dinleme metodu
// Her yeni rakam girildiginde bu metod cagirilir
public void actionPerformed(ActionEvent e)
{
Double sayi1=new Double([Link]() );
dikkenar1=[Link]();
ww

Double sayi2=new Double([Link]() );


dikkenar2=[Link]();
//[Link](" ");//kutudaki rakami sil
repaint();//pencereyi yeniden paint metoduna gore ciz
}
//=====================================================
// paint (boya=pencereye ciz metodu)
public void paint(Graphics g)
{

60
61

[Link](" hipotenus = "+hipotenus(dikkenar1,dikkenar2),25,80);


}

m
//=====================================================
//ucgenin hipotenusunu hesaplama metodu
public double hipotenus(double dk1,double dk2)
{
return [Link](dk1*dk1+dk2*dk2);
}
}

o
i.c
dil
ja va
w.
ww

61
62

BÖLÜM 3 : Sınıf (Class) Yapılarına Giriş

m
3.1 Sınıf yapısının genel tanımı

Şu na kadarki bütün programlarımızda sınıf(class) yapısını kullandık. Fakat tam olarak

o
sınıfların ne olduğunu ve neler yapabileceklerini anlatmadık. Sınıf yapısının en onemli
ozelliği yeni bir değişken türü tanımlıyor olmasıdır. Şu ana kadar programlarımızı
tanımlamak amacıyla çeşitli sınıflar tanımladık. Bu bölümde sınıfları değişken türü olarak
tanımlamasını ve kullanmasını göreceğiz.

i.c
Sınıf (Class) deyince herhangi bir nesnenin genel tanımlanmasını anlıyoruz. Bu sınıflardan
değişkenler tanımandıklarında nesneleri oluştururlar. Örneğin kalem dediğimizde genel bir
sınıfı anlatıyoruz. Alinin cebindeki kırmızı kalem ise belirli bir nesnedir. Sınıfın genel tanımı
şu şekilde yapılabilir :

Class sınıfın_ismi
{
//sınıfa ait değişken listesi
değişken_türü değişken_ismi;
değişken_türü değişken_ismi;
.........
//sınıfa ait metot listesi
dil
degişken türü metotadı(metod girdi değişken listesi)
va
{
//metodun içindeki hesaplanan işlemler
return çıktı_değişkeni;
}
..............

}
ja

Sınıf (class) tanımında metodların bulunması şart değildir. Bulundukları takdirde bunlar o
sınıfa ait veya sinifin üyesi metodlar olarak düşünülür. İlk sınıf örneği olarak içinde hiçbir
metodun yer almadığı bir kutu sınıfı tanımlıyalım. Bir kutuyu üç geometrik boyutu
(eni,boyu,yüksekliği) cinsinden tanımlayabiliriz.
w.

Class Kutu
{
double en;
double boy;
double yukseklik;
ww

Üstte bahsettiğimiz gibi sınıf yeni bir değişken türü yaratır. Yukardaki sınıfın yarattığı
değişken türünün adı Kutu’dur. Kutu değişkenini başka bir proğramda tanımlarken
budeğişken türünden bir nesne yaratılır. Örneğin

Kutu benimkutum= new Kutu();

62
63

Benimkutum kutu türünde tanılanmış bir nesnedir. Bu nesnenin kendisinin de en boy ve

m
yükseklik olmak üzere üç alt değişkeni mevcuttur. Eğer bir programda benimkutum değişkeni
tanımlanmışsa, bu değişkenin alt degişkenlerine şu şekilde ulaşılabilir :

[Link]=1.0;

o
Şimdi Kutu değişkenini kullanacak ufak bir kututestı sınıfı oluşturalım ve Kutu sınıfını bu
sınıfta kullanalım.

import [Link].*;

i.c
class Kutu
{
double en;
double boy;
double yukseklik;
}

dil
class kututesti
{
public static void main(String args[])
{
Kutu benimkutum=new Kutu();
double hacim;
[Link]=10.0;
[Link]=20.0;
va
[Link]=30.0;
hacim=[Link]*[Link]*[Link];
[Link]("Benim kutumun hacmi : "+hacim);
}
}

Bu programın adının [Link] olması zorunludur. Çünki ana metod(main) kututesti


ja

sınıfında tanımlanmıştır. Fakat programı javac terimiyle bilgisayar diline çevirdiğimizde iki
tane sınıf(class) dosyasının oluştuğunu görürüz. Birisi [Link] diğeride [Link].
Ana program kututesti olduğu için bu programın işletimi
java kututesti
deyimini kullanarak yapılır. Program işletildiğinde
w.

Benim kutumun hacmi : 6000.0

Sonucunu verir. Benim kutum nesnesi yaratıldığında bilgisayar belleğinde benimkutum için
nir adres tanımlanır. New Kutu() deyimi verildiğinde ise bilgisayrın belleginde en,boy ve
yükseklik değişkenleri için yer ayrılır ve bu yerlerin adresleriyle benim kutum nesnesinin
ww

adresi arasında bağlantı sağlanır. Bunu grafik olarak anlatalım :

Deyim Bilgisayar belleği


Kutu benimkutum; Null

Benimkutum
Benimkutum=new Kutu(); En

Boy

Yukseklik
63
64

Benimkutum

m
Not null terimi bilgisayar beleğinin boş olduğunu gösterir. Yukardaki grafikte ilk olarak
Kutu benimkutum; tanımı yapıldığında bilgisayar belleğinde 1 byte boyutunda bir yer
tanımlar. Ve bu yere bos anlamına gelen null degerini yükler. İkinci durumda ise
(benimkutum=new Kutu() tanımında) benimkutum nesne adresindeki kutuda
en,boy,yükseklik değişkenlerinin adresleri kaydedilmiştir. Bu adres aracılığıyla en boy ve

o
yükseklik değişkenlerine benimkutum degişkeni üzerinden ulaşılabilir. Diğer deyimle
en,boy,yükseklik benim kutum nesnesinin alt değişkenleridir.

3.2 Kurucu ( constructor ) metot

i.c
İkinci bir programda Kutu sınıfı iki nesne tanımlama gereği duyduğumuzu varsayalım. Buna
ornek olarak Şekil 3.2.1 de [Link] programı tanımlanmıştır.

import [Link].*;

class Kutu
{
double en;
double boy;
double yukseklik;
}

class kututesti1
{
dil
va
public static void main(String args[])
{
double hacim;
Kutu benimkutum1=new Kutu();
[Link]=10.0;
[Link]=20.0;
[Link]=30.0;
hacim=[Link]*[Link]*[Link];
ja

[Link]("Benim kutumun hacmi : "+hacim);


Kutu benimkutum2=new Kutu();
[Link]=5.0;
[Link]=10.0;
[Link]=15.0;
hacim=[Link]*[Link]*[Link];
w.

[Link]("Benim kutumun hacmi : "+hacim);


}
}
Şekil 3.2.1 Kutu sınıfı iki nesne tanımlayan [Link] programı

Bu programın çıktısı :

Benim kutumun hacmi : 6000.0


ww

Benim kutumun hacmi : 750.0

Bu programda Kutu sınıfından benimkutum1 ve benimkutum2 değişkenler


tanımlanmıştır. Bu basit programda bile en,boy ve yükseklik değikenlerini
iki defa çağırmak listenin uzamasına sebep olmuştur. Gerçek uygulamalarda
ise çok daha yüksek sayıda değişken içeren sınıflar oluşturulabilir ve bu
sınıflarda oluşturulan toplam nesne sayısı da çok fazla olabilir. Bu yüzden
nesneyi ilk tanımlarken aynı zamanda değişkenlerinin değerlerini de
tanılayabilirsek, çok daha okunaklı ve kısa bir bilgisayar listesiyle aynı

64
65

işi yapabiliriz. Bu iş için kurucu (constructor) adı verilen metodlar


kullanılır. Kurucu metodları diğer metodlardan biraz farklıdır. Once metod

m
önüne metod değişken türü gelmez ve metod dışına hiçbir değişken
göndermezler. İsimleri de herzaman sınıf(class) ismiyle aynı olur. Şekil
3.2.1 deki programı kurucu (constructor) metodu kullanarak tekrar yazalım.
import [Link].*;

class Kutu
{

o
double en;
double boy;
double yukseklik;

i.c
//kurucu metod kutu
Kutu(double e,double b,double y)
{
en=e;
boy=b;
yukseklik=y;
}

dil
}

class kututesti2
{
public static void main(String args[])
{
double hacim;
Kutu benimkutum1=new Kutu(10.0,20.0,30.0);
hacim=[Link]*[Link]*[Link];
va
[Link]("Benim kutumun hacmi : "+hacim);
Kutu benimkutum2=new Kutu(5.0,10.0,15.0);
hacim=[Link]*[Link]*[Link];
[Link]("Benim kutumun hacmi : "+hacim);
}
}

Şekil 3.2.2 Kutu sınıfı iki nesneyi kurucu(constructor) metodu yardımıyla


ja

tanımlayan [Link] programı

Bu programın çıktısı :

Benim kutumun hacmi : 6000.0


Benim kutumun hacmi : 750.0
w.

Görüldüğü gibi bu program bir öncekinin aynı sonucu vermiştir. Faket burada
bir önceki programda yapılan

Kutu benimkutum1=new Kutu();

Tanımı yerini
ww

Kutu benimkutum1=new Kutu(10.0,20.0,30.0);

Tanımına bırakmış ve kututesti2 sınıfı yazılırken en ,boy yükseklik değişkenlerinin yeniden


tanımlanması ihtiyacını ortadan kaldırmıştır.

65
66

3.3 Diğer metotlar

m
Tekrar yukarıda incelediğimiz kutu sınıfını göz önüne alalım. Hacim bir kutunun özellikleri
arasında yer alır, ve her zaman kutunun hacminin hesaplanması gerekebilir. Bu yüzden hacim
işlemini Kutu sınıfının içinde tanımlamak daha ideal olacaktır. Şekil 3.3.1 deki
[Link] programında hacim hesaplarını yapan hacim metodu Kutu sınıfının içinde
tanımlanmıştır.

o
import [Link].*;

class Kutu

i.c
{
double en;
double boy;
double yukseklik;

//kurucu metod kutu


Kutu(double e,double b,double y)
{

dil
en=e;
boy=b;
yukseklik=y;
}

//bu metot kutunun hacmini hesaplar


double hacim()
{
va
return en*boy*yukseklik;
}

class kututesti3
{
public static void main(String args[])
{
ja

Kutu benimkutum1=new Kutu(10.0,20.0,30.0);


[Link]("Benim kutumun hacmi : "+[Link]() );
Kutu benimkutum2=new Kutu(5.0,10.0,15.0);
[Link]("Benim kutumun hacmi : "+[Link]() );
}
}
w.

Şekil 3.3.1 Kutu sınıfı iki nesneyi kurucu(constructor) metodu yardımıyla


tanımlayan ve hacmi hacim() metoduyla hesaplayan [Link] programı

Bir önceki bölümde metod yazımı konusunda anlattıklarımızın hepsini buraya ilave edebiliriz.
ww

3.3 Diğer metotlar 3.4 this deyiminin kullanımı

bazen bir metodun içinde o metodun ait olduğu sınıftan yaratılacak nesneyi veya o nesnenin
bir alt değişkenini tanımlamak gerekir. Nesne daha tanımlanmadığindan direk olarak nesne
ismini kullanamayız. Bunun yerina java this deyimini kullanır. This deyimi bilhassa sınıfa ait
değişken silerinin aynısı metodda kullanılmışsa işe yarar. Bu durumda tüm sınıfa ait
değişkenler [Link]ğişken_ismi komutuyla çağırılabilir. Eçen bölümde sınıf ve metota ait
değişkenleri izlerken [Link] ve [Link] isimlerinde iki örnek

66
67

problemi incelemiştik. Şimdi de aynıgruptan metotvesını[Link] programını inceleyelim.

m
import [Link];
import [Link];

public class metotvesinifdeg3 extends Applet


{
//buradaki degiskenler tum sinifa aittir

o
double x ;
int y ;

void metod1( Graphics g) //metoda hi‡ bir de§iŸken girmiyor


{

i.c
double x;
int y;
x=5.5;
y=6;
//tum sinifa at degiskenler this kelimesi ile birlikte kullanilabilirler
[Link]("metod1 in dis degiskenleri this ile ulasim : x = "+this.x+"
y = "+this.y,25,25);
[Link]("metod1 in ic degiskenleri : x = "+x+" y = "+y,25,40);

dil
}

public void paint(Graphics g)


{
x = 2.5;
y = 3;
metod1(g);
}
va
}

Şekil 3.4.1 [Link] programıyla ve this deyimi yardımıyla


metotun içinde yerel ve sınıfa ait değişkenlere ulaşım.

Sınıfa ait her değişkeni başına this. Getirerek kullanabiliriz. Fakat this
kullanımı mutlaka gerekli değilse kullanılmaması tavsiye edilir. Örneğin
ja

yukarıdaki kurucu metot kutu

//kurucu metod kutu


Kutu(double e,double b,double y)
{
[Link]=e;
w.

[Link]=b;
[Link]=y;
}

şeklinde yazılabilirdi. Fakat sınıfta aynı isimde başka değişken olmadığından bilgisayar zaten
bu değişkenlerin sınıfa ait olduklarını bilmektedir ve ayrıca tekrarlamaya gerek yoktur.
ww

3.5 sınıf değişkenlerinin dış dünyadan gizlenmesi


Aşağıda dort işlem (toplama cıkarma carpma bolme yapan dortislemhesapmakinasi sınıfını
görüyorsunuz.

public class dortislemhesapmakinasi


{
//sınıf değişkenleri x1 ve x2

67
68

private double x1,x2;

m
// kurucu metot dortislemhesapmakinesi
public dortislemhesapmakinasi(double y1,double y2)
{
//constructor
x1=y1;
x2=y2;
}

o
// ikinci bir kurucu metot dortislemhesapmakinesi
public dortislemhesapmakinasi()
{

i.c
x1=1;
x2=1;
}

public double topla()


{
return x1+x2;
}

public double cikar()


{

}
return x1-x2;

public double carp()


{
return x1*x2;
dil
va
}

public double bol()


{
return x1/x2;
}

//bu metodla x1 in değeri değiştirilir


ja

public void ilksayigir(double y1)


{
x1=y1;
}

//bu metodla x2 nin değeri değiştirilir


w.

public void ikincisayigir(double y2)


{
x2=y2;
}

//bu metodla x1 ve x2 nin değerleri değiştirlir


public void ikisayigir(double y1,double y2)
{
ww

x1=y1;
x2=y2;
}

Şekil 3.5.1 dö[Link] programı ve sınıf değişkenlerinin


değerlerinin metod kullanılarak değiştirilmesi

68
69

Bu sınıfta (class) sınıf değişkenleri x1 ve y1 in değerlerinin değiştirilmesi için üç metot


yazılmıştır.. Bunun sebebi programlarda sınıfa ait değişkenlere dışarıdan direk ulaşımın

m
önlenmesini sağlamaktır. İyi programlama şartlarından birisi sınıfın değişkenlerine sadece o
sınıfın metotları üzerinden ulaşmaktır. Herkese serbest ulaşım verilmez. Hatta bunu saglamak
için değişkenlerin başına sadece bu sınıfa aittir dışarıdan kullanılamaz anlamındaki private
sözcügü getirilebilir.

o
[Link] programının x1 ve x2 değişkenlerine private sözcüğü
kullandığımız için

dortislemhesapmakinasi h = new dortislemhesapmakinasi();

i.c
h.x1 = 2.0;
h.x2 = 3.5;

şeklinde ulaşılamaz. Aynı işlemi yapmak için aşağıdaki üç yoldan birini kullanabiliriz.

dortislemhesapmakinasi h = new dortislemhesapmakinasi();

dil
[Link](2.0);
[Link](3.5);

veya

dortislemhesapmakinasi h = new dortislemhesapmakinasi();


[Link](2.0,3.5);
va
veya

dortislemhesapmakinasi h = new dortislemhesapmakinasi(2.0,3.5);

3.6 Sınıflarda Kalıtım (inheritance)


ja

Bir sınıfın kurulmasında o sınıfla direk olarak ilişkisi olan bir sınıftan onun tüm metodları ve
değişkenleri kalıtım (inheritance) yoluyla yeni kurulan bir sınıfa aktarılabilir. Kalıtım için
sınıf(class) tanımında extends kelimesi kullanılır. Eğer bir sınıftan daha alt sınıflara kalıtım
yoluyla aktarma yapılacaksa privatedeğişken türü yerini protected değişken türüne bırakır.
w.

Protected private deyiminin aynıdır. Fakat kalıtımla değişkenlerin aktarıldığı alt sınıflara
değişkenleri görme izni verir. Private terimi ise kalıtımla aktarılan alt sınıflardan bile o
değişkenleri saklar.

Şekil 3.6.1 de nokta sınıfı tanımlanmıştır. Şekil 3.6.2 de ise nokta sınıfından kalıtım yoluyla
yaratılan daire sınıfını görüyoruz. Programda da görüleceği gibi daire sınıfının tanımı
ww

public class daire extends nokta

terimiyle yapılmıştır. Ayrıca daire sınıfının kurucusu yazılırken nokta sınıfının kurucusu direk
olarak super(a,b); terimiyle çağırılmıştır.

Burada önemli bir noktayı hatırlatalım : bir sınıf sadece bir tane başka sınıfın netod ve
değişkenlerini kalıtım yoluyla aktarabilir.

69
70

m
public class nokta
{
protected double x, y;

public nokta(double a, double b)


{

o
noktagir(a,b);
}

public void noktagir(double a, double b) { x=a; y=b;


}

i.c
public double Xoku() {
return x;
}

public double Yoku()


{
return y;
}

}
public String toString()
{

}
return "["+x+","+y+"]";
dil
Şekil 3.6.1 [Link] programı ve nokta sınıfının tanımı.
va
import nokta;
public class daire extends nokta
{
protected double yaricap;

public daire()
ja

{
//daire kalitim yaptigi nokta sinifinin kurucu metodunu
// super deyimi ile cagirabilir.
super(0,0);
yaricapgir(0);
}
w.

public daire(double r, double a, double b)


{
super(a,b);
yaricapgir(r);

}
ww

public void yaricapgir(double r)


{
if(r >= 0.0)
yaricap=r;
else
yaricap=0.0;
}

public double yaricapoku()

70
71

{
return yaricap;

m
}

public double alan()


{
return 3.14159*yaricap*yaricap;
}

o
public String toString()
{
return "Merkez = "+"["+x+","+y+"]"+
"; Yaricap="+yaricap;

i.c
}
}

Şekil 3.6.2 [Link] programı ve daire sınıfının tanımı. Daire sınıfı


nokta sınıfından Kalıtım (inheritance) yoluyla türetilmiştir.

Kalıtım yoluyla aktarılan bir metod yeni programda o programın içinde yazılmış gibi aynen
kullanılabilir.

(composition)
dil
3.7 Sınıfları başka bir sınıfta nesne olarak çağırarak bir araya getirme

Sınıftaki değişken ve metodları kalıtım yoluyla aktarabildiğimiz gibi, sadece üst sınıfa ait bir
nesne (object) tanımını alt sınıfta tanımlıyarak ta yapabiliriz.
va
import nokta;
public class daire1
{
protected double yaricap;
protected nokta merkez;

public daire1()
{
ja

merkez=new nokta(0,0);
yaricapgir(0);
}

public daire1(double r, double a, double b)


w.

{
merkez=new nokta(a,b);
yaricapgir(r);

public void yaricapgir(double r)


ww

{
if(r >= 0.0)
yaricap=r;
else
yaricap=0.0;
}

public double yaricapoku()


{
return yaricap;

71
72

m
public double alan()
{
return [Link]*yaricap*yaricap;
}

public String toString()


{

o
return "Merkez = "+"["+merkez.x+","+merkez.y+"]"+
"; Yaricap="+yaricap;
}
}

i.c
Şekil 3.7.1 [Link] programı ve daire sınıfının tanımı. Nokta sınıfı
daire1 sınıfında merkez adlı nesne olarak tanımlanmıstır.

3.8 Kalıtım yoluyla alt sınıfa bağlanmış üst sınıf referansı üzerinden alt
sınıfı çağırma

programın içinde aktarımı mümkündür.

import [Link];
import [Link];
dil
Yukarıda nokta ve daire sınıflarını tanımlamıştık. Baska bir sınıftan kalıtım yoluyla türeyen
sınıfın(dairenin noktadan kalıtım yoluyla türemesi gibi), üst sınıfın adresi(tanımı) üzerinden
va
public class noktatesti extends Applet
{
private nokta noktaref,n;
private daire daireref,d;
public void init()
{
n=new nokta(30,50);
d=new daire(2.7,120,89);
}
ja

public void paint(Graphics g)


{
//once noktamızı ve dairemizi yazdıralım
[Link]("Nokta n : "+[Link](),25,25);
[Link]("Daire d : "+[Link](),25,40);
//c dairesinin adresini nokta olarak tan mlanan noktaref e aktaral m
w.

noktaref=d;
[Link]("Daire(noktaref uzerinden) :"+[Link](),25,70);
//noktaref nesnesini daireref degiskenine aktaral m
daireref=(daire)noktaref;
[Link]("Daire(daireref uzerinden) :"+[Link](),25,85);
[Link]("Dairenin alani(daireref uzerinden)
:"+[Link](),25,100);
ww

}
}
Şekil 3.8.1 [Link] sınıfında üst sınıf üzerinden adres referansı
kullanımı

Şekil 3.8.1 de görülen [Link] sınıfında n nokta sınıfı nesnesi ve


noktaref noktasinifi nesnesi ve d ve daireref daire sinifi nesneleri
tanımlanmiştır. İnit metodunda p ve c nesnelerinin adresleri kurucu metodu
new deyimiyle taşıyarak tanımlanmiştir. Dahasonra noktaref=d; deimiyle
aslında daire sınıfından olan d nesnesi nokta sınıfından tanımlanan

72
73

noktaref nesnesinin adresine yüklenmiştir. Programda da görüldüğü gibi


noktaref üzerinden daireyi kullanmak mümkündür çünki nokta dairenin kalıtın

m
yoluyla üst sınıfıdır. Aynı zamanda cast işlemcisi (daire) terimini
kullanarak noktaref’i daireref’e aktarmak da mümkün olmuştur. Bu aktarma
nokta dairenin super sınıfı olmasa başarılamazdı. Bazen sadece bu süper
sınıf aktarımını saglamak amacıyla sınıf hiyerarşisinin en tepesine aslında
belli bir görevi olmıyan abstract sınıflar yerleştirilir. Bu sınıfın alt
sınıfları olarak tanımlanan tüm sınıflar bu sınıf adresinden yararlanılarak
aktarılabilir. Abstract sınıfların tanımında abstract sözcüğü kullanılır.

o
Abstract tür metodların içinde metodların sadece başlıkları verilip
tanımları yapılmıyabilir. (metodun ana gövdesi tanımlanmıyabilir). Abstract
super sınıfının kullanılmasına şöyle bir örnek verebiliriz : sekil isimli
bir abstract sınıfın alt sınıfları olarak daire,üçgen,dikdörtgen ve kare

i.c
sınıflarını olusturduğumuzu ve bu sınıfların herbirinin kendi şeklini
çizecek ciz metodunu içerdiğini düşünelim. Programı yazarken abstract sınıf
sekilde de alan metodu tanımı yaparız. Ve sekil sınıfından bir nesne
tanımlarız. Program calışırken sekil üzerinden istediğimiz alt şeklin
çizimi dinamik olarak her biri için atrı adres tanımlamadan mümkün olur.
Aynı şekilde bir nümerik analiz programı yazarken, örneğin her değişik
fonksiyon için ayrı ayrı integral metodu yazma yerine abstract tür bir
fonksiyon için integral programını yazar ve gerçek foksiyonumuzu

dil
tanımladığımız sınıfı bu abstract sınıfın alt sınıfı olarak tanımlarız.
Bu kavramı daha sonraki bölümlerimizde daha geniş örneklerle açıklamaya
çalışacağız.

3.9 nesneyi dinamik olarak silmek finalize() metodu

Java dili kullanılmayan nesneleri silmek için arka planda çalışan bir sisteme sahiptir. Bu
yüzden C++ gibi dillerde dinamik nesne tanımlarında mutlaka yer alması gereken nesneyi
va
silme metodları javada o kadar gerekli değildir. Fakat eğer kendiniz metlaka bir nesneyi acil
olarak silmek isteseniz finalize() isimli bir metodu sınıfınızda tanımlayıp kullanabilirsiniz.
Örnek olarak aşağıdaki metodu verebiliriz.

protected void finalize() throws Throwable


{
ja

[Link]();
}

JAVA PROGRAMLAMA DİLİ


w.

HAFTA 6

Geçen haftaki alıştırmaların çözümleri


H5A1~1 JAV 2.021 24/05/98 12:32 [Link]
H5A2~1 JAV 2.456 24/05/98 12:48 [Link]

Bu hafta incelenecek dosyalar :


ww

KUTUTE~1 JAV 655 24/05/98 14:58 [Link]


KUTUTE~2 JAV 655 24/05/98 14:58 [Link]
KUTUTE~3 JAV 582 24/05/98 16:00 [Link]
KUTUTE~4 JAV 611 24/05/98 15:16 [Link]
DAIRE~1 JAV 809 24/05/98 20:44 [Link]
DAIRE1~2 JAV 766 24/05/98 22:07 [Link]
DAIRET~2 JAV 665 24/05/98 22:03 [Link]
DAIRET~3 JAV 682 24/05/98 22:08 [Link]
NOKTA~1 JAV 423 24/05/98 20:42 [Link]
H5A1~1 JAV 2.021 24/05/98 12:32 [Link]

73
74

H5A2~1 JAV 2.456 24/05/98 12:48 [Link]

m
Bu haftaki alıştırmalar :

ALIŞTIRMA 1

Nokta sınıfını kullanarak dogru sınıfını yarat. Doğru iki noktayla


tanımlanır. Dogru sınıfının kurucu metodunu, boyunu hesaplayan boy
metodunu, uç noktalarını String değişkeni olarak tanımlayan toString

o
metodunu ve gerekli olan diğer metodları tanımla. Konsol programı olarak
dogrutesti sınıfı oluşturarak bu sınıfın içinde cokdogrubirdogru isimli bir
nesne oluştur be bu nesnenin baslangıç ve bitiş noktalarıyla boyunu yazdır.
Girdi değerlerini program içinde sabit olarak tanımla.

i.c
ALIŞTIRMA 2

Nokta sınıfını kullanarak dikdortgen sınıfını yarat. Dikdörtgen iki


noktayla tanımlanır. Dikdortgen sınıfının kurucu metodunu, çevresini
hesaplayan çevre metodunu, Alanını hesaplayan alan metodonu, dikdortgeni
tanımlayan iki noktayı String değişkeni olarak tanımlayan toString metodunu

dil
ve gerekli olan diğer metodları tanımla. Applet programı olarak
dikdortgentesti sınıfı oluşturarak bu sınıfın içinde cokguzelbirdikdortgen
isimli bir nesne oluştur be bu nesnenin baslangıç ve bitiş noktalarıyla
boyunu yazdır. Girdi değerlerini program içinde sabit olarak tanımla.

ALIŞTIRMA 3

Dogrutesti1 sınıfını yaz. Bu sınıfta dogruyu tanımlıyan uç noktaları konsol


programına dışardan değişken olarak gir.
va
ALIŞTIRMA 4

Dikdortgentesti1 sınıfını yaz. Bu sınıfta dogruyu tanımlıyan uç noktaları


applet programına dışardan değişken olarak gir
ja

JAVA PROGRAMLAMA DİLİ


HAFTA 7

Gecen haftaki alıştırmaların çözümleri :

DOGRU~1 JAV 867 01/06/98 22:59 [Link]


w.

import nokta;

public class dogru


{
protected nokta n1,n2;

//kurucu metod metot girdisi x1,y1,x2,y2


ww

public dogru(double x1, double y1,double x2,double y2)


{
n1=new nokta(x1,y1);
n2=new nokta(x2,y2);
}

//kurucu metod, method girdisi iki nokta


public dogru(nokta nokta1,nokta nokta2)
{
n1=new nokta(nokta1.x,nokta1.y);

74
75

n2=new nokta(nokta2.x,nokta2.y);
}

m
public void dogrugir(double x1, double y1,double x2,double y2)
{
[Link](x1,y1);
[Link](x2,y2);
}

o
public String toString()
{
return "("+[Link]()+","+[Link]()+")";
}

i.c
public double boy()
{
return [Link](([Link]()-[Link]())*([Link]()-[Link]()) +
([Link]()-[Link]())*([Link]()-[Link]()) );
}
}

DOGRUT~2 JAV
import [Link].*;
import nokta;
307

public class dogrutesti


{
dil
01/06/98 22:58 [Link]

public static void main(String args[]) throws IOException


{
va
dogru cokdogrubirdogru=new dogru(1.0,1.0,2.0,2.0);
[Link]([Link]());
[Link]("dogru boyu : "+[Link]());
}
}
ja

([1.0,1.0],[2.0,2.0])
dogru boyu : 1.4142135623730951

DIKDOR~1 JAV 926 01/06/98 23:22 [Link]


import nokta;
w.

public class dikdortgen


{
protected nokta n1,n2;

//kurucu metod metot girdisi x1,y1,x2,y2


public dikdortgen(double x1, double y1,double x2,double y2)
{
ww

n1=new nokta(x1,y1);
n2=new nokta(x2,y2);
}

//kurucu metod, method girdisi iki nokta


public dikdortgen(nokta nokta1,nokta nokta2)
{
n1=new nokta(nokta1.x,nokta1.y);
n2=new nokta(nokta2.x,nokta2.y);

75
76

m
public void dikdortgengir(double x1, double y1,double x2,double y2)
{
[Link](x1,y1);
[Link](x2,y2);
}

public String toString()

o
{
return "dikdortgen : ("+[Link]()+","+[Link]()+")";
}

i.c
public double alan()
{
return ([Link]()-[Link]())*([Link]()-[Link]());
}

public double cevre()


{
return 2*([Link]()-[Link]())+ 2*([Link]()-[Link]());

dil
}
}

DIKDOR~2 JAV 345 01/06/98 23:43 [Link]


va
import [Link];
import [Link];
ja

public class dikdortgentesti extends Applet


{
public void paint(Graphics g)
{
dikdortgen cokguzelbirdikdortgen=new dikdortgen(1,1,2,2);
w.

[Link]([Link](),20,20);
[Link]("Alan : "+ [Link](),20,35);
}
}

NOKTA~1 JAV 423 24/05/98 20:42 [Link]


ww

public class nokta


{
protected double x, y;

public nokta()
{
noktagir(0,0);
}

76
77

public nokta(double a, double b)


{

m
noktagir(a,b);
}

public nokta(nokta n)
{
noktagir([Link](),[Link]());
}

o
public void noktagir(double a, double b)
{
x = a;

i.c
y = b;
}

public void Xgir(double a)


{
x = a;
}

dil
public double Xoku()
{
return x;
}

public double Yoku()


{
return y;
}
va
public String toString()
{
return "["+x+","+y+"]";
}
}

Bu haftaki alıştırmalar:
ja

ALIŞTIRMA 1

Hesapmakinesi sınıfını yarat. Bu sınıf iki gerçek değişkeni sınıf değişkeni olarak
tanımlasın. Topla,cıkar,carp ve bol metodlarını yaz ve bu işlemleri metodların
içinde tanımla.
w.

Hesapmakinesitesti konsol programını yaz ve bu sınıf hesapmakinesi sınıfını


kullanarak dışarıdan girilen iki gercek sayının dört işlemini hesapla.

public class dortislemhesapmakinasi


{
private double x1,x2;

public dortislemhesapmakinasi(double y1,double y2)


ww

{
//kurucu (constructor) metot
x1=y1;
x2=y2;
}

public dortislemhesapmakinasi()
{
//kurucu metot (constructor)

77
78

x1=1;
x2=1;

m
}

public double topla()


{
return x1+x2;
}

o
public double cikar()
{
return x1-x2;
}

i.c
public double carp()
{
return x1*x2;
}

public double bol()


{

dil
return x1/x2;
}

public void ilksayigir(double y1)


{
x1=y1;
}

public void ikincisayigir(double y2)


va
{
x2=y2;
}

public void ikisayigir(double y1,double y2)


{
x1=y1;
x2=y2;
ja

}
w.

import [Link].*; //giris çikis


import Text;
import dortislemhesapmakinasi;

class dortArtiIslem1
{
public static void main (String args[]) throws IOException
{
ww

dortislemhesapmakinasi h=new dortislemhesapmakinasi(0.0,0.0);


double sayi1,sayi2;
//
DataInputStream cin=new DataInputStream([Link]);
[Link]("Bir sayi giriniz : ");
sayi1=[Link](cin);
[Link]("Ikinci bir sayi giriniz : ");
sayi2=[Link](cin);
[Link](sayi1,sayi2);

78
79

[Link]("Iki tam sayinin toplami : "+[Link]());


[Link]("Iki tam sayinin farki : "+[Link]());

m
[Link]("Iki tam sayinin carpimi : "+[Link]());
[Link]("Iki tam sayinin bolumu : "+[Link]());
}
}

Bir sayi giriniz : 2.5

o
Ikinci bir sayi giriniz : 3.5
Iki tam sayinin toplami : 6.0
Iki tam sayinin farki : -1.0
Iki tam sayinin carpimi : 8.75

i.c
Iki tam sayinin bolumu : 0.7142857142857143

JAVA DÖNEM ÖDEVİ 1

Bayağı kesirler sanırım ilk okulda sizleri epey zorlamıştır. Daha fazla aklımızı
karıştırmalarını önlemek amacıyla bayagikesir sınıfını tanımlayalım. Bu sınıf
bayağı kesirlerin dört işlemini ve sadeleştirilmelerini yapabilme kapasitesinde
olsun. Aynı zamanda bayağı kesirleri yazdıran toString metodunu da tanımlayalım. Bu

dil
metod [2/3] veya 3[5/4] şeklinde bayağı kesirleri yazdırabilsin.
Bayağı kesirleri sadeleştirirken en büyük ortak bölen hesabı gerekebilir. Bu amaçla
asağıdaki metod sizlere ders hocası tarafından armağan edilmiştir.

int enbuyukortakbolen(int n, int m)


{
// iki tam sayının en buyuk ortak bolenini hesaplar
if(n==0)
return m;
va
if(m==0)
return n;
while(m != n)
{
if(n>m)
n=n-m;
else
m=m-n;
}
ja

return n;
}

not : sadeleştirme işlemi pay ve paydayı en büyük ortak bölene bölerek yapılır.

Bayagi kesir sınıfının calışmasını kontrol amacıyla [Link] applet


programını yaz. Bu programa iki bayağı kesir gir ve dort işlemini hesapla.
w.

Süre : 3 Hafta. Bu alıştırma 3 hafta sonra toplanacak ve sizin için


değerlendirilecektir.

JAVA ÖRNEK PROBLEMI

Yukarıdaki ödev problemi yapmanıza yardımcı olmak amacıyla kompleks sınıfı örnek
olarak burada verilmiştir. Dönem ödevinde verilen bayagikesir ve burada verilen
kompleks sınıfıyla ilgili iki noktaya dikkatinizi çekmek isterim. Birincisi bu iki
ww

sınıf şu ana kadar baktığımız diğer sınıflardan farklı olarak sadece size java
öğretme amaçlı sınıflar değildir. Bu sınıflar her zaman kütüphanenizde kalabilecek
ve gerektiğinde direk olarak gerçek programlarınızda kullanılabilecek özelliklerde
sınıflardır. Kompleks sınıfı kompleks değişkenlerd gerektiğinde kullanılabilecek
bütün metotları içermektedir.

//===========================================
// kompleks sınıfı tanımı
// Dr. Turhan Coban
//===========================================

79
80

import [Link].*;

m
// sınıf kompleks
// bu sınıf kompleks sayıların matematik
// işlemlerini tanımlar
//
class kompleks {
// sınıf degiskenleri
double ger;

o
double imaj;

// kurucu metodlar
public kompleks()

i.c
{
ger=0;
imaj=0;
}

public kompleks(double nger,double nimaj)


{
ger=nger;

dil
imaj=nimaj;
}

public kompleks(double numer)


{
ger=numer;
imaj=0;
}
va
public kompleks(kompleks c )
{
ger=[Link]();
imaj=[Link]();
}
// giriş - çıkış metotları

public double gercek()


ja

{
return ger;
}

public double imajineri()


{
w.

return imaj;
}

public void gercekgir(double r)


{
ger=r;
}
ww

public void imajinerigir(double i)


{
imaj=i;
}

public void kompleksgir(kompleks sag)


{
ger=[Link]();
imaj=[Link]();

80
81

m
public void kompleksgir(double nr,double ni)
{
ger=nr;
imaj=ni;
}

public double R()

o
{
//kompleks sayinin polar koordinat cap esidi
return [Link](ger*ger+imaj*imaj);
}

i.c
public double theta()
{
//kompleks sayinin polar koordinat radyan aci esidi
return Math.atan2(imaj,ger);
}

public double dtheta()

dil
{
//kompleks sayinin polar koordinat derece aci esidi
return Math.atan2(imaj,ger)*45.0/[Link](1.0);
}

public void topla(kompleks sag)


{
imaj = imaj + [Link]();
ger = ger + [Link]();
va
}

public void cikar(kompleks sag)


{
imaj = imaj - [Link]();
ger = ger - [Link]();
}
ja

public void carp(kompleks sag )


{
ger = ger*[Link]() - imaj*[Link]();
imaj = ger*[Link]() + imaj*[Link]();
}
w.

public void bol(kompleks sag )


{
double a=ger*ger+imaj*imaj;
ger = ( ger*[Link]() + imaj*[Link]())/a;
imaj = (-ger*[Link]() + imaj*[Link]())/a;
}

public static kompleks topla(kompleks sol, kompleks sag)


ww

{
// iki kompleks say n n toplam n return deyimiyle kompleks olarak
// aktar r
double r1=([Link]() + [Link]());
double i1=([Link]() + [Link]());
kompleks sonuc;
sonuc=new kompleks(r1,i1);
return sonuc;
}

81
82

public static kompleks cikar(kompleks sol, kompleks sag)

m
{ // iki kompleks sayinin sonuclarini aktar
kompleks sonuc;
sonuc=new kompleks(([Link]() - [Link]()),
([Link]() - [Link]()));
return sonuc;
}

o
public static kompleks carp(kompleks sol, kompleks sag)
{ // iki kompleks sayinin carpimini aktar
kompleks sonuc;
sonuc=new kompleks

i.c
(([Link]()*[Link]() - [Link]()*[Link]()),
([Link]()*[Link]() + [Link]()*[Link]()));
return sonuc;
}

public static kompleks bol(kompleks sol, kompleks sag)


{ // return division of two kompleks numbers

dil
double a=[Link]()*[Link]()+[Link]()*[Link]();
kompleks sonuc;
sonuc=new kompleks
(([Link]()*[Link]() + [Link]()*[Link]())/a,
(-[Link]()*[Link]() + [Link]()*[Link]())/a);
return sonuc;
}

public static kompleks pow(kompleks sol, double sag)


va
{ // return sum of two kompleks numbers
double Rad,th;
Rad=[Link](sol.R(),sag);
th=sag*[Link]();
kompleks sonuc;
sonuc =new kompleks((Rad*[Link](th) ),
(Rad*[Link](th) ) );
return sonuc;
ja

public boolean kucuktur(kompleks sol,kompleks sag)


{
// less then comparison of two kompleks numbers
return (sol.R() < sag.R());
w.

public boolean kucuktur_esittir(kompleks sol,kompleks sag)


{
// less then and esittir comparison of two kompleks numbers
return (sol.R() <= sag.R());
}
ww

public boolean buyuktur(kompleks sol,kompleks sag)


{
// buyuktur then comparison of two kompleks numbers
return sol.R() > sag.R();
}

public boolean buyuktur_esittir(kompleks sol,kompleks sag)


{
// buyuktur then and esittir comparison of two kompleks numbers

82
83

return sol.R() >= sag.R();


}

m
public boolean esittir(kompleks sol,kompleks sag)
{
// esittir comparison of two kompleks numbers
return sol.R() == sag.R();
}

o
public boolean esit_degildir(kompleks sol,kompleks sag)
{
// not esittir comparison of two kompleks numbers

i.c
return sol.R() != sag.R();
}

public static String toString(kompleks value)


{
String b="";
if([Link]([Link]())!=1)
{

dil
if([Link]() >= 0)
b=b+"("+[Link]()+" + "+[Link]()+"i )";
else
b=b+"("+[Link]()+" - "+(-[Link]())+"i )";
}
else
{
if([Link]() >= 0)
b=b+"("+[Link]()+" + i )";
va
else
b=b+"("+[Link]()+" - i )";
}
return b;
}

public String toString()


{
ja

// yazima hazir kompleks formda String degiskeni iletir.


String b="";
if([Link](imajineri())!=1)
{
if(imajineri() > 0)
b=b+"("+gercek()+" + "+imajineri()+"i )";
w.

else if(imajineri() <0 )


b=b+"("+gercek()+" - "+(-imajineri())+"i )";
else
b=b+gercek()+ " ";
}
else
{
if(imajineri() > 0)
ww

b=b+"("+gercek()+" + i )";
else if(imajineri() < 0)
b=b+"("+gercek()+" - i )";
else
b=b+gercek()+" ";
}
return b;
}
};

83
84

//kompleks sinifinin tanımının sonu

m
import [Link]; // java applet sinifini cagir
import [Link].*; // java pencere kullanma sinifini cagir
import [Link].*; // java pencereyi dinleme sinifini cagir
import kompleks;

public class H8A1 extends Applet implements ActionListener

o
{
//
//=====================================================
// sinif degiskenleri

i.c
// bu degiskenler tum sinifa aittir
Label kutubasligi1; //Label sinifi degiskeni (nesnesi)
kutubasligi1
TextField kutugirdisi1; // Textfield sinifi degiskeni (nesnesi)
kutugirdisi1
Label kutubasligi2; //Label sinifi degiskeni (nesnesi)
kutubasligi2
TextField kutugirdisi2; // Textfield sinifi degiskeni (nesnesi)

dil
kutugirdisi2
TextField kutugirdisi3; // Textfield sinifi degiskeni (nesnesi)
kutugirdisi2
TextField kutugirdisi4; // Textfield sinifi degiskeni (nesnesi)
kutugirdisi2
kompleks k1; // kompleks degisken k1
kompleks k2; // kompleks degisken k2
//=====================================================
// pencereyi baslatma metodu
va
// pencere ilk basladiginda
// degiskenler buradaki degerleri alirlar
public void init()
{
k1=new kompleks();
k2=new kompleks();
kutubasligi1=new Label("Birinci kompleks sayiyi giriniz : ");
add(kutubasligi1);
ja

kutugirdisi1=new TextField(5);
[Link](this);
add(kutugirdisi1);
kutugirdisi2=new TextField(5);
[Link](this);
add(kutugirdisi2);
w.

kutubasligi2=new Label("Ikinci kompleks say y giriniz : ");


add(kutubasligi2);
kutugirdisi3=new TextField(5);
[Link](this);
add(kutugirdisi3);
kutugirdisi4=new TextField(5);
[Link](this);
add(kutugirdisi4);
ww

}
//=====================================================
// girdi alanindaki olan olaylari dinleme metodu
// Her yeni rakam girildiginde bu metod cagirilir
public void actionPerformed(ActionEvent e)
{
Double sayi1=new Double([Link]() );
Double sayi2=new Double([Link]() );
Double sayi3=new Double([Link]() );

84
85

Double sayi4=new Double([Link]() );


[Link]([Link](),[Link]());

m
[Link]([Link](),[Link]());
repaint();//pencereyi yeniden paint metoduna gore ciz
}
//=====================================================
// paint (boya=pencereye ciz metodu)
public void paint(Graphics g)
{

o
[Link]("ilk sayi : "+[Link](),25,80);
[Link]("ikinci sayi : "+[Link](),25,95);

[Link]("iki sayinin toplami :

i.c
"+[Link]([Link](k1,k2)),25,110);
[Link]("iki sayinin farki :
"+[Link]([Link](k1,k2)),25,125);
[Link]("iki sayinin carpimi :
"+[Link]([Link](k1,k2)),25,140 );
[Link]("iki sayinin bolumu :
"+[Link]([Link](k1,k2)),25,155 );
}

dil
} va
ja

Java dönem ödevinin çözümü


w.

//===========================================
// bayagikesir sinifi tanimi
// Dr. Turhan Coban
//===========================================
import [Link].*;

// sinif bayagikesir
// bu sinif bayagikesir sayilarin matematik
ww

// islemlerini tanimlar
//
class bayagikesir {
// sinif degiskenleri
int pay;
int payda;

// kurucu metodlar

85
86

public bayagikesir()
{

m
pay=0;
payda=1;
}

public bayagikesir(int npay,int npayda)


{
pay=npay;

o
payda=npayda;
}

public bayagikesir(int numer)

i.c
{
pay=numer;
payda=1;
}

public bayagikesir(bayagikesir c )
{
pay=[Link]();

dil
payda=[Link]();
}
// giriŸ - ‡ k Ÿ metotlar

int enbuyukortakbolen(int n,int m)


{
// iki tam sayının en buyuk ortak bolenini hesaplar
if(n==0)
return m;
va
if(m==0)
return n;
while(m != n)
{
if(n>m)
n=n-m;
else
m=m-n;
ja

}
return n;
}

public void sadelestir()


{
w.

//sadelestir :
//a) isareti paya tasi;
//b) pay ve paydan n ortak en b y k ortak bolenlerini yoket;
int sign = 1;
if(pay<0)
{
sign=-1;
pay=-pay;
ww

}
if(payda<0)
{
sign=-sign;
payda=-payda;
}
if(payda != 0)
{
int d = enbuyukortakbolen(pay,payda);

86
87

pay=sign*(pay/d);
payda=payda/d;

m
}
else
{
[Link]("Payda s f ra esittir");
}
}

o
public int Pay()
{
return pay;
}

i.c
public int Payda()
{
return payda;
}

public void payGir(int r)


{

dil
pay=r;
}

public void paydaGir(int i)


{
payda=i;
}

public void bayagikesirGir(bayagikesir sag)


va
{
pay=[Link]();
payda=[Link]();
}

public void bayagikesirGir(int nr,int ni)


{
pay=nr;
ja

payda=ni;
}

public void bayagikesirGir(int nr)


{
pay=nr;
w.

payda=1;
}

public void bayagikesirGir(double d)


{
// tam sayinin bayagikesir esitini y kle
// eh birazc k yaklas m var tabi
bayagikesirGir((int)d*10000,10000);
ww

sadelestir();
}

public double toDouble()


{
//bayagikesir sayinin gercek sayi esidi
return ((double)pay/(double)payda);
}

87
88

public static bayagikesir BayagikesireCevir(double d)


{

m
// tam sayinin bayagikesir esiti
// eh birazc k yaklas m var tabi
bayagikesir b=new bayagikesir();
[Link]((int)d*10000,10000);
[Link]();
return b;
}

o
public void topla(bayagikesir sag)
{

i.c
//ikinci bir bayagikesirle topla
pay = pay*[Link]() + [Link]()*payda;
payda = payda*[Link]();
}

public void topla(int sag)


{
//bir gercek say yla topla

dil
pay = pay + sag*payda;
sadelestir();
}

public void cikar(bayagikesir sag)


{
//ikinci bir bayagikesirle topla
pay = pay*[Link]() - [Link]()*payda;
payda = payda*[Link]();
va
sadelestir();
}

public void cikar(int sag)


{
//bir gercek say yla topla
pay = pay - sag*payda;
sadelestir();
ja

public void carp(bayagikesir sag )


{
//bir bayagikesir sayiyla carp
pay = pay*[Link]();
w.

payda = payda*[Link]();
sadelestir();
}

public void carp(int sag )


{
//bir gercek sayiyla carp
pay = pay*sag;
ww

sadelestir();
}

public void bol(bayagikesir sag )


{
//bir bayagikesir say yla bol
pay = pay*[Link]();
payda = payda*[Link]();
sadelestir();

88
89

m
public void bol(int sag )
{
//bir Pay say yla bol
payda = payda*sag;
sadelestir();
}

o
public static bayagikesir topla(bayagikesir sol, bayagikesir sag)
{
// iki bayagikesir say n n toplam n return deyimiyle bayagikesir olarak
// aktar r

i.c
int r1= [Link]() * [Link]() + [Link]() * [Link]();
int i1= [Link]()* [Link]();
bayagikesir sonuc;
sonuc=new bayagikesir(r1,i1);
[Link]();
return sonuc;
}

dil
public static bayagikesir topla(bayagikesir sol, int sag)
{
// bir bayagikesir ve bir Pay say n n toplam n return deyimiyle
bayagikesir olarak
// aktar r
int r1=[Link]() + sag*[Link]();
int i1=[Link]();
bayagikesir sonuc;
sonuc=new bayagikesir(r1,i1);
va
[Link]();
return sonuc;
}

public static bayagikesir topla(int sol, bayagikesir sag)


{
// bir bayagikesir ve bir Pay say n n toplam n return deyimiyle
bayagikesir olarak
ja

// aktar r
int r1=[Link]() + sol*[Link]();
int i1=[Link]();
bayagikesir sonuc;
sonuc=new bayagikesir(r1,i1);
[Link]();
w.

return sonuc;
}

//===================================
public static bayagikesir cikar(bayagikesir sol, bayagikesir sag)
{
// iki bayagikesir say n n toplam n return deyimiyle bayagikesir olarak
// aktar r
ww

int r1= [Link]() * [Link]() - [Link]() * [Link]();


int i1= [Link]()* [Link]();
bayagikesir sonuc;
sonuc=new bayagikesir(r1,i1);
[Link]();
return sonuc;
}

public static bayagikesir cikar(bayagikesir sol, int sag)

89
90

{
// bir bayagikesir ve bir Pay say n n toplam n return deyimiyle

m
bayagikesir olarak
// aktar r
int r1=[Link]() - sag*[Link]();
int i1=[Link]();
bayagikesir sonuc;
sonuc=new bayagikesir(r1,i1);
[Link]();

o
return sonuc;
}

public static bayagikesir cikar(int sol, bayagikesir sag)

i.c
{
// bir bayagikesir ve bir Pay say n n toplam n return deyimiyle
bayagikesir olarak
// aktar r
int r1=[Link]() - sol*[Link]();
int i1=[Link]();
bayagikesir sonuc;
sonuc=new bayagikesir(r1,i1);

dil
[Link]();
return sonuc;
}

//===================================

public static bayagikesir carp(bayagikesir sol, bayagikesir sag)


{ // iki bayagikesir sayinin carpimini aktar
bayagikesir sonuc;
va
sonuc=new bayagikesir([Link]()*[Link](),[Link]()*[Link]());
[Link]();
return sonuc;
}

public static bayagikesir carp(bayagikesir sol, int sag)


{ // bir bayagikesir ve bir double sayinin carpimini aktar
bayagikesir sonuc;
ja

sonuc=new bayagikesir([Link]()*sag,[Link]());
[Link]();
return sonuc;
}

public static bayagikesir carp(int sol, bayagikesir sag)


w.

{ // bir bayagikesir ve bir double sayinin carpimini aktar


bayagikesir sonuc;
sonuc=new bayagikesir([Link]()*sol,[Link]());
[Link]();
return sonuc;
}

public static bayagikesir bol(bayagikesir sol, bayagikesir sag)


ww

{ // iki bayagikesir sayinin b”l mlerini aktar


bayagikesir sonuc;
sonuc=new bayagikesir((int)([Link]()*[Link]()),
(int)([Link]()*[Link]()));
[Link]();
return sonuc;
}

public static bayagikesir bol(bayagikesir sol, int sag)

90
91

{ // bayagikesir say y double say ya bol


bayagikesir sonuc;

m
sonuc=new bayagikesir([Link](),([Link]()*sag));
[Link]();
return sonuc;
}

public boolean kucuktur(bayagikesir sol,bayagikesir sag)


{

o
// less then comparison of two bayagikesir numbers
return ([Link]() < [Link]());
}

i.c
public boolean kucuktur_esittir(bayagikesir sol,bayagikesir sag)
{
// less then and esittir comparison of two bayagikesir numbers
return ([Link]() <= [Link]());
}

public boolean buyuktur(bayagikesir sol,bayagikesir sag)


{

dil
// buyuktur then comparison of two bayagikesir numbers
return [Link]() > [Link]();
}

public boolean buyuktur_esittir(bayagikesir sol,bayagikesir sag)


{
// buyuktur then and esittir comparison of two bayagikesir numbers
return [Link]() >= [Link]();
}
va
public boolean esittir(bayagikesir sol,bayagikesir sag)
{
// esittir comparison of two bayagikesir numbers
return [Link]() == [Link]();
}

public boolean esit_degildir(bayagikesir sol,bayagikesir sag)


ja

{
// not esittir comparison of two bayagikesir numbers
return [Link]() != [Link]();
}

public static String toString(bayagikesir value)


w.

{
String b="";
if([Link]([Link]())!=1)
{
b=b+"( "+[Link]()+" / "+[Link]()+" )";
}
else
{
ww

b=b+[Link]()+" ";
}
return b;
}

public String toString()


{
// yazima haz r bayagikesir formda String de§iskeni iletir.
String b="";

91
92

if([Link](Payda())!=1)
{

m
b=b+"( "+pay+" / "+Payda()+" )";
}
else
{
b=b+Pay()+" ";
}
return b;

o
}
};
//bayagikesir sinifinin taniminin sonu

i.c
Bayagıkesir sınıfı test programı bkTesti

import [Link]; // java applet sinifini cagir


import [Link].*; // java pencere kullanma sinifini cagir
import [Link].*; // java pencereyi dinleme sinifini cagir
import bayagikesir;

{
//

// sinif degiskenleri dil


public class bkTesti extends Applet implements ActionListener

//=====================================================

// bu degiskenler tum s n fa aittir


Label kutubasligi1;
kutubasligi1
//Label sinifi degiskeni (nesnesi)
va
TextField kutugirdisi1; // Textfield sinifi degiskeni (nesnesi)
kutugirdisi1
Label kutubasligi2; //Label sinifi degiskeni (nesnesi)
kutubasligi2
TextField kutugirdisi2; // Textfield sinifi degiskeni (nesnesi)
kutugirdisi2
TextField kutugirdisi3; // Textfield sinifi degiskeni (nesnesi)
kutugirdisi2
ja

TextField kutugirdisi4; // Textfield sinifi degiskeni (nesnesi)


kutugirdisi2
bayagikesir k1; // bayagikesir degisken k1
bayagikesir k2; // bayagikesir degisken k2
//=====================================================
// pencereyi baslatma metodu
// pencere ilk basladiginda
w.

// degiskenler buradaki degerleri alirlar


public void init()
{
k1=new bayagikesir(1,2);
k2=new bayagikesir(2,4);
kutubasligi1=new Label("Birinci bayagikesir sayiyi giriniz : ");
add(kutubasligi1);
ww

kutugirdisi1=new TextField(5);
[Link](this);
add(kutugirdisi1);
kutugirdisi2=new TextField(5);
[Link](this);
add(kutugirdisi2);
kutubasligi2=new Label("Ikinci bayagikesir sayiyi giriniz : ");
add(kutubasligi2);
kutugirdisi3=new TextField(5);
[Link](this);

92
93

add(kutugirdisi3);
kutugirdisi4=new TextField(5);

m
[Link](this);
add(kutugirdisi4);
}
//=====================================================
// girdi alanindaki olan olaylari dinleme metodu
// Her yeni rakam girildiginde bu metod cagirilir
public void actionPerformed(ActionEvent e)

o
{
Integer sayi1=new Integer([Link]() );
Integer sayi2=new Integer([Link]() );
Integer sayi3=new Integer([Link]() );

i.c
Integer sayi4=new Integer([Link]() );
[Link]([Link](),[Link]());
[Link]([Link](),[Link]());
repaint();//pencereyi yeniden paint metoduna gore ciz
}
//=====================================================
// paint (boya=pencereye ciz metodu)
public void paint(Graphics g)

dil
{
[Link]("ilk sayi : "+[Link](),25,80);
[Link]("ikinci sayi : "+[Link](),25,95);

[Link]("iki sayinin toplami :


"+[Link]([Link](k1,k2)),25,110);
[Link]("iki sayinin farki :
"+[Link]([Link](k1,k2)),25,125);
[Link]("iki sayinin carpimi :
va
"+[Link]([Link](k1,k2)),25,140 );
[Link]("iki sayinin bolumu :
"+[Link]([Link](k1,k2)),25,155 );
}
}
ja
w.
ww

93
94

BÖLÜM 4 : Boyutlu degişken ve nesneler (Arrays)

m
4.1 Tek boyutlu değişkenler

Boyutlu değişkenler aynı degişken türü veya sınıf türünden birden fazla nesne veya
değişkenin tek bir isimle tanımlanmasıdır. Boyutlu değişkenlere referans indeks numarası
kullanılarak ulaşılır. Genel olarak bir boyutlu değişkenler

o
Değişken_türü değişken_ismi[];

Şeklinde tanımlanır. Bir örnek verecek olursak

i.c
int ayın_gunleri[];

Bu tanım hernekadar haftanın_gunleri nin boyutlu bir değişken olduğunu belirtiyorsa da kesin
boyutunu bildirmemektedir. Boyutlu değişkenin tam boyutunu tanımlamak ve bilgisayar
hafızasındaki yerini tam olarak saptamak için

dil
Değişken_ismi=new Değişken_türü[değişken_boyutu];

Terimi kullanılır. Bunu bir önceki örneğe uygularsak :

Ayın_gunleri=new int[12];
va
Arrayi bir kere tanımladıktan sonra onun içindeki her alt değere indeksi üzerinden ulaşmak
mümkündür. Örnegin:

ayın_gunleri[0] = 31;
ayın_gunleri[1] = 28;

gibi. . İndeks değişkeni herzaman sıfırdan başlar.


ja

Küçük bir örnek sınıfta bu kavramı daha açık olarak vermeye çalışalım.

Class boyut
{
w.

Public static void main(String args[] )


{
int ayin_gunleri[]=new int[12];
ayin_gunler[0]=31;
ayin_gunler[1]=28;
ayin_gunler[2]=31;
ww

ayin_gunler[3]=30;
ayin_gunler[4]=31;
ayin_gunler[5]=30;
ayin_gunler[6]=31;
ayin_gunler[7]=31;
ayin_gunler[8]=30;
ayin_gunler[9]=31;
ayin_gunler[10]=30;

94
95

ayin_gunler[11]=31;
[Link](“Nisan ayı “+ayin_gunleri[3]+”gun ceker”);

m
}
}
Şekil 4.1.1 [Link] programı

Bu programı daha kısa olarak yazmak için Şekil 4.1.2 de görülen şekilde bütün değişkenlerin

o
değerlerini aynı anda tanımlıyabiliriz.

Class boyut1
{

i.c
Public static void main(String args[] )
{
int ayin_gunleri[]={31,28,31,30,31,30,31,31,30,31,30,31};
[Link](“Nisan ayı “+ayin_gunleri[3]+”gun ceker”);
}
}

dil
Şekil 4.1.2 [Link] programı

Şekil 4.1.3 de boyut kavramının for döngüsüyle birlikte kullanışını görüyorsunuz. Boyutlu
değişkenin toplam boyutuna da sayı.length değişkeniyle ulaşabiliriz.

import [Link].*; //java girdi cikti sinifini cagir


class Aritmetik2
va
{
public static void main(String args[])
{
int sayi[]={10,5,7,9,11,13,14,18};
int toplam=0;
int i;
for(i=0;i<[Link];i++)
{
toplam+=sayi[i];
ja

}
[Link]("Ortalama = "+toplam/[Link]);
}
}
w.

Şekil 4.1.3 [Link] programı

Şimdi de bir applet örneğinde tek boyutlu değişkenleri kullanalım. Daha önce [Link]
programını incelemiştik. Şimdi bu programa her bir zar yüzeyinin atılış frekanslarını
ekleyelim. Toplam altı yüz olduğundan birden altıya kadar her sayının kaç kere geldiğini
saydırmamız gerekir. Bunun için bir boyutlu zarfrekansi değişkenini tanımlayacağız.
Program listesi ve sonuç appleti Şekil 4.1.4 ve şekil 4.1.5 de görülmektedir.
ww

import [Link].*;
import [Link];
import [Link].*;

public class zarfrekansiApplet extends Applet implements ActionListener


{
int toplamzaratisi=0;
int toplam=0;

95
96

TextField ilkzar,ikincizar;
Button salla; //zar atma d gmesi

m
int zar1,zar2;
int zarfrekansi[];

public static int zar()


{
return 1+(int)([Link]()*6);
}

o
public void init()
{
//programi baslat

i.c
zarfrekansi=new int[6];
ilkzar=new TextField(10); // Textfield sinifi ilkzar nesnesini yarat
add(ilkzar); // ilk zar nesnesini pencereye ekle
ikincizar=new TextField(10);// Textfield sinifi ikincizar nesnesini yarat
add(ikincizar); // ikinci zar nesnesini pencereye ekle
salla=new Button("Zari salla ve at");
add(salla);
[Link](this);

dil
}

public void actionPerformed(ActionEvent e)


{
zar1=zar();
zar2=zar();
[Link]([Link](zar1));
[Link]([Link](zar2));
toplam+=(zar1+zar2);
va
toplamzaratisi++;
// not boyutlu degisken indeksi 0 dan basliyor.
zarfrekansi[zar1-1]++;
zarfrekansi[zar2-1]++;
repaint();
}
public void paint( Graphics g)
{
ja

[Link]("toplam = "+toplam+" Atilan zar sayisi =


"+toplamzaratisi,25,50);
for(int i=0;i<6;i++)
{
[Link](zarfrekansi[i]+" kere "+(i+1)+" atildi ",25,(65+15*i));
}
w.

}
}
ww

96
97

o m
i.c
Şekil 4.1.4 [Link] appletinin görünümü

4.2 Tek boyutlu nesne tipi değişkenler

Örneğin :
dil
Nesne tipi değişkenler için de aynı normal basit değişkenlerde olduğu gibi boyut tanımı
yapılır. Normal boyut tanımı yapıldıktan sonra, boyuttaki her nesne teker teker tanımlanır.

kompleks sayi[]=new kompleks[5];


sayi[0]=new kompleks(1,2);
sayi[1]=new kompleks(1,-1);
va
sayi[2]=new kompleks(2,0);
sayi[3]=new kompleks(1.1,-0.5);
sayi[4]=new kompleks(1,1.5);

dogru3 n[]=new dogru3[3];


n[0]=new dogru3(1,1,1,2,2,2);
ja

n[1]=new dogru3(2,2,2,3,3,3);
n[2]=new dogru3(3,3,3,4,4,4);

gibi.

4.3 Çok boyutlu değişkenler


w.

İki ve daha fazla boyutlu değişkenler de tanımlamak mümkündür. İki boyutlu değişkenler en
fazla tablo veya matris gibi satır ve sütun olmak üzere iki boyutta gösterilmesi gereken
büyüklükleri oluşturmak için kullanılı[Link] iki boyutlu değişkenleri direk olarak açamaz. Tek
boyutlu değişkenlerin yine tek boyutlu degişkenini açar. Sonuç olarak iki boyut sağlanmış
olur. Örnek verecek olursak
ww

Int b[][]=new int[3][4]. Genel olarak ilk parantes satır sayısı, ikinci parantez sütun sayısı
olarak kabul edilir. Buna göre b değişkenini şöyle düşünebiliriz :

b[0][0] b[0][1] b[0][2] b[0][3]


b[1][0] b[1][1] b[1][2] b[1][3]
b[2][0] b[2][1] b[2][2] b[2][3]

Iki boyutlu değişken de bir boyutlu değişkenlerde olduğu gibi degerleri direk olarak

97
98

yüklüyebiliriz, ve yükleme sırasında boyutları da tayin edebiliriz.


Örneğin :

m
Int b[][] = {{1,2},{3,4}};

Terimi bize aşağıdaki tabloyu tanımlar:

1 2

o
3 4

b[0][0] b[0][1]
b[0][1] b[1][1]

i.c
İki boyutlu değişkenlerin kullanılmasını göstermek amacıyla bir örnek problem verelim:

import [Link];
import [Link];

public class ikiboyut extends Applet

dil
{
// void tipi paint metodu
public void paint( Graphics g)
{
int a1[][]={{1,2,3},{4,5,6}};
int a2[][]={{1,2},{4}};
[Link](" a1 : ",25,25);
ikiboyutyazdir(a1,g,40);
[Link](" a2 : ",25,70);
va
ikiboyutyazdir(a2,g,85);
}

public void ikiboyutyazdir(int a[][], Graphics g,int y)


{
int x=25;
for(int i=0;i<[Link];i++)
{
ja

for(int j=0;j<a[i].length;j++)
{
[Link]([Link](a[i][j]),x,y);
x+=15;
}
x=25;
w.

y+=15;
}
}
}

Şekil 4.3.1 İki boyutlu değişkenler örnegi [Link]


ww

Boyutlara ulaşmak için programdan da görüleceği gibi for döngüsü kullandık. Boyutlu
değişkenlere ulaşım. For döngülerinin en çok kullanıldığı yerdir.
Satırların boyutuna [Link], sütunların boyutuna ise a[satır].length terimiyle ulaştık. Bu tanım
bize toplam satır ve sütun boyutunu direk tanımlar, ve kullanımda yeterince esneklik sağlar.

98
99

4.4 boyutlu değişkenlerin metodlara aktarımı

m
Boyutlu değişkenler aynen boyutsuz değişkenler gibi metotlara aktarılırlar. Örneğin eğer
int sıcaklık[] = new int[24];

o
i.c
Şekil 4.3.1 İki boyutlu değişkenler örnegi [Link] doyasının appletviewer ile görünümü

dil
deyimiyle tanımlanan sicaklık;
sicakligidegistir(sıcaklik);
terimiyle sicakligidegistir metotuna aktarılabilir. Metot tanımlanırken, sıcaklığın boyutlu
değişken olduğu tanımlanmalıdır:
double void sicakligideğiştir(int sicaklik[])
{
..........................
va
}

gibi.

Metodların çıktı değişkenleri de çok boyutlu olarak tanımlanabilir ve kullanılabilir. Örneğin :

public static double[][] inversematris(double[][] a)


ja

gibi.

JAVA PROGRAMLAMA DİLİ


w.

HAFTA 8

ARITME~1 JAV 390 07/06/98 18:47 [Link]


NOKTA3~1 JAV 1.054 09/06/98 5:01 [Link]

public class nokta3


{
protected double x, y, z;
ww

//kurucu metodlar
public nokta3()
{
nokta3gir(0,0,0);
}

public nokta3(double a, double b,double c)


{

99
100

nokta3gir(a,b,c);
}

m
public nokta3(nokta3 n)
{
nokta3gir([Link](),[Link](),[Link]());
}

// giris cikis metodlari

o
public void nokta3gir(double a, double b,double c)
{
x = a;
y = b;

i.c
z = c;
}

public void nokta3gir(nokta3 in1)


{
x = in1.x;
y = in1.y;
z = in1.z;

dil
}

public void Xgir(double a)


{
x = a;
}

public void Ygir(double b)


{
va
y = b;
}

public void Zgir(double c)


{
x = c;
}
ja

public double Xoku()


{
return x;
}

public double Yoku()


w.

{
return y;
}

public double Zoku()


{
return z;
}
ww

public String toString()


{
return "["+x+","+y+","+z+"]";
}
}

DOGRU3~1 JAV 2.419 09/06/98 5:04 [Link]


public class dogru3

100
101

{
// 3 boyutlu dogru

m
nokta3 n1;
nokta3 n2;

public dogru3()
{
n1=new nokta3();
n2=new nokta3();

o
}

public dogru3(double n1x, double n1y,double n1z,


double n2x, double n2y,double n2z)

i.c
{
n1=new nokta3(n1x,n1y,n1z);
n2=new nokta3(n2x,n2y,n2z);
}

public dogru3(nokta3 na,nokta3 nb)


{
n1=new nokta3([Link](),[Link](),[Link]());

dil
n2=new nokta3([Link](),[Link](),[Link]());
}

public void dogru3gir(double x1, double y1,double z1,


double x2, double y2,double z2)
{
n1.nokta3gir(x1,y1,z1);
n2.nokta3gir(x2,y2,z2);
}
va
public void dogru3gir(nokta3 in1, nokta3 in2 )
{
n1.nokta3gir(in1.x,in1.y,in1.z);
n2.nokta3gir(in2.x,in2.y,in2.z);
}

public void n1gir(double x1,double y1,double z1)


ja

{
n1.nokta3gir(x1,y1,z1);
}

public void n1gir(nokta3 in1)


{
w.

n1.nokta3gir(in1.x,in1.y,in1.z);
}

public void n2gir(double x2,double y2,double z2)


{
n2.nokta3gir(x2,y2,z2);
}
ww

public void n2gir(nokta3 in2)


{
n2.nokta3gir(in2.x,in2.y,in2.z);
}

public nokta3 n1oku()


{
return n1;
}

101
102

public nokta3 n2oku()

m
{
return n2;
}

public double X()


{
//dogrunun x koordinat uzunlugu

o
return ([Link]()-[Link]());
}

public double Y()

i.c
{
//dogrunun y koordinat uzunlugu
return ([Link]()-[Link]());
}

public double Z()


{
//dogrunun z coordinat uzunlugu

dil
return ([Link]()-[Link]());
}

public double aci_n1_xy()


{
//dogrunun n1 noktasindan x y duzlemindeki ac s
return Math.atan2(Y(),X());
}
va
public double aci_n1_xz()
{
// dogrunun n1 noktas ndan x z duzlemindeki ac s
// radyan
return Math.atan2(Z(),X());
}

public double aci_n1_yz()


ja

{
//dogrunun n1 noktas ndan y z duzlemindeki ac s
//radyan
return Math.atan2(Z(),Y());
}
w.

public double R()


{
//dogrunun boyu
return [Link](X()*X()+Y()*Y()+Z()*Z());
}

public String toString()


{
ww

return "n1: "+[Link]()+"n2: "+[Link]();


}
}

DORTIS~1 JAV 660 24/05/98 20:19 [Link]


H8A1~1 JAV 3.202 08/06/98 22:03 [Link]
KOMPLE~1 JAV 7.350 09/06/98 5:35 [Link]

102
103

Bu haftaki alıştırmalar:

ALIŞTIRMA 1

m
Sizin için kompleks sınıfı yaratılmış ve bu sınıfın nasıl kullanıldığını açıklayan
H8A1 applet programı verilmiştir. Bu iki programı incele. Ayrıca Aritmetik2
programını incele ve boyutlu değişkenlerin kullanımını öğren. Sonra 5 kompleks
sayının toplamını hesaplayan bir konsol programı yaz.

import [Link].*; //java girdi cikti sinifini cagir

o
import kompleks;

class H8A1
{

i.c
public static void main(String args[])
{
kompleks sayi[]=new kompleks[5];
sayi[0]=new kompleks(1,2);
sayi[1]=new kompleks(1,-1);
sayi[2]=new kompleks(2,0);
sayi[3]=new kompleks(1.1,-0.5);
sayi[4]=new kompleks(1,1.5);

dil
kompleks toplam=new kompleks();
int i;
for(i=0;i<[Link];i++)
{
[Link](sayi[i]);
}
[Link]((double)[Link]);
[Link]("Ortalama = "+[Link]());
}
va
}

Ortalama = (1.22 + 0.4i )

import [Link].*; //java girdi cikti sinifini cagir


import kompleks;
ja

class H8A1a
{
public static void main(String args[]) throws IOException
{
kompleks sayi[]=new kompleks[5];
double n1,n2;
w.

kompleks toplam=new kompleks();


int i;
DataInputStream cin=new DataInputStream([Link]);
for(i=0;i<[Link];i++)
{
[Link]("bir kompleks sayi giriniz : ");
n1=[Link](cin);
ww

n2=[Link](cin);
sayi[i]=new kompleks(n1,n2);
[Link](sayi[i]);
}
[Link]((double)[Link]);
[Link]("Ortalama = "+[Link]());
}
}

103
104

bir kompleks sayi giriniz : 1 1


bir kompleks sayi giriniz : 2 2

m
bir kompleks sayi giriniz : 3 3
bir kompleks sayi giriniz : 4 4
bir kompleks sayi giriniz : 5 5
Ortalama = (3.0 + 3.0i )

o
ALIŞTIRMA 2

Üç boyutlu nokta ve doğru tanımları nokta3 ve dogru3 sınıflarında verilmiştir. 3


tane dogruyu boyutlu değişken olarak H9A2 sınıfında tanımlayın ve dogruların toplam
boylarını ve baslangıç noktasının xy xz ve yz düzlemlerinde yaptığı açıları derece

i.c
cinsinden yazdırın.

import [Link].*; //java girdi cikti sinifini cagir


import kompleks;

class H8A2
{
public static void main(String args[])
{
dogru3 n[]=new dogru3[3];

dil
n[0]=new dogru3(1,1,1,2,2,2);
n[1]=new dogru3(2,2,2,3,3,3);
n[2]=new dogru3(3,3,3,4,4,4);
int i;
for(i=0;i<[Link];i++)
{
va
[Link](n[i].toString()+"boy : "+n[i].R());
[Link]("aci xy = "+n[i].aci_n1_xy());
[Link]("aci xz = "+n[i].aci_n1_xz());
[Link]("aci yz = "+n[i].aci_n1_yz());
}
}
}
ja

n1: [1.0,1.0,1.0]n2: [2.0,2.0,2.0]boy : 1.7320508075688772


aci xy = 0.7853981633974483
aci xz = 0.7853981633974483
aci yz = 0.7853981633974483
n1: [2.0,2.0,2.0]n2: [3.0,3.0,3.0]boy : 1.7320508075688772
aci xy = 0.7853981633974483
w.

aci xz = 0.7853981633974483
aci yz = 0.7853981633974483
n1: [3.0,3.0,3.0]n2: [4.0,4.0,4.0]boy : 1.7320508075688772
aci xy = 0.7853981633974483
aci xz = 0.7853981633974483
aci yz = 0.7853981633974483
ww

104
105

BÖLÜM 5 : SINIFLARDA HİYERARSİ, ABSTRACT SINIF VE


İNTERFACE

m
5.1 Abstract sınıf

Üçüncü bölümde sınıfların diğer sınıflardan kalıtım (Inheritance) yoluyla türetilmesini


görmüştük. Sınıfları kalıtım yoluyla birbirinden türetirken eğer ortak özellikli sınıflar

o
yaratıyorsak, bütün bu sınıf gurubunun en tepesine abstract bir sınıf koyabiliriz. Abstract sınıf
diğer sınıfların kullanılmasında extends yoluyla superclasslik etmek ve bütün alt sınıflara
ortak bir adres çıkış noktası sağlamak dışında bir görevi yoktur. Diğer bir deyimle bu sınıflar
hiçbir zaman doğrudan kullanılmazlar. Ancak alt sınıflarından birini referand olarak

i.c
göstermek ve onlara dolaylı yoldan ulaşmak amacıyla kullanılırlar.

Kavramı daha iyi verebilmek için bir örnek problem oluşturalım. Daha önce sınıf kavramını
açıklarken kullandığımız nokta,daire sınıflarını hatırlıyacaksınız. Şimdi bu sınıfların üzerine
sekil isimli bir abstract sınıf ekleyerek tekrar oluşturalım.

dil
public abstract class sekil
{
public double alan() {return 0.0;}
public double hacim() {return 0.0;}
public abstract String isimOku();
}
Şekil 5.1.1 Abstract sınıf sekil ([Link] dosyasında yer alıyor)
va
import sekil;

public class nokta extends sekil


{
protected double x, y;

public nokta(double a, double b)


{
ja

noktagir(a,b);
}

public void noktagir(double a, double b)


{
x=a;
w.

y=b;
}

public double Xoku()


{
return x;
}
ww

public double Yoku()


{
return y;
}

public String toString()


{
return "["+x+","+y+"]";
}

105
106

public String isimOku()

m
{
return "Nokta";
}
}
Şekil 5.1.2 Abstract sınıf sekilden kalıtımla türetilen nokta sınıfı

o
import nokta;

i.c
public class daire extends nokta
{
protected double yaricap;

public daire()
{
//daire kal t m yaptigi nokta s n f n n kurucu metodunu
// super deyimi ile cagirabilir.

dil
super(0,0);
yaricapgir(0);
}

public daire(double r, double a, double b)


{
super(a,b);
yaricapgir(r);
va
}

public void yaricapgir(double r)


{
if(r >= 0.0)
yaricap=r;
else
yaricap=0.0;
ja

public double yaricapoku()


{
return yaricap;
}
w.

public double alan()


{
return 3.14159*yaricap*yaricap;
}

public String toString()


{
ww

return "Merkez = "+"["+x+","+y+"]"+


"; Yaricap="+yaricap;
}

public String isimOku()


{
return "Daire";
}
}

106
107

Şekil 5.1.3 sınıf noktadan kalıtımla türetilen daire sınıfı

m
import daire;

public class silindir extends daire


{
protected double yukseklik;
public silindir(){

o
yukseklikoku(0);}
public silindir( double h, double r, int a, int b){
super(r, a, b );
yukseklikoku( h);}
public void yukseklikoku (double h )

i.c
{
if(h>=0) yukseklik=h;
else yukseklik=0;
}
public double yukseklikoku(){return yukseklik;}

public double alan()


{

dil
return 2* [Link]()+
2*[Link]*yaricap*yukseklik;
}
public double hacim(){return [Link]()*yukseklik;}
public String toString()
{return [Link]()+";yukseklik="+yukseklik;}
public String isimOku(){return "Silindir";}
}
va
Şekil 5.1.4 sınıf daireden kalıtımla türetilen silindir sınıfı

import [Link];
import [Link];

public class abstracttesti extends Applet


{
ja

private nokta n;
private daire d;
private silindir s;
private sekil a[];

public void init()


w.

{
n = new nokta(7,11);
d = new daire(3.5,22,8);
s = new silindir(10,3.3,10,10);
a = new sekil[3];
a[0]=n;
a[1]=d;
a[2]=s;
ww

public void paint(Graphics g)


{
//direk cag rma :
[Link]([Link]()+": "+[Link](),25,25);
[Link]([Link]()+": "+[Link](),25,40);
[Link]([Link]()+": "+[Link](),25,55);
//indirek cag rma

107
108

int y=85;
for(int i=0;i<[Link];i++)

m
{
[Link](a[i].isimOku()+": "+a[i].toString(),25,y);
y+=15;
[Link]("Alan : "+a[i].alan()+" Hacim : "+a[i].hacim(),25,y);
y+=15;
}
}

o
}
Şekil 5.1.5 Abstract sınıf ve indirek referanslamayı test eden abstractTesti sınıfı

i.c
dil
va
Şekil 5.1.5 Abstract sınıf ve indirek referanslamayı test eden abstractTesti sınıfının
sonuclarının applet de görülmesi

Örnekten de görüldügü gibi nokta, daire ve silindir abstract sekil sınıfının alt sınıfları olarak
oluşturulmuş, ve aynı zamanda bu sınıflara indirek referans olarak kullanılmıştır. Diğer bir
deyimle nokta daire ve silindirin adresleri sekil sınıfı nesneye aktarılmış ve bu nesne
üzerinden üç sınıfta indirek olarak kullanılmıştır. Bu indirek kullanımın bize temel faydası,
ja

Programımıza yeni sınıflar eklediğimizde daha kolay ve az program değiştirerek uyumu


sağlayabilme yeteneğidir. Orneğin yukarıdaki program sınıfları durubuna koni eklemek
istersekbütün yapacağımız koni sınıfını tanımladıktan sonra, sekil nesnesi a nın boyutunu bir
arttırarak aynı hesaplamaya koniyide ilave etmekten ibaret olacaktır. Bu tür uygulamalar
bilgisayar kodunun değişim gereksinimini minimuma indirgediğinden nesne kokenli
w.

bilgisayar programcılığının onemli uygulamalarından biridir.

5.2 Interface

abstract sınıfların dezavantajı sadece bir sınıfınkalıtım yoluyla ve extends sozcüğü


kullanılarak bağlanabilir olmasıdır. Ve eğer başka bir sınıf halihazırda o sınıfa kalıtım yoluyla
ww

bağlanmışsa, bizim yeni bir sınıfı üst sınıf olarak kullanma olasılığımız yok olmuş demektir.
Fakat bazı uygulamalar için bu [Link] zaman interface kullanırız. Interface de
abstract sınıf gibi kendi içinde bir işlem yapmaz. Sadece öbür sınıfların bağlanmasını teşkil
eden bir adres noktası olarak iş görür. İnterface’i bir başka sınıfa bağlamak gerektiğinde
extends yerine implements sözcüğü kullanılır.

Örnek olarak bir önceki problemi interface ile tanımlıyalım.

108
109

public interface sekil


{

m
double alan();
double hacim();
String isimOku();
}

Şekil 5.2.1 interface sekil ([Link] dosyasında yer alıyor)

o
import sekil;

public class nokta implements sekil


{

i.c
protected double x, y;

public nokta(double a, double b)


{
noktagir(a,b);
}

public void noktagir(double a, double b)


{

}
x=a;
y=b;

public double Xoku()


{
return x;
dil
va
}

public double Yoku()


{
return y;
}

public double alan() {return 0.0;}


ja

public double hacim() {return 0.0;}

public String toString()


{
return "["+x+","+y+"]";
}
w.

public String isimOku()


{
return "Nokta";
}
}
ww

Şekil 5.2.2 interface sekilden implements kelimesiyle türiyen nokta sınıfı ([Link]
dosyasında yer alıyor)

Görüldüğü gibi burada nokta sınıfının bir öncekinden farkı implements kelimesinin
kullanılmış olaması ve bos alan ve hacim metodlarının bu dosyada yazılmasının
gerekmesinden ibarettir. Daire ve silindir sınıflarında bir fark mevcut degildir. İki seklin
işlemsel sonuçları arasında da bir fark mevcut değildir.

109
110

m
JAVA PROGRAMLAMA DİLİ
HAFTA 9

ALIŞTIRMA 1

Derste gördüğümüz abstract class sekil,nokta,daire, silindir sınıflarını ve ilave olarak koni

o
sınıfını yaratınız. Bu sınıfların [Link] test sınıfında alanlarını ve hacimlerini sekil
referansını kullanarak yazdırınız.

ALIŞTIRMA 2

i.c
Derste gördüğümüz interface sekil,nokta,daire, silindir sınıflarını ve ilave olarak küre sınıfını
yaratınız. Bu sınıfların [Link] test sınıfında alanlarını ve hacimlerini sekil referansını
kullanarak yazdırınız.

dil
ja va
w.
ww

110
111

m
BÖLÜM 6 : GRAFİKLER, FONTLAR VE RENKLER

Daha önce applet çizerken [Link] kütüphanesindeki grafik (Graphics) sınıfını kullanmıştık.
Ve grafik (Graphics) sinifinina ait drawString metotunu kullanarak applete yazı yazdırmıştık.
Şimdi bu sınıfın diğer özelliklerini ve metodlarını öğreneceğiz. Graphics sınıfı, yazı yazma,

o
çizgi çizme, dikdörtgen, oval çizme gibi bir dizi metodu barındırır. Bunun dışında awt
kütüphanesinin önemli bir sınıfı da Color sınıfıdır. Color sınıfı rekleri tanımlar ve değişik
renklerin kullanımına imkan verir. Font sınıfı grafikte kullanılan yazıların fontlarının (yazı
tipinin ve boyutunun) belirlenmesi amacıyla kullanılır. FontMetrics sınıfı fontların

i.c
boyutlarının belirlenmesiyle ilgili metodları içerir. Polygon sınıfı polygon çizimiyle ilgili
metodları barındırır.

Java appletlerinde çizim yaparken ilk hatırlamamız gereken şey, coordinat merkezinin ekranın
sol üst köşesi olduğudur. X ekseni aşağı doğru, Y ekseni sola doğru gider.

X ekseni

Y ekseni dil
Y ekseninin alta doğru gitmesi konsol programlarında satırların alta dogru ilerlemesi gibi
tarihi bir nedene dayanmaktadır. Bütün bilgisayar grafik programlamasında standartdır.
va
6.1 Graphics sınıfı

Graphics sınıfı gafik çizimi için gerekli olan bir çok metodu içinde barındırır. Grafik sınıfı
Applet sınıfının alt sınıflarındandır. Bu yüzden applet sınıfının alt sınıfı olan (extends applet )
Her sınıfta direk olarak tanımlıdır. Grafik çizme amacıyla genellikle Graphics sınıfından bir
ja

nesne paint metodunun içinde çağırılır. Paint metodunun tanımı şöyledir

Public void paint (Graphics g)

Paint metod genellikle applet metodu tarafından otomatik olarak applet ilk açıldığında
w.

çağırılır. Tekrar çağırılması gerektiğinde ise repaint metodu çağırılır ve repaint metodu
üzerinden indirek olarak paint metodu çağırılır. Repaint metodu

Public void repaint()

Şeklinde tanımanmıştır. Normal grafik çizdirme metodlarımızı paint metodumuzun içerisinde


tanımlanan Graphics sınıfı nessneleri kullanarak yapacağız.
ww

6.1.1 drawString, drawChars ve drawBytes metodları

Bu metodların tanımları şu şekilde verilmiştir.

public abstract void drawString( String stringYazı, int x,int y)

111
112

public void drawChars( char charYazı[],


int baslangıçindeksi,int yazılacakharfsayısı,

m
int x,int y)

public void drawBytes( byte byteYazı[],


int başlangıçindeksi,int yazılacakharfsayısı,
int x,int y)

o
drawString metodu bir string değişkenini verilen x ve y koordinatlarından başlayarak çizer.
DrawChars bir boyutlu Char tipi değişken dizisini başlangiçindeksi indeksinden baslayarak
yazılacakharfsayısı kadar kısmını x ve y koordinatlarından başlıyarakçizer. DrawByte metodu

i.c
da drawChars metodu gibidir tek değişikliği Byte türü boyutlu değişken kullanmasıdır.

Şekil [Link] de bu metodların kullanılmasını açıklayan bir program verilmiştir.

import [Link];
import [Link].*;

dil
public class ciz extends Applet
{
private String s ="Bunu drawString Metoduyla yazdir";
private char c[]={'c','h','a','r','s',' ','8'};
private byte b[]={'b','y','t','e',55,56,57};

public void paint(Graphics g)


{
[Link](s,100,25);
va
[Link](c,2,3,100,50);
[Link](b,0,5,100,75);
}
}

Şekil [Link] drawString drawChars drawBytes metodlarını kullanan ciz programı


ja
w.
ww

Şekil [Link] drawString drawChars drawBytes metodlarını kullanan ciz programının


Applet çıktısı

6.2 Renk kontrolü

appletlerde renk controlu Color sınıfını kullanarak yapılır. Renk olusumunda monitör ve Tv
de kullnılan RGB (Red-Green-Blue=Kırmızı-Yesil-Mavi) sistemi temel alınır. Bu üç renk
monitorde 0-255 arası değerler alabilir. Üç rengin karışımı toplam 256*256*256 renk

112
113

tanımlar.
Color sınıfı kurucu metodları şu şekilden tanımlanır.

m
public Color( int kirmizi,int yesil,int mavi) //her renk 0-255 arası
public Colot(float kirmizi,float yeşil,float mavi) //her renk 0.0-1.0 arası
Color sınıfında ayrıca renk degerlerini okuyabildiğimiz

public int getRed() // Kırmızı tonunu oku

o
public int getGreen()//Yesil tonunu oku
public int getBlue()//Mavi tonunu oku
public abstract Color getColor() //rengi oku

i.c
metotları ve rengi değiştirebildiğimiz

public abstract Color setColor(Color c)

metodu mevcuttur.

Applette renk değiştirdiğimiz küçük bir örnek program yazalım :

import [Link].*;
import [Link];

public class Renk extends Applet


{
private int kirmizi,yesil,mavi;
public void init()
dil
va
{
kirmizi=100;
yesil=255;
mavi=125;
// arka palanın rengi mavi olarak veriliyor
setBackground(new Color(0,0,255));
}
ja

public void paint(Graphics g)


{
// yazının rengi 100,255,125 olarak alındı
[Link](new Color(kirmizi,yesil,mavi));
[Link]("ABCDEFGHIJKLMNOPQRSTUVWXYZ",50,33);
showStatus("Su andaki renk : "+[Link]());
w.

}
}
ww

Bu programda kirmizi değeri 100, yesil değeri 255 ve mavi degeri de 125 alınmış ve setColor
deyimiyle yeni renk tanımlanmıştır. Arka plan rengi ise public void setBackground(Color c)

113
114

Metotunu kullanarak maviye dönüştürülmüştür.

m
6.3 Yazı Kontrolu

Appletlerde yazı kontrolu Font sınıfını kullanarak yapılır. Şekil 5.3.1 de java 1.1.5 de
kullanılabilecek tüm yazı stillerinin (font) listesini veren [Link] programını görüyoruz.

o
import [Link].*;
import [Link].*;

public class stil extends Applet


{

i.c
public void paint(Graphics g)
{
String stilListesi[];
stilListesi=getToolkit().getFontList();
int y=15;
for(int i=0;i<[Link];i++)
{
[Link](stilListesi[i],15,y);

}
}
y+=15;
}

dil
Şekil 6.3.1 [Link] programı, java kütüphanesinde mevcut olan yazı sitillerini gösterir
ja va

Şekil 6.3.2 [Link] programı, java kütüphanesinde mevcut olan yazı sitillerini gösterir
w.

applet programının sonuçları.

Bu yazı sitillerinden birisi asağıda verilen yazı tiplerinden birisiyle beraber ve verilen belli bir
yazı boyutunda gösterilebilir.

public final static int PLAIN : düz yazı sitili


ww

public final static int BOLD : Kalın yazı sitili

public static int ITALIC : İtalik (yatık) yazı sitili

bu tanımlardaki final sözcüğü bu ifadelerin değişken değil sabit olduğunu gö[Link]


sınıfının kurucu metodu şu şekildedir.

114
115

Public Font( String s, int yazı_sitili, int harf_boyutu);

m
Bir appletin yazı sitili Graphics sınıfındaki setFont metoduyla değiştirilebilir.

Public abstract void setFont(Font f)

Örnek olarak aşağıdaki deyimi verebiliriz :

o
[Link](new Font(“Serif”,[Link],12);

Şimdi setFont metotunu küçük bir örnekte kullanarak gösterelim :

i.c
import [Link].*;
import [Link];

public class RenkFont extends Applet


{
private int kirmizi,yesil,mavi;

dil
public void init()
{
kirmizi=100;
yesil=255;
mavi=125;
}

public void paint(Graphics g)


va
{
[Link](new Color(kirmizi,yesil,mavi));
setBackground(new Color(0,0,255));
[Link](new Font("TimesRoman",[Link],36));
[Link]("ABCDEFGHIJKLMNOPQRSTUVWXYZ",50,33);
showStatus("Su andaki font : "+[Link]());
}

}
ja

Şekil 6.3.3 [Link] programı, java kütüphanesindeki Font uygulamasını gösterir


w.

Şekil 6.3.4 [Link] programı, java kütüphanesindeki Font uygulamasını gösterir


ww

6.4 Çizgi çizimi

Javada çizgi çizmek için kullanılan temel metot drawLine metodudur. Bu metod Graphics
sınıfında tanımlanmıştır. Kurucu metodu :
Public abstract void drawLine(
int x1, // ilk noktanın x koordinatı

115
116

int y1, //ilk noktanın y koordinatı


int x2, // ikinci noktanın x koordinatı

m
int y2) //ikinci noktanın y koordinatı
Bir küçük örnek problemde metodu kullanalım :

import [Link];
import [Link].*;

o
public class cizgiciz extends Applet
{
public void paint(Graphics g)

i.c
{
[Link](new Color(0,255,255));
[Link](new Font("SansSerif",[Link],24));
[Link](10,10,230,95);
}
}

dil
va
Şekil 6.4.1 Çizgi çizim örneği [Link] ve çizginin appletde görünümü

6.5 Dikdörtgen çizimi


ja

Javada dikdörtgen çizmek için kullanılan temel metot drawRect metodudur. Bu metod
Graphics sınıfında tanımlanmıştır. Bu metotların tanımı :
Public abstract void drawRect(
int x1, // üst tepe noktanın x koordinatı
int y1, // üst tepe noktanın y koordinatı
w.

int en, // dikdörgenin genişliği


int yukseklik) // dikdörtgenin yüksekliği
Bu metoda ilave olarak dikdörtgenin içini verilen renkte boyayan
Public abstract void fillRect(
int x1, // üst tepe noktanın x koordinatı
int y1, // üst tepe noktanın y koordinatı
int en, // dikdörgenin genişliği
ww

int yukseklik) // dikdörtgenin yüksekliği


ve dikdörtgeni arkaplan renginde boyayan (silen)
Public abstract void clearRect(
int x1, // üst tepe noktanın x koordinatı
int y1, // üst tepe noktanın y koordinatı
int en, // dikdörgenin genişliği
int yukseklik) // dikdörtgenin yüksekliği

116
117

metotları mevcuttur. DrawREct ve fillRec metodunun kullanımı Şekil 5.5.1 de verilmiştir.

m
import [Link];
import [Link].*;

public class dikdortgenCiz extends Applet


{
public void paint(Graphics g)

o
{
[Link](new Color(255,0,0));
[Link](10,10,100,50);
[Link](129,10,100,50);

i.c
}
}

dil
Şekil 6.5.1 [Link] programı ve [Link] appleti

Köşeleri yuvarlatılmış dikdörtgen çizmek içinse drawRoundRect metodu kullanılır


va
Public abstract void drawRoundRect(
int x1, // üst tepe noktanın x koordinatı
int y1, // üst tepe noktanın y koordinatı
int en, // dikdörgenin genişliği
int yukseklik, // dikdörtgenin yüksekliği
int koseeni, // yuvarlak kosenin eni
ja

int koseyuksekligi )// yuvarlak kosenin yuksekligi


Bu metoda ilave olarak dikdörtgenin içini verilen renkte boyayan
Public abstract void fillRoundRect(
int x1, // üst tepe noktanın x koordinatı
int y1, // üst tepe noktanın y koordinatı
w.

int en, // dikdörgenin genişliği


int yukseklik, // dikdörtgenin yüksekliği
int koseeni, // yuvarlak kosenin eni
int koseyuksekligi )// yuvarlak kosenin yuksekligi

import [Link];
import [Link].*;
ww

public class yuvarlakKoseliDikdortgenCiz extends Applet


{
public void paint(Graphics g)
{
[Link](new Color(0,0,255));
[Link](new Font("SansSerif",[Link],12));
[Link](10,10,100,100,15,15);
[Link](120,10,100,100,15,15);

117
118

}
}

o m
i.c
Şekil 6.5.2 [Link] programı ve appleti

Ayrıca 3 boyutlu dikdortgen çizen draw3DRect ve fill3Drect metotları mevcutttur. Bu

dil
metotların tanımları şu şekilde verilmiştir.

Public abstract void draw3DRect(


int x1, // üst tepe noktanın x koordinatı
int y1, // üst tepe noktanın y koordinatı
int en, // dikdörgenin genişliği
int yukseklik, // dikdörtgenin yüksekliği
va
boolean yukarıkaldırma) // yukarı kalkık 3üncü boyut

Public abstract void fill3DRect(


int x1, // üst tepe noktanın x koordinatı
int y1, // üst tepe noktanın y koordinatı
int en, // dikdörgenin genişliği
int yukseklik, // dikdörtgenin yüksekliği
ja

boolean yukarıkaldırma) // yukarı kalkık 3üncü boyut

import [Link];
import [Link].*;
w.

public class ucBoyutluDikdortgenCiz extends Applet


{
public void paint(Graphics g)
{
[Link]([Link]);
[Link](new Font("SansSerif",[Link],12));
g.draw3DRect(10,10,100,100,true);
ww

g.fill3DRect(120,10,100,100,true);
g.draw3DRect(10,120,100,100,false);
g.fill3DRect(120,120,100,100,false);

}
}

118
119

o m
i.c
Şekil 6.5.3 [Link] programı ve appleti

6.6 Oval ve açılı oval çizimi

int x1,
int y1,
dil
Oval çizimi için drawOval ve fillOval metodları kullanılır bu metodların tanımı şöyledir :

Public abstract void drawOval(


// üst tepe noktanın x koordinatı
// üst tepe noktanın y koordinatı
va
int en, // ovalin genişliği
int yukseklik) // ovalin yüksekliği

Public abstract void fillOval(


int x1, // üst tepe noktanın x koordinatı
int y1, // üst tepe noktanın y koordinatı
int en, // ovalin genişliği
ja

int yukseklik) // ovalin yüksekliği

(x1,y1) koordinatının ovalle ilişkisini daha iyi anlayabilmek için aşağıdaki grafiği verebiliriz :

(x1,y1)
w.

boy
ww

en

Şekil 6.6.1 Oval tanımı koordinat sistemi

Oval programını küçük bir örnek programda kullanalım :

import [Link];

119
120

import [Link].*;

m
public class daireCiz extends Applet
{
public void paint(Graphics g)
{
[Link](new Color(0,0,255));
[Link](10,10,50,50);
[Link](70,10,50,50);

o
}
}

i.c
dil
Şekil 6.6.2 [Link] programı ve apleti

Eğer bir ovalin tamamını değilde sadece bir bölümünü çizmek dilenilirse, drawArc ve fillArc
metotları kullanılabilir. Bu metotların tanımı :
va
Public abstract void drawArc(
int x1, // üst tepe noktanın x koordinatı
int y1, // üst tepe noktanın y koordinatı
int en, // ovalin genişliği
int yukseklik, // ovalin yüksekliği
int başlangıçaçısı, //arkın başlangıç açısı, derece
ja

int çizimaçısı) // arkın çizim açısı, derece

Public abstract void fillArc(


int x1, // üst tepe noktanın x koordinatı
int y1, // üst tepe noktanın y koordinatı
w.

int en, // ovalin genişliği


int yukseklik, // ovalin yüksekliği
int başlangıçaçısı, //arkın başlangıç açısı, derece
int çizimaçısı) // arkın çizim açısı, derece

Şimdi de bu metotu kullanan bir bilgisayar programı yazalım :


ww

import [Link];
import [Link].*;

public class arcCiz extends Applet


{
public void paint(Graphics g)
{
[Link](new Color(0,0,255));

120
121

[Link](new Font("SansSerif",[Link],12));
[Link](70,10,50,50);

m
[Link](10,10,50,50,30,60);
[Link](70,10,50,50,30,60);
}
}

o
i.c
Şekil 6.6.3 [Link] programı ve apleti

6.7 Polygon çizimi

dil
Açık ve kapalı polygon şekilleri çizmek için drawPolygon ve fillPolygon metotları
kullanılır. Metotların tanımı :

public abstract void drawPolygon(


int x[], // x koordinat vektörü
int y[], // y koordinatı vektörü
int nokta sayısı) // nokta sayısı
va
public abstract void drawPolyline(
int x[], // x koordinat vektörü
int y[], // y koordinatı vektörü
int nokta sayısı) // nokta sayısı
ja

public abstract void drawPolygon( Polygon p) //Graphics sınıfı metodu

public Polygon() //Polygon sınıfı

public Polygon(
w.

int x[], // x koordinat vektörü


int y[], // y koordinatı vektörü
int nokta sayısı) // nokta sayısı

Metot tanımlarından görüldüğü gibi polygon int türü vektörle çizilebileceği gibi bu vektörü
içinde barındıran Polygon sınıfı bir nesne kullanılarak ta çizilebilir.
ww

Örnek olarak üçgen çizen bir program verelim :


import [Link];
import [Link].*;

public class ucgenCiz extends Applet


{
public void paint(Graphics g)
{
int x[]={10,(int)(10+100*[Link]([Link]/3.0)),110,10};

121
122

int y[]={100,(int)(100-100*[Link]([Link]/3.0)),100,100};
int x1[]={130,(int)(130+100*[Link]([Link]/3.0)),230,130};

m
int y1[];
y1=y;
[Link](new Color(0,0,255));
[Link](x,y,4);
[Link](x1,y1,4);
}
}

o
i.c
6.8 Resim gösterimi
dil
Şekil 6.7.1 [Link] programı ve apleti

Java dili sadece .gif ve .jpg standartlarındaki resimleri gösterebilir. Bu standartlar internet
va
ortamından kaynaklanmaktadır.
Resim önce getImage metoduyla bir Image sınıfı nesneye yuklenir, sonra drawImage
metoduyla gösterilir.
Orneğin Image resim=getImage(getDocumentBase(),”[Link]”);
Ve resim [Link](resim,1,1,this); deyimiyle çizilir. Burada ikinci ve üçüncü noktalar
başlangıç x ve y koordinatlarıdı[Link] olarak this resmin çizileceği appletin içinde bulunulan
sınıfın appleti olduğunu belirtmektedir.
ja

Bir örnek problemle resim çizimini biraz daha belirgin hale getitelim :

import [Link];
import [Link].*;
w.

public class resim extends Applet


{
private Image bebek;
public void init()
{
bebek=getImage(getDocumentBase(),"[Link]");
ww

public void paint(Graphics g)


{
[Link](bebek,1,1,this);
// resmi orijinalinin iki kat boyunda ciziniz
int en=[Link](this);
int yukseklik=[Link](this);
[Link](bebek,1,90,en*2,yukseklik*2,this);
}

122
123

o m
i.c
dil
ja va

JAVA PROGRAMLAMA DİLİ


HAFTA 10

CIZ~1 JAV 459 16/06/98 1:40 [Link]


w.

import [Link];
import [Link].*;

public class ciz1 extends Applet


{
private String s ="Bunu drawString Metoduyla yazdir";
private char c[]={'c','h','a','r','s',' ','8'};
ww

private byte b[]={'b','y','t','e',75,76,77};

public void init()


{
Color c=new Color(0,0,255);
setBackground(c);

123
124

public void paint(Graphics g)


{

m
[Link](new Color(100,255,125));
[Link](new Font("SansSerif",[Link],24));
[Link](s,100,25);
[Link](c,2,3,100,50);
[Link](b,0,6,100,75);
}
}

o
i.c
CIZGIC~2 JAV
PLOT~1 JAV
251
8.987
dil
16/06/98
16/06/98
1:42 [Link]
1:57 [Link]

//======================================================
// Numerical Analysis package in java
// Plot class to plot 2D data
// Dr. Turhan Coban
va
// =====================================================
import [Link].*;
import [Link].*;
import [Link].*;

public class Plot


{
ja

String label; // Plot Label


String xlabel; // X axis Label
String ylabel; // Y axis Label
String filename; // file name
double xmax,xmin,ymax,ymin; // real max,min scale
int xabsmin,yabsmin,abswidth,absheight; // absolute max,min scale
w.

int nmax; // max number of data points


int nline; // max number of data sets
double x[][]; // x data
double y[][]; // y=f(x) data
int n[]; // n : number of data in each
line
int red[],green[],blue[]; // color code 0-255
int plottype[];
ww

int xgridon;
int ygridon;
// plottype = 0 continuous line
// plottype = 10 user defined character plot
// plottype = 20 rectangle
// plottype = 21 circle
// plottype = 22 triangle
// plottype = 23 diamond
// plottype = 24 pentagon

124
125

// plottype = 25 hexagon
char ch[]; // plot character (used with plottype 10)

m
int xntic; // number of tics in x axis
int yntic; // number of tics in y axis
DataInputStream fin;
DataInputStream ffile;
File plotFile;
File lineDataFile;
public void set_plotwindow(int width,int height,double xip,double

o
yip,double dxp,double dyp)
{
//sets rectangular plot window
xabsmin = (int)(width*(xip+0.2));

i.c
yabsmin = (int)(height*(yip+0.2));
abswidth = (int)(width*dxp);
absheight = (int)(height*dyp);
}

public Plot(String pl,String xl,String yl,int xnt,int ynt,int xgo,int


ygo,String ifn[],int ipt[],int ir[],int ig[],int ib[]) throws IOException
{

dil
xmin=9.99e50;
xmax=-9.99e50;
ymin=9.99e50;
ymax=-9.99e50;
xntic=8;
yntic=8;
double xtemp,ytemp;
label=pl;
xlabel=xl;
va
ylabel=yl;
nline=[Link];
xntic=xnt;
yntic=ynt;
xgridon=xgo;
ygridon=ygo;
n=new int[nline];
red=new int[nline];
ja

green=new int[nline];
blue=new int[nline];
plottype=new int[nline];
ch=new char[nline];
//read all data to determine limit values
String fn[];
w.

fn=new String[nline];
int i,j;
for(i=0;i<nline;i++)
{
fn[i]=ifn[i];
plottype[i]=ipt[i];
if(plottype[i] == 10) ch[i]='*';
red[i]=ir[i];
ww

green[i]=ig[i];
blue[i]=ib[i];
j=0;
n[i]=0;
//open ffile
lineDataFile=new File(fn[i]);
lineDataFile=new File([Link]());
try{
ffile=new DataInputStream(new FileInputStream(lineDataFile));

125
126

} catch(IOException e)
{

m
[Link]("Error Opening File \n"+[Link]());
[Link](1);
}
try{
while(ffile!=null)
{
xtemp=[Link](ffile);

o
ytemp=[Link](ffile);
if(xtemp<xmin) xmin=xtemp;
if(xtemp>xmax) xmax=xtemp;
if(ytemp<ymin) ymin=ytemp;

i.c
if(ytemp>ymax) ymax=ytemp;
n[i]++;
}
} catch(EOFException e_eof)
{
//close ffile
try{
[Link]();

dil
} catch(IOException e)
{
[Link]("Error Closing File\n"+[Link]());
[Link](1);
}
} //End of EOFException
if(i==0) nmax=n[i];
else
{
va
if(n[i]>nmax) nmax=n[i];
}
}
x=new double[nline][nmax];
y=new double[nline][nmax];
//re-read the data again to load it
lineDataFile=new File(fn[i]);
lineDataFile=new File([Link]());
ja

for(i=0;i<nline;i++)
{
//open ffile
try{
ffile=new DataInputStream(new FileInputStream(lineDataFile));
} catch(IOException e)
w.

{
[Link]("Error Opening File \n"+[Link]());
[Link](1);
}
for(j=0;j<n[i];j++)
{
x[i][j]=[Link](ffile);
y[i][j]=[Link](ffile);
ww

}
//close ffile
try{
[Link]();
} catch(IOException e)
{
[Link]("Error Closing File\n"+[Link]());
[Link](1);
}

126
127

}
set_plotwindow(600,500,0.15,0.1,0.8,0.6);

m
}

public Plot() throws IOException


{
//adding max-min prompts and input fields
//initial values of max and mins
// Structure of input file

o
// filename
// xlabel
// ylabel
// nline xntic yntic xgridon ygridon

i.c
// datafilename plottype redcolor greencolor bluecolor
// ........
// datafilename plottype redcolor greencolor bluecolor

//
// A sample data file input :
//

dil
// 4 10 10 1 1
// [Link] 22 0 0 0
// [Link] 21 0 255 0
// [Link] 0 0 255 0
// [Link] 0 0 0 255
//
// see above for meaning of plot types
xmin=9.99e50;
xmax=-9.99e50;
va
ymin=9.99e50;
ymax=-9.99e50;
xntic=8;
yntic=8;
double xtemp,ytemp;
plotFile=new File("[Link]");
plotFile=new File([Link]());
try{
ja

fin=new DataInputStream(new FileInputStream(plotFile));


} catch(IOException e)
{
[Link]("Error Opening File \n"+[Link]());
[Link](1);
}
w.

label=[Link](fin);
xlabel=[Link](fin);
ylabel=[Link](fin);
nline=[Link](fin);
xntic=[Link](fin);
yntic=[Link](fin);
xgridon=[Link](fin);
ygridon=[Link](fin);
ww

n=new int[30];
red=new int[30];
green=new int[30];
blue=new int[30];
plottype=new int[30];
ch=new char[30];
//read all data to determine limit values
String fn[];
fn=new String[nline];

127
128

int i,j;
for(i=0;i<nline;i++)

m
{
fn[i]=[Link](fin);
plottype[i]=[Link](fin);
if(plottype[i] == 10) ch[i]=[Link](fin);
red[i]=[Link](fin);
green[i]=[Link](fin);
blue[i]=[Link](fin);

o
j=0;
n[i]=0;
//open ffile
lineDataFile=new File(fn[i]);

i.c
lineDataFile=new File([Link]());
try{
ffile=new DataInputStream(new FileInputStream(lineDataFile));
} catch(IOException e)
{
[Link]("Error Opening File \n"+[Link]());
[Link](1);
}

dil
try{
while(ffile!=null)
{
xtemp=[Link](ffile);
ytemp=[Link](ffile);
if(xtemp<xmin) xmin=xtemp;
if(xtemp>xmax) xmax=xtemp;
if(ytemp<ymin) ymin=ytemp;
if(ytemp>ymax) ymax=ytemp;
va
n[i]++;
}
} catch(EOFException e_eof)
{
//close ffile
try{
[Link]();
} catch(IOException e)
ja

{
[Link]("Error Closing File\n"+[Link]());
[Link](1);
}
} //End of EOFException
w.

if(i==0) nmax=n[i];
else
{
if(n[i]>nmax) nmax=n[i];
}
}
//close ffile
try{
ww

[Link]();
} catch(IOException e)
{
[Link]("Error Closing File\n"+[Link]());
[Link](1);
}
x=new double[nline][nmax];
y=new double[nline][nmax];
//re-read the data again to load it

128
129

for(i=0;i<nline;i++)
{

m
//open ffile
try{
lineDataFile=new File(fn[i]);
lineDataFile=new File([Link]());
ffile=new DataInputStream(new FileInputStream(lineDataFile));
} catch(IOException e)
{

o
[Link]("Error Opening File \n"+[Link]());
[Link](1);
}
for(j=0;j<n[i];j++)

i.c
{
x[i][j]=[Link](ffile);
y[i][j]=[Link](ffile);

}
//close ffile
try{
[Link]();

dil
} catch(IOException e)
{
[Link]("Error Closing File\n"+[Link]());
[Link](1);
}

set_plotwindow(400,400,0.1,0.1,0.8,0.6);
va
//close fin
try{
[Link]();
} catch(IOException e)
{
[Link]("Error Closing File\n"+[Link]());
[Link](1);
}
ja

PLOTSH~2 JAV 11.584 16/06/98 1:57 [Link]


w.

//======================================================
// Numerical Analysis package in java
// PlotShapes class
// This class convert graphic draw methods to
// plot coordinates and gives additional plotting methods
// Dr. Turhan Coban
// =====================================================
ww

import [Link].*;
import [Link].*;
import [Link].*;

public class PlotShapes extends Applet


{
Graphics g;
int xabsmin,yabsmin;
int absheight,abswidth;

129
130

double xmin,xmax,ymin,ymax;

m
public PlotShapes(Graphics gi,int xabsmini ,int yabsmini,
int absheighti,int abswidthi,
double xmini,double xmaxi,
double ymini,double ymaxi)
{
// xabsmin : absulute stating point x axis
// yabsmin : absolute starting point y axis

o
// absheight : absoulute height of plotting window
// abswidth : absolute width of plotting window
// xmin : minimum x value (real number)
// xmax : maximum x value (real number)

i.c
// ymin : minimum y value (real number)
// ymax : maximum y value (real number)
// g : graphic object that actual drawing is done through
g=gi;
xabsmin=xabsmini;
yabsmin=yabsmini;
absheight=absheighti;
abswidth=abswidthi;

dil
xmin=xmini;
xmax=xmaxi;
ymin=ymini;
ymax=ymaxi;
}

public void drawLine(int plottype,double x1,double y1,double x2,double y2)


{
// draw a line from (x1,y1) to (x2,y2)
va
if(plottype==0) //draw a continuous line
{
[Link]( (int)(xabsmin+(x1-xmin)/(xmax-xmin)*abswidth),
(int)(yabsmin+absheight-(y1-ymin)/(ymax-
ymin)*absheight),
(int)(xabsmin+(x2-xmin)/(xmax-xmin)*abswidth),
(int)(yabsmin+absheight-(y2-ymin)/(ymax-
ymin)*absheight));
ja

}
} //end of drawLine

public void drawChar(char ch,double x1,double y1)


{
w.

// draws a single character at (x1,y1)


char ch1[]=new char[1];
ch1[0]=ch;
int h=[Link]().getHeight();
int w=h-2;
[Link](ch1,0,1,
(int)(xabsmin+(x1-xmin)/(xmax-xmin)*abswidth)-2,
(int)(yabsmin+absheight-(y1-ymin)/(ymax-ymin)*absheight)+h/2);
ww

} //end of [Link]

public void drawChars(char ch[],int firstspace,int numberofchars,


double x1,double y1)
{
// draws a character array from space firstspace to
(firstspace+numberofchars)
// starting at (x1,y1)

130
131

int h=[Link]().getHeight();
int w=h-2;

m
[Link](ch,firstspace,numberofchars,
(int)((xabsmin+(x1-xmin)/(xmax-xmin)*abswidth)+5),
(int)((yabsmin+absheight-(y1-ymin)/(ymax-
ymin)*absheight)+h/2));

} //end of [Link]

o
public void drawString(String s,double x1,double y1)
{
//draws a String at (x1,y1)
int h=[Link]().getHeight();

i.c
int w=h-2;
[Link](s,
(int)(xabsmin+(x1-xmin)/(xmax-xmin)*abswidth),
(int)(yabsmin+absheight-(y1-ymin)/(ymax-ymin)*absheight));

} //end of [Link]

public void drawRect(double x1,double y1,int rectwidth,int rectheight)

dil
{
// draw a rectangle starting at (x1,y1)
// with dimensions of (rectwidth,rectheight)
[Link](
(int)(xabsmin+(x1-xmin)/(xmax-xmin)*abswidth-rectwidth/2),
(int)(yabsmin+absheight-(y1-ymin)/(ymax-ymin)*absheight-
rectheight/2),
rectwidth,rectheight);
va
}//end of drawRect

public void drawOval(double x1,double y1,int width,int height)


{
// draw an oval with the centre of (x1,y1)
// with dimension of (width,height)
[Link](
(int)(xabsmin+(x1-xmin)/(xmax-xmin)*abswidth-width/2),
ja

(int)(yabsmin+absheight-(y1-ymin)/(ymax-ymin)*absheight-
height/2),
width,height);
}//end of drawRect

public void drawPolygon(double x1,double y1,int radius,int side)


w.

{
//draw a polygon of n sides n=3(trinagle),n=4(dimond)....
double Pi=4.0*[Link](1.0);
int xvalues[]=new int[side+1];
int yvalues[]=new int[side+1];
double angle_increase;
double angle;
angle_increase=2.0*Pi/side;
ww

angle=Pi/2.0;
for(int i=0;i<side;i++)
{
xvalues[i]= (int)([Link](xabsmin+(x1-xmin)/
(xmax-xmin)*abswidth+radius*[Link](angle)));
yvalues[i]= (int)([Link](yabsmin+absheight-(y1-ymin)/
(ymax-ymin)*absheight-radius*[Link](angle)));
if(i==0) {xvalues[side]=xvalues[i];yvalues[side]=yvalues[i];}
angle+=angle_increase;

131
132

}
[Link](xvalues,yvalues,side+1);

m
}//end of drawPolygon

public void drawXTic(int ticNumber,double ticHeight,int ticSide)


{
//draw a series of x axis tics
double dtic=(xmax-xmin)/ticNumber;
double x1=xmin;

o
double y1=ymin;
if(ticSide==0)
{
for(int i=0;i<=ticNumber;i++)

i.c
{
drawLine(0,x1,y1,x1,(y1-ticHeight));
x1=x1+dtic;
}
}
else
{
for(int i=0;i<=ticNumber;i++)

dil
{
drawLine(0,x1,y1,x1,(y1+ticHeight));
x1=x1+dtic;
}
}
}

public void drawYTic(int ticNumber,double ticWidth,int ticSide)


va
{
//draw a series of y axis tics
double dtic=(ymax-ymin)/ticNumber;
double x1=xmin;
double y1=ymin;
if(ticSide==0)
{
for(int i=0;i<=ticNumber;i++)
ja

{
drawLine(0,x1,y1,(x1-ticWidth),y1);
y1=y1+dtic;
}
}
else
w.

for(int i=0;i<=ticNumber;i++)
{
drawLine(0,x1,y1,(x1+ticWidth),y1);
y1=y1+dtic;
}
}
ww

public void drawXGrid(int ticNumber)


{
//draw x gridlies |||||||
double dtic=(xmax-xmin)/ticNumber;
double x1=xmin;
for(int i=0;i<=ticNumber;i++)
{

132
133

drawLine(0,x1,ymin,x1,ymax);
x1=x1+dtic;

m
}
}

public void drawYGrid(int ticNumber)


{
//draw y gridlines =====
double dtic=(ymax-ymin)/ticNumber;

o
double y1=ymin;
for(int i=0;i<=ticNumber;i++)
{
drawLine(0,xmin,y1,xmax,y1);

i.c
y1=y1+dtic;
}
}

public void drawXNumbers(int ticNumber)


{
//draw x numbers
double dtic=(xmax-xmin)/ticNumber;

dil
double x1=xmin;
double y1=ymin;
String s;
s=" ";
for(int i=0;i<=ticNumber;i++)
{
s=[Link]([Link](x1*100.0)/100.00);
[Link](s,(int)(xabsmin+(x1-xmin)/(xmax-xmin)*abswidth),
(int)(yabsmin+absheight-(y1-ymin)/(ymax-ymin)*absheight)+20);
va
x1=x1+dtic;
}
}

public void drawYNumbers(int ticNumber)


{
ja

// draw y numbers
double dtic=(ymax-ymin)/ticNumber;
double x1=xmin;
double y1=ymin;
String s;
s=" ";
w.

for(int i=0;i<=ticNumber;i++)
{
s=[Link]([Link](y1*100)/100.0)+" ";
[Link](s,(int)(xabsmin+(x1-xmin)/(xmax-xmin)*abswidth-40),
(int)(yabsmin+absheight-(y1-ymin)/(ymax-ymin)*absheight));
y1=y1+dtic;
}
}
ww

public void drawXLabel(String xLabel)


{
// draw x labels
double x1=xmin+(xmax-xmin)/2.0;
double y1=ymin;
[Link](xLabel,(int)(xabsmin+(x1-xmin)/(xmax-xmin)*abswidth),
(int)(yabsmin+absheight-(y1-ymin)/(ymax-ymin)*absheight)+30);
}

133
134

public void drawYLabel(String yLabel)

m
{
// draw y labels
double x1=xmin-(xmax-xmin)/6.0;
double y1=ymax-(ymax-ymin)/3.0;
int n=[Link]();
char ch[]=new char[n];
[Link](0,n,ch,0);

o
// [Link](yLabel,(int)(xabsmin+(x1-xmin)/(xmax-xmin)*abswidth-60),
// (int)(yabsmin+absheight-(y1-ymin)/(ymax-ymin)*absheight));
for(int i=0;i<n;i++)
{

i.c
drawChar(ch[i],x1,y1);
y1=y1-(ymax-ymin)/30;
}
}

public void drawLabel(String Label)


{
//draw graphic label

dil
double x1=xmin+(xmax-xmin)/2.0;
double y1=ymax;
[Link](Label,(int)(xabsmin+(x1-xmin)/(xmax-xmin)*abswidth),
(int)(yabsmin+absheight-(y1-ymin)/(ymax-ymin)*absheight)-10);
}

public void
drawPlotLines(int i,int plottype[],double x[][],double y[][],int n[],char
ch[])
va
{
int j;
//draw lines
if(plottype[i]==0)
{
for(j=0;j<n[i]-1;j++)
{
if((x[i][j]>=xmin && x[i][j]<=xmax )
ja

&& (y[i][j]>=ymin && y[i][j]<=ymax))


{
if((x[i][j+1]>=xmin && x[i][j+1]<=xmax) &&
(y[i][j+1]>=ymin && y[i][j+1]<=ymax))
{
drawLine(0,x[i][j],y[i][j],x[i][j+1],y[i][j+1]);
w.

}
else if(x[i][j+1]>xmax)
{
double b=(y[i][j+1]-y[i][j])/(x[i][j+1]-x[i][j]);
double a=y[i][j]-b*x[i][j];
drawLine(0,x[i][j],y[i][j],xmax,(a+b*xmax));
}
else if(y[i][j+1]>ymax)
ww

{
double b=(y[i][j+1]-y[i][j])/(x[i][j+1]-x[i][j]);
double a=y[i][j]-b*x[i][j];
drawLine(0,x[i][j],y[i][j],(ymax-a)/b,ymax);
}
else if(x[i][j+1]>xmax && y[i][j+1]>ymax)
{
double b=(y[i][j+1]-y[i][j])/(x[i][j+1]-x[i][j]);
double a=y[i][j]-b*x[i][j];

134
135

drawLine(0,x[i][j],y[i][j],(ymax-a)/b,(a+b*xmax));
}

m
}
else if((x[i][j+1]>=xmin && x[i][j+1]<=xmax )
&& (y[i][j+1]>=ymin && y[i][j+1]<=ymax))
{
if(x[i][j]<xmin)
{
double b=(y[i][j+1]-y[i][j])/(x[i][j+1]-x[i][j]);

o
double a=y[i][j+1]-b*x[i][j+1];
drawLine(0,xmin,(a+b*xmin),x[i][j+1],y[i][j+1]);
}
if(y[i][j]<ymin)

i.c
{
double b=(y[i][j+1]-y[i][j])/(x[i][j+1]-x[i][j]);
double a=y[i][j+1]-b*x[i][j+1];
drawLine(0,(ymin-a)/b,ymin,x[i][j+1],y[i][j+1]);
}
}
}//end of for(j=0
}//end of if(plottype

dil
//draw characters
else if(plottype[i]==10)
{
for(j=0;j<n[i];j++)
{
if((x[i][j]>=xmin && x[i][j]<=xmax )
&& (y[i][j]>=ymin && y[i][j]<=ymax))
{ drawChar(ch[i],x[i][j],y[i][j]); }
}//end of for(j=0;
va
}//end else if(plottype[i]==10)
//draw rectangles
else if(plottype[i]==20)
{
for(j=0;j<n[i];j++)
{
if((x[i][j]>=xmin && x[i][j]<=xmax )
&& (y[i][j]>=ymin && y[i][j]<=ymax))
ja

{ drawRect(x[i][j],y[i][j],4,4); }
}//end of for(j=0;
}//end else if(plottype[i]==20)
//draw circle
else if(plottype[i]==21)
{
w.

for(j=0;j<n[i];j++)
{
if((x[i][j]>=xmin && x[i][j]<=xmax )
&& (y[i][j]>=ymin && y[i][j]<=ymax))
{ drawOval(x[i][j],y[i][j],4,4); }
}//end of for(j=0;
}//end else if(plottype[i]==21)
else if(plottype[i]>=22 && plottype[i]<=27)
ww

{
for(j=0;j<n[i];j++)
{ if((x[i][j]>=xmin && x[i][j]<=xmax )
&& (y[i][j]>=ymin && y[i][j]<=ymax))
{drawPolygon(x[i][j],y[i][j],5,(plottype[i]-19));}
}//end of for(j=0;
}//end else if(plottype[i]==21..27)
}

135
136

m
PLOTAP~2 JAV 4.119 16/05/98 22:21 [Link]

//======================================================
// Numerical Analysis package in java
// PlotApplet class to plot 2D data

o
// Dr. Turhan Coban
// =====================================================
import [Link].*;
import [Link].*;
import [Link].*;

i.c
import [Link].*;
import PlotShapes;
import Plot;

public class PlotApplet extends Applet implements ActionListener


{
Label promptXmin; // Label prompt in Xmin field
Label promptXmax; // Label prompt in Xmax field

dil
Label promptYmin; // Label prompt in Ymin field
Label promptYmax; // Label prompt in Ymax field
TextField inputXmin; // input field Xmin
TextField inputXmax; // input field Xmax
TextField inputYmin; // input field Ymin
TextField inputYmax; // input field Ymax
Plot p1;

public void init()


va
{
try{initplot();}
catch(IOException e_eof) {showStatus("IO exception");}
catch(SecurityException e_s) {showStatus("Security exception");}
}

public void initplot() throws IOException


{
ja

//adding max-min prompts and input fields

//label
//xaxis
//yaxis
// 4 10 10 1 1
w.

// [Link] 22 0 0 0
// [Link] 21 0 255 0
// [Link] 0 0 255 0
// [Link] 0 0 0 255
int xnt=10;
int ynt=10;
int xgo=1;
int ygo=1;
ww

String il=new String("label");


String xl=new String("x axis");
String yl=new String("y axis");
String ifn[]=new String[4];
ifn[0]="[Link]";
ifn[1]="[Link]";
ifn[2]="[Link]";
ifn[3]="[Link]";
int ipt[]=new int[4];

136
137

int ib[]=new int[4];


int ir[]=new int[4];

m
int ig[]=new int[4];
ipt[0]=22;
ipt[1]=21;
ipt[2]=0;
ipt[3]=0;
ir[0]=0;
ig[0]=0;

o
ib[0]=0;
ir[1]=0;
ig[1]=255;
ib[1]=0;

i.c
ir[2]=0;
ig[2]=255;
ib[2]=0;
ir[3]=0;
ig[3]=255;
ib[3]=0;

try{

dil
//p1=new Plot(il,xl,yl,xnt,ynt,xgo,ygo,ifn,ipt,ir,ig,ib);
p1=new Plot();
} catch(SecurityException ase) {[Link]("applet security
exception");}
promptXmin=new Label("Xmin ");
inputXmin=new TextField(5);
promptXmax=new Label("Xmax ");
inputXmax=new TextField(5);
promptYmin=new Label("Ymin ");
va
inputYmin=new TextField(5);
promptYmax=new Label("Ymax ");
inputYmax=new TextField(5);
[Link](this);
[Link](this);
[Link](this);
[Link](this);
add(promptXmin);
ja

add(inputXmin);
add(promptXmax);
add(inputXmax);
add(promptYmin);
add(inputYmin);
add(promptYmax);
w.

add(inputYmax);
}

public void paint(Graphics g)


{
[Link]([Link]([Link]));
[Link]([Link]([Link]));
[Link]([Link]([Link]));
ww

[Link]([Link]([Link]));
PlotShapes ps=new PlotShapes(g,[Link],[Link],
[Link],[Link],[Link],[Link],[Link],[Link]);
[Link]([Link],[Link],[Link],[Link]);
[Link]([Link],([Link])/80.0,0);
[Link]([Link],([Link])/80.0,0);
[Link]([Link]);
[Link]([Link]);
[Link]([Link]);

137
138

[Link]([Link]);
[Link]([Link]);

m
if([Link]!=0)
[Link]([Link]);
if([Link]!=0)
[Link]([Link]);
int i,j;
for(i=0;i<[Link];i++)
{

o
// Select plot colors
[Link](new Color([Link][i],[Link][i],[Link][i]));
[Link](i,[Link],p1.x,p1.y,p1.n,[Link]);
}//end of for(i=0

i.c
}//end of method

public void actionPerformed( ActionEvent e)


{
Double valXmin=new Double([Link]());
[Link]=[Link]();
Double valXmax=new Double([Link]());
[Link]=[Link]();

dil
Double valYmin=new Double([Link]());
[Link]=[Link]();
Double valYmax=new Double([Link]());
[Link]=[Link]();
repaint();
}

}
ja va
w.
ww

Bilgi dosyası [Link]

label of the plot Plot başlığı


xaxis of the plot x axis başlığı

138
139

yaxis of the plot y axis başlığı


3 10 10 0 0 plot cizgi sayısı logaritmikX logaritmikY gridX gridY

m
[Link] 10 * 0 0 255 dosyaİsmi plot_türü (10 ise plot char) Kırmızı Yesil Ma
[Link] 0 255 0 0 dosyaİsmi Plot_türü Kırmızı Yesil Mavi
[Link] 0 255 100 0 dosya_ismi Plot_türü Kırmızı Yeşil Mavi

Bilgi dosyası [Link]


1 1
2 4

o
3 9
4 16
5 25
6 36

i.c
7 49

Bilgi dosyası [Link]


0 0
0.526316 0.277008
1.05263 1.10803
1.57895 2.49307

dil
2.10526 4.43213
2.63158 6.92521
3.15789 9.9723
3.68421 13.5734
4.21053 17.7285
4.73684 22.4377
5.26316 27.7008
5.78947 33.518
6.31579 39.8892
va
6.84211 46.8144
7.36842 54.2936
7.89474 62.3269
8.42105 70.9141
8.94737 80.0554
9.47368 89.7507
10 100
ja

Bilgi dosyası [Link]


1 1
2 2
3 3
4 4
5 5
w.

Bu haftaki alıştırmalar:

ALIŞTIRMA 1

drawRect ve fillRect metodlarını kullanarak biri dolu diğeri sadece bir çizgi olan
iki dikdörtgen çiz.
ww

ALIŞTIRMA 2
drawOval ve fillOval metodlarını kullanarak biri dolu diğeri sadece bir çizgi olan
iki daire çiz.

ALIŞTIRMA 3
ciz metodundaki ikinci resmi iptal ederek sadece bir resim kalmasını sağla

import [Link];

139
140

import [Link].*;

m
public class resim extends Applet
{
private Image bebek;

public void init()


{
bebek=getImage(getDocumentBase(),"[Link]");

o
}

public void paint(Graphics g)


{

i.c
[Link](bebek,1,1,this);
}
}

ALIŞTIRMA 4
drawPolygon ve fillPolygon metodlarını kullanarak biri dolu diğeri sadece bir çizgi
olan iki eşkenar üçgen çiz.

import [Link];
import [Link].*;

{
public void paint(Graphics g)
{
dil
public class ucgenCiz extends Applet

int x[]={10,(int)(10+100*[Link]([Link]/3.0)),110,10};
va
int y[]={100,(int)(100-100*[Link]([Link]/3.0)),100,100};
int x1[]={130,(int)(130+100*[Link]([Link]/3.0)),230,130};
int y1[];
y1=y;
[Link](new Color(0,255,0));
[Link](x,y,4);
[Link](x1,y1,4);
}
ja

}
w.
ww

ALIŞTIRMA 5

PlotShapes,Plot, PlotApplet sınıflarını incele, ve calistır. Not dosyaları


incelediğinizde daha gelecek bölümlerde göreceğimiz yanliş kontrolü ve dosyaya

140
141

yazdırıp okutma metodlarını da göreceksiniz. Bu detaylar icin ilgili bolümleri


okuyabilirsiniz veya programların bu bölümleri için daha sonraki bölümleri işlemeyi
bekleyebilirsiniz.

m
ALIŞTIRMA 6

Türkçe renkleri tanımlıyan renk sınıfını yaz.

o
i.c
dil
ja va
w.
ww

141
142

BÖLÜM 7: Grafik Applet Oluşturma Metotları, Grafik Kullanıcısı


Arabirim programları (GUI)

m
7.1 Graphic Kullanıcısı Arabirim programları, GUI, (Graphics User Interface)

Grafik kullanıcı arabirim programları, GUI, programınıza kullanıcının daha iyi anlıyabileceği
bir görünüş verme amacıyla oluşturulur. Kullanıcıya sunulan programın onun rahatlıkla

o
anlayabileceği bir formata sahip olması günümüz programlamacılığında oldukça önemlidir.
Reklamlarla büyüyen bir kuşak için paket bazen paketin içindekinden bile onemli hale
gelebilmektedir. Grafik Kullanıcısı Arabirim programları kullanıcıya sunduğumuz be paketi
oluşturmaktadır.

i.c
GUI metodları [Link] (Abstract windowing toolkit) paketinde yer almaktadır. Bu pakette
Container ve Component isimli iki alt pakette yer almaktadır. Her zaman kullndığımız
Applet sınıfı Component sınıfından türiyen Panel sınıfının alt sınıfıdır. Yani Component
Appletlerin süper sınıfıdır.
Burada Component sınıfının

dil
1. TextComponent
• TextField
• TextArea
2. Button
3. Label
4. Checkbox
5. List
va
6. Choice
7. Canvas
8. Scrollbar
9. Container
• Panel
[Link]
• ScrollPane
ja

• Window
Frame
Dialog

Sınıflarını incelemeye calışacağız.


w.

7.2 Label (Etiket) sınıfı

Label sınıfı Appletin içine sadece okunabşlen fakat değiştirilemeyen yazılar yazma amacıyla
kullanılırlar. Label sınıfında tanımlanan metotlar şunlardır:
1. Kurucu Metotlar :
ww

public Label() // Label sınıfı nesneyi olusturur herhangi bir yazı göstermez
public Label(String s) // Label sınıfı nesneyi olusturur ve s stringini gösterir
public void Label(String s,int pozisyon) // Label sınıfı nesneyi olusturur ve s stringi gösterir
aynı zamanda Labeli pozisyonda verilen değere göre istenilen yere yerleştirir.
Yerleştirme konumları :[Link],[Link],[Link] (sol,orta,sağ)
konumlarıdır.
2. Giriş çıkış metotları
public String getText() // Label sınıfının String değişkenini okur.

142
143

public void setText(String s) // Label sınıfının String değişkenine yeni değer


girer.

m
public void setAlignment(int pozisyon)
Labeli pozisyonda verilen değere göre istenilen yere yerleştirir.
Yerleştirme konumları :[Link],[Link],[Link] (sol,orta,sağ)
konumlarıdır.
Örnek olarak bir bir program verelim :

o
import [Link];
import [Link].*;

i.c
public class LabelTesti extends Applet
{
private Label L1,L2;
public void init()
{
L1=new Label();
[Link]("Bu etiket once bos tanimlandi");
add(L1);
L2=new Label("Bu etiket yazisi ilk tanimda tanimlandi");
add(L2);
}

public void paint(Graphics g)


{ dil
[Link]("L1 : "+[Link](),25,80);
[Link]("L2 : "+[Link](),25,95);
}
va
}
ja
w.

Şekil 7.2.1 [Link] rogramı ve appleti

LabelTesti programında kullanılan add metodu Lable’i Container sınıfına(Appletin alt sınıfı
olduğu) bağlar, diğer deyimle applete ilave eder.
ww

7.3 Button (Düğme) sınıfı

Button (düğme) basılınca belirli işlemlerin yapılmasını başlatan bir sınıftır. Graphic arabirim
kullanım (GUI) programlarını veya Applet programlarını konsol programlarından ayıran en
önemli özellik, GUI lerin işlem kökenli olmasıdır. Diğer bir deyimle kullanıcının başlatacağı
işlemleri yapar ve kullanıcının yeni bir işlem tanımlamasını beklerler. Bu işlemleri yapan

143
144

sınıflar [Link] kütüphanesinde tanımlanmıştır. Bu kütüphanede en çok


kullanacağımız sınıflar hiyerarşi düzeninde şöyle verilebilir :

m
[Link]
• [Link]
1. ActionEvent // Bir dügme(Button) basıldığında,Listeden (List) iki klikle bir
seçim yapıldığında veya menuden seçim yapıldığında kullanılır.
2. AdjustmentEvent // asağı yukarı kaydırma cubugunda (scroll bar) bir işlem

o
yapıldığında kullanılır.
3. ItemEvent // List veya CheckBox kliklendiginde (bir kere) kullanılır
4. ComponentEvent //appletteki elemanların gizlenmesi, boylarının değiştirilmesi,
veya değişik yerlere alınması amacıyla kullanılır.

i.c
4.1 ContainerEvent //Containera(applete) yeni bir eleman eklenilir veya
çıkarılırken kullanılır.
4.2 FocusEvent//herhangi bir applet elemanı kullanılmaya baslandıgında on plana
cıkarılmakk, ve kullanılmadıgında arka plana atılmak istendiğinde kullanılır.
4.3 PaintEvent
4.4 WindowEvent//pencere acılıp kapandığında,kücültülüp büyütüldüğünde vb.
4.5 InputEvent

dil
4.5.1 KeyEvent//keyboarddan bir girdi alındığında kullanılır
4.5.2 MouseEvent//mouse dan bir girdi alındığında kullanılır
Kullanıcı bir applet programı yazarken dinleme ile ilgili iki işlem yapar ilk işlem herhangi bir
GUI dan bir girdi olup olmadığını dinlemek olduysa kaydetmek ikincisi ise bu işlemin sebep
olacağı işlemleri oluşturmaktır. Dinleme işlemini yapan metodlar şunlardır :
[Link]
1. ActionListener
va
2. AdjustmentListener
3. ComponentListener
4. ContainerListener
5. FocusListener
6. ItemListener
7. KeyListener
ja

8. MouseListener
9. MouseMotionListener
10. TextListener
11. WindowListener
w.

Bu metotların birçoğunu ilgili orneklerde yeri geldiğinde kullanacağız. Şimdi aynı sonucu
veren iki button orneği ile bu kavramı biraz daha açmaya çalışalım :

import [Link];
import [Link].*;
import [Link].*;
ww

public class ButtonTesti extends Applet


{
private Button B1,B2;

public void init()


{
B1=new Button("B1");
[Link](new B1Basilinca(this));
add(B1);

144
145

B2=new Button("B2");
[Link](new B2Basilinca(this));

m
add(B2);
}
}

class B1Basilinca implements ActionListener


{
Applet applet;

o
public B1Basilinca(Applet a) {applet=a;}

public void actionPerformed(ActionEvent e)

i.c
{
[Link](" "+[Link]()+"dugmesine basildi");
}

class B2Basilinca implements ActionListener


{

dil
Applet applet;

public B2Basilinca(Applet a) {applet=a;}

public void actionPerformed(ActionEvent e)


{
[Link](" "+[Link]()+"dugmesine basildi");
}
va
}
ja

Şekil 7.3.1 [Link] sınıfı ve sonuçlarının appletde görünmesi

import [Link];
w.

import [Link].*;
import [Link].*;

public class ButtonTesti1 extends Applet implements ActionListener


{
private Button B1,B2;

public void init()


ww

{
B1=new Button("B1");
[Link](this);
add(B1);
B2=new Button("B2");
[Link](this);
add(B2);
}

145
146

public void actionPerformed(ActionEvent e)


{

m
if([Link]()==B1)
{showStatus(" "+[Link]()+"dugmesine basildi");}
else if([Link]()==B2)
{showStatus(" "+[Link]()+"dugmesine basildi");}
}

o
Şekil 7.3.2 [Link] sınıfı (sonuclar [Link] ile aynıdır)

Birinci programda düğmelere basıldığında oluşan eylemler (showStatus köşesine basılan

i.c
düğmeyi yazdırma) ayrı sınıflarda yaptırılmış ve Applet sınıfı üzerinden bizim ButtonTesti
sınıfına aktarılmıştır. İkinci programda ise aynı işlemler tek bir sınıfın içerisinde yer almıştır.

Programdan da görülecegi gibi düğme basma eylemi ActionEvent sınıfı üzerinden


aktarılmıştır.

dil
7.4 TextField(YazımAlanı) sınıfı

TextField bir satırlık yazım alanlarıdır. TextField’in metotları aşağıda verilmiştir :

1. Kurucu Metodlar :
public TextField()
public TextField(int satırsayısı) // satır sayısı uzunluğunda bir yazı kutusu açar.
va
public TextField(String s) // s uzunluğunda bir yazı kutusu açr ve s yi içine yazar
public TextField(String s,int satırsayısı) ) // satır sayısı uzunluğunda bir yazı
kutusu açr ve s yi içine yazar
2. Diğer Metotlar:
Public void setEchoChar(char c) // kutudaki gerçek yazıyı gizleyerek onun yerine c
karacter değişkenini yazar.
Public void setEditable(boolean b) //kutunun içine yazılan yazının degiştirileblmesini
ja

sağlar veya engeller b=true yazı yazılabilir b=false yazı yazılamaz.

Bu metotların kullanımını yine bir program örneğiyle izleyelim :

import [Link];
w.

import [Link].*;
import [Link].*;

public class TextFieldTesti extends Applet implements ActionListener


{
private TextField T1,T2,T3,T4;

public void init()


ww

{
setBackground([Link]);
//bos textField
T1=new TextField();
[Link](this);
add(T1);
T2=new TextField("Buraya yazi yaziniz");
[Link](this);
add(T2);

146
147

T2=new TextField("gizli yazi");


[Link]('*');

m
[Link](this);
add(T2);
T3=new TextField("gizli yazi");
[Link](false);
add(T3);
}

o
public void actionPerformed(ActionEvent e)
{
showStatus("Yazi : "+[Link]());
}

i.c
}

dil
ja va

Şekil 7.4.1 [Link] programı ve sonuçlarının appletde görünümü


w.

Bu programda her yazı alanına (TextField) addActionListener metodu eklenmiş ve bir yazı
girildiğinde actionPerformed metodundaki showStatus metodu yoluyla en son girilen yazı
showStatus penceresine aktarılmıştır.

7.5 TextArea(YazımAlanı) sınıfı


ww

Text Area sınıfı yapı olarak TextField sınıfına benzer. En onemli farkı bir satır yerine birden
fazla satır girdi alabilme olasılığıdır. TextField ve TextArea sınıfları TextComponent sınıfının
alt sınıflarıdır. Bu yüzden üstte belirttiğimiz
Public void setEchoChar(char c) // kutudaki gerçek yazıyı gizleyerek onun yerine c
karacter değişkenini yazar.
Public void setEditable(boolean b) //kutunun içine yazılan yazının degiştirileblmesini
sağlar veya engeller b=true yazı yazılabilir b=false yazı yazılamaz.

147
148

Metotları burada da aynen geç[Link]’nınkurucu metotlarıda şöyledir:


public TextArea()

m
public TextArea(int sütun,int satır)
sütun x satır boyutunda yazı alanı tanımlar
public TextArea(String s)
String değişkeni s nin boyuna göre yazı alanı tanımlar ve s yi içine yazar.
public TextArea(String s,int sütun,int satır)

o
sütun x satır boyutunda yazı alanı tanımlar ve s yi içine yazar
public TextArea(String s,int sütun,int satır,int scrollbar)
scroll bar (kontrolçubuğu) değişkeni şu değerleri alabilir :
SCROLLBARS_BOTH

i.c
Hem yatay hemdüşey kontrol çubuğu tanımlar
SCROLLBARS_HORİZONTAL_ONLY
Yatay kontrol çubuğu tanımlar
SCROLBARS_NONE
Kontrol çubuğu tanımlamaz
SCROLLBARS_VERTİCAL_ONLY
Düşey kontrol çubuğu tanımlar

import [Link];
import [Link].*;
dil
Şimdi TextArea metodunu Küçük bir örnekte kullanalım :

public class TextAreaTesti extends Applet


{
private TextArea T1;
public void init()
va
{
setBackground([Link]);
//bos textField
String s="buraya denemek icin\nyazi yazildi\n\t sonrada bu yazi
aktarildi";
//not \n satirbasi kontrolu
// \t bir sonraki tab setine git
T1=new TextArea(s,5,40);
ja

add(T1);
}
}

Şekil 7.5.1 [Link] Programı


Bu programda gördüğünüz \n ve \t string komutlarıdır. Alt satıra geç ve gelecek tab noktasına
w.

git anlamına gelir Bu komutlar aslında c dilinden alınmadır ve c dilindeki tüm \ komutları
java stringlerinde de geçerlidir.

Şimdi TextArea metodunu biraz daha kompleks bir programda kullanalım


ww

import [Link];

148
149

import [Link].*;
import [Link].*;

m
public class TextAreaTesti1 extends Applet
implements ActionListener,TextListener
{
private TextArea T1,T2;
private Button kopye;
public void init()
{
setBackground([Link]);

o
//bos textField
String s="buraya denemek icin\nyazi yazildi\n\t sonrada bu yazi aktarildi";
//not \n sat rbaŸ kontrol
// \t bir sonraki tab setine git
T1=new TextArea(s,5,20,TextArea.SCROLLBARS_NONE);

i.c
[Link](this);
add(T1);
kopye=new Button("Kopye >>>");
[Link](this);
add(kopye);
T2=new TextArea(5,20);
[Link](false);
add(T2);
}

dil
public void actionPerformed(ActionEvent e)

// T1 penceresinden seçilen yazıyı


// kopye düğmesine basıldığında T2 penceresine aktar
[Link]([Link]());
}
public void textValueChanged(TextEvent e)
{
//Birinci pencereye yeni yazı yazıldığında ikinci pencereye aktar
va
TextComponent kaynak=(TextComponent)([Link]());
[Link]([Link]());
}
}
ja
w.
ww

Şekil 7.5.3-7.5.4 [Link] Programı ve sonuçlarını gösteren appletler

149
150

Bu programda TextListener kullanıldığından textValueChange metodu da kullanılmıştır.


Buradaki metot birinci kutuya yazılan yazıyı ikinci kutuya kopyalamaktadır.

m
Kopye düğmesine basılınca ise sadece [Link]() metoduyla secilmiş olan text
actionPerforned metodu üzerinden T2 Yazım Alanına (TextArea) aktarılmaktadır.

7.6 Choice (Seçim) sınıfı

o
Choice (Seçim) sınıfı birden fazla maddeden seçim yapılması gerektiğinde kullanılan bir
sınıftır.
Choice sınıfının kurucu metodu ve diger metotlarının listesi aşağıda verilmiştir :
public Choice() // Kurucu metot

i.c
public String getItem(int indeks)
İndeksteki seçimi verir
public synchronised void add(String s)
verilen Stringi Chice listesine ekler.
public synchronised String getSelectedItem()
Fareyle seçilmiş olan liste elemanını verir
public synchronised String insert(String s, int indeks)

verilen stringi listeden siler


dil
verilen stringi listeye indeks sırasındaki madde olarak ekle
public synchronised void remove(String s)

Choice (Seçim) sınıfını bir programda kullanalım :

import [Link].*;
va
import [Link];
import [Link].*;

public class ChoiceTesti extends Applet


{
private Choice F;
private TextField T;
public void init()
ja

{
F=new Choice();
[Link]("MonoSpaced"); // Courier
[Link]("SansSerif"); // Helvetica
[Link]("Serif"); // Times
T=new TextField([Link](0),30);
w.

[Link](false);
[Link](new Font([Link](0),[Link],12));
[Link](new FontIsmiKontrolu(T));
[Link](new TextFieldKontrolu(T));
add(F);
add(T);
}
}
ww

class FontIsmiKontrolu implements ItemListener


{
private Component C;
public FontIsmiKontrolu(Component C)
{
this.C=C;
}
public void itemStateChanged(ItemEvent e)

150
151

{
[Link](new Font([Link]().toString(),

m
[Link]().getStyle(),
[Link]().getSize()));
}
}

class TextFieldKontrolu implements ItemListener


{

o
private TextField T;
public TextFieldKontrolu(TextField T)
{
this.T=T;

i.c
}

public void itemStateChanged(ItemEvent e)


{
Choice C=(Choice)[Link]();
[Link]("Indeks : "+ [Link]()+"; Font : "+[Link]());
}
}

dil
Sekil 7.6.1 [Link] programı

Choice seçimlerini yukarıdaki [Link] de de görüleceği gibi


aktarılırken ItemListener ve ItemEvent kullanılmıştır. Bu metodla
kullanılması gereken method ItemStateChanged metodudur.
ja va
w.
ww

Sekil 7.6.2 [Link] programının sonuçlarının appletde görülmesi

7.7 CheckBox ve CheckBoxGroup sınıfları

Check box ve CheckBoxGroup sınıfları çesitli opsiyonlar arasından seçim yapabilme


olasılığını sağlayan sınıflardır.
Kurucu metotları :
Public CheckBox(String s)

151
152

Tek bir kare kontrol kutusu oluşturur. Kontrol kutusu başta boştur
Public CheckBox(String s, CheckBoxGroup c,boolean durum)

m
Tekbir daire şeklinde kontrol kutusu oluşturur ve bu kontrol kutusunu CheckBoxGroup
nesnesine ilave eder.
Public CheckboxGroup()
CheckboxGroup nesnesini oluşturur bu gruba checkboxlar ilave edilebilir

o
CheckBox kullanımını anlamak amacıyla [Link] programına göz atalım :

import [Link];
import [Link].*;

i.c
import [Link].*;

public class CheckBoxTesti extends Applet implements ItemListener


{
private TextField T;
private Checkbox Kalin,Italic;

public void init()

dil
{
setBackground([Link]);
//bos textField
T=new TextField("Buradaki yazinin degismesini izleyiniz");
add(T);
Kalin=new Checkbox("Kalin");
[Link](this);
add(Kalin);
Italic=new Checkbox("Italik");
va
[Link](this);
add(Italic);
}

public void itemStateChanged(ItemEvent e)


{
int KalinAyari;
if([Link]())
ja

{KalinAyari=[Link];}
else
{KalinAyari=[Link];}
int ItalicAyari;

if([Link]())
w.

{ItalicAyari=[Link];}
else
{ItalicAyari=[Link];}
[Link](new Font("Serif",KalinAyari+ItalicAyari,14));
}

}
ww

Şekil 7.7.1 [Link] programı

152
153

o m
i.c
Şekil 7.7.2 [Link] programının sonuçlarının appletde görülmesi

Şimdi de checkBoxGroup programının çalışmasını ornekleyen RadioButtonTesti programına


göz atalım.

import [Link];
import [Link].*;
import [Link].*;
dil
public class RadiobuttonTesti extends Applet implements ItemListener
{
private TextField T;
va
private Font NormalFont,KalinFont,ItalicFont,KalinItalicFont;
private Checkbox Normal,Kalin,Italic,KalinItalic;
private CheckboxGroup fontGurubu;

public void init()


{
setBackground([Link]);
//bos textField
ja

T=new TextField("Buradaki yazinin degismesini izleyiniz");


add(T);
fontGurubu=new CheckboxGroup();
Normal=new Checkbox("Normal",fontGurubu,true);
[Link](this);
add(Normal);
w.

Kalin=new Checkbox("Kalin",fontGurubu,true);
[Link](this);
add(Kalin);
Italic=new Checkbox("Italik",fontGurubu,true);
[Link](this);
add(Italic);
KalinItalic=new Checkbox("Kalin Italik",fontGurubu,true);
[Link](this);
ww

add(KalinItalic);
NormalFont=new Font("Serif",[Link],14);
KalinFont=new Font("Serif",[Link],14);
ItalicFont=new Font("Serif",[Link],14);
KalinItalicFont=new Font("Serif",[Link]+[Link],14);
[Link](NormalFont);
}
public void itemStateChanged(ItemEvent e)
{

153
154

int KalinAyari;
if([Link]()== Normal)

m
{[Link](NormalFont);}
else if([Link]()== Kalin)
{[Link](KalinFont);}
else if([Link]()== Italic)
{[Link](ItalicFont);}
else if([Link]()== KalinItalic)
{[Link](KalinItalicFont);}

o
}
}

i.c
dil
va
Şekil 7.7.3 [Link] programı ve sonuçlarının applette gösterilmesi

7.8 Mouse(Fare) kontrolu

Modern bilgisayarlarda bilgisayar işlemlerinin çok büyük bir kısmı mouse (fare) ile kontrol
edilir. Javada temel fare kontrollarını sağlayan sınıflar MouseListener ve
ja

MouseMotionListener sınıflarıdır.

Bu sınıfların en çok kullanılan metotları şunlardır :


1. MouseListener Metotları :
public void mousePressed(MouseEvent e)
w.

bir mouse düğmesi basılınca çağırılır


public void mouseClicked(MouseEvent e)
bir mouse düğmesi basılıp bırakılırsa çağırılır.
public void mouseReleased(MouseEvent e)
Bir mouse düğmesi basılı olarak mouse çekildikten sonra düğme bırakılınca çağırılır.
public void mouseEntered(MouseEvent e)
mouse pencere içine girince çağırılır.
ww

public void mouseExited(MouseEvent e)


mouse pencere çerçevesinin dışındaysa çağırılır.
2. MouseMotionListener Metotları
public void mouseDragged(MouseEvent e)
Mouse düğmesi basılı iken mouse hareket ettirilirse çağırılır
public void mouseMoved(MouseEvent e)
Mouse hareket ederse çağırılır.

154
155

Bu metotların kullanımlarını göstermek amacıyla [Link] programı aşağıda verilmiştir.

m
import [Link];
import [Link].*;
import [Link].*;

o
public class FareTesti extends Applet
implements MouseListener, MouseMotionListener
{
private int nx,ny=-10;
private String s="";

i.c
public void init()
{
addMouseListener(this);
addMouseMotionListener(this);
}

public void paint(Graphics g)


{

dil
[Link](s+"["+nx+","+ny+"]",nx,ny);
}

public void degerleriGir(String e,int x,int y)


{
s=e;
nx=x;
va
ny=y;
repaint();
}

//fare dinleyicisinin dinledikleriyle ilgili cikti metodlari


public void mouseClicked(MouseEvent e)
{ degerleriGir("Kliklendi",[Link](),[Link]()); }
public void mousePressed(MouseEvent e)
ja

{ degerleriGir("Basildi",[Link](),[Link]()); }
public void mouseReleased(MouseEvent e)
{ degerleriGir("Birakildi",[Link](),[Link]()); }
public void mouseEntered(MouseEvent e)
{ showStatus("Fare applet alani icinde"); }
public void mouseExited(MouseEvent e)
w.

{ showStatus("Fare applet alani disinda"); }


//MouseMotionListener (fare hareket dinleyicisi) metotlari
public void mouseDragged(MouseEvent e)
{ degerleriGir("basilip cekiliyor",[Link](),[Link]()); }
public void mouseMoved(MouseEvent e)
{ degerleriGir("hareket halinde",[Link](),[Link]()); }

}
ww

155
156

7.9 List sınıfı, listeden seçim

m
List sınıfı bir listeden seçim yapmaya ve bu seçim sonucu gerekli işlemleri
oluşturmaya yarar. IemListener ve ActionListener sınıf implementlerini
kullanır.

import [Link];

o
import [Link].*;
import [Link].*;

public class ListTesti extends Applet


implements ActionListener,ItemListener

i.c
{
private List renkListesi;
private String renkIsmi[]={"Siyah","Mavi","Cam Gobegi","Koyu Gri","Gri",
"Yesil","Acik gri","Mor","Portakal","Pembe","Kirmizi","Beyaz","Sari"};
private Color C[]={[Link],[Link],[Link],[Link],
[Link],[Link],[Link],[Link],[Link],
[Link],[Link],[Link],[Link]};

dil
public void init()
{
//Ekranda 5 isim g”r lebilecel bir liste ac
//ayn ismi birden fazla tekrarlama
renkListesi=new List(5,false);
[Link](this);
[Link](this);
//listeye ekle
va
for(int i=0;i<[Link];i++)
{
[Link](renkIsmi[i]);
}
add(renkListesi);
}

public void actionPerformed(ActionEvent e)


{
ja

setBackground(C[[Link]()]);
repaint();
}

public void itemStateChanged(ItemEvent e)


{
w.

showStatus([Link]()+"; indeks : "+


[Link]());
}

}
ww

156
157

m
Şekil 7.9.1 [Link] programı ve sonuçların appletviewer da görünümü

7.10 FlowLayout sınıfı kullanarak GUI formatlanması

Flow layout sınını appletde tyer alan GUI lerin sag dol ve ortada formatlanmasını saglar.
Kurucu metodu şu şekillerde tanımlanır :

o
public Flowlayout()
public Flowlayout(int formatbolgesi)
formatbolgesi [Link], [Link] veya [Link]

i.c
değerlerini alabilir.
public Flowlayout(int formatbolgesi,int yatay_bosluk,int dikey_bosluk)
formatbolgesi [Link], [Link] veya [Link]
değerlerini alabilir. Yatay_bosluk pixel olarak yatay posisyonda elemanlar arasında kalan
boslugu gosterir. Dikey bosluk ise dikey dogrultudaki pixel olarak boşluktur.

Küçuk bir örnek problemle FlowLayout kullanımını daha açık hale getirebiliriz.

import [Link];
import [Link].*;
import [Link].*;
dil
public class FlowLayoutTesti extends Applet implements ActionListener
{
private Button B[];
va
public void init()
{
B=new Button[3];
B[0]=new Button("Sol");
B[1]=new Button("Orta");
B[2]=new Button("Sag");
for(int i=0;i<[Link];i++)
{
ja

B[i].addActionListener(this);
add(B[i]);
}
}
public void actionPerformed(ActionEvent e)
{
w.

int pozisyon=[Link];;
if([Link]()==B[0])
{
pozisyon=[Link];
}
else if([Link]()==B[1])
{
pozisyon=[Link];
ww

}
else if([Link]()==B[2])
{
pozisyon=[Link];
}
setLayout(new FlowLayout(pozisyon));
validate();
}
}

157
158

o m
i.c
dil
Şekil 7.10.1 FlowLayout sınıfı ve sonuçlarının Appletde görülmesi

7.11 BorderLayout sınıfı kullanarak GUI formatlanması


BorderLayout sınıfı GUI elemanlarını beş bolgeye ayırarak guruplar,
kuzey(NORTH), güney(SOUTH), dogu(EAST),Batı(WEST),orta(CENTER), Kuzey
Appletin üst ısmı anlamına gelir. BorderLAyout sınıfının kurucu metodları
şunlardır :
va
public BorderLayout()
public BorderLayout(int yatay_bosluk,int dikey_bosluk);
yatay_bosluk ve dikey_basluk pixel olarak alınır. GUI elemanlarının
arasındaki bosluk miktarını tanımlar.
Şimdi bir örnekle sınıfı açıklamaya çalışalım.

import [Link];
import [Link].*;
ja

import [Link].*;

public class BorderLayoutTesti extends Applet implements ActionListener


{
private Button B[];
private String S[]={"Kuzeyi Gizle","Guneyi Gizle","Doguyu Gizle",
w.

"Batiyi Gizle","Ortayi Gizle"};


public void init()
{
setLayout(new BorderLayout(5,5));
B=new Button[5];
for(int i=0;i<[Link];i++)
{
B[i]=new Button(S[i]);
ww

B[i].addActionListener(this);
}
add(B[0],[Link]);
add(B[1],[Link]);
add(B[2],[Link]);
add(B[3],[Link]);
add(B[4],[Link]);
}

158
159

public void actionPerformed(ActionEvent e)


{

m
for(int i=0;i<[Link];i++)
{
if([Link]()==B[i])
B[i].setVisible(false);
else B[i].setVisible(true);
}
validate();

o
}
}

Şekil 7.11.1 [Link] programı

i.c
dil
ja va
w.
ww

159
160

o m
i.c
Şekil 7.11.2 [Link] programının sonuçlarının applette görulmesi

7.12 GridLayout sınıfı kullanarak GUI formatlanması

dil
GridLayout sınıfı appleti eşit boyutta gridlere böler ve her grid elemanının içine bir GUI
yerleştirilebilmesine olanak sağlar. GridLayout sınıfının kurucu metodları şöyledir :
public GridLayout(int satırlar,int sütunlar)
publicGridLayout(int satırlar,int sütunlar,
int yatay_bosluk,int dikey_bosluk);
yatay_bosluk ve dikey_basluk pixel olarak alınır. GUI elemanlarının
arasındaki bosluk miktarını tanımlar.
va
Şimdi bir örnekle sınıfı açıklamaya çalışalım.

import [Link];
import [Link].*;
import [Link].*;

public class GridLayoutTesti extends Applet


{
ja

private Button B[];


private String S[]={"1","1","3",
"4","5","6"};
public void init()
{
setLayout(new GridLayout(3,2,5,5));
w.

B=new Button[6];
for(int i=0;i<[Link];i++)
{
B[i]=new Button(S[i]);
add(B[i]);
}
}
}
ww

160
161

Şekil 7.12.1 [Link] programı ve sonuçlarının applette görulmesi

m
7.13 Panel sınıfı

Daha kompleks formatlamalara gereksinme duyulduğunda panel sınıfını kullanabiliriz. Panel


sınıfı applete yerleştirebileceğimiz alt bolgeler oluşturur. Hemen bir ornekle paneli nasıl
kulandığımızı açıklamaya çalışalım.

o
import [Link];
import [Link].*;
import [Link].*;

i.c
public class Paneltesti extends Applet
{
private Panel buttonPanel;
private Button buttons[];
public void init()
{
buttonPanel=new Panel();
buttons=new Button[5];

dil
[Link](new GridLayout(1,[Link]));
for(int i=0;i<[Link];i++)
{
buttons[i]=new Button("Button "+(i+1));
[Link](buttons[i]);
}
setLayout(new BorderLayout());
add(buttonPanel,[Link]);
}
va
}
ja

Şekil 7.13.1 [Link] programı ve sonuçlarının applette görulmesi


w.

Şu ana kadarki format örneklerinde anlatımı basitleştirmek amacıyla hep


düğmeler (button) kullandık. Şimdi de başka bir problemde Layout sınıfının
kullanılmasına bakalım :

import [Link].*;
import [Link];
ww

import [Link].*;

public class PolinomunKokleri extends Applet implements ActionListener


{
// polinom a*x^2+b*x+c=0
private Panel YaziPaneli;
Label prompt1;
Label prompt2;

161
162

Label prompta;
TextField inputa; //

m
Label promptb; //
TextField inputb; //
Label promptc; //
TextField inputc; //
double a,b,c; //polinomun katsayilari
double delta=0.0; //determinant
double x1,x2; //kokler

o
public void init()
{

i.c
setBackground([Link]);
YaziPaneli=new Panel();
[Link](new Font("Serif",[Link],12));
[Link]( new GridLayout(4,2) );
prompt1=new Label("a*x^2+b*x+c = 0");
prompt2=new Label("Polinomunun kokleri");
prompta=new Label(" a : ");
inputa =new TextField(5);

dil
[Link](this);
promptb=new Label(" b : ");
inputb =new TextField(5);
[Link](this);
promptc=new Label(" c : ");
inputc =new TextField(5);
[Link](this);
[Link](prompt1);
[Link](prompt2);
va
[Link](prompta);
[Link](inputa);
[Link](promptb);
[Link](inputb);
[Link](promptc);
[Link](inputc);
add(YaziPaneli);
}
ja

public void paint(Graphics g)


{
[Link]([Link]);
[Link](new Font("Serif",[Link],14));
w.

[Link]("Polinomun Kokleri: ",70,175);


[Link]([Link]);
[Link](new Font("Serif",[Link],12));
if(delta<0)
{
[Link]("Kok 1 :"+(-b/2.0/a)+"+ i* "+[Link](-
delta)/2.0/a,100,190 );
[Link]("Kok 2 :"+(-b/2.0/a)+"- i* "+[Link](-
ww

delta)/2.0/a,100,205);
}
if(delta==0)
{
[Link]("Kok 1 :"+(-b/2.0/a),100,190 );
[Link]("Kok 2 :"+(-b/2.0/a),100,205 );
}
if(delta>0)
{

162
163

x1=-b/2.0/a+[Link](delta)/20/a;
x2=-b/2.0/[Link](delta)/2.0/a;

m
[Link]("Kok 1 :"+x1,100,190 );
[Link]("Kok 2 :"+x2,100,205);
}
}

public void actionPerformed( ActionEvent e)


{

o
Double sayi1=new Double([Link]() );
Double sayi2=new Double([Link]() );
Double sayi3=new Double([Link]() );
a=[Link]();

i.c
b=[Link]();
c=[Link]();
delta=b*b-4.0*a*c;
repaint();
}
}

dil
ja va

Şekil 7.13.2 İkinci dereceden denklemin koklerini hesaplayan [Link]


programı ve sonuçlarının applette görulmesi
w.

JAVA PROGRAMLAMA DİLİ


HAFTA 11

Bu haftaki incelenecek programlar :

LABELT~1 JAV 428 22/06/98 23:49 [Link]


ww

BAYAGI~1 JAV 7.866 22/06/98 23:21 [Link]


BUTTON~1 JAV 807 23/06/98 0:31 [Link]
TEXTFI~1 JAV 686 23/06/98 0:45 [Link]
CHECKB~1 JAV 847 23/06/98 1:32 [Link]
FARETE~1 JAV 1.258 23/06/98 2:08 [Link]

Bu haftaki Alıştırmalar

ALISTIRMA 1

163
164

[Link] programını ve gecen hafta incelediğimiz cizgiciz programını birleştirerek

m
fareyi kallanarak ekrana cizgi çizdiriniz (cizginin baslangic ve bitis noktaları fare tarafindan
belirlenecektir)

ALISTIRMA 2

o
[Link] programını ve gecen hafta incelediğimiz drawRect metodunu birleştirerek
fareyi kallanarak ekrana dikdortrtgen çizdiriniz (dikdortgenin baslangic ve bitis noktaları fare
tarafindan belirlenecektir)

i.c
ALISTIRMA 3

[Link] programını ve gecen hafta incelediğimiz drawOval metodunu birleştirerek


fareyi kallanarak ekrana daire çizdiriniz (dairenin merkezi ve capı fare tarafindan
belirlenecektir)

HAFTA 12
JAVA PROGRAMLAMA DILI

Bu haftaki incelenecek dosyalar

PANELT~1 JAV 527


dil
30/06/98 6:52 [Link]
va
RADIOB~1 JAV 1.473 25/06/98 17:57 [Link]

ALIŞTIRMA 1

Appletin alt bölgesinde(SOUTH) iki sıra, her sırada beşer dügmeden on düğme bulunan bir applet oluşturunuz..
Appletin tepesinde bir TextField oluşturunuz. Her dügmeye basıldığında textfieldde degişik bir yazı görünsün.
Yazıları 2x5 lik bir String değişkeninden okuyarak Text fielde yükleyiniz.
ja

import [Link];
import [Link].*;
import [Link].*;

public class Panel10 extends Applet implements ActionListener


{
w.

private Panel buttonPanel;


private Button buttons[];
String s[]=
{"Birinci Butona Basildi",
"Ikinci Butona Basildi",
"Ucüncü Butona Basildi",
"Dordüncü Butona Basildi",
ww

"Besinci Butona Basildi",


"Altinci Butona Basildi",
"Yedinci Butona Basildi",
"Sekizinci Butona Basildi",
"Dokuzunccu Butona Basildi",
"Onuncu Butona Basildi"};
TextField T;
public void init()
{

164
165

T=new TextField(s[0]);

m
buttonPanel=new Panel();
buttons=new Button[10];
[Link](new GridLayout(2,[Link]/2));
for(int i=0;i<[Link];i++)
{
buttons[i]=new Button("Button "+(i+1));
buttons[i].addActionListener(this);

o
[Link](buttons[i]);
}
setLayout(new BorderLayout());
add(buttonPanel,[Link]);

i.c
add(T,[Link]);
}

public void actionPerformed(ActionEvent e)


{
for(int i=0;i<[Link];i++)
{ if([Link]()==buttons[i]) [Link](s[i]);}
validate();

dil
}

}
ja va

8. JAVADA HATA ANALİZİ VE YAKALANMASI

Javada diğer dillerden farklı olarak dil yapısının içinde hataları yakalamak için oldukça
gelişmiş bir sistem mevcuttur. Eger javada kontrol edilmemiş bir hata oluşursa program durur
w.

ve hatayı yazar. Biz hata oluştuğunda hata kontrol sisteminde hatayı kontrol edip programı
çalıştırmaya devam edebiliriz. Javadaki hata kontrol bloğu şu şekilde yazılır :

try { java deyimleri;


java kaynaklarından herhangi birini kullanan deyimler
}
ww

catch( herhangibirtürException e1)


{ exception kontrol deyimleri }
catch( diğerherhangibirtürException e1)
{ exception kontrol deyimleri }
finally
{
deyimler

165
166

java kaynağını serbest bırakma deyimleri


}

m
Javadaki Exception türleri aşağıdaki listede verilmiştir :

[Link] hata listesi

o
AbstractMethodError
ClassCircularityError
ClassFormatError
Error

i.c
ExceptionInInitializerError
IllegalAccessError
IncompatibleClassChangeError
InstantiationError
InternalError
LinkageError
NoClassDefFoundError
NoSuchFieldError
NoSuchMethodError
OutOfMemoryError
StackOverflowError
ThreadDeath
UnknownError
UnsatisfiedLinkError
dil
va
VerifyError
VirtualMachineError
[Link] Exception listesi
ArithmeticException
ArrayIndexOutOfBoundsException
ArrayStoreException
ja

ClassCastException
ClassNotFoundException
CloneNotSupportedException
Exception
IllegalAccessException
w.

IllegalArgumentException
IllegalMonitorStateException
IllegalStateException
IllegalThreadStateException
IndexOutOfBoundsException
InstantiationException
InterruptedException
ww

NegativeArraySizeException
NoSuchFieldException
NoSuchMethodException
NullPointerException
NumberFormatException
RuntimeException
SecurityException

166
167

StringIndexOutOfBoundsException

m
[Link] exception listesi

EmptyStackException
MissingResourceException
NoSuchElementException

o
TooManyListenersException

[Link] exception listesi

i.c
CharConversionException
EOFException
FileNotFoundException
IOException
InterruptedIOException
InvalidClassException
InvalidObjectException
NotActiveException
NotSerializableException
ObjectStreamException
OptionalDataException
StreamCorruptedException
SyncFailedException
dil
va
UTFDataFormatException
UnsupportedEncodingException
WriteAbortedException
Şekil 8.1 Java hata ve exception listesi

Java hata oluştuğununda hatanın oluştuğu metodun girişinde kullanılan throws kelimesini
ja

takip eden Exception sınıfıyla aynı exception gurubunu yaşıyan try-catch gurubuna aktarır.
Bu metodun içinde gerekli noktada (hatanın oluşacağı şartda) throw deyimi kullanılarak hata
oluştuğu aktarılır ve bu aktarım try-catch gurubu tarafından yakalanır ve işleme alınır.
w.

Hata kontrolunu daha iyi açıklayabilmek amacıyla bir örnek vermek istiyoruz.
SifiraBölünmeException sinifinda yeni bir hata kontrol sinifi yaratiyoruz. Bu sinif ve java
kütüphanesinde mevcut olan tamsayı format hatası (NumberFormatException)
sifirebolmetesti programında test edilmiştir. Sonuçlar applet çıktılarında görülmektedir. Eğer
bu hatalar kontrol edilmeseydi, java programı hata vererek çalışmasını durdururdu.
Programdaki hata kontrol deyimleri kalın harfle verilmiştir. Hata kontrol bloğu ise italik
ww

olarak verilmiştir.

public class sifiraBolunmeException


extends ArithmeticException
{
public sifiraBolunmeException()
{
super("sifira bolmeye calistiniz ");
}

167
168

m
Şekil 8.2 Bizim tarafımızdan oluşturulan [Link] hata kontrolü
programı

import [Link];
import [Link].*;
import [Link].*;

o
import [Link];
import sifiraBolunmeException;

public class sifirebolmetesti extends Applet implements ActionListener

i.c
{
private Label L1,L2;
private TextField T1,T2;
private int sayi1,sayi2;
private double sonuc;

public void init()


{

dil
sayi1=0;
sayi2=1;
L1=new Label("Payi gir : ");
L2=new Label("Paydayi gir : ");
T1=new TextField(10);
T2=new TextField(10);
[Link](this);
add(L1);
add(T1);
va
add(L2);
add(T2);
}

public double bol(int s1,int s2) throws sifiraBolunmeException


{
if(s2==0) throw new sifiraBolunmeException();
ja

return (double) s1/s2;


}

public void actionPerformed(ActionEvent e)


{
w.

DecimalFormat hassaslik3=new DecimalFormat("#.000");


try{
sayi1=[Link]([Link]());
sayi2=[Link]([Link]());
[Link]("");
[Link]("");
sonuc=bol(sayi1,sayi2);
showStatus(sayi1+" / "+sayi2+" = "+[Link](sonuc));
ww

}
catch(NumberFormatException nfe)
{showStatus("iki tam sayi girmelisiniz.");}
catch(sifiraBolunmeException sbh)
{showStatus([Link]());}
}
}

168
169

o m
i.c
dil
Şekil 8.2 Bizim tarafımızdan oluşturulan [Link] hata kontrolü ve
sayı formatı hata kontrolü (NumberFormatException) yapan [Link]
programı ve sonuçlarının applet ekranında izlenimi

Prgramlarda da görüldüğü gibi hata programın calismasına engel olmaksızın kullanıcıya


bildirilmektedir. Bu program gurubunda once ArithmeticException sınıfından
sıfıraBolunmeException sınıfı türetilmiştir. Sonra programın içindeki
va
public double bol(int s1,int s2) throws sifiraBolunmeException
{
if(s2==0) throw new sifiraBolunmeException();
return (double) s1/s2;
}
ja

metodunda metodun once throws sifiraBolunmeException deyimiyle exception


gondereceği bildirilmiş, ve metodun içinde
if(s2==0) throw new sifiraBolunmeException();

deyimiyle exception ( hata değişkeni) gönderilmiştir. Gönderilen hata değişkeni (exception)


w.

try{
sayi1=[Link]([Link]());
sayi2=[Link]([Link]());
[Link]("");
[Link]("");
sonuc=bol(sayi1,sayi2);
showStatus(sayi1+" / "+sayi2+" = "+[Link](sonuc));
ww

}
catch(NumberFormatException nfe)
{showStatus("iki tam sayi girmelisiniz.");}
catch(sifiraBolunmeException sbh)
{showStatus([Link]());}
}
}

gurubu tarafından yakalanmış, ve eğer sıfır hatası varsa

169
170

catch(sifiraBolunmeException sbh) deyimi tarafından yakalanmiş ve

m
showStatus("iki tam sayi girmelisiniz."); işlemini çağırmıştı bu işlem
sonunda applet sifiraBolunmeException sınıfının toString metodunu
kullanarak
sifiraBolunmeException:sıfıra bolmeye calıstınız
mesajını vermiştir.

o
Ayrıca yukardaki program parçacığında da görüldüğü gibi programımız aynı zamanda
NumberFormatException nfe terimiyle integer olan rakamımızın integer olarak gönderilip
gönderilmediğini kontrol etmektedir. Bu exception java küyüphanesindeki parsInt metodu

i.c
tarafından gönderilmektedir.

dil
ja va
w.
ww

170
171

10. PARELEL KULLANIM (MULTITHREADING)

m
İşlemleri tek tek sırayla ve iyi bir şekilde yapabilseydik belki de ok mükemmel sonuçlar
alabilirdik. Fakat Dünyadaki hemen hemen hiçbirşey tek tek sırayla çalışmaz. İnsan vücudu
da dajhil bir çok doğal sistemler paralel olark çalışır. Yani bir işlem yapılırken parelelinde
diğer bir işlem yapılmaya devam eder. Bizim şu anda kullandığımız bilgisayarların büyük bir

o
bölümü tek bir işlemciye(processor) sahiptir. Birden fazla işlemciye sahip paralel
bilgisayarlarda, her bir işlemcide bir iş tanımlayarak paralel kullanım mümkündür. Fakat tek
işlemcili sistemler için(seri bilgisayar) yazılmış olan program dilleri genel olarak birden fazla
işlemin aynı anda yapılmasına izin vermezler. Modern bilgisayar dilleri arasında sadece Ada

i.c
ve Java dilleri bir işlemcide birden fazla işlemin (programın) aynı anda kullanılmasına izin
verir. C++ dili birden fazla programın aynı anda kullanılmasına izin vermez. Bu yüzden tek
kullanımlı bir programlama dilidir.

Parelel Kullanım(Multithreading) Tek bir işlemcinin birden fazla program tarafından


kullanılmasıdır. Bu kullanım CPU (merkez program işlemcisi) adını verdiğimiz temel

dil
bilgisayar işlem ünitesinin çeşitli programlar tarafından ortaklaşa kullanılması prensibine göre
yapılır. Bilgisayar CPU zamanı küçük parçalara bölünerek her parçada ayrı bir bilgisayar
programının çalışması ve diğer bilgisayar programlarının beklemesi sağlanır. Programlar
küçük paketçikler halinde program işlemcisine gönderilir ve sonuçlar tekrar hafızaya aktarılır.
Sonra ikinci bir program parçacığı işlemci belleğine gönderilir. Modern seri bilgisayarlarda
cache adı verilen bu program parçacıkları çalışırken diğer program parçacıklarını tutabilen
hizli hafıza birimleri de bulunur.Tüm bu kontrolları ve birden fazla programın tek işlemcide
va
çalışma işlemini java dilinde doğrudan programlayabiliriz.

CPU nun Parelel kullanımı Runnable interface’i veya abstract Thread sınıfıni kullanarak
gerçekleştirilir. Aşağıda Bu iki yolu kullanarak bir digital saat programı oluşturulmuştur. Bu
programlarda saat sadece tek bir program olmasına rağmen bilgisayarın belleğinde eğer
devamlı çalıştırılacak olursa başka hiçbir programın çalıştırılamıyacağı düşünülerek paralel
kullanımlı olarak verilmiştir.
ja

import [Link];import [Link];import [Link].*;import


[Link];import [Link].*;
class saatThread extends Thread
{
Applet a;
w.

public saatThread(Applet ai)


{a=ai;}
public void run()
{
while(true)
{
[Link]();
ww

try {[Link](1000);}
catch(InterruptedException e)
{[Link]([Link]());}
}
}
}

public class saat extends Applet


{
Font F;

171
172

Date D;
DateFormat df;

m
Locale tr;
saatThread r;

public void init()


{
F=new Font("TimesRoman",[Link],24);
tr=new Locale("tr","TR");

o
D=new Date();
df= [Link]([Link],tr);
r=new saatThread(this);
[Link]();

i.c
}

public void paint(Graphics g)


{
[Link](D);
D=new Date();
[Link](F);
try

dil
{
[Link]([Link](),10,50);
}
catch(NullPointerException e){}
}
}
Şekil 9.1 [Link] sınıfının thread sınıfından türemiş olarak yazılımı.
va
import [Link];import [Link];import [Link];import
[Link];
public class saat extends Applet implements Runnable{ Font theFont=new
Font("TimesRoman",[Link],24);
ja

Date theDate;
Thread runner;

public void start()


{
if(runner==null)
w.

{
runner=new Thread(this);
[Link]();
}
}

public void stop()


{
ww

if(runner!=null)
{
[Link]();
runner=null;
}
}

public void run()


{

172
173

while(true)

m
{
theDate=new Date();
repaint();
try {[Link](1000);}
catch(InterruptedException e) {}
}
}

o
public void paint(Graphics g)
{

i.c
[Link](theFont);
try
{
[Link]([Link](),10,50);
}
catch(NullPointerException e){}
}
}

dil
va
Şekil 9.1 [Link] sınıfının Runnable interface’i ile yazılımı ve applet çıktısı
ja

Programlardan da görüldüğü gibi thread adı verilen ve bilgisayar belleğinde diğer


programlarla beraber çalışmasını istediğimiz program parçacıklarını java programının içinde
başlatabiliriz(start), kontrol edebiliriz veya durdurabiliriz(stop). Program parçacığının
çalışmadan bekleyeceği sureyi de sleep metotunu kullanarak ayarlıyabiliriz.
w.

İkinci olarak biraz daha karışık bir örneğe göz atalım. Bu örnekte, iki tane program bilgisayar
belleginde aynı anda çalışacaktır. Birinci program ikinci programla ortak olarak kullanılan bir
bilgisayar int hafıza noktasına sırasıyla birden ona kadar değişen bir rakam yazacak, ikinci
program da aynı noktadan (OrtakHucreden) yazılan değeri okuyacaktır.
ww

class OrtakHucre{ public static void main(String args[]) {


TutInteger h=new TutInteger(); UretInteger p=new UretInteger(h);
KullanInteger c= new KullanInteger(h); [Link](); [Link]();
}
}

class UretInteger extends Thread


{

173
174

private TutInteger pTut;

m
public UretInteger(TutInteger h)
{
pTut=h;
}

public void run()


{

o
for(int count=0; count<10; count++)
{
[Link](count);
[Link]("OrtakInteger "+count+" degerini uretti");

i.c
try{
sleep( (int) ([Link]()*5000 ) );
}
catch(InterruptedException e)
{
[Link]("Exeption "+[Link]());
}

dil
}
}
}

class KullanInteger extends Thread


{
private TutInteger cTut;

public KullanInteger(TutInteger h)
va
{
cTut=h;
}

public void run()


{
int Intdegeri=0;
ja

while (Intdegeri !=9)


{
try{
sleep( (int) ([Link]()*5000));
}
w.

catch(InterruptedException e)
{
[Link]("Exeption "+[Link]());

}
Intdegeri=[Link](); [Link]("Kullan
Integer"+Intdegeri+" degerini okudu"); } }}
class TutInteger{ private int OrtakInt; public void setOrtakInt(int
ww

Intdegeri)
{
OrtakInt=Intdegeri;
}

public int getOrtakInt()


{
return OrtakInt;
}

174
175

m
OrtakInteger 0 degerini urettiOrtakInteger 1 degerini urettiOrtakInteger 2
degerini urettiKullan Integer2 degerini okudu
OrtakInteger 3 degerini uretti
OrtakInteger 4 degerini uretti
OrtakInteger 5 degerini uretti

o
Kullan Integer5 degerini okudu
Kullan Integer5 degerini okudu
OrtakInteger 6 degerini uretti
OrtakInteger 7 degerini uretti
Kullan Integer7 degerini okudu

i.c
OrtakInteger 8 degerini uretti
OrtakInteger 9 degerini uretti
Kullan Integer9 degerini okudu
Şekil 9.2 [Link] programı ve çıktısı

dil
import [Link].*;import [Link].*;import [Link].*;//runnable interfacei
kullanarakclass UretInteger implements Runnable { private TutInteger
pTut; private Thread thread; public UretInteger(TutInteger h) {
pTut=h;
thread = new Thread(this);
[Link]();
}
public void run() {
for(int count=0; count < 10; count++) {
va
[Link](count);
[Link]("Ortak Integer " + count+" Olarak
olusturuldu");
try {
[Link]((int)([Link]()*3000));
}
catch(InterruptedException exception) {
[Link]("Exception " + [Link]());
ja

}
}
}
}
class KullanInteger implements Runnable{
private TutInteger cTut;
w.

private Thread thread;


public KullanInteger(TutInteger h) {
cTut = h;
thread= new Thread(this);
[Link]();
}
public void run() {
int Intdegeri=0;
ww

while(Intdegeri != 9) {
try {
[Link]((int)([Link]()*3000));
}
catch(InterruptedException e) {
[Link]("Exception " + [Link]());
}
Intdegeri = [Link]();

175
176

[Link]("Kullan Integer " + Intdegeri+"degerini


yakaladi");

m
}
}
}
class TutInteger {
private int OrtakInt;
public void setOrtakInt(int Intdegeri) {OrtakInt = Intdegeri;}
public int getOrtakInt() { return OrtakInt;}

o
}

public class OrtakHucreR {


public static void main(String[] args) {

i.c
TutInteger h= new TutInteger();
new UretInteger(h);
new KullanInteger(h);
}
}
Şekil 9.3 Runnable interface’i ile çalişan [Link] sınıfı

private TextArea cikti;


public void init()
{
dil
import [Link].*;import [Link];import
[Link];public class OrtakHucreBuf extends Applet{
va
setLayout(new BorderLayout());
cikti = new TextArea();
add(cikti,[Link]);
}
public void start()
{
Tutinteger h=new Tutinteger(cikti);
Uretinteger p=new Uretinteger(h);
Consumeinteger c= new Consumeinteger(h);
ja

[Link]();
[Link]();
}
}

class Uretinteger extends Thread


w.

{
private Tutinteger pTut;
private TextArea cikti;

public Uretinteger(Tutinteger h)
{
pTut=h;
ww

public void run()


{
for(int count=0; count<10; count++)
{
[Link](count);

try{
sleep( (int) ([Link]()*500 ) );

176
177

}
catch(InterruptedException e)

m
{
[Link]("Hata : "+[Link]());
}
}
}
}

o
class Consumeinteger extends Thread
{
private Tutinteger cTut;

i.c
public Consumeinteger(Tutinteger h)
{
cTut=h;
}

public void run()


{
int intdegeri;

while (intdegeri !=9)


{
try{

}
dil
intdegeri=[Link]();

sleep( (int) ([Link]()*500));

catch(InterruptedException e)
va
{
[Link]("Hata "+[Link]());
}
intdegeri=[Link]();

}
}
}
ja

class Tutinteger
{
private int Ortakint[] = {9,9,9,9,9};
private boolean writeable = true;
private boolean okunabilir = false;
private int YerelOku =0, YerelYaz=0;
w.

private TextArea cikti;

public Tutinteger(TextArea out)


{
cikti = out;
}

public synchronized void setOrtakint(int intdegeri)


ww

{
while (!writeable)
{
try{

[Link](" Beklemede "+intdegeri);


wait();
}
catch (InterruptedException e)

177
178

{
[Link]("Hata :"+[Link]() );

m
}
}

Ortakint[YerelYaz]=intdegeri;
okunabilir = true;
[Link]("\n Uretilen "+intdegeri+" Yazilan "+YerelYaz);
YerelYaz = ++YerelYaz % 5;

o
[Link]("\t yazilan hucre "+YerelYaz+"\t okunan hucre
"+YerelOku);

i.c
printBuffer(cikti, Ortakint);

if(YerelYaz==YerelOku)
{
writeable=false;
[Link]("\nDEPOLAMA YERLER˜ DOLU ");
}
notify();

dil
}

public synchronized int getOrtakint()


{
int intdegeri;
while (!okunabilir)
{
try{
[Link](" KULLANMAK iCiN BEKLiYOR ");
va
wait();
}
catch (InterruptedException e)
{
[Link]("hata:"+[Link]() );
}
}
ja

writeable=true;
intdegeri=Ortakint[YerelOku];

[Link]("\n Kullanilan "+intdegeri+" Okundugu Hucre


"+YerelOku);
YerelOku = ++YerelOku % 5;
w.

[Link]("\t yazilan h cre "+YerelYaz+"\t okunan hucre


"+YerelOku);

printBuffer(cikti, Ortakint);
if (YerelOku==YerelYaz)
{okunabilir=false;
[Link]("\niNTEGER DEPOSU BOS");
}
ww

notify();

return intdegeri;
}

public void printBuffer(TextArea out,int buf[])


{

178
179

[Link]("\t depo: ");


for(int i=0; i<[Link]; i++)

m
[Link](" "+buf[i]);
}
}

o
Uretilen 0 Yazilan 0 yazilan hucre 1 okunan hucre 0 depo: 0 9 9 9 9
Kullanilan 0 Okundugu Hucre 0 yazilan hucre 1 okunan hucre 1 depo: 0 9 9 9 9
INTEGER DEPOSU BOS

i.c
Uretilen 1 Yazilan 1 yazilan hucre 2 okunan hucre 1 depo: 0 1 9 9 9
Kullanilan 1 Okundugu Hucre 1 yazilan hucre 2 okunan hucre 2 depo: 0 1 9 9 9
INTEGER DEPOSU BOS
Uretilen 2 Yazilan 2 yazilan hucre 3 okunan hucre 2 depo: 0 1 2 9 9
Uretilen 3 Yazilan 3 yazilan hucre 4 okunan hucre 2 depo: 0 1 2 3 9
Kullanilan 2 Okundugu Hucre 2 yazilan hucre 4 okunan hucre 3 depo: 0 1 2 3 9
Uretilen 4 Yazilan 4 yazilan hucre 0 okunan hucre 3 depo: 0 1 2 3 4
Kullanilan 3 Okundugu Hucre 3 yazilan hucre 0 okunan hucre 4 depo: 0 1 2 3 4

dil
Uretilen 5 Yazilan 0 yazilan hucre 1 okunan hucre 4 depo: 5 1 2 3 4
Uretilen 6 Yazilan 1 yazilan hucre 2 okunan hucre 4 depo: 5 6 2 3 4
Uretilen 7 Yazilan 2 yazilan hucre 3 okunan hucre 4 depo: 5 6 7 3 4
Kullanilan 4 Okundugu Hucre 4 yazilan hucre 3 okunan hucre 0 depo: 5 6 7 3 4
Kullanilan 5 Okundugu Hucre 0 yazilan hucre 3 okunan hucre 1 depo: 5 6 7 3 4
Uretilen 8 Yazilan 3 yazilan hucre 4 okunan hucre 1 depo: 5 6 7 8 4
Kullanilan 6 Okundugu Hucre 1 yazilan hucre 4 okunan hucre 2 depo: 5 6 7 8 4
Uretilen 9 Yazilan 4 yazilan hucre 0 okunan hucre 2 depo: 5 6 7 8 9
va
Kullanilan 7 Okundugu Hucre 2 yazilan hucre 0 okunan hucre 3 depo: 5 6 7 8 9
Kullanilan 8 Okundugu Hucre 3 yazilan hucre 0 okunan hucre 4 depo: 5 6 7 8 9
Kullanilan 9 Okundugu Hucre 4 yazilan hucre 0 okunan hucre 0 depo: 5 6 7 8 9
INTEGER DEPOSU BOS

Şekil 9.4 Buffer ile uyum sağlanmış [Link] sınıfı ve applet çıktısı
ja

class OrtakHucreSyn{ public static void main(String args[]) {


TutInteger h=new TutInteger(); UretInteger p=new UretInteger(h);
KullanInteger c= new KullanInteger(h);

[Link]();
w.

[Link]();
}
}

class UretInteger extends Thread


{
private TutInteger pTut;
ww

public UretInteger(TutInteger h)
{
pTut=h;
}

public void run()


{
for(int count=0; count<10; count++)
{
[Link](count);

179
180

[Link]("UretInteger OrtakInteger
degerini"+count+"olarak olusturdu");

m
try{
sleep( (int) ([Link]()*3000 ) );
}
catch(InterruptedException e)
{
[Link]("Exeption "+[Link]());

o
}
}
}
}

i.c
class KullanInteger extends Thread
{
private TutInteger cTut;

public KullanInteger(TutInteger h)
{
cTut=h;

dil
}

public void run()


{
int Intedegeri=0;

while (Intedegeri !=9)


{
try{
va
sleep( (int) ([Link]()*3000));
}
catch(InterruptedException e)
{
[Link]("Exeption "+[Link]());
}
Intedegeri=[Link]();
[Link]("KullanInteger "+Intedegeri+" yakalad ");
ja

}
}
}

class TutInteger
{
w.

private int OrtakInt;


private boolean Yazilabilir = true;

public synchronized void setOrtakInt(int Intedegeri)


{
while (!Yazilabilir)
{
ww

try{
wait();
}
catch (InterruptedException e)
{
[Link]("Exception:"+[Link]() );
}
}

180
181

OrtakInt=Intedegeri;
Yazilabilir=false;

m
notify();

public synchronized int getOrtakInt()


{
while (Yazilabilir)

o
{
try{
wait();
}

i.c
catch (InterruptedException e)
{
[Link]("Exception:"+[Link]() );
}
}

Yazilabilir=true;

dil
notify();

return OrtakInt;
}
}

UretInteger OrtakInteger degerini 0 olarak olusturduKullanInteger 0


yakaladıUretInteger OrtakInteger degerini 1 olarak olusturduKullanInteger 1
va
yakaladı
UretInteger OrtakInteger degerini 2 olarak olusturdu
KullanInteger 2 yakaladı
UretInteger OrtakInteger degerini 3 olarak olusturdu
KullanInteger 3 yakaladı
UretInteger OrtakInteger degerini 4 olarak olusturdu
KullanInteger 4 yakaladı
UretInteger OrtakInteger degerini 5 olarak olusturdu
ja

KullanInteger 5 yakaladı
UretInteger OrtakInteger degerini 6 olarak olusturdu
KullanInteger 6 yakaladı
UretInteger OrtakInteger degerini 7 olarak olusturdu
KullanInteger 7 yakaladı
UretInteger OrtakInteger degerini 8 olarak olusturdu
KullanInteger 8 yakaladı
w.

UretInteger OrtakInteger degerini 9 olarak olusturdu


KullanInteger 9 yakaladı

Şekil 9.5 Uyum saglanmış [Link] sınıfı ve sonuçları

Programlardan da görüleceği gibi UretInteger sınıfı (thread’i) TutInteger sınıfını kullanarak


ww

yeni bir integer degeri yaratmakta ve KullanInteger sınıfı da bu değeri ortak hafızadan
okumaktadır. Burada orijinal programlarda iki thread’in çalişma sıralarının sırayla gitmamesi
problemi çıkmıştır. Bazen UretInteger programı birden fazla çalışmakta bazende
KullanInteger programı birden fazla çalışmaktadır. Bunu onlemek için OrtakHucreSync
programında TutInteger sınıfının içinde Uyum kontrolü yapılmıştır. boolean yazılabilir
değişkenini bir trafik işareti gibi kullanıp UretInteger ve TutInteger threat programlarının
sırasıyla işleme girmesi, bu arada diğerinin beklemesi sağlanmıştır. Buradaki zorluk. Bazen
bir programın çok fazla bekleyebilmesi olasılığıdır. Bunu engellemek içinde OrtakHucreBuf

181
182

programında yazmak için bir yerıne beş integer yeri tanımlanmış, ve okutma ve yazma
işlemlerinde iki ayrı kontrol boolean deyimi kullanılmıştır.

o m
i.c
dil
ja va
w.
ww

182
183

m
10. JAVA GİRDİ - ÇIKTI PROGRAMLANMASI
10.1 Javanın I/O (Girdi çıktı ) kütüphanesinde yer alan sınıflar ve interface’ler

Java 1.1 java.ıo kütüphanesinde yer alan sınıflar şunlardır :

o
BufferedInputStream
BufferedOutputStream
BufferedReader
BufferedWriter

i.c
ByteArrayInputStream
ByteArrayOutputStream
CharArrayReader
CharArrayWriter
DataInputStream
DataOutputStream
File
FileDescriptor
FileInputStream
FileOutputStream
FileReader
FileWriter
FilterInputStream
FilterOutputStream
FilterReader
FilterWriter
dil
va
InputStream
InputStreamReader
LineNumberInputStream
LineNumberReader
ObjectInputStream
ObjectOutputStream
ObjectStreamClass
OutputStream
ja

OutputStreamWriter
PipedInputStream
PipedOutputStream
PipedReader
PipedWriter
PrintStream
w.

PrintWriter
PushbackInputStream
PushbackReader
RandomAccessFile
Reader
SequenceInputStream
StreamTokenizer
StringBufferInputStream
ww

StringReader
StringWriter
Writer

Bu sınıfların hepsinin genel görevi javaya girdi sağlamak ve çıktı almaktır. Burada bunlardan bir kısmının
işlevlerini ve nasıl çalıştıklarını inceleyeceğiz.

183
184

m
10.2 File (Dosya) sınıfı

File sınıfı girdi çıktı işlemlerini sağlarken, dosya isimleri ve bulundukları dizin ile ilgili bilgi verir. Kurucu
metotları şöyledir :

File(String dosya_ismi);

o
File(String dizin_ismi, String dosya_ismi);
File(File file_tipi_nesne,String dosya_ismi);

Örnek olarak
File f1=new File(“/”);

i.c
File f2=new File(“/”,”[Link]”);
File f3=new File(f1,”[Link]”);

tanımlarını verebiliriz. File sınıfında tanımlanmış olan Metotlar şunlardır.

canRead()
Tanımlanan dosyadan bilgi okunulabilirliğini test eder.
canWrite()

delete()
Dosyayı siler
equals(Object)
dil
Tanımlanan dosyaya bilgi yazılabilirliğini test eder.

Dosya ismini Object te verilen dosya ismiyle karşılaştırır.


exists()
Dosyanın mevcut olup olmadığını kontrol eder.
getAbsolutePath()
va
Dosyanın tam dizin ismini ve dosya ismini verir( co/java/prog/[Link]).
getName()
Dosyanın ismini verir.([Link])
getParent()
Dosyanın içinde bulunduğu dizinin ismini verir.(prog)
getPath()
dosyanın ismini ve içinde bulunduğu dizinin ismini verir.(prog/[Link])
isAbsolute()
ja

Dosya isminin mutlak isim olup olmadığını kontrol eder.(Eğer dosya ismi co/java/prog/[Link]
olarak verilmişse true değeri verir.)
isDirectory()
verilen isimin bir dizin ismi olup olmadığını kontrol eder.
isFile()
verilen isimin birdosya isimi olup olamdığını kontrol eder.
w.

lastModified()
Dosyanın en son değiştirildiği tarihi verir
length()
Dosyanın boyutunu Byte olarak verir.
list()
Verilen dizinin içindeki dosyaların listesini verir.
list(FilenameFiltre)
Verilen dizinin içindeki Filtre nesnesindeki tanıma uyan dosyaların listesini verir.
ww

mkdir()
Yeni bir dizin oluşturur.
mkdirs()
O anda tanımlı olan dizinin içine bir alt dizin oluşturur.
renameTo(File)
Dosyanın ismini değiştirir.
toString()
Dosya ve dizin isimleri topluluğunun String değişkeni eşdeğerini verir.

184
185

Bu metotları ufak bir program içinde kullanalım.

m
import [Link].*;

class FileTesti
{
public static void main(String args[])
{
File f1=new File("[Link]");

o
[Link]("Dosya ismi : "+[Link]());
[Link]("Dizin ismi : "+[Link]());
[Link]("Mutlak Dizin ismi : "+[Link]());
[Link]("Ust Dizin ismi : "+[Link]());

i.c
[Link]( [Link]() ? "Mevcut " : " Mevcut degil ");
[Link]( [Link]() ? "Yazilabilir " : " Yazilamaz");
[Link]( [Link]() ? "Okunabilir " : " Okunamaz");
[Link]( [Link]() ? "Dizin " : " Dizin degil");
[Link]( [Link]() ? "Dosya " : " Dosya degil");
[Link]( [Link]() ? "Mutlak dizin ismi " : " Mutlak dizin ismi degil");
[Link]("Son Degisiklik : "+[Link]());
[Link]("Dosya boyutu : "+[Link]()+" Byte");

dil
}
}
Şekil 10.1.1 [Link] programı

Dosya ismi : [Link]


Dizin ismi : [Link]
Mutlak Dizin ismi : D:\co\java\prog\[Link]
Ust Dizin ismi : null
va
Mevcut
Yazilabilir
Okunabilir
Dizin degil
Dosya
Mutlak dizin ismi degil
Son Degisiklik : 900410464000
Dosya boyutu : 337 Byte
ja

Şekil 10.1.1 [Link] programının sonucları

10.3 Ardışık (Sequential) dosya yaratılması


Java bilgi dosyalarını birbiri ardısıra gelen byte akışı olarak görür. Her dosya dosya-bitiş
w.

işaretiyle sonlanır. Yeni bir dosya açıldığında bu dosyayla ilgili bir nesne oluşturulur. Yeni
bir java programı açıldığında üç akış nesnesi otomatik olarak açılır. Bunlar [Link] ,
[Link], [Link] nesneleridir. Eğer kendimiz bir girdi veya çıktı akış nesnesi
oluşturmak istersek FileInputStream veya FileOutputStream sınıfı bir nesne
tanımlıyabiliriz. Akısın içindeki değişkenleri sadece byte olarak okumak yerine direk
olarak double veya integer gibi değişkenler türünden okumak istersek DataInputStream
ww

ve DataOutputStream sınıflarını kullanırız. Genel olarak FileOutputStream ve


DataOutputStream sınıflarını aşağıdaki gibi bir arada kullanabiliriz :

try{ ciktiakimi=new DataOutputStream(new FileOutputStream(“[Link]”));}


catch(IOException e) {[Link](“Dosya acilamadi\n”+[Link]());}

Bu deyim bize [Link] isimli dosyadan bir fileOutputStream aracılığıyla açılan dosyayı
DataOutputStream’e çevirip gerçek değişkenler cinsinden akış kanalı açar. Kanal açıldıktan

185
186

sonra aşağıdaki deyimlerden birini kullanarak. Dosyaya bilgi aktarımı yapabiliriz.

m
import [Link].*;
import [Link].*;
import [Link].*;

public class ardisikDosyaYarat extends Frame implements ActionListener


{

o
private TextField hesapIsmiKutusu,isimKutusu,soyIsimKutusu,hesapKutusu;
private Button enter,done;
private DataOutputStream cikti;
private Label H,I,S,P;
public ardisikDosyaYarat()

i.c
{
super("Musteri dosyasi Ac");
try{
cikti=new DataOutputStream(new FileOutputStream("[Link]"));
} catch(IOException e)
{ [Link]("Dosya dogru acilamadi\n"+[Link]());
[Link](1);
}

dil
setSize(300,150);
setLayout(new GridLayout(5,2));
H=new Label("Hesap numarasi :");
add(H);
hesapIsmiKutusu=new TextField();
add(hesapIsmiKutusu);
I=new Label("isim : ");
add(I);
va
isimKutusu=new TextField(20);
add(isimKutusu);
S=new Label("Soyisim : ");
add(S);
soyIsimKutusu=new TextField(20);
add(soyIsimKutusu);
P=new Label("Hesaptaki para : ");
add(P);
hesapKutusu=new TextField(20);
ja

add(hesapKutusu);
enter=new Button("Gir");
[Link](this);
add(enter);
done=new Button("Cikis");
[Link](this);
w.

add(done);
setVisible(true);
}

public void hesapEkle()


{
int accountNumber=0;
ww

Double d;
if(![Link]().equals(""))
{
try{
accountNumber=[Link]([Link]());
if(accountNumber>0)
{
[Link](accountNumber);
[Link]([Link]());
[Link]([Link]());

186
187

d=new Double([Link]());
[Link]([Link]());

m
}
[Link]("");
[Link]("");
[Link]("");
[Link]("");
}

o
catch(NumberFormatException nfe)
{
[Link]("Hesap numarasi tamsayi degisken olamalidir");
}
catch(IOException io)

i.c
{
[Link]("Dosyaya yazarken hata olustu\n"+[Link]());
[Link](1);
}
}
}
public void actionPerformed(ActionEvent e)
{

dil
hesapEkle();
if([Link]()==done)
{
try{ [Link]();}
catch(IOException io)
{
[Link]("Dosya kapatilamadi\n"+[Link]());
}
[Link](0);
va
}
}

public static void main(String args[])


{
new ardisikDosyaYarat();
}
}
ja
w.
ww

Şekil 10.3.2 [Link] programı ve sonuclarının Frame çıktısında


görülmesi

import [Link].*;
import [Link].*;
import [Link].*;
public class ardisikDosyaOku extends Frame implements ActionListener
{
private TextField accountField,firstNameField,lastNameField,balanceField;

187
188

private Button next,done;


private DataInputStream input;

m
public ardisikDosyaOku()
{
super("Musteri dosyasini oku");
try{
input=new DataInputStream(new FileInputStream("[Link]"));
} catch(IOException e) { [Link]("Dosya
acilamadi\n"+[Link]());

o
[Link](1);
}
setSize(300,150);
setLayout(new GridLayout(5,2));

i.c
add(new Label("Hesap Numarasi :"));
accountField=new TextField();
add(accountField);
add(new Label("isim : "));
firstNameField=new TextField(20);
add(firstNameField);
add(new Label("soyisim : "));
lastNameField=new TextField(20);

dil
add(lastNameField);
add(new Label("Hesaptaki para : "));
balanceField=new TextField(20);
add(balanceField);
next=new Button("bir sonraki hesap");
[Link](this);
add(next);
done=new Button("cikis");
[Link](this);
va
add(done);
setVisible(true);
}
public void readRecord()
{
int account;
String first,last;
double balance;
ja

{
try{
account=[Link]();
first=[Link]();
last=[Link]();
balance=[Link]();
w.

[Link]([Link](account));
[Link](first);
[Link](last);
[Link]([Link](balance));
}
catch(EOFException eof)
{
closeFile();
ww

}
catch(IOException io)
{
[Link]("Dosyay okurken hata olustu\n"+[Link]());
[Link](1);
}
}
}
public void actionPerformed(ActionEvent e)

188
189

{
if([Link]()==next)

m
readRecord();
else
closeFile();
}

private void closeFile()

o
{
try{
[Link]();
[Link](0);
}

i.c
catch(IOException e)
{
[Link]("Dosya Kapama Hatası oluştu\n"+[Link]());
[Link](1);
}
}

public static void main(String args[])

dil
{
new ardisikDosyaOku();
}
}
ja va

Şekil 10.3.2 [Link] programı ve sonuclarının Frame çıktısında


görülmesi

[Link] programında [Link] dosyası


w.

try{
cikti=new DataOutputStream(new FileOutputStream("[Link]"));
}
catch(IOException e)
{
[Link]("Dosya dogru acilamadi\n"+[Link]());
[Link](1);
ww

gurubunu kullanarak açılmıştır. Bu gurubu File sınıfını da kullanarak

File f=new File(“[Link]”);


f=[Link](f);
try{
cikti=new DataOutputStream(new FileOutputStream(f));

189
190

}
catch(IOException e)

m
{ [Link]("Dosya dogru acilamadi\n"+[Link]());
[Link](1);
}

şeklinde de yaratabilirdik. İkinci şekilde dosyayı tanımlarken tam dizin ismini de otomatik
olarak tanımlamış olurduk.

o
Dosyanın okunması içinse

try{

i.c
input=new DataInputStream(new FileInputStream("[Link]"));
}
catch(IOException e)
{
[Link]("Dosya acilamadi\n"+[Link]());
[Link](1);
}

dil
gurubunu kullandık. Eğer dosya ismi de değişkende dışarıdan okuduktan sonra ismi File
sınıfına yükleyip sonra akış kanalı açabiliriz.

Dosyaya yazmak için

write(byte B[] )
va
byte tipi boyutludeğişkeni açılmış olan DataOutputStream kanalına yazar.

write(byte B[], int baslangıcindeksi, int indeksboyutu)

byte tipi boyutludeğişkeni açılmış olan DataOutputStream kanalına yazar.


Baslangiç indeksinden baslar ve indeksboyutu uzunluğundaki kısmı yazar.
ja

write(int B)

int datayı data output stream’e yazar.


w.

writeBoolean(boolean B)

Boolean değişkeni DataOutputStream’e yazar.

writeByte(int)
ww

int değişkeni byte olarak DataOutputStream’e yazar.

writeBytes(String)

String değişkeni byte boyutlu değişken olarak DataOutputStream’e yazar.

writeChar(int)

190
191

int değişkeni char değişken olarak DataOutputStream’e yazar.

m
writeChars(String)

String değişkeni Char değişken olarak DataOutputStream’e yazar.

o
writeDouble(double)

double değişkeni double değişken olarak DataOutputStream’e yazar.

i.c
writeFloat(float)

float değişkeni float değişken olarak DataOutputStream’e yazar.

writeInt(int)

float değişkeni float değişken olarak DataOutputStream’e yazar.

writeLong(long)

dil
long değişkeni long değişken olarak DataOutputStream’e yazar.

writeShort(int)
va
int değişkeni short (short integer) değişken olarak DataOutputStream’e yazar.

writeUTF(String)

String değişkeni unicode UTF-8 formatı karekter boyutu olarak yazar.


ja

Metotlarından birini kullanabiliriz.

Dosyadan okumak için :


w.

read(byte[])
read(byte[], int, int)
readBoolean()
readByte()
8-bit byte integer okur
readChar()
unicode karecter(char)okur
ww

readDouble()
double okur
readFloat()
float okur
readFully(byte[])
byte boyutlu değişkenini, byte[] boyutlu girdi değişkeninin boyutuna göre okur.
Reads [Link] bytes from this data input stream into the byte array.

191
192

readFully(byte[], int, int)

m
readInt()
İnteger okur
readLine()
Bir satırı satırbaşı yap komutuna kadar okur. Java 1.0 komutudur. 1.1 de kullanılmaması
tavsiye edilir.

o
readLong()
Long tamsayı değişkeni okur.
readShort()
Short tamsayı değişkeni okur

i.c
readUnsignedByte()
8-bitlik işaretsiz tamsayı değişkeni okur.
readUnsignedShort()
16-bitlik işaretsiz tamsayı değişkeni okur.
readUTF()
Unicode karekteri okur.
readUTF(DataInput)

n byte değeri okumadan atlar.


dil
Unicode Karakterini (Character) DataInput girdi akışından okur.
skipBytes(int n)

Dosya ile işlemler bittikten sonra dosya kapanır.

private void closeFile()


va
{
try{
[Link]();
[Link](0);
}
catch(IOException e)
{
[Link]("Dosya Kapama Hatası oluştu\n"+[Link]());
ja

[Link](1);
}
}
w.

closeFile() metodu dosya akışını kapatmak macıyla oluşturulmuştur.

10.4 Raslantısal Ulaşım Dosyası Oku (Random Access File)

Raslantısal Ulaşım Dosyasının (Random Access File) Ardışık Dosya sisteminden temel farkı,
Teyp kaydıyla CD kaydı arasındaki fark gibidir. Ardışık dosyalar Teyp kaydı şeklinde birbiri
ardı sıra gelen bilgilerden oluşur. Raslantısal Ulaşom sisteminde ise CD gibi herhangi bir
ww

kayıta kayıt numarası kullanılarak doğrudan ulaşmak mümkündür. Çok daha çabuk ulaşım
olanakları yaratır. Raslantısal Ulaşım dosyası örneği olarak aşağıdaki paketi veriyoruz. Kayit
sınıfı tek bir kayıtın yazılıp okunabilmesi için gerekli olan bilgileri içeriyor. Kayıtların hesap
numarası, isim, soyisim ve hesaptaki paradan oluştuğunu kabul ediyoruz. Bütün bu kayıtları
bir arada yapmak için oku ve yaz metodları bu sınıfın içindr tanımlanmıştır. Raslantısal
ulaşım kanalının dosyaya açılması için :

192
193

try{
girdi=new RandomAccessFile("[Link]","rw");

m
} catch(IOException e)
{
[Link]("Dosya acma hatasi\n"+[Link]());
[Link](1);
}

o
yapısı kullanbilir. Buradaki “rw” yapısı dosyaya hem yazı yazılıp hem okunabileceğini
belirtir. “r” sadece okumak için “w” sadece yazmak için kullanılır.

RandomAccessFile gurubunun içinde yer alan metodlar şunlardır :

i.c
close()

RandomAccessFile (Raslantısal Ulaşım Dosyası) kanalını ve ilgili tüm sınıfları kapatır. Rnek
olarak :

private void closeFile()


{
try{
[Link]();
[Link](0);
}
catch(IOException e)
{
dil
[Link]("Error closing filr\n"+[Link]());
va
[Link](1);
}
}

metodu verilebilir.

getFD()
ja

dosya (File) tanımını verir

getFilePointer()
Dosyanın (File) o anda hangi dosya referansını gösterdiğini belirtir.
w.

length()
Dosyadaki toplam referans sayısını verir.

read()
Byte (char değişkeni karşılığı) olarak dosyadan bilgiyi okur (bir byte).

read(byte[])
ww

Byte (char değişkeni karşılığı) olarak dosyadan bilgiyi okur (byte[] değişkeninin boyu kadar)
ve byte degişkenine aktarır.

read(byte[], int baslangıç_indisi, int indis_boyutu)


Byte (char değişkeni karşılığı) olarak dosyadan bilgiyi okur (byte[] değişkeninin boyu kadar,
başlangıç indisinden başlayarak, indis_boyutu uzunluğunda) ve byte degişkenine aktarır.

193
194

readBoolean()

m
boolean değişken okur

readByte()

dosyadan integer tipi byte değişken (işaretli 8-bit ) okur.

o
readChar()

Dosyadan Unicode karekter (character) okur.

i.c
readDouble()

Dosyadan double değişkeni okur.

readFloat()

Dosyadan float değişkeni okur.

readFully(byte[] b)
dil
[Link] bouyutundaki byte değerini boyutlu byte değişkenine aktarır.

readFully(byte[] b, int baslangıç_indisi, int toplam_boy)


va
readInt()

Dosyadan int değişkeni okur.

readLine()
ja

Dosyadan “\n” = yeni satır işaretini görene kadar yazılan her şeyi bütün bir satır olarak okur.

readLong()
w.

Dosyadan Long (Long integer) değişkeni okur.

readShort()

Dosyadan Short (Short integer) değişkeni okur.

readUnsignedByte()
ww

İşaretsiz 8 bitlik integer değeri okur.

readUnsignedShort()

İşaretsiz 16 bitlik Short integer değeri okur.

194
195

readUTF()

m
UTF stringi okur

seek(long)

indisi herhangi bir bilgi gurubu indisine ayarlar.

o
skipBytes(int n)

n bit input değerini okumadan atlar

i.c
Aşağıdaki tanımlar read tanımlarına parelel olan write terimleridir.

write(byte[])

write(byte[], int, int)

write(int)

writeBoolean(boolean)

writeByte(int)

writeBytes(String)
dil
va
writeChar(int)

writeChars(String)

writeDouble(double)
ja

writeFloat(float)

writeInt(int)
w.

writeLong(long)

writeShort(int)

writeUTF(String)

Şimdi de ornek programın listesini verelim:


ww

import [Link].*;

public class Kayit


{
private int hesap;
private String soyIsim;
private String Isim;

195
196

private double hesaptakiPara;


public void oku(RandomAccessFile dosya) throws IOException

m
{
//RandomAccessFile = Raslantisal Ulasim dosyasi
hesap=[Link]();
char first[]=new char[15];
for(int i=0;i<[Link];i++)
{ first[i]=[Link](); }
Isim=new String(first);

o
char last[]=new char[15];
for(int i=0;i<[Link];i++)
{ last[i]=[Link](); }
soyIsim=new String(last);

i.c
hesaptakiPara=[Link]();
}

public void yaz(RandomAccessFile dosya) throws IOException


{
StringBuffer buf;
[Link](hesap);
if(Isim!=null)

dil
buf=new StringBuffer(Isim);
else
buf=new StringBuffer(15);
[Link](15);
[Link]([Link]());
if(soyIsim!=null)
buf=new StringBuffer(soyIsim);
else
buf=new StringBuffer(15);
va
[Link](15);
[Link]([Link]());
[Link](hesaptakiPara);
}

public void yazhesap(int a) {hesap = a;}


public int okuhesap() {return hesap;}
public void yazIsim(String f){Isim=f;}
ja

public String okuIsim() {return Isim;}


public void yazsoyIsim(String f){soyIsim=f;}
public String okusoyIsim() {return soyIsim;}
public void yazhesaptakiPara(double b) {hesaptakiPara=b;}
public double okuhesaptakiPara() {return hesaptakiPara;}
public static int boyut() {return 72;}
w.

10.4.1 [Link] dosyası

import [Link].*;
import [Link].*;
import [Link].*;
ww

import Kayit;

public class RaslantisalUlasimDosyasiYarat


{
private Kayit hesapDosyasi;
private RandomAccessFile girdi;
public RaslantisalUlasimDosyasiYarat()
{
hesapDosyasi = new Kayit();

196
197

try{
girdi = new RandomAccessFile("[Link]","rw");

m
for(int i=0;i<100;i++)
{ [Link](girdi); }
} catch(IOException e)
{
[Link]("Dosya acma hatasi\n"+[Link]());
[Link](1);
}

o
}

public static void main(String args[])


{

i.c
RaslantisalUlasimDosyasiYarat H=
new RaslantisalUlasimDosyasiYarat();
}
}

10.4.2 [Link] dosyası

import [Link].*;
import
import
import
[Link].*;
[Link].*;
Kayit;

dil
public class RaslantisalUlasimDosyasiYaz extends Frame implements
ActionListener
{
private TextField hesapAlani,isimAlani,soyisimAlani,hesaptakiParaAlani;
va
private Button birsonraki,kapat;
private RandomAccessFile girdi;
private Kayit hesapDosyasi;
public RaslantisalUlasimDosyasiYaz()
{
super("Tesadufi ulasim dosyasina yaz");
hesapDosyasi=new Kayit();
try{
ja

girdi=new RandomAccessFile("[Link]","rw");
} catch(IOException e)
{
[Link]("Dosya acma hatasi\n"+[Link]());
[Link](1);
}
setSize(300,150);
w.

setLayout(new GridLayout(5,2));
add(new Label("Hesap numarasi:"));
hesapAlani=new TextField();
add(hesapAlani);
add(new Label("isim : "));
isimAlani=new TextField(20);
add(isimAlani);
ww

add(new Label("Soyisim : "));


soyisimAlani=new TextField(20);
add(soyisimAlani);
add(new Label("Hesaptaki para : "));
hesaptakiParaAlani=new TextField(20);
add(hesaptakiParaAlani);
birsonraki=new Button("Gir");
[Link](this);
add(birsonraki);

197
198

kapat=new Button("cikis");
[Link](this);

m
add(kapat);
setVisible(true);
}

public void addKayit()


{
int accountNumber=0;

o
Double d;
if(![Link]().equals(""))
{
try{

i.c
accountNumber=[Link]([Link]());
if(accountNumber>0 && accountNumber <=100)
{
[Link](accountNumber);
[Link]([Link]());
[Link]([Link]());
d=new Double([Link]());
[Link]([Link]());

dil
[Link]((long)(accountNumber-1)*[Link]());
[Link](girdi);
}
[Link]("");
[Link]("");
[Link]("");
[Link]("");
}
catch(NumberFormatException nfe)
va
{
[Link]("Hesap numarasi tamsayi degisken olamalidir");
}
catch(IOException io)
{
[Link]("Dosyaya yazarken hata olustu\n"+[Link]());
[Link](1);
}
ja

}
}
public void actionPerformed(ActionEvent e)
{
addKayit();
if([Link]()==kapat)
w.

{
try{ [Link]();}
catch(IOException io)
{
[Link]("Dosya kapatilamadi\n"+[Link]());
}
[Link](0);
}
ww

}
public static void main(String args[])
{
new RaslantisalUlasimDosyasiYaz();
}
}

198
199

o m
i.c
10.4.3 [Link] dosyası ve Frame çıktısı

import
import
import
import
[Link].*;
[Link].*;
[Link].*;
Kayit; dil
public class RaslantisalUlasimDosyasiOku extends Frame implements
ActionListener
va
{
private TextField hesapAlani,isimAlani,soyisimAlani,hesaptakiParaAlani;
private Button birsonraki,kapat;
private RandomAccessFile girdi;
private Kayit hesapDosyasi;
public RaslantisalUlasimDosyasiOku()
{
super("Musteri dosyasini oku");
ja

try{
girdi=new RandomAccessFile("[Link]","r");
} catch(IOException e)
{ [Link]("Dosya acilamadi\n"+[Link]());
[Link](1);
}
w.

hesapDosyasi=new Kayit();
setSize(300,150);
setLayout(new GridLayout(5,2));
add(new Label("Hesap numarasi :"));
hesapAlani=new TextField();
add(hesapAlani);
add(new Label("isim : "));
isimAlani=new TextField(20);
ww

add(isimAlani);
add(new Label("soyisim : "));
soyisimAlani=new TextField(20);
add(soyisimAlani);
add(new Label("Hesaptaki para : "));
hesaptakiParaAlani=new TextField(20);
add(hesaptakiParaAlani);
birsonraki=new Button("bir sonraki hesap");
[Link](this);

199
200

add(birsonraki);
kapat=new Button("cikis");

m
[Link](this);
add(kapat);
setVisible(true);
}

public void okuKayit()


{

o
int hesap;
String ilk,son;
double balance;
{

i.c
try{
do{
[Link](girdi);
} while([Link]()==0);
[Link]([Link]([Link]()));
[Link]([Link]([Link]()));
[Link]([Link]([Link]()));

dil
[Link]([Link]([Link]()))
;
}
catch(EOFException eof)
{
closeFile();
}
catch(IOException io)
{
va
[Link]("Dosyay okurken hata olustu\n"+[Link]());
[Link](1);
}
}
}

public void actionPerformed(ActionEvent e)


{
ja

if([Link]()==birsonraki)
okuKayit();
else
closeFile();
}
w.

private void closeFile()


{
try{
[Link]();
[Link](0);
}
catch(IOException e)
{
ww

[Link]("Error closing filr\n"+[Link]());


[Link](1);
}
}

public static void main(String args[])


{
new RaslantisalUlasimDosyasiOku();
}

200
201

o m
i.c
10.4.4 [Link] dosyası ve Frame çıktısı

Yukardaki proğramın ilginç bir yönü de Applet yerine Frame sınıfını kullanmış olmasıdır.

dil
Frame sadece yerel bilgisayarda kullanılabilen grafik ortamı programlamasıdır. Temel olarak
applet yapılarında kullanılan her yapı Frame de de kullanılabilir. Yalnız frame main
programdan başlatılır. Html dosyasından başlatılmaz. Sadece yerel bilgisayarda geçerli bir
programlama türüdür.
ja va
w.
ww

201
202

11 GELİŞMİŞ JAVA BİLGİ İŞLEME YAPILARI

m
11.1 Vector Sınıfı

Daha önce boyutlu değişkenleri görmüştük. Boyutlu değişkenlerin boyutları bilgisayar


belleğinde oluşturulurken birbiri ardına sırayla oluşturulur.

o
Örneğin double b[]=new double[3];
Deyimi bilgisayar belleğinde

i.c
1023400 b[0]
1023464 b[1]
1023528 b[2]

yerlerini birbirini izleyen adreslerde ayırır.

değiştirmektir.

double c[]=new double[5];


for(int i=0,i<[Link];i++)
{ c[i]=b[i];}
dil
Buradaki sorun eğer bilgisayar belleğindeki toplam yer değiştirilmek istenirse bunun zor
olmasıdır. Pratik olarak yapılabilecek şey yeni bir boyutlu değişken oluşturup adresleri
va
b=c;

Daha gelişmiş bir bilgi yapısı olarak vector sınıfı kullanılır. Vector sınıfında her bilgi elemanı
aynı zamanda bir sonraki bilgi elemanının adresini taşır. Boylece istenildiğinde dizinin son
elemanına yeni bir adres ilave edilerek kolayca yeni elemanlar ilave edilebilir.
ja

Dizinin arasından herhangibir elemanı da kalaylıkla sadece referans adresini değiştirerek


silebiliriz.
w.

Vector sınıfında tanımlanan metodlar

addElement(Object)

Vectöre object türü (herhangi bir sınıf olabilir, vectörün hepsi bu sınfta tanımlanmış
olmalıdır.) bir eleman ekler.
ww

capacity()

vectörn toplam kapasitesini verir.

clone()

202
203

vectorun bir kopye vectörünü verir.

m
contains(Object)

Vectörün içinde sorgulanan elemanın olup olmadığını kontrol eder.

copyInto(Object[])

o
vectorü boyutlu değişkene aktarır.

elementAt(int indeks)

i.c
Verilen indeksteki elemanı verir..

elements()

Tüm vektörü enumeration sınıfına aktarır.

ensureCapacity(int yeni_kapasite)

dil
eğer yeni_kapasite vector kapasitesinin üstündeyse vector yeni_kapasite’ye aktarılır.

firstElement()

Vectörün ilk elemanını verir.


va
indexOf(Object)

Object’in indeks değerini verir

indexOf(Object, int indeks)


ja

Object’in indeks değerini verir, arama indeks değişkeninden başlayarak yapılır.

insertElementAt(Object, int indeks)


w.

Vectörün ideks noktasına Object ilave edilir.

isEmpty()

Vectörün boş olup olmadığı kontrol edilir.

lastElement()
ww

vectörün son elemanının indeksini verir.

lastIndexOf(Object)

Object’in vectördeki son tekrarının indeksini verir.

203
204

lastIndexOf(Object, int indeks)

m
indeks ten başlayarak geriye doğru Objectin ilk tekrarlandığı yeri bulur.

removeAllElements()

Vectördeki bütün elemanları siler.

o
removeElement(Object)

Vectördeki Object elemanını siler.

i.c
removeElementAt(int indeks)

indeksle verilen elemanı siler.

setElementAt(Object, int indeks)

setSize(int)

Sets the size of this vector.

size()
dil
Objectin ideksini indeks olarak belirler.
va
Vectördeki toplam eleman sayısını verir.

toString()

Vectörün String eşitini verir.


ja

trimToSize()

Vectörün boyutunu dolu olan elemanlarının boyutuna kısaltır.


w.

Aşağıda bu metodların önemlilerinden bazılarını veren bir program verilmiştir.

import [Link].*;import [Link].*;import [Link];import


[Link].*;public class VectorTesti extends Applet implements
ActionListener{ private Vector v; private Label prompt; private
TextField input;
private Button addBtn, removeBtn, firstBtn, lastBtn, emptyBtn,
containsBtn, locationBtn, trimBtn,
ww

statsBtn, displayBtn;
Panel YaziPaneli;
public void init()
{
setBackground([Link]);
YaziPaneli=new Panel();
[Link](new Font("Serif",[Link],12));
[Link]( new GridLayout(5,2) );
v = new Vector(1);

204
205

prompt= new Label("Bir String degiskeni giriniz ");


input = new TextField(10);

m
addBtn = new Button("Ekle");
removeBtn = new Button("Cikar");
firstBtn = new Button("Ilk");
lastBtn = new Button("Son");
emptyBtn = new Button("Bos mu ?");
containsBtn = new Button("Listede varmi?");
locationBtn = new Button("Adresi");

o
trimBtn = new Button("Kes");
statsBtn = new Button("Istatistikler");
displayBtn = new Button("Listeyi Goster");
add(prompt);

i.c
add(input);
[Link](this);
[Link](addBtn);
[Link](this);
[Link](removeBtn);
[Link](this);
[Link](firstBtn);
[Link](this);

dil
[Link](lastBtn);
[Link](this);
[Link](emptyBtn);
[Link](this);
[Link](containsBtn);
[Link](this);
[Link](locationBtn);
[Link](this);
[Link](trimBtn);
va
[Link](this);
[Link](statsBtn);
[Link](this);
[Link](displayBtn);
add(YaziPaneli);
}

public void actionPerformed(ActionEvent e)


ja

{
if([Link]()==addBtn)
{ [Link]([Link]());
showStatus("Listenin sonuna eklendi: "+[Link]()); }
else if([Link]()==removeBtn)
{ if([Link]([Link]()))
w.

showStatus("Silindi :"+[Link]());
else
showStatus([Link]()+"not in vector");
}
else if([Link]() == firstBtn)
{
try{
showStatus("Ilk eleman : "+[Link]());
ww

}
catch(NoSuchElementException exception)
{
showStatus([Link]() );
}
}
else if([Link]()==lastBtn)
{ try{
showStatus("Son eleman : "+[Link]());

205
206

}
catch(NoSuchElementException exception)

m
{ showStatus([Link]() );}
}
else if([Link]() == emptyBtn)
{
showStatus([Link]()? "Vector bos ":"vector dolu ");
}
else if([Link]()==containsBtn)

o
{
String searchKey = [Link]();

if([Link](searchKey) )

i.c
showStatus("Vektor elemanlari " +searchKey);
else
showStatus("Aranan eleman Vektorde bulunamadi "+searchKey);
}
else if([Link]()==locationBtn)
{ showStatus("Eleman "+[Link]([Link]() )+" pozisyonunda
bulundu");
}

dil
else if([Link]()==trimBtn)
{ [Link]();
showStatus("Vector boyu eleman boyuna k salt ld ");
}
else if([Link]()== statsBtn)
{
showStatus("Boyut = "+[Link]()+"; Toplam kapasite =
"+[Link]());
}
va
else if([Link]()== displayBtn) {
Enumeration enum=[Link]();
StringBuffer buf = new StringBuffer();
while([Link]())
{
[Link]([Link]() );
[Link](" ");
}
ja

showStatus([Link]() );
}
[Link]("");
}
}
w.
ww

206
207

o m
i.c
Şekil 11.1.1 [Link] programı ve applet çıktısı

Bundan sonraki program iki kümenin bileşim ve kesişim kümelerini hesaplamaktadır.

dil
Kümelerin kaç elemandan oluştuğu tanımlanmamıştır. İşlemler vector sınıfını kullanarak
yapılmaktadır. Ayrıca bu yapıda vector sınıfını bir döngü içinde kullanmak için vector sınıfı
Enumeration sınıfına yüklenmektedir.

Enumeration n1=[Link]();
Enumeration n2=[Link]();
while([Link]())
{
va
s1=(String)[Link]();
[Link](s1);
}

kod parçacığında vector sınıfının elements metodu,Enumeration sınıfı ve Enumeration


sınıfının hasMoreElements ve nextElement metodları kullanılarak nasıl döngü oluşturulduğu
görülmektedir. Enumeration sınıfı vectör elemanlarını sırayla çağırmaya yarayan özel bir
ja

sınıftır.
// Bu program vector ve Enumeration siniflarını// Kullanmaktadır. Bilesim,
kesisim kümelerini hesaplar// Ayni zamanda StringTokaniser sınıfını
kullanır.
import [Link].*;
w.

import [Link].*;
import [Link];
import [Link].*;

class SetA
{
public Vector bilesim(Vector list1, Vector list2)
ww

{
Vector bilesimVectoru = new Vector();
String s1,s2;
Enumeration n1=[Link]();
Enumeration n2=[Link]();
while([Link]())
{
s1=(String)[Link]();
[Link](s1);
}

207
208

while([Link]())
{

m
s2=(String)[Link]();
if(![Link](s2))
[Link](s2);
}
return bilesimVectoru;
}

o
public Vector kesisim(Vector list1,Vector list2)
{
Vector kesisimVectoru = new Vector();
String s;

i.c
Enumeration n = [Link]();
while([Link]())
{
s=(String)[Link]();
if([Link](s))
[Link](s);
}
return kesisimVectoru;

dil
}
}

public class SetTest extends Applet implements ActionListener


{
SetA set = new SetA(); // SetA
Label L1, P1, P2;
TextField T1,T2;
TextArea cikti;
va
// dinamik boyutlu degisken sinifi Vector'u kullanarak
// iki vector listesi yarat
Vector list1 = new Vector();
Vector list2 = new Vector();

// Sonuclari yine vektor cinsinden de§iskenler


// kullanarak aktar
ja

Vector ansUn;
Vector ansInt;

public void init() {


P1 = new Label("Birinci listeyi gir : ");
T1 = new TextField(50);
w.

P2 = new Label("Ikinci listeyi gir : ");


T2 = new TextField(50);

//Sonuclarin yazildigi yazi alanini ac


cikti = new TextArea(10,40);
[Link](false);
[Link]("");
add(P1);
ww

add(T1);
[Link](this);
add(P2);
add(T2);
[Link](this);
add(cikti);
}

public void girdiA(String string, Vector list)

208
209

{
// StringTokeniser sinifi String degiskenleri icin

m
// Enumeration sinifinin yaptigina paralel gorev
// gorur String'i sıraya sokarak degerlerini sırayla verir
StringTokenizer tokens = new StringTokenizer(string);
while([Link]()) {
String test = [Link]();
[Link](test);
}

o
}

public void ciktiA(Vector v)


{

i.c
Enumeration enum = [Link]();
while([Link]())
{
String ans = (String)[Link]();
[Link](ans + "\n");
}
}

dil
public void actionPerformed(ActionEvent e)
{
if([Link]()==T1)
{
String stringToTokenize = [Link]();
girdiA(stringToTokenize,list1);
}
else if([Link]()==T2)
{
va
String stringToTokenize = [Link]();
girdiA(stringToTokenize,list2);
// Iki listenin bilesim ve kesisim k melerini hesapla.
ansUn = [Link](list1,list2);
ansInt = [Link](list1,list2);
// sonuclari cikti alanina gonder
[Link]("\nIki listenin bilesim kumesi : \n");
ciktiA(ansUn);
ja

[Link]("\nIki listenin kesisim kumesi : \n");


ciktiA(ansInt);
}
} //actionPerformed metodunun sonu
}
w.

Bu programda aynı zamanda StringTokaniser sınıfı kullanılmıştır. StringTokaniser String


değişkenini bosluk kullanarak alt değişkenlere ayırmaya yarayan Enumeration türü bir sınıftır.
ww

209
210

o m
i.c
dil
Şekil 11.1.2 Vector sınıfını kullanarak iki kumenin bileşim ve kesişim kümelerini
hesaplayan [Link] programı ve applet çıktısı
va
JAVA PROGRAMLAMA DİLİ
HAFTA 14

Hafta 13 dosyaları :

ORTAKH~1 JAV 1.787 21/07/98 6:40 [Link]


ja

ORTAKH~2 JAV 1.668 21/07/98 6:37 [Link]


ORTAKH~3 JAV 3.792 21/07/98 7:06 [Link]
ORTAKH~4 JAV 2.335 21/07/98 7:09 [Link]

Bu haftaki dosyalar
w.

SAAT~1 JAV 991 28/07/98 5:47 [Link]


SETTES~3 JAV 3.730 27/07/98 17:55 [Link]
VECTOR~1 JAV 4.456 27/07/98 16:56 [Link]

ALISTIRMA 1
ww

Hafta 13 dosyaları ve [Link] programını inceleyiniz. [Link] runnable interface’i ile yazılmıştır (implements
Runnable). Aynı programın abstract Tread ile (extends Threat) yazılmış şeklini oluşturunuz. Saati gösteren bu
programın niçin threat olarak yazılması gerektiğini izah ediniz.

ALIŞTIRMA 2

[Link] programını inceleyiniz. Kesişim kumesiyle bileşim kumesinin farkını oluşturan kümeyi hesaplayan
bir metod yazınız ve test programına da ekleyerek çalıştırınız.

210
211

12 ÖRNEKLERLE SAYISAL ANALİZ

m
Bu bölümümüzde bazı pratik matematik problemlerinin java ile nasıl çözülebileceğine göz
atacağız. Sayısal analiz işlemlerini yapmak amacıyla iki sınıf oluşturduk bunlar Matrix ve
Numeric sınıflarıdır. Bu serinin devamı olan java ile numerik analiz kitabında bu sınıflardaki
metotları tek tek inceleyeceğiz. Burada ise sadece program listeleri ve örnek problemler
vermekle yetineceğiz.

o
İlkönce Matrix sınıfının metot başlıklarını verelim :

toString Metotları

i.c
public static String toString(double left)
public static String toString(double[][] left)
public static String toString(complex[][] left)
public static String toStringT(complex[] left)
public static String toString(complex[] left)
public static String toStringT(double[] left)
public static String toString(double[] left)

dil
inverse matris ve denklem sistemi çözüm hesapları
public static double[][] inv(double[][] a)
public static double[][] inverse(double a[][])
public static double[] LUaxb(double a[][],double x[],int indx[])
public static double[] AXB(double a[][],double b[])
Determinant hesapları
public static double det(double a[][])
va
public static double determinant(double a[][])
public static double D(double a[][])
Matrislerin dört işlemi
public static double[][] multiply(double[][] left,double[][] right)
public static double[] multiply(double[][] left,double[] right)
public static double[] multiply(double[] left,double[][] right)
ja

public static double[][] multiply(double left,double[][] right)


public static double[][] multiply(double[][] left,double right)
public static double[] multiply(double left,double[] right)
public static double[] multiply(double[] left,double right)
public static double[][] add(double[][] left,double[][] right)
w.

public static double[] add(double[] left,double[] right)


public static double[][] substract(double[][] left,double[][] right)
public static double[] substract(double[] left,double[] right)
public static double[][] divide(double[][] left,double[][] right)
public static double[][] LUdivide(double[][] left,double[][] right)
public static double[] LUdivide(double[] left,double[][] right)
public static double[] divide(double[] left,double[][] right)
ww

public static double[] divide(double[] left,double[][] right)


Üst işlemi
public static double[][] pow(double[][] right,double left)
public static double[] pow(double[] right,double left)
Absulute matriks
public static double abs(double[][] left)
public static double abs(double[] left)

211
212

Transpose matriks
public static double[][] Transpose(double [][] left)

m
public static double[][] T(double [][] left)
public static complex[][] T(complex [][] left)
Birim matris
public static double[][] I(int n)
public static double[] one(int n)

o
EigenValue Poblemi
public static double[][] balance(double b[][])
public static double[][] Hessenberg(double b[][])
public static double[][] QR(double b[][])

i.c
public static double[][] eigenValue(double b[][])
public static complex[] eigenValueC(double b[][])
public static double[][] balancedEigenValue(double b[][])
public static double[][] eigenQL(double a[][])
Polinomun kökleri
public static double[][] poly_roots(double c[])
public static complex[] poly_rootsC(double c[])

Matrix Sınıfının Listesi :

//
//
dil
//=============================================================
Numerical Analysis Packages in Java
Matrix calculations class Matrix
va
// Author : Dr. Turhan Coban
//=============================================================
//Turhan Coban
import [Link].*;
import complex;

public class Matrix


{
ja

// This class defines matrix and vector


// calculation methods

public static String toString(double left)


{
//arrange double to string conversion so that all the
w.

//matrix double variables nicely printed in the same column


String s="";
if(left>=0) s=s+" ";
s=s+left;
double n=[Link]();
while(n<13)
{
s=s+" ";
ww

n=[Link]();
}
return s;
}

public static String toString(double[][] left)


{
//return a string representation of a matrix
int n,m;

212
213

String b;
b="";

m
n=[Link];
m=left[0].length;
for(int i=0;i<n;i++)
{
for(int j=0;j<m;j++)
{
b=b+toString(left[i][j]);

o
}
b=b+"\n";
}
return b;

i.c
}

public static String toString(complex[][] left)


{
//return a string representation of a complex matrix
int n,m;
String b;
b="";

dil
n=[Link];
m=left[0].length;
for(int i=0;i<n;i++)
{
for(int j=0;j<m;j++)
{
b=b+left[i][j].toString()+"\t";
}
b=b+"\n";
va
}
return b;
}

public static String toStringT(complex[] left)


{
// returns a horizontal string representation of
// a complex vector
ja

int n,m;
String b;
b="";
n=[Link];
for(int i=0;i<n;i++)
{
w.

b=b+left[i].toString()+"\n";
}
return b;
}

public static String toString(complex[] left)


{
// returns a vertical string representation of
ww

// a complex vector
int n,m;
String b;
b="";
n=[Link];
for(int i=0;i<n;i++)
{
b=b+left[i].toString()+" ";
}

213
214

b=b+"\n";
return b;

m
}

public static String toStringT(double[] left)


{
// returns a vertical string representation
// of a double vector
int n,m;

o
String b;
b="";
n=[Link];
for(int i=0;i<n;i++)

i.c
{
b=b+toString(left[i])+"\n";
}
return b;
}

public static String toString(double[] left)


{

dil
// returns a horizontal string representation
// of a double vector
int n,m;
String b;
b="";
n=[Link];
for(int i=0;i<n;i++)
{
b=b+toString(left[i]);
va
}
b=b+"\n";
return b;
}
public static String toString(int[] left)
{
// returns a horizontal string representation
// of a integer vector
ja

int n,m;
String b;
b="";
n=[Link];
for(int i=0;i<n;i++)
{
w.

b=b+left[i]+"\t";
}
b=b+"\n";
return b;
}

public static double SIGN(double a,double b)


{
ww

//returns the value of double a with sign of double b;


//if a=-2, b= 3 SIGN(a,b) returns 2
//if a=-2, b=-3 SIGN(a,b) returns -2
//if a= 2, b=-3 SIGN(a,b) returns -2
//if a= 2, b= 3 SIGN(a,b) returns 2
if(b!=0)
return [Link](a)*b/[Link](b);
else
return [Link](a);

214
215

m
public static double[][] inv(double[][] a)
{
// INVERSION OF A MATRIX
// inversion by using gaussian elimination
// with full pivoting
int n=[Link];

o
int m=a[0].length;
double b[][];
b=new double[n][n];
int indxc[];

i.c
int indxr[];
double ipiv[];
indxc=new int[n];
indxr=new int[n];
ipiv=new double[n];
int i,j,k,l,ll,ii,jj;
int icol=0;
int irow=0;

dil
double big,dum,pivinv,temp;
if(n!=m)
{
[Link]("Matrix must be square ");
for(ii=0;ii<n;ii++)
for(jj=0;jj<n;jj++)
b[ii][jj]=0.0;
return b;
}
va
for(i=0;i<n;i++)
for(j=0;j<n;j++)
b[i][j]=a[i][j];
for(i=0;i<n;i++)
{
big=0.0;
for(j=0;j<n;j++)
{
ja

if(ipiv[j] != 1)
for(k=0;k<n;k++)
{
if(ipiv[k] == 0)
{
if([Link](b[j][k]) >= big)
w.

{
big=[Link](b[j][k]);
irow=j;
icol=k;
}
}
else if(ipiv[k] > 1 )
{
ww

[Link]("error : inverse of the matrix : singular


matrix-1");
for(ii=0;ii<n;ii++)
for(jj=0;jj<n;jj++)
b[ii][jj]=0.0;
return b;
}
}
}

215
216

++ ipiv[icol];
if(irow != icol)

m
for(l=0;l<n;l++)
{
temp=b[irow][l];
b[irow][l]=b[icol][l];
b[icol][l]=temp;
}
indxr[i]=irow;

o
indxc[i]=icol;
if(b[icol][icol] == 0.0)
{
[Link]("error : inverse of the matrix : singular matrix-

i.c
2");
for(ii=0;ii<n;ii++)
for(jj=0;jj<n;jj++)
b[ii][jj]=0.0;
return b;
}
pivinv=1.0/b[icol][icol];
b[icol][icol]=1.0;

dil
for(l=0;l<n;l++) b[icol][l] *=pivinv;
for(ll=0;ll<n;ll++)
if(ll != icol)
{
dum=b[ll][icol];
b[ll][icol]=0.0;
for(l=0;l<n;l++) b[ll][l]-= b[icol][l]*dum;
}
}
va
for(l=n-1;l>=0;l--)
{
if(indxr[l] != indxc[l])
for(k=0;k<n;k++)
{
temp=b[k][indxc[l]];
b[k][indxc[l]]=b[k][indxr[l]];
b[k][indxr[l]]=temp;
ja

}
}
return b;
}

public static double[][] inverse(double a[][])


w.

{
//inverse of a matrix
//this method enable usage of inv or inverse as
//name of mtrix inversion method
return [Link](a);
}

//LU decomposition method


ww

public static double[][] LU(double c[][],int indx[],int d[])


{
//returns LU decomposition of matrix c and index indx
double a[][];
int n=[Link];
a=new double[n][n];
double vv[];
vv=new double[n];
double sum,dum,big,temp;

216
217

int i,j,k;
int imax;

m
int nmax=100;
double tiny=1.0e-40;
imax=0;
for(i=1;i<=n;i++)
{
for(j=1;j<=n;j++)
a[i-1][j-1]=c[i-1][j-1];

o
}
d[0]=1;
for(i=1;i<=n;i++)
{

i.c
big=0.0;
for(j=1;j<=n;j++)
{
if([Link](a[i-1][j-1])>big) big=[Link](a[i-1][j-1]);
}
if(big==0) {[Link]("singular matrix");return a;}
vv[i-1]=1.0/big;
}

dil
for(j=1;j<=n;j++)
{
for(i=1;i<j;i++)
{
sum=a[i-1][j-1];
for(k=1;k<i;k++)
{
sum-=a[i-1][k-1]*a[k-1][j-1];
}
va
a[i-1][j-1]=sum;
}
big=0;
for(i=j;i<=n;i++)
{
sum=a[i-1][j-1];
for(k=1;k<j;k++)
{
ja

sum-=a[i-1][k-1]*a[k-1][j-1];
}
a[i-1][j-1]=sum;
dum=vv[i-1]*[Link](sum);
if(dum>=big)
{
w.

imax=i;
big=dum;
}
} //end of i=0
if(j != imax)
{
for(k=1;k<=n;k++)
{
ww

dum=a[imax-1][k-1];
a[imax-1][k-1]=a[j-1][k-1];
a[j-1][k-1]=dum;
}
d[0]=-d[0];
vv[imax-1]=vv[j-1];
} //end of if
indx[j-1]=imax;
if(a[j-1][j-1]==0) a[j-1][j-1]=tiny;

217
218

if(j!=n)
{

m
dum=1.0/a[j-1][j-1];
for(i=j+1;i<=n;i++)
a[i-1][j-1]*=dum;
}//endif
} //end for j=
return a;
}

o
public static double[] LUaxb(double a[][],double x[],int indx[])
{

i.c
//solves AX=B system of linear equation of LU decomposed matrix a
//(calculated by method LU)
int ii=0;
int i,j,ll=0;
double sum=0;
int n=[Link];
double b[];
b=new double[n];

dil
for(i=1;i<=n;i++)
{
b[i-1]=x[i-1];
}
for(i=1;i<=n;i++)
{
ll=indx[i-1];
sum=b[ll-1];
b[ll-1]=b[i-1];
va
if(ii!=0)
{
for(j=ii;j<=(i-1);j++)
{
sum-=a[i-1][j-1]*b[j-1];
}
}
else if(sum!=0) ii=i;
ja

b[i-1]=sum;
}
for(i=n;i>=1;i--)
{
sum=b[i-1];
if(i<n)
w.

{
for(j=(i+1);j<=n;j++)
{
sum-=a[i-1][j-1]*b[j-1];
}
}
b[i-1]=sum/a[i-1][i-1];
}
ww

return b;
}

public static double[] AXB(double a[][],double b[])


{
//Solution of system of linear equations by LU method
// note that the same calculation can be done by divide method.
int n=[Link];
double c[]=new double[n];

218
219

int d[]={1};
int indx[]=new int[n];

m
double e[][]=new double[n][n];
e=[Link](a,indx,d);
c=[Link](e,b,indx);
return c;
} //end of AXB

public static double[][] LUinv(double a[][])

o
{
//inverse of a matrix by using LU decomposition method
//this method is more efficient than inv (or inverse)
int n=[Link];

i.c
double c[][]=new double[n][n];
double b[][]=Matrix.I(n);
int d[]={0};
int indx[]=new int[n];
double e[][]=new double[n][n];
e=[Link](a,indx,d);
for(int i=0;i<n;i++)
{

dil
c[i]=[Link](e,b[i],indx);
}
return Matrix.T(c);
} //end of LUinv

public static double det(double a[][])


{
//determinant of a matrix
int n=[Link];
va
int indx[]=new int[n];
int d[]={1};
double e;
double b[][]=new double[n][n];
b=[Link](a,indx,d);
e=d[0];
for(int i=0;i<n;i++)
e=e*b[i][i];
ja

return e;
} //end of det

public static double determinant(double a[][])


{
//determinant of a matrix
w.

return [Link](a);
}

public static double D(double a[][])


{
//determinant of a matrix
return [Link](a);
}
ww

//************* multiply methods definitions *********************


public static double[][] multiply(double[][] left,double[][] right)
{
//multiplication of two matrices
int ii,jj,i,j,k;
int m1=left[0].length;
int n1=[Link];
int m2=right[0].length;

219
220

int n2=[Link];
double[][] b;

m
b=new double[m1][n2];
if(n1 != m2)
{
[Link]("inner matrix dimensions must agree");
for(ii=0;ii<n1;ii++)
{
for(jj=0;jj<m2;jj++)

o
b[ii][jj]=0;
}
return b;
}

i.c
for(i=0;i<m1;i++)
{
for(j=0;j<n2;j++)
{
for(k=0;k<n1;k++)
b[i][j]+=left[i][k]*right[k][j];
}
}

dil
return b;
//end of multiply of two matrices
}

public static double[] multiply(double[][] left,double[] right)


{
//multiplication of one matrix with one vector
int ii,jj,i,j,k;
va
int m1=left[0].length;
int n1=[Link];
int m2=[Link];
double[] b;
b=new double[m2];
if(n1 != m2)
{
[Link]("inner matrix dimensions must agree");
ja

for(ii=0;ii<n1;ii++)
{
b[ii]=0;
}
return b;
}
w.

for(i=0;i<m1;i++)
{
b[i]=0;
for(k=0;k<n1;k++)
b[i]+=left[i][k]*right[k];
}
return b;
//end of multiply of a matrix and a vector
ww

public static double[] multiply(double[] left,double[][] right)


{
//multiplication of one vector with one matrix
int ii,jj,i,j,k;
int m2=right[0].length;
int n2=[Link];
int m1=[Link];

220
221

double[] b;
b=new double[m1];

m
if(n2 != m1)
{
[Link]("inner matrix dimensions must agree");
for(ii=0;ii<n2;ii++)
{
b[ii]=0;
}

o
return b;
}
for(i=0;i<m2;i++)
{

i.c
b[i]=0;
for(k=0;k<m1;k++)
b[i]+=right[i][k]*left[k];
}
return b;
//end of multiply of a vector and a matrix
}

dil
public static double[][] multiply(double left,double[][] right)
{
//multiplying a matrix with a constant
int i,j;
int n=[Link];
int m=right[0].length;
double b[][];
b=new double[n][m];
for(i=0;i<n;i++)
va
{
for(j=0;j<m;j++)
b[i][j]=right[i][j]*left;
}
return b;
//end of multiplying a matrix with a constant double
}
ja

public static double[][] multiply(double[][] left,double right)


{
//multiplying a matrix with a constant
int i,j;
int n=[Link];
int m=left[0].length;
w.

double b[][];
b=new double[n][m];
for(i=0;i<n;i++)
{
for(j=0;j<m;j++)
b[i][j]=left[i][j]*right;
}
return b;
ww

//end of multiplying a matrix with a constant double


}

public static double[] multiply(double left,double[] right)


{
//multiplying a vector with a constant
int i;
int n=[Link];
double b[];

221
222

b=new double[n];
for(i=0;i<n;i++)

m
{
b[i]=left*right[i];
}
return b;
}

public static double[] multiply(double[] left,double right)

o
{
//multiplying a vector with a constant
int i;
int n=[Link];

i.c
double b[];
b=new double[n];
for(i=0;i<n;i++)
{
b[i]=right*left[i];
}
return b;
}

dil
//*************** end of multiply methods definitions **************
//=============== defination of power methods pow ==============
public static double[][] pow(double[][] right,double left)
{
// power of a matrix
int i,j;
double b[][];
int n=[Link];
int m=right[0].length;
va
b=new double[n][m];
for(i=0;i<n;i++)
{
for(j=0;j<m;j++)
{
if(left==0.0)
{
b[i][j]=1.0;
ja

}
else
{
b[i][j]=[Link](right[i][j],left);
}
}
w.

}
return b;
//end of power of a matrix
}

public static double[] pow(double[] right,double left)


{
// power of a vector
ww

int i;
int n=[Link];
double b[];
b=new double[n];
for(i=0;i<n;i++)
{
if(left==0.0)
{
b[i]=1.0;

222
223

}
else

m
{
b[i]=[Link](right[i],left);
}
}
return b;
//end of power of a vector
}

o
//=================end of power method pow definitions =============
//***************** addition add methods **************************

i.c
public static double[][] add(double[][] left,double[][] right)
{
//addition of two matrices
int n1=[Link];
int m1=left[0].length;
int n2=[Link];
int m2=right[0].length;
int nMax,mMax;

dil
int i,j;
if(m1>=m2) mMax=m1;
else mMax=m2;
if(n1>=n2) nMax=n1;
else nMax=n2;
double b[][];
b=new double[nMax][mMax];
for(i=0;i<n1;i++)
{
va
for(j=0;j<m1;j++)
{
b[i][j]=b[i][j]+left[i][j];
}
}
for(i=0;i<n2;i++)
{
for(j=0;j<m2;j++)
ja

{
b[i][j]=b[i][j]+right[i][j];
}
}
return b;
//end of matrix addition method
w.

public static double[] add(double[] left,double[] right)


{
//addition of two vectors
int n1=[Link];
int n2=[Link];
int nMax;
ww

int i;
if(n1>=n2) nMax=n1;
else nMax=n2;
double b[];
b=new double[nMax];
for(i=0;i<n1;i++)
{
b[i]=b[i]+left[i];
}

223
224

for(i=0;i<n2;i++)
{

m
b[i]=b[i]+right[i];
}
return b;
//end of vector addition method
}

public static double[][] substract(double[][] left,double[][] right)

o
{
//addition of two matrices
int n1=[Link];
int m1=left[0].length;

i.c
int n2=[Link];
int m2=right[0].length;
int nMax,mMax;
int i,j;
if(m1>=m2) mMax=m1;
else mMax=m2;
if(n1>=n2) nMax=n1;
else nMax=n2;

dil
double b[][];
b=new double[nMax][mMax];
for(i=0;i<n1;i++)
{
for(j=0;j<m1;j++)
{
b[i][j]=b[i][j]+left[i][j];
}
}
va
for(i=0;i<n2;i++)
{
for(j=0;j<m2;j++)
{
b[i][j]=b[i][j]-right[i][j];
}
}
return b;
ja

//end of matrix substraction method


}

public static double[] substract(double[] left,double[] right)


{
//addition of two vectors
w.

int n1=[Link];
int n2=[Link];
int nMax;
int i;
if(n1>=n2) nMax=n1;
else nMax=n2;
double b[];
b=new double[nMax];
ww

for(i=0;i<n1;i++)
{
b[i]=b[i]+left[i];
}
for(i=0;i<n2;i++)
{
b[i]=b[i]-right[i];
}
return b;

224
225

//end of vector substraction method


}

m
//============== division of the matrices
public static double[][] divide(double[][] left,double[][] right)
{
//division of two matrices
int n=[Link];
int m=right[0].length;

o
double b[][];
b=new double[n][m];
b=[Link]([Link](right),left);
return b;

i.c
}

public static double[][] LUdivide(double[][] left,double[][] right)


{
//division of two matrices utilises LUinv method instead of inv
int n=[Link];
int m=right[0].length;
double b[][];

dil
b=new double[n][m];
b=[Link]([Link](right),left);
return b;
}

public static double[] divide(double[] left,double[][] right)


{
//division of two matrices
va
int n=[Link];
int m=right[0].length;
double b[];
b=new double[n];
b=[Link]([Link](right),left);
return b;
}
ja

public static double[] LUdivide(double[] left,double[][] right)


{
//division of two matrices utilises AXB (LU decomposition method)
//in fact this method is exactly same as AXB except spacing of the
//arguments
return AXB(right,left);
w.

//============== absolute value of a matrix===================

public static double abs(double[][] left)


{
// absoulute value of a matrix
int i,j;
ww

int n=[Link];
int m=left[0].length;
double b=0;
for(i=0;i<n;i++)
for(j=0;j<m;j++)
{
b=b+[Link](left[i][j]);
}
return b;

225
226

m
public static double abs(double[] left)
{
// absolute value of a vector
int i;
int n=[Link];
double b=0;
for(i=0;i<n;i++)

o
{
b=b+[Link](left[i]);
}
return b;

i.c
}

//===============special matrices==============================
public static double[][] Transpose(double [][] left)
{
//transpose matrix (if A=a(i,j) Transpose(A)=a(j,i)
int i,j;
int n=[Link];

dil
int m=left[0].length;
double b[][];
b=new double[m][n];
for(i=0;i<n;i++)
{
for(j=0;j<m;j++)
{
b[j][i]=left[i][j];
}
va
}
return b;
}

public static double[][] T(double [][] left)


{
//transpose matrix (if A=a(i,j) T(A)=a(j,i)
int i,j;
ja

int n=[Link];
int m=left[0].length;
double b[][];
b=new double[m][n];
for(i=0;i<n;i++)
{
w.

for(j=0;j<m;j++)
{
b[j][i]=left[i][j];
}
}
return b;
}
ww

public static complex[][] T(complex [][] left)


{
//transpose matrix (if A=a(i,j) T(A)=a(j,i)
int i,j;
int n=[Link];
int m=left[0].length;
complex b[][];
b=new complex[m][n];
for(i=0;i<n;i++)

226
227

{
for(j=0;j<m;j++)

m
{
b[j][i]=new complex(left[i][j]);
}
}
return b;
}

o
public static double[][] I(int n)
{
//unit matrix

i.c
double b[][];
b=new double[n][n];
for(int i=0;i<n;i++)
b[i][i]=1.0;
return b;
}

public static double[] one(int n)

dil
{
//one matrix
double b[];
b=new double[n];
for(int i=0;i<n;i++)
b[i]=1.0;
return b;
}
va
public static double[][] characteristic_matrix(double c[])
{
//this routine converts polynomial coefficients to a matrix
//with the same eigenvalues (roots)
int n=[Link]-1;
int i;
double a[][]=new double[n][n];
for(i=0;i<n;i++)
ja

{
a[0][i]=-c[i+1]/c[0];
}
for(i=0;i<n-1;i++)
{
a[i+1][i]=1;
w.

}
return a;
}

//===========Eigen value calculations ==============

public static double[][] balance(double b[][])


{
ww

// balance of a matrix for more accurate eigenvalue


// calculations
double radix=2.0;
double sqrdx=radix*radix;
double c,r,f,s,g;
int m,j,i,last;
int n=[Link];
last=0;
double a[][];

227
228

a=new double[n][n];
f=1;

m
s=1;
for(i=1;i<=n;i++)
for(j=1;j<=n;j++)
a[i-1][j-1]=b[i-1][j-1];
while(last==0)
{
last=1;

o
for(i=1;i<=n;i++)
{
c=0;r=0;
for(j=1;j<=n;j++)

i.c
{
if(j != i)
{
c+=[Link](a[j-1][i-1]);
r+=[Link](a[i-1][j-1]);
} //end of if(j!=..
} //end of for(j=1...
if(c != 0 && r != 0 )

dil
{
g=r/radix;
f=1.0;
s=c+r;
while(c<g)
{
f*=radix;
c*=sqrdx;
}
va
g=r*radix;
while(c>g)
{
f/=radix;
c/=sqrdx;
}
} //end of if(c != 0 && ....
if( (c+r)/f < 0.95*s )
ja

{
last=0;
g=1.0/f;
for(j=1;j<=n;j++) { a[i-1][j-1]*=g; }
for(j=1;j<=n;j++) { a[j-1][i-1]*=f; }
} //end of if( ((c+r..
w.

}//end of for(i=1;i<=n....
} //end of while last==0
return a;
}

public static double[][] Hessenberg(double b[][])


{
// Calculates the hessenberg matrix
ww

// it is used in QR method to calculate eigenvalues


// of a matrix(symmetric or non-symmetric)
int m,j,i;
int n=[Link];
double a[][];
a=new double[n][n];
for(i=0;i<n;i++)
for(j=0;j<n;j++)
a[i][j]=b[i][j];

228
229

double x,y;
if(n>2)

m
{
for(m=2;m<=(n-1);m++)
{
x=0.0;
i=m;
for(j=m;j<=n;j++)
{

o
if([Link](a[j-1][m-2]) > [Link](x))
{
x=a[j-1][m-2];
i=j;

i.c
} //end of if([Link](..
}//end of for(j=m,j<=n...
if(i!=m)
{
for(j=(m-1);j<=n;j++)
{
y=a[i-1][j-1];
a[i-1][j-1]=a[m-1][j-1];

dil
a[m-1][j-1]=y;
}//end of for(j=(m-1)..
for(j=1;j<=n;j++)
{
y=a[j-1][i-1];
a[j-1][i-1]=a[j-1][m-1];
a[j-1][m-1]=y;
}//end of for(j=1;j<=n....
} //end of if(i!=m)
va
if(x != 0.0)
{
for(i=(m+1);i<=n;i++)
{
y=a[i-1][m-2];
if(y!=0.0)
{
y=y/x;
ja

a[i-1][m-2]=y;
for(j=m;j<=n;j++)
{
a[i-1][j-1]-=y*a[m-1][j-1];
}
for(j=1;j<=n;j++)
w.

{
a[j-1][m-1]+=y*a[j-1][i-1];
}
}//end of if(y!=0..
}//end of for(i=(m+1)...
} //end of if(x != 0.0...
}//end of for(m=2;m<=(n-1)..
}//end of Hessenberg
ww

for(i=1;i<=n;i++)
for(j=1;j<=n;j++)
{
if(i>(j+1)) a[i-1][j-1]=0;
}
return a;
}

public static double[][] QR(double b[][])

229
230

{
//calculates eigenvalues of a Hessenberg matrix

m
int n=[Link];
double rm[][]=new double[2][n];
double a[][]=new double[n+1][n+1];
double wr[]=new double[n+1];
double wi[]=new double[n+1];
int nn,m,l,k,j,its,i,mmin;
double z,y,x,w,v,u,t,s,r=0,q=0,p=0,anorm;

o
for(i=0;i<n;i++)
for(j=0;j<n;j++)
a[i+1][j+1]=b[i][j];
anorm=[Link](a[1][1]);

i.c
for (i=2;i<=n;i++)
for (j=(i-1);j<=n;j++)
anorm += [Link](a[i][j]);
nn=n;
t=0.0;
while (nn >= 1) {
its=0;
do {

dil
for (l=nn;l>=2;l--) {
s=[Link](a[l-1][l-1])+[Link](a[l][l]);
if (s == 0.0) s=anorm;
if ((double)([Link](a[l][l-1]) + s) == s) break;
}
x=a[nn][nn];
if (l == nn) {
wr[nn]=x+t;
wi[nn--]=0.0;
va
}
else {
y=a[nn-1][nn-1];
w=a[nn][nn-1]*a[nn-1][nn];
if (l == (nn-1)) {
p=0.5*(y-x);
q=p*p+w;
z=[Link]([Link](q));
ja

x += t;
if (q >= 0.0) {
z=p+[Link](z,p);
wr[nn-1]=wr[nn]=x+z;
if (z!=0) wr[nn]=x-w/z;
wi[nn-1]=wi[nn]=0.0;
w.

}
else {
wr[nn-1]=wr[nn]=x+p;
wi[nn-1]= -(wi[nn]=z);
}
nn -= 2;
}
else {
ww

if (its == 30) [Link]("Too many iterations in


hqr");
if (its == 10 || its == 20) {
t += x;
for (i=1;i<=nn;i++) a[i][i] -= x;
s=[Link](a[nn][nn-1])+[Link](a[nn-1][nn-2]);
y=x=0.75*s;
w = -0.4375*s*s;
}

230
231

++its;
for (m=(nn-2);m>=l;m--) {

m
z=a[m][m];
r=x-z;
s=y-z;
p=(r*s-w)/a[m+1][m]+a[m][m+1];
q=a[m+1][m+1]-z-r-s;
r=a[m+2][m+1];
s=[Link](p)+[Link](q)+[Link](r);

o
p /= s;
q /= s;
r /= s;
if (m == l) break;

i.c
u=[Link](a[m][m-1])*([Link](q)+[Link](r));
v=[Link](p)*([Link](a[m-1][m-1])+
[Link](z)+[Link](a[m+1][m+1]));
if ((double)(u+v) == v) break;
}
for (i=m+2;i<=nn;i++) {
a[i][i-2]=0.0;
if (i != (m+2)) a[i][i-3]=0.0;

dil
}
for (k=m;k<=nn-1;k++) {
if (k != m) {
p=a[k][k-1];
q=a[k+1][k-1];
r=0.0;
if (k != (nn-1)) r=a[k+2][k-1];
if ((x=[Link](p)+[Link](q)+[Link](r)) != 0.0) {
p /= x;
va
q /= x;
r /= x;
}
}
if ((s=[Link]([Link](p*p+q*q+r*r),p)) != 0.0) {
if (k == m) {
if (l != m)
a[k][k-1] = -a[k][k-1];
ja

}
else
a[k][k-1] = -s*x;
p += s;
x=p/s;
y=q/s;
w.

z=r/s;
q /= p;
r /= p;
for (j=k;j<=nn;j++) {
p=a[k][j]+q*a[k+1][j];
if (k != (nn-1)) {
p += r*a[k+2][j];
a[k+2][j] -= p*z;
ww

}
a[k+1][j] -= p*y;
a[k][j] -= p*x;
}
mmin = nn<k+3 ? nn : k+3;
for (i=l;i<=mmin;i++) {
p=x*a[i][k]+y*a[i][k+1];
if (k != (nn-1)) {
p += z*a[i][k+2];

231
232

a[i][k+2] -= p*r;
}

m
a[i][k+1] -= p*q;
a[i][k] -= p;
}
}
}
}
}

o
} while (l < nn-1);
}
for(i=0;i<n;i++)
{

i.c
rm[0][i]=wr[i+1];
rm[1][i]=wi[i+1];
}
return rm;
} //end of QR

public static double[][] eigenValue(double b[][])


{

dil
// this routine input a matrix (non symetric or symmetric)
// and calculate eigen values
// method balance can be used prior to this method to balance
// the input matrix
int n=[Link];
double d[][]=new double[2][n];
d=[Link]([Link](b));
return d;
}
va
public static complex[] eigenValueC(double b[][])
{
// this routine input a matrix (non symetric or symmetric)
// and calculate eigen values
// method balance can be used prior to this method to balance
// the input matrix
//output eigenvalues will be in a vector of complex form
ja

int n=[Link];
double d[][]=new double[2][n];
d=[Link]([Link](b));
complex c[]=new complex[n];
for(int i=0;i<n;i++)
{
w.

c[i]=new complex(d[0][i],d[1][i]);
}
return c;
}

//roots of a polynomial
public static double[][] poly_roots(double c[])
{
ww

//roots of a degree n polynomial


// P(x)=c[n]*x^n+c[n-1]*x^(n-1)+....+c[1]*x+c[0]=0;
int n=[Link]-1;
double a[][]=new double[n][n];
a=characteristic_matrix(c);
double d[][]=new double[2][n];
d=eigenValue(a);
return d;
}

232
233

public static complex[] poly_rootsC(double c[])

m
{
// roots of a degree n polynomial
// P(x)=c[n]*x^n+c[n-1]*x^(n-1)+....+c[1]*x+c[0]=0;
// roots are returned as complex variables
int n=[Link]-1;
double a[][]=new double[n][n];
a=characteristic_matrix(c);

o
double d[][]=new double[2][n];
d=eigenValue(a);
complex e[]=new complex[n];
for(int i=0;i<n;i++)

i.c
e[i]=new complex(d[0][i],d[1][i]);
return e;
}

public static double[][] balancedEigenValue(double b[][])


{
// this routine input a matrix (non symetric or symmetric)
// and calculates eigen values

dil
// method balance is used to balance the matrix previous to
// actual calculations
int n=[Link];
double d[][]=new double[2][n];
d=[Link]([Link]([Link](b)));
return d;
}

public static double[][] tridiagonal(double b[][], double d[], double e[])


va
{
//reduces matrix to tridiaonal form by using householder transformation
//this method is used by QL method to calculate eigen values
//and eigen vectors of a symmetric matrix
int l,k,j,i;
int n=[Link];
double scale,hh,h,g,f;
double a[][]=new double[n+1][n+1];
ja

double c[][]=new double[n][n];


for(i=0;i<n;i++)
for(j=0;j<n;j++)
a[i][j]=b[i][j];
for (i=n;i>=2;i--) {
l=i-1;
w.

h=scale=0.0;
if (l > 1) {
for (k=1;k<=l;k++)
scale += [Link](a[i-1][k-1]);
if (scale == 0.0)
e[i-1]=a[i-1][l-1];
else {
for (k=1;k<=l;k++) {
ww

a[i-1][k-1] /= scale;
h += a[i-1][k-1]*a[i-1][k-1];
}
f=a[i-1][l-1];
g=(f >= 0.0 ? -[Link](h) : [Link](h));
e[i-1]=scale*g;
h -= f*g;
a[i-1][l-1]=f-g;
f=0.0;

233
234

for (j=1;j<=l;j++) {
a[j-1][i-1]=a[i-1][j-1]/h;

m
g=0.0;
for (k=1;k<=j;k++)
g += a[j-1][k-1]*a[i-1][k-1];
for (k=j+1;k<=l;k++)
g += a[k-1][j-1]*a[i-1][k-1];
e[j-1]=g/h;
f += e[j-1]*a[i-1][j-1];

o
}
hh=f/(h+h);
for (j=1;j<=l;j++) {
f=a[i-1][j-1];

i.c
e[j-1]=g=e[j-1]-hh*f;
for (k=1;k<=j;k++)
a[j-1][k-1] -= (f*e[k-1]+g*a[i-1][k-
1]);
}
}
} else
e[i-1]=a[i-1][l-1];

dil
d[i-1]=h;
}
d[1-1]=0.0;
e[1-1]=0.0;
/* Contents of this loop can be omitted if eigenvectors not
wanted except for statement d[i-1]=a[i-1][i-1]; */
for (i=1;i<=n;i++) {
l=i-1;
if (d[i-1] != 0) {
va
for (j=1;j<=l;j++) {
g=0.0;
for (k=1;k<=l;k++)
g += a[i-1][k-1]*a[k-1][j-1];
for (k=1;k<=l;k++)
a[k-1][j-1] -= g*a[k-1][i-1];
}
}
ja

d[i-1]=a[i-1][i-1];
a[i-1][i-1]=1.0;
for (j=1;j<=l;j++) a[j-1][i-1]=a[i-1][j-1]=0.0;
}
return a;
}
w.

public static double pythag(double a, double b)


{
//this method is used by QL method
double absa,absb;
absa=[Link](a);
absb=[Link](b);
if (absa > absb) return absa*[Link](1.0+(absb/absa)*(absb/absa));
ww

else return (absb==0.0 ? 0.0 :


absb*[Link](1.0+(absa/absb)*(absa/absb)));
}

public static double[][] QL(double d[], double e[], double a[][])


{
// QL algorithm : eigenvalues of a symmetric matrix reduced to tridiagonal
// form by using method tridiagonal
int n=[Link];

234
235

int m,l,iter,i,j,k;
double s,r,p,g,f,dd,c,b;

m
for (i=2;i<=n;i++) e[i-2]=e[i-1];
e[n-1]=0.0;
double z[][]=new double[n][n];
for(i=0;i<n;i++)
for(j=0;j<n;j++)
z[i][j]=a[i][j];
for (l=1;l<=n;l++) {

o
iter=0;
do {
for (m=l;m<=n-1;m++) {
dd=[Link](d[m-1])+[Link](d[m]);

i.c
if ((double)([Link](e[m-1])+dd) == dd) break;
}
if (m != l) {
if (iter++ == 30) [Link]("Too many iterations in
QL");
g=(d[l]-d[l-1])/(2.0*e[l-1]);
r=[Link](g,1.0);
g=d[m-1]-d[l-1]+e[l-1]/(g+[Link](r,g));

dil
s=c=1.0;
p=0.0;
for (i=m-1;i>=l;i--) {
f=s*e[i-1];
b=c*e[i-1];
e[i]=(r=[Link](f,g));
if (r == 0.0) {
d[i] -= p;
e[m-1]=0.0;
va
break;
}
s=f/r;
c=g/r;
g=d[i ]-p;
r=(d[i-1]-g)*s+2.0*c*b;
d[i ]=g+(p=s*r);
g=c*r-b;
ja

for (k=1;k<=n;k++) {
f=z[k-1][i ];
z[k-1][i ]=s*z[k-1][i-1]+c*f;
z[k-1][i-1]=c*z[k-1][i-1]-s*f;
}
}
w.

if (r == 0.0 && i >= l) continue;


d[l-1] -= p;
e[l-1]=g;
e[m-1]=0.0;
}
} while (m != l);
}
return z;
ww

public static double[][] eigenQL(double a[][])


{
// QL algoritm to solve eigen value problems
// symmetric matrices only (real eigen values)
// first column of the matrix returns eigen values
// second..n+1 column returns eigen vectors.
// Note : If matrix is not symmetric DO NOT use

235
236

// this method use eigenValue method (a QR algorithm)


int i,j;

m
int n=[Link];
double sum[]=new double[n];;
double d[]=new double[n];
double b[][]=new double[n][n];
double e[]=new double[n];
double z[][]=new double[n+1][n];
b=tridiagonal(a,d,e);

o
b=QL(d,e,b);
for(j=0;j<n;j++)
{
z[0][j]=d[j];

i.c
for(i=0;i<n;i++)
{
z[i+1][j]=b[i][j]/b[0][j];
if(z[i+1][j]<1e-13) z[i+1][i]=0;
}
}
return z;
}

//end of eigen value programs

//end of class Matrix


}

Matrix Sınıfı örnek programları


1. İnverse matris
dil
va
import [Link].*;
import Numeric;

class Matrix3
{
public static void main(String args[]) throws IOException
{
ja

/*
double a[][];
a=new double[5][5];
a[0][0]=1;
a[0][1]=2;
a[0][2]=0;
w.

a[0][3]=0;
a[0][4]=0;
a[1][0]=-2;
a[1][1]=3;
a[1][2]=0;
a[1][3]=0;
a[1][4]=0;
a[2][0]=3;
ww

a[2][1]=4;
a[2][2]=50;
a[2][3]=0;
a[2][4]=0;
a[3][0]=-4;
a[3][1]=5;
a[3][2]=-60;
a[3][3]=7;
a[3][4]=0;
a[4][0]=-5;

236
237

a[4][1]=6;
a[4][2]=-70;

m
a[4][3]=8;
a[4][4]=-9;
*/
double c[][]=new double[5][5];
double a[][]={{1,2,0,0,0},{-2,3,0,0,0},{3,4,50,0,0},{-4,5,-60,7,0},
{-5,6,-70,8,-9}};
double b[]=new double[5];

o
int d[]=new int[1];
b[0]=1;
b[1]=0;
b[2]=0;

i.c
b[3]=0;
b[4]=0;
[Link]("Original Matrix : ");
[Link]([Link](a));
[Link]("Inverse Matrix : (Method inv) ");
[Link]([Link]([Link](a)));
[Link]("Matrix * Inverse Matrix : (Method multiply) ");
[Link]([Link]([Link](a,[Link](a))));

dil
[Link]("Solution of system of equation : ");
[Link]("with second side : ");
[Link]([Link](b));
[Link]([Link]([Link](b,a)));
int indx[]=new int[5];
d[0]=0;
c=[Link](a,indx,d);
[Link]("LU decomposed matrix : (Method LU) ");
[Link]([Link](c));
va
[Link]("Matrix inversion by LU decomposition : (Method
LUinv)");
[Link]([Link]([Link](a)));
[Link]("Matrix * Inverse Matrix (LU Decomposition) :");
[Link]([Link]([Link](a,[Link](a))));
}
}
ja

inverse matrix metodları sonucu :


Original Matrix :
1.0 2.0 0.0 0.0 0.0
-2.0 3.0 0.0 0.0 0.0
3.0 4.0 50.0 0.0 0.0
-4.0 5.0 -60.0 7.0 0.0
w.

-5.0 6.0 -70.0 8.0 -9.0


Inverse Matrix : (Method inv)
0.4285714285714286 -0.2857142857142857 0.0 -1.1895246692412392E-17 3.96508223080413E-
18
0.2857142857142857 0.14285714285714285 0.0 5.947623346206196E-18-
1.9825411154020644E-18
-0.048571428571428564 0.005714285714285717 0.019999999999999997-3.8659551750340293E-19
1.898283117997477E-18
-0.37551020408163255-0.21632653061224483 0.1714285714285714 0.14285714285714282
2.2431036619977644E-17
ww

-0.003628117913832162 0.01723356009070296-0.0031746031746031824 0.12698412698412698-


0.11111111111111112
Matrix * Inverse Matrix : (Method multiply)
1.0 0.0 0.0 0.0 1.5407439555097887E-33
-1.1102230246251565E-16 1.0 0.0 4.163336342344337E-17-1.3877787807814454E-17
4.440892098500626E-16 1.6653345369377348E-16 0.9999999999999999-3.122502256758254E-17
9.887923813067798E-17
0.0 2.220446049250313E-16 0.0 0.9999999999999999 1.7347234759768022E-17
-2.8449465006019636E-16 1.942890293094024E-16 1.734723475976807E-16 0.0 1.0

Solution of system of equation :


with second side :

237
238

1.0
0.0
0.0

m
0.0
0.0
0.4285714285714286
0.2857142857142857
-0.048571428571428564
-0.37551020408163255
-0.003628117913832162
LU decomposed matrix : (Method LU)

o
-2.0 3.0 0.0 0.0 0.0
-0.5 3.5 0.0 0.0 0.0
2.5 -0.42857142857142855-70.0 8.0 -9.0
-1.5 2.4285714285714284-0.7142857142857143 5.714285714285714-6.428571428571429
2.0 -0.2857142857142857 0.8571428571428571 0.025000000000000064 7.875

i.c
Matrix inversion by LU decomposition : (Method LUinv)
0.42857142857142855-0.2857142857142857 -0.0 -0.0 -0.0
0.2857142857142857 0.14285714285714285 0.0 0.0 0.0
-0.04857142857142856 0.005714285714285712 0.02 -0.0 -0.0
-0.37551020408163255-0.21632653061224494 0.17142857142857143 0.14285714285714285 0.0
-0.0036281179138321806 0.017233560090702916-0.003174603174603183 0.12698412698412698-
0.1111111111111111

Matrix * Inverse Matrix (LU Decomposition) :

dil
1.0 0.0 0.0 0.0 0.0
0.0 1.0 0.0 0.0 0.0
4.440892098500626E-16-1.1102230246251565E-16 1.0 0.0 0.0
-4.440892098500626E-16-4.440892098500626E-16 0.0 1.0 0.0
-1.1796119636642288E-16-8.326672684688674E-17-4.5102810375396984E-17 0.0 1.0

2. n inci dereceden polinomun kökleri

import [Link].*;
import Numeric;
va
class Matrix4
{
public static void main(String args[]) throws IOException
{
//calculation of the roots of a polynomial (degree n)
double a[][];
a=new double[3][3];
ja

/*
double e[]=new double[4];
e[0]= -1;
e[1]= 8;
e[2]=-19;
e[3]= 12;
w.

*/
double e[]={-1,8,-19,12};
//e represents polynomial P(x)=-x^3+8*x^2-19*x+12
// indirect way calculate charecteristic matrix and then calculate
// eigenvalue of the characteristic matrix
// by using charecteristic_matrix and eigenValue
// (or eigenValueC or balancedEigenValue)
ww

// C in method names indicated complex variable output


[Link]("Original polynomial : ");
[Link]([Link](e));
a=Matrix.characteristic_matrix(e);
[Link]("Characteristic Matrix : ");
[Link]([Link](a));
//unbalanced matrix eigenvalue calculations
[Link]("eigen values (Method eigenValue)");
[Link]([Link](Matrix.T([Link](a))));
//balanced eigen value calculations

238
239

[Link]("eigen values (Method balancedeigenValue)");

m
[Link]([Link](Matrix.T([Link](a))))
;
complex c[]=new complex[5];
c=[Link](a);
[Link]("eigen values (Method eigenValueC)");
[Link]([Link](c));
//direct way use poly_roots (or poly_rootsC)

o
//poly_roots returns double matrix 2xn as complex value representation
//poly_rootsC returns complex vector solution as roots
[Link]("roots of polynomial (Method poly_roots)");
[Link]([Link](Matrix.T(Matrix.poly_roots(e))));

i.c
[Link]("roots of polynomial (Method poly_roots)");
[Link]([Link](Matrix.poly_rootsC(e)));
}
}

cözüm :

dil
Original polynomial :
-1.0 8.0 -19.0 12.0

Characteristic Matrix :
8.0 -19.0 12.0
1.0 0.0 0.0
0.0 1.0 0.0

eigen values (Method eigenValue)


va
3.9999999999999964 0.0
3.0000000000000067 0.0
0.9999999999999991 0.0

eigen values (Method balancedeigenValue)


4.000000000000007 0.0
2.999999999999993 0.0
1.0000000000000004 0.0
ja

eigen values (Method eigenValueC)


3.9999999999999964
3.0000000000000067
0.9999999999999991
w.

roots of polynomial (Method poly_roots)


3.9999999999999964 0.0
3.0000000000000067 0.0
0.9999999999999991 0.0

roots of polynomial (Method poly_roots)


3.9999999999999964
3.0000000000000067
ww

0.9999999999999991

3. Determinant

import [Link].*;
import Numeric;

239
240

class Matrix5
{

m
public static void main(String args[]) throws IOException
{
//calculation of an inverse matrix
double a[][];
a=new double[2][2];
a[0][0]=1;
a[0][1]=2;

o
a[1][0]=3;
a[1][1]=4;
[Link]("Matrix : ");
[Link]([Link](a));

i.c
[Link]("Inverse Matrix : ");
[Link]([Link]([Link](a)));
[Link]("Matrix * Inverse Matrix :");
[Link]([Link]([Link](a,[Link](a))));
[Link]("Determinant = "+[Link](a));
}
}

dil
cözümü :
Matrix :
1.0 2.0
3.0 4.0

Inverse Matrix :
-2.0 1.0
1.5 -0.5
va
Matrix * Inverse Matrix :
1.0 0.0
0.0 1.0

Determinant = -2.0

4. Eigenvalue
ja

import [Link].*;
import Numeric;

class Matrix6
{
w.

public static void main(String args[]) throws IOException


{
//Eigen Value calculations using QL method
double a[][]={{3,-1,0},{-1,2,-1},{-0,-1,3}};
[Link]("Original Matrix : ");
[Link]([Link](a));
[Link]("eigen values and Eigen Vectors : ");
ww

[Link]([Link]([Link](a)));
}
}

çözümü :

Original Matrix :
3.0 -1.0 0.0
-1.0 2.0 -1.0

240
241

0.0 -1.0 3.0

m
eigen values and Eigen Vectors :
4.0 2.9999999999999996 1.0000000000000004
1.0 1.0 1.0
-1.0000000000000004 0.0 2.0000000000000004
1.0000000000000007-0.9999999999999997 1.0000000000000004

o
Numeric sınıfı (Sayısal analiz paketi)

Numerik sınıfı ve fonksiyon girdi sınıfları ve metotları :

i.c
abstract class f_x
//tek fonksiyon tek değişken
// örnek f=x*x
abstract double func(double x);
abstract class f_xi
// birden fazla fonksiyon birden fazla değişken
// denklem_referansı indisinin değerine göre bir fonksiyon gri verir
// örnek f[0]=x[0]+sin(x[1])

dil
// f[1]=x[0]*x[0]-x[1]
// func(x,1) f[1]değerini verir
// func(x,0) f[0]değerini verir
abstract double func(double x[],int equation_ref);
abstract class fi_xi

// birden fazla fonksiyon birden fazla değişken


// tüm fonksiyonların değerini vektör olarak verir
va
// örnek f[0]=x[0]+sin(x[1])
// f[1]=x[0]*x[0]-x[1]
// func(x) f[0] ve f[1] değerlerini verir
abstract double[] func(double x[]);
abstract class fij_xi
{
// iki boyutlu fonksiyon matrisi ve değişken vectörü verilmiş
// örnek f[0][0]=x[0]+[Link](x[1]) f[0][1]=x[0]-x[1]
ja

// f[1][0]=x[0]*x[0]-x[1] f[1][1]=[Link](x[0]+x[1]*x[1]
// func(x) f[0][0], f[0][1]
// f[1][0], f[1][1]
// değerlerin iki boyutlu matrix olarak verir.
abstract double[][] func(double x[]);
w.

public class Numeric


Türev
public static double derivative(f_x f_deriv,double x)
public static double derivative(f_xi f_deriv,int equation_ref,
double x[],int x_ref)
public static double derivative(fi_xi f_deriv,
int equation_ref,double x[],int x_ref)
İntegral
ww

public static double integral(f_x f_xnt,double a,double b)


public static void trap(f_x ff,double a,double h, int j,int m,double R[][])
public static double integral_romberg(f_x ff,double a,double b)
Non-linear denklem kökleri
public static double newton(double x,f_x y,f_x dy)
public static double newton(double x,f_x y)
public static double newton_2nd_derivative(double x,f_x y,f_x dy)
public static double newton_2nd_derivative(double x,f_x y)
public static double secant_2nd_derivative(double x,f_x y)

241
242

public static double bisection(double xl,double xu,f_x y)


public static double[] newton( double x[],fi_xi y,fij_xi dy)

m
public static double[] newton( double x[],fi_xi y)
Least Square polinom uydurma
public static double[] poly_least_square
(double xi[],double yi[],int n)
public static double f_least_square(double e[],double x)
public static double error(double x[],double y[],double e[])

o
public static double[][] orthogonal_polynomial_least_square
(double xi[],double fi[],int m)
public static double f_orhogonal_polynomial(double a[][],double x)
Diferansiyel denklemler
public static double[] RK4(f_xi fp,double x0,double xn,double f0,int N)

i.c
public static double[][] RK4(f_xi fp,double x0,double xn,double f0[],int
public static double[][]
RKF45(f_xi fp,double x0,double xn,double f0,int N) throws IOException

Numeric sınıfı listesi :

//
//
// dil
//=============================================================
Numerical Analysis Package in Java
Numerical analysis calculation class Numeric
Author : Dr. Turhan Coban
//=============================================================
import [Link].*;
import Matrix;
va
abstract class f_x
{
//single function single independent variable
// example f=x*x
abstract double func(double x);
}
ja

abstract class f_xi


{
// multifunction multi independent variable
// a single value is returned indiced to equation_ref
// example f[0]=x[0]+sin(x[1])
// f[1]=x[0]*x[0]-x[1]
w.

// func(x,1) returns the value of f[1]


// func(x,0) returns the value of f[0]

abstract double func(double x[],int equation_ref);


}

abstract class fi_xi


{
ww

// multifunction multi independent variable


// vector of dependent variables are returned
// example f[0]=x[0]+sin(x[1])
// f[1]=x[0]*x[0]-x[1]
// func(x) returns the value of f[0] and f[1]
// as a two dimensional vector

abstract double[] func(double x[]);


}

242
243

abstract class fij_xi

m
{
// multifunction multi independent variable
// for n independent variable n*n matrix of
// dependent variables are returned
// example f[0][0]=x[0]+[Link](x[1]) f[0][1]=x[0]-x[1]
// f[1][0]=x[0]*x[0]-x[1] f[1][1]=[Link](x[0]+x[1]*x[1]
// func(x) returns the value of f[0][0], f[0][1]

o
// f[1][0], f[1][1]
// as a two dimensional matrix

abstract double[][] func(double x[]);

i.c
}

public class Numeric


{
//This is a library of numerical methods
//
public static double derivative(f_x f_deriv,double x)

dil
{
// This method calculates derivatives of a simple function
// accuracy of method can be adjusted by changing
// variables h0 and n
// function input should be in the form given in abstract class
// f_x
double h0=0.0256;
int i,m;
int n=7;
va
//derivative of a simple function
double T[][];
T=new double[n][n];
double h[];
h=new double[n];
//vector<double> h(n,0);
for(i=0;i<n;i++)
{
ja

h[i]=0;
for(int j=0;j<n;j++)
T[i][j]=0;
}
h[0]=h0;
double r=0.5;
w.

for( i=1;i<n;i++)
{
h[i]=h0*[Link](r,i);
}

for(i=0;i<n;i++)
{
T[i][0]=( f_deriv.func(x + h[i]) - f_deriv.func( x - h[i]))/(2.0*h[i]);
ww

}
for(m=1;m<n;m++)
{
for(i=0;i<n-m;i++)
{
T[i][m]=(h[i]*h[i]*T[i+1][m-1] - h[i+m]*h[i+m]*T[i][m-1])/(h[i]*h[i]
- h[i+m]*h[i+m]);
}
}

243
244

double xx=T[0][n-1];
return xx;

m
}

public static double derivative(f_xi f_deriv,int equation_ref,


double x[],int x_ref)
{
// This method calculates derivative of a function selected from a set of
// functions. Accuracy of method can be adjusted by changing

o
// variables h0 and n
// function input should be in the form given in abstract class
// f_xi

i.c
double h0=0.0256;
int i,m;
int n=7;
double x1[];
x1=new double[[Link]];
double x2[];
x2=new double[[Link]];
for(i=0;i<[Link];i++)

dil
{
x1[i]=x[i];
x2[i]=x[i];
}
//derivative of a simple function
double T[][];
T=new double[n][n];
double h[];
h=new double[n];
va
//vector<double> h(n,0);
for(i=0;i<n;i++)
{
h[i]=0;
for(int j=0;j<n;j++)
T[i][j]=0;
}
h[0]=h0;
ja

double r=0.5;
for( i=1;i<n;i++)
{
h[i]=h0*[Link](r,i);
}
w.

for(i=0;i<n;i++)
{
x1[x_ref]+=h[i];
x2[x_ref]-=h[i];
T[i][0]=( f_deriv.func(x1,equation_ref) -
f_deriv.func(x2,equation_ref))/(2.0*h[i]);
x1[x_ref]=x[x_ref];
x2[x_ref]=x[x_ref];
ww

}
for(m=1;m<n;m++)
{
for(i=0;i<n-m;i++)
{
T[i][m]=(h[i]*h[i]*T[i+1][m-1] -
h[i+m]*h[i+m]*T[i][m-1])/(h[i]*h[i] - h[i+m]*h[i+m]);
}
}

244
245

double xx=T[0][n-1];
return xx;

m
}

public static double derivative(fi_xi f_deriv,


int equation_ref,double x[],int x_ref)
{
// This method calculates derivative of a function selected from a set of
// functions. Accuracy of method can be adjusted by changing

o
// variables h0 and n
// function input should be in the form given in abstract class
// f_xi
double h0=0.0256;

i.c
int i,m;
int n=7;
double f1[];
f1=new double[[Link]];
double f2[];
f2=new double[[Link]];
double x1[];
x1=new double[[Link]];

dil
double x2[];
x2=new double[[Link]];
for(i=0;i<[Link];i++)
{
x1[i]=x[i];
x2[i]=x[i];
}
//derivative of a simple function
double T[][];
va
T=new double[n][n];
double h[];
h=new double[n];
//vector<double> h(n,0);
for(i=0;i<n;i++)
{
h[i]=0;
for(int j=0;j<n;j++)
ja

T[i][j]=0;
}
h[0]=h0;
double r=0.5;
for( i=1;i<n;i++)
{
w.

h[i]=h0*[Link](r,i);
}

for(i=0;i<n;i++)
{
x1[x_ref]+=h[i];
x2[x_ref]-=h[i];
f1=f_deriv.func(x1);
ww

f2=f_deriv.func(x2);
T[i][0]=( f1[equation_ref] - f2[equation_ref])/(2.0*h[i]);
x1[x_ref]=x[x_ref];
x2[x_ref]=x[x_ref];
}
for(m=1;m<n;m++)
{
for(i=0;i<n-m;i++)
{

245
246

T[i][m]=(h[i]*h[i]*T[i+1][m-1] - h[i+m]*h[i+m]*T[i][m-1])/(h[i]*h[i]
- h[i+m]*h[i+m]);

m
}
}
double xx=T[0][n-1];
return xx;
}

public static double integral(f_x f_xnt,double a,double b)

o
{
//integral of a function by using gauss-legendre quadrature
//
double s[],w[];

i.c
int i;
s=new double[30];
w=new double[30];
s[ 0] = .15532579626752470000E-02;
s[ 1] = .81659383601264120000E-02;
s[ 2] = .19989067515846230000E-01;
s[ 3] = .36899976285362850000E-01;
s[ 4] = .58719732103973630000E-01;

dil
s[ 5] = .85217118808615820000E-01;
s[ 6] = .11611128394758690000E+00;
s[ 7] = .15107475260334210000E+00;
s[ 8] = .18973690850537860000E+00;
s[ 9] = .23168792592899010000E+00;
s[10] = .27648311523095540000E+00;
s[11] = .32364763723456090000E+00;
s[12] = .37268153691605510000E+00;
s[13] = .42306504319570830000E+00;
va
s[14] = .47426407872234120000E+00;
s[15] = .52573592127765890000E+00;
s[16] = .57693495680429170000E+00;
s[17] = .62731846308394490000E+00;
s[18] = .67635236276543910000E+00;
s[19] = .72351688476904450000E+00;
s[20] = .76831207407100990000E+00;
s[21] = .81026309149462140000E+00;
ja

s[22] = .84892524739665800000E+00;
s[23] = .88388871605241310000E+00;
s[24] = .91478288119138420000E+00;
s[25] = .94128026789602640000E+00;
s[26] = .96310002371463720000E+00;
s[27] = .98001093248415370000E+00;
w.

s[28] = .99183406163987350000E+00;
s[29] = .99844674203732480000E+00;
w[ 0] = .39840962480827790000E-02;
w[ 1] = .92332341555455000000E-02;
w[ 2] = .14392353941661670000E-01;
w[ 3] = .19399596284813530000E-01;
w[ 4] = .24201336415292590000E-01;
w[ 5] = .28746578108808720000E-01;
ww

w[ 6] = .32987114941090080000E-01;
w[ 7] = .36877987368852570000E-01;
w[ 8] = .40377947614710090000E-01;
w[ 9] = .43449893600541500000E-01;
w[10] = .46061261118893050000E-01;
w[11] = .48184368587322120000E-01;
w[12] = .49796710293397640000E-01;
w[13] = .50881194874202750000E-01;
w[14] = .51426326446779420000E-01;

246
247

w[15] = .51426326446779420000E-01;
w[16] = .50881194874202750000E-01;

m
w[17] = .49796710293397640000E-01;
w[18] = .48184368587322120000E-01;
w[19] = .46061261118893050000E-01;
w[20] = .43449893600541500000E-01;
w[21] = .40377947614710090000E-01;
w[22] = .36877987368852570000E-01;
w[23] = .32987114941090080000E-01;

o
w[24] = .28746578108808720000E-01;
w[25] = .24201336415292590000E-01;
w[26] = .19399596284813530000E-01;
w[27] = .14392353941661670000E-01;

i.c
w[28] = .92332341555455000000E-02;
w[29] = .39840962480827790000E-02;
int n=30;
double z=0;
double x,y;
for(i=0;i<n;i++)
{
x=(b+a)/2.0+(b-a)/2.0*s[i];

dil
y=f_xnt.func(x);
z+=(b-a)/2*w[i]*y;
}
for(i=0;i<n;i++)
{
x=(b+a)/2.0+(b-a)/2.0*(-s[i]);
y=f_xnt.func(x);
z+=(b-a)/2.0*w[i]*y;
}
va
return z;
}

public static void trap(f_x ff,double a,double h, int j,int m,double R[][])
{
// successive trapezoidal integration rule
// this program will be utilised in romberg integration
ja

double sum=0;
int p;
for(p=1;p<=m;p++)
{ sum+=[Link](a+h*(2*p-1)); }
R[j][0]=R[j-1][0]/2.0+h*sum;
}
w.

public static double integral_romberg(f_x ff,double a,double b)


{
//romberg integration
int n=8;//increase n to increase accuracy
double R[][];
R=new double[n+1][n+1];
int m=1;
ww

double h=b-a;
double close=1;
double tol=1e-40;
int j=0,k=0;
double ret=0;
R[0][0]=h/2.0*([Link](a)+[Link](b));
do
{
j++;

247
248

h/=2.0;
[Link](ff,a,h,j,m,R);

m
m*=2;
for(k=1;k<=j;k++)
{
R[j][k]=R[j][k-1]+(R[j][k-1]-R[j-1][k-1])/([Link](4,k)-1.0);
close=[Link](R[j-1][j-1]-R[j][j]);
ret=R[j][k];
}

o
}while(close>tol && j<n);
return ret;
}

i.c
//==================================================
//Finding Non-linear Roots of Functions

public static double newton(double x,f_x y,f_x dy)


{

// Newton - Raphson method for single equation


// with single variable

dil
// required function and its derivative

int nmax=500;
double tolerance=1.0e-15;
double fx,dfx;
for(int i=0;i<nmax;i++)
{
fx=[Link](x);
dfx=[Link](x);
va
x-=fx/dfx;
if([Link](fx)<tolerance)
{
return x;
}
}
return x;
}
ja

public static double newton(double x,f_x y)


{
// Newton - Raphson method for single equation
// required function only derivative is calculated
w.

// numerically by using method derivative

int nmax=500;
double tolerance=1.0e-15;
double fx,dfx;
for(int i=0;i<nmax;i++)
{
fx=[Link](x);
ww

dfx=[Link](y,x);
x-=fx/dfx;
if([Link](fx)<tolerance)
{
return x;
}
}
return x;
}

248
249

m
public static double newton_2nd_derivative(double x,f_x y,f_x dy)
{
// Newton - Raphson type method for single equation
// includes 2nd order derivative calculations
//function and first order derivative is required
int nmax=500;
double dx=1e-3;

o
double x1m;
double tolerance=1.0e-15;
double fx,fxm,dfx,dfxm,d2fx;
for(int i=0;i<nmax;i++)

i.c
{
fx=[Link](x);
fxm=[Link](x-dx);
dfx=[Link](x);
dfxm=[Link](x-dx);
d2fx=-6.0/dx/dx*(fx-fxm)+2.0/dx*(2.0*dfx+dfxm);
x-=(fx/dfx+.5*fx*fx/(dfx*dfx*dfx)*d2fx);
if([Link](fx)<tolerance)

dil
{
return x;
}
}
return x;
}

public static double newton_2nd_derivative(double x,f_x y)


{
va
// Newton - Raphson type method for single equation
// includes 2nd order derivative calculations
// function is required, first order derivative calculated
// numerically by derivative method.
int nmax=500;
double dx=1e-3;
double x1m;
double tolerance=1.0e-15;
ja

double fx,fxm,dfx,dfxm,d2fx;
for(int i=0;i<nmax;i++)
{
fx=[Link](x);
fxm=[Link](x-dx);
dfx=[Link](y,x);
w.

dfxm=[Link](y,(x-dx));
d2fx=-6.0/dx/dx*(fx-fxm)+2.0/dx*(2.0*dfx+dfxm);
x-=(fx/dfx+.5*fx*fx/(dfx*dfx*dfx)*d2fx);
if([Link](fx)<tolerance)
{
return x;
}
}
ww

return x;
}

public static double secant_2nd_derivative(double x,f_x y)


{
// Newton - Raphson type method for single equation
// includes 2nd order derivative calculations
// function should be supplied
int nmax=500;

249
250

double dx=1.0e-3;
double dx1=2.0e-3;

m
double x1m;
double tolerance=1.0e-15;
double fx,fxm,fxm1,dfx,dfxm,d2fx;
for(int i=0;i<nmax;i++)
{
fx=[Link](x);
fxm=[Link](x-dx);

o
fxm1=[Link](x-dx1);
dfx=(fx-fxm)/dx;
dfxm=(fx-fxm1)/dx1;
d2fx=-6.0/dx/dx*(fx-fxm)+2.0/dx*(2.0*dfx+dfxm);

i.c
x-=(fx/dfx+.5*fx*fx/(dfx*dfx*dfx)*d2fx);
if([Link](fx)<tolerance)
{
return x;
}
}
return x;
}

//function should be supplied


// defination of variables :
// xl : lower guess
// xu : upper guess
dil
public static double bisection(double xl,double xu,f_x y)

//bisection method to find roots of a function [Link](x)


va
// xr : root estimate
// es : stopping criterion
// ea :approximate error
// maxit : maximum iterations
// iter : number of iteration
double test;
double xr=0;
double es,ea;
ja

double fxl,fxr;
int maxit=500,iter=0;
es=0.000001;
ea=1.1*es;
while((ea>es)&&(iter<maxit))
{
w.

xr=(xl+xu)/2.0;
iter++;
if((xl+xu)!=0)
{ ea=[Link]((xu-xl)/(xl+xu))*100;}
fxl= [Link](xl);
fxr= [Link](xr);
test= fxl*fxr;
if(test==0.0) ea=0;
ww

else if(test<0.0) xu=xr;


else
{
xl=xr;
}
} //end of while
return xr;
}

250
251

public static double[] newton( double x[],fi_xi y,fij_xi dy)


{

m
//solution of nonlinear system of equations
//by using newton raphson method.
//ti :weigth factor
//x independent value vector:
//y dependent function vector
//dy derivative of dependent function matrix
double ti=1.0;

o
int i;
int nmax=400;
double tolerance=1.0e-15;
int n=[Link];

i.c
double b[];
b=new double[n];
for(i=0;i<n;i++)
{
b[i]=1.0;
}
i=0;
while( i++ < nmax && [Link](b) > tolerance )

dil
{
b=[Link]([Link]([Link](x),[Link](x)),-ti);
x=[Link](x,b);
}
if(i >= nmax) [Link]("warning maximum number"+
" of iterations results may not be valid");
return x;
}
va
public static double[] newton( double x[],fi_xi y)
{
//solution of nonlinear system of equations
//by using newton raphson method.
//this function does not require derivatives
//it is utilised method derivative to calculate derivatives
double ti=1.0;
int i,ii,jj;
ja

int nmax=400;
double tolerance=1.0e-15;
int n=[Link];
double b[];
b=new double[n];
double dy[][];
w.

dy=new double[n][n];
i=0;
for(i=0;i<n;i++)
{
b[i]=1.0;
}
while( i++ < nmax && [Link](b) > tolerance )
{
ww

for(ii=0;ii<n;ii++)
{
for(jj=0;jj<n;jj++)
{
dy[ii][jj]=[Link](y,ii,x,jj);
}
}
b=[Link]([Link]([Link](x),dy),-ti);
x=[Link](x,b);

251
252

}
if(i >= nmax) [Link]("warning maximum number of iterations"+

m
" results may not be valid" );
return x;
}

//========= least square curve fitting methods ==========

//-------- polynomial least square curve fitting --------

o
public static double[] poly_least_square
(double xi[],double yi[],int n)
//polynomial least square curve fitting

i.c
//variables xi,yi vector of data points
//degree of curve fitting
{
//xi vector of independent variable
//yi vector of dependent variable
//n : degree of curve fitting
int l=[Link];
int i,j,k;

dil
int np1=n+1;
double A[][];
A=new double[np1][np1];
double B[];
B=new double[np1];
double X[];
X=new double[np1];

for(i=0;i<n+1;i++)
va
{
for(j=0;j<n+1;j++)
{
if(i==0 && j==0)
A[i][j]=l;
else
for(k=0;k<l;k++)
A[i][j] += [Link](xi[k],(i+j));
ja

}
for(k=0;k<l;k++)
{
if(i==0)
B[i]+= yi[k];
else
w.

B[i] += [Link](xi[k],i)*yi[k];
}
}
X=[Link](B,A);
//X=B/A;

double max=0;
for(i=0;i<n+1;i++)
ww

if([Link](X[i]) > max) max = [Link](X[i]);


for(i=0;i<n+1;i++)
if(([Link](X[i]/max) > 0) && ([Link](X[i]/max) < 1.0e-11)) X[i]=0;
return X;
}

public static double f_least_square(double e[],double x)


{
// this function calculates the value of

252
253

// least square curve fitting function


int n=[Link];

m
double ff;
if(n!=0.0)
{ ff=e[n-1];
for(int i=n-2;i>=0;i--)
{ ff=ff*x+e[i]; }
}
else

o
ff=0;
return ff;
}

i.c
public static double error(double x[],double y[],double e[])
{
//calculates absolute square root error of a least square approach
double n=[Link];
int k;
double total=0;
for(k=0;k<n;k++)
{

dil
total+=(y[k]-f_least_square(e,x[k]))*(y[k]-f_least_square(e,x[k]));
}
total=[Link](total);
return total;
}

//-------End least square methods --------------------


//-------Orthogonal polynomial least square curve fitting ---
va
public static double[][] orthogonal_polynomial_least_square
(double xi[],double fi[],int m)
//orthogonal polynomial least square curve fitting
//this method do not require any matrix solution
//variables xi,fi vector of data points wi weight functions
//m degree of curve fitting
{
int i,j,k;
ja

int n=[Link];
int mp2=n+2;
int mp1=n+1;
//matrix<double> p(m+2,n,0);
double p[][];
p=new double[mp2][n];
w.

//vector<double> gamma(m+1,0);
double gamma[];
gamma=new double[mp1];
//vector<double> beta(m+1,0);
double beta[];
beta=new double[mp1];
//vector<double> omega(m+1,0);
double omega[];
ww

omega=new double[mp1];
//vector<double> alpha(m+1,0);
double alpha[];
alpha=new double[mp1];
//vector<double> b(m+1,0);
double b[];
b=new double[mp1];
//vector<double> wi(n,1.);
double wi[];

253
254

wi=new double[n];
//matrix<double> a(3,m+1);

m
double a[][];
a=new double[3][mp1];
for(i=0;i<n;i++)
{
p[1][i]=1.0;
p[0][i]=0.0;
}

o
gamma[0]=0;
for(i=0;i<n;i++)
{
gamma[0]+=wi[i];

i.c
}
beta[0]=0.0;
for(j=0;j<m+1;j++)
{
omega[j]=0;
for(i=0;i<n;i++)
{
omega[j]+=wi[i]*fi[i]*p[j+1][i];

dil
}
b[j]=omega[j]/gamma[j];
if( j != m)
{
alpha[j+1]=0;
for(i=0;i<n;i++)
{
alpha[j+1]+=wi[i]*xi[i]*p[j+1][i]*p[j+1][i]/gamma[j];
}
va
for(i=0;i<n;i++)
{
p[j+2][i]=(xi[i]-alpha[j+1])*p[j+1][i]-beta[j]*p[j][i];
}
gamma[j+1]=0;
for(i=0;i<n;i++)
{
gamma[j+1]+=wi[i]*p[j+2][i]*p[j+2][i];
ja

}
beta[j+1]=gamma[j+1]/gamma[j];
}
}//end of j
for(j=0;j<m+1;j++)
{
w.

a[0][j]=b[j];
a[1][j]=alpha[j];
a[2][j]=beta[j];
}
return a;
}

public static double f_orhogonal_polynomial(double a[][],double x)


ww

double yy=0;
int k;
int m=a[0].length-1;
int mp2=m+2;
double q[];
q=new double[mp2];
//vector<double> q(m+2,0.0);

254
255

for(k=m-1;k>=0;k--)
{

m
q[k]=a[0][k]+(x-a[1][k+1])*q[k+1]-a[2][k+1]*q[k+2];
yy=q[k];
}
return yy;
}

//minimization of a function

o
public static double amotry(double p[][], double y[], double psum[], int
ndim,
f_xi ff, int ihi, double fac)
{

i.c
int j;
double fac1,fac2,ytry;
double ptry[]=new double[ndim];
fac1=(1.0-fac)/ndim;
fac2=fac1-fac;
for (j=1;j<=ndim;j++) ptry[j-1]=psum[j-1]*fac1-p[ihi-1][j-1]*fac2;
ytry=[Link](ptry,0);
if (ytry < y[ihi-1]) {

dil
y[ihi-1]=ytry;
for (j=1;j<=ndim;j++) {
psum[j-1] += ptry[j-1]-p[ihi-1][j-1];
p[ihi-1][j-1]=ptry[j-1];
}
}
return ytry;
}
va
public static void amoeba(double p[][], double y[], int ndim, double ftol,
f_xi ff, int nfunk)
{
int i,ihi,ilo,inhi,j,mpts=ndim+1;
int NMAX=5000;
double rtol,sum,swap,ysave,ytry;
double psum[]=new double[ndim];
ja

nfunk=0;
for (j=1;j<=ndim;j++)
{
for (sum=0.0,i=1;i<=mpts;i++) sum += p[i-1][j-1];
psum[j-1]=sum;
}
w.

for (;;) {
ilo=1;
//ihi = y[1]>y[2] ? (inhi=2,1) : (inhi=1,2);
if(y[0]>y[1])
{
inhi=2;
ihi=1;
}
ww

else
{
inhi=1;
ihi=2;
}
for (i=1;i<=mpts;i++) {
if (y[i-1] <= y[ilo-1]) ilo=i;
if (y[i-1] > y[ihi-1]) {
inhi=ihi;

255
256

ihi=i;
} else if (y[i-1] > y[inhi-1] && i != ihi) inhi=i;

m
}
rtol=2.0*[Link](y[ihi-1]-y[ilo-1])
/([Link](y[ihi-1])+[Link](y[ilo-1]));
if (rtol < ftol) {
swap=y[0];
y[0]=y[ilo-1];
y[ilo-1]=swap;

o
for (i=1;i<=ndim;i++)
{
swap=p[0][i-1];
p[0][i-1]=p[ilo-1][i-1];

i.c
p[ilo-1][i-1]=swap;
}
break;
}
if (nfunk >= NMAX) [Link]("NMAX exceeded");
nfunk += 2;
ytry=amotry(p,y,psum,ndim,ff,ihi,-1.0);
if (ytry <= y[ilo-1])

dil
ytry=amotry(p,y,psum,ndim,ff,ihi,2.0);
else if (ytry >= y[inhi-1]) {
ysave=y[ihi-1];
ytry=amotry(p,y,psum,ndim,ff,ihi,0.5);
if (ytry >= ysave) {
for (i=1;i<=mpts;i++) {
if (i != ilo) {
for (j=1;j<=ndim;j++)
psum[j-1]=0.5*(p[i-1][j-1]+p[ilo-
va
1][j-1]);
p[i-1][j-1]=psum[j-
1];
y[i]=[Link](psum,0);
}
}
nfunk += ndim;
for (j=1;j<=ndim;j++)
ja

{
for (sum=0.0,i=1;i<=mpts;i++) sum +=
p[i][j];
psum[j]=sum;
}
w.

}
} else --nfunk;
}
}

// differential equation solutions


public static double[] RK4(f_xi fp,double x0,double xn,double f0,int N)
{
ww

//4th order Runge Kutta Method


//fp :given derivative function df/dx(f,x)
// xo : initial value of the independent variable
// xn : final value of the independent variable
// f0 : initial value of the dependent variable
// N : number of dependent variable to be calculated
// fi : dependent variable
double h=(xn-x0)/N;
double fi[]=new double[N+1];

256
257

double xi[]=new double[2];


double k[];

m
k=new double[4];
int i;
double x;
fi[0]=f0;
for(x=x0,i=0;x<xn;x+=h,i++)
{
xi[0]=x;

o
xi[1]=fi[i];
k[0]=h*[Link](xi,0);
xi[0]=x+h/2.0;
xi[1]=fi[i]+k[0]/2;

i.c
k[1]=h*[Link](xi,0);
xi[1]=fi[i]+k[1]/2.0;
k[2]=h*[Link](xi,0);
xi[0]=x+h;
xi[1]=fi[i]+k[2];
k[3]=h*[Link](xi,0);
fi[i+1]=fi[i]+k[0]/6.0+k[1]/3.0+k[2]/3.0+k[3]/6.0;
}

dil
return fi;
}

public static double[][] RK4(f_xi fp,double x0,double xn,double f0[],int N)


{
//4th order Runge Kutta Method
//fp : given set of derivative functions dfj/dxi(fj,x)
// xo : initial value of the independent variable
// xn : final value of the independent variable
va
// f0 : initial value of the dependent variable
// N : number of dependent variable to be calculated
// fi : dependent variable
double h=(xn-x0)/N;
int M=[Link];
double fi[][];
fi=new double[M][N+1];
double xi[]=new double[M+1];
ja

double k[]=new double[4];


int i,j;
double x;
for(j=0;j<=M;j++)
fi[j][0]=f0[j];
for(x=x0,i=0;x<xn;x+=h,i++)
w.

{
for(j=1;j<=M;j++)
{
xi[0]=x;
xi[1]=fi[j-1][i];
k[0]=h*[Link](xi,j-1);
xi[0]=x+h/2.0;
xi[1]=fi[j-1][i]+k[0]/2;
ww

k[1]=h*[Link](xi,j-1);
xi[1]=fi[j-1][i]+k[1]/2.0;
k[2]=h*[Link](xi,j-1);
xi[0]=x+h;
xi[1]=fi[j-1][i]+k[2];
k[3]=h*[Link](xi,j-1);
fi[j-1][i+1]=fi[j-1][i]+k[0]/6.0+k[1]/3.0+k[2]/3.0+k[3]/6.0;
}
}

257
258

return fi;
}

m
public static double[][]
RKF45(f_xi fp,double x0,double xn,double f0,int N) throws IOException
{
// Runge Kutta - Fehlberg Method
// fp : derivative function df/dx(f,x) (defined as a class)
// Tol :Tolerance

o
//Hmax : maximum possible step size
//Hmin : minimum possible step size
//k : Runge kutta coefficients
//Err : error

i.c
//x[i] : input variable to fp = df/dx(f,x) = df/dx(x[i])
//j : actual step size
//fi[][]:solution matrix
//fj[][]:solution matrix in exact size(j) (return function)
double h=(xn-x0)/N;
double fi[][]=new double[2][1000];
double Tol=2.0e-3;
double Hmin=h/64.0;

dil
double Hmax=h*64.0;
double k[]=new double[6];
double Err;
double s;
double xi[]=new double[2];
int j=0;
fi[0][j]=x0;
fi[1][j]=f0;
while(fi[0][j] < xn )
va
{
if(fi[0][j]+h > xn) h=xn-fi[0][j];
xi[0]=fi[0][j];
xi[1]=fi[1][j];
k[0]=h*[Link](xi,0);
xi[0]=fi[0][j]+h/4.0;
xi[1]=fi[1][j]+k[0]/4.0;
k[1]=h*[Link](xi,0);
ja

xi[0]=fi[0][j]+3.0/8.0*h;
xi[1]=fi[1][j]+3.0/32.0*k[0]+9.0/32.0*k[1];
k[2]=h*[Link](xi,0);
xi[0]=fi[0][j]+12.0/13.0*h;
xi[1]=fi[1][j]+1932.0/2197.0*k[0]-7200.0/2197.0*k[1]+7296.0/2197.0*k[2];
k[3]=h*[Link](xi,0);
w.

xi[0]=fi[0][j]+h;
xi[1]=fi[1][j]+439.0/216.0*k[0]-8.0*k[1]+3680.0/513.0*k[2]-
845.0/4104.0*k[3];
k[4]=h*[Link](xi,0);
xi[0]=fi[0][j]+0.5*h;
xi[1]=fi[1][j]-8.0/27.0*k[0]+2.0*k[1]
-3544/2565*k[2]+1859.0/4104.0*k[3]-11.0/40.0*k[4];
k[5]=h*[Link](xi,0);
ww

Err=[Link](1.0/360.0*k[0]-128/4275*k[2]
-2197.0/75240*k[3]+1.0/5.0*k[4]+2.0/55.0*k[5]);
if(Err<Tol || h<2*Hmin)
{
fi[0][j+1]=fi[0][j]+h;
fi[1][j+1]=fi[1][j]+16.0/135.0*k[0]+6656.0/12825.0*k[2]+
28561.0/56430.0*k[3]-9.0/50.0*k[4]+2.0/55.0*k[5];
j++;
}

258
259

else
{

m
if(Err==0) s=0;
else s=0.84*([Link](Tol*h/Err,0.25));
if(s<0.75 && h>(2*Hmin) ) h/=2.0;
if(s>1.5 && Hmax >(2*h) ) h*=2.0;
}
}
double fj[][]=new double[2][j+1];

o
for(int i=0;i<=j;i++)
{
fj[0][i]=fi[0][i];
fj[1][i]=fi[1][i];

i.c
}
return fj;
}

//End of Class Numeric


}

dil
Numeric sınıfı örnek problemleri :

1. Non linear denklem çözümleri :

import [Link].*;
import Numeric;
import complex;
va
class f1 extends fi_xi
{
double[] func(double[] x)
{
double b[];
b=new double[2];
b[0]=x[0]*x[0]-x[1]-1;
b[1]=(x[0]-2)*(x[0]-2)+(x[1]-0.5)*(x[1]-0.5)-1.0;
ja

return b;
}
}

class df1 extends fij_xi


{
w.

double[][] func(double x[])


{
double b[][];
b=new double[2][2];
b[0][0]=2.0*x[0];
b[0][1]=-1.0;
b[1][0]=2.0*x[0]-4.0;
b[1][1]=2.0*x[1]-4.0;
ww

return b;
}
}

class f2 extends f_x


{
double func(double x)
{
return [Link](x)-x/2;

259
260

}
}

m
class df2 extends f_x
{
double func(double x)
{
return [Link](x)-0.5;
}

o
}

class Matrix2

i.c
{
public static void main(String args[]) throws IOException
{
//Solution of zero of functions of one or multivariable equations
f1 b1;
b1=new f1();
df1 db1;
db1=new df1();

dil
f2 b2;
b2=new f2();
df2 db2;
db2=new df2();
double x[];
x=new double[2];
x[0]=0;
x[1]=0.5;
double xx=2.5;
va
[Link]("Roots of equations : ");
[Link]("Newtons method y=f(x)=0 f(x) and df(x)/dx is
given");
[Link]("Newton y,dy x= "+[Link](xx,b2,db2));
[Link]("");
[Link]("Newtons method y=f(x)=0 f(x) is given");
[Link]("Newton y, x= "+[Link](xx,b2));
[Link]("");
ja

[Link]("Newtons method with 2nd derivative y=f(x)=0 ");


[Link]("f(x) and df(x)/dx is given ");
[Link]("Newton_2nd_derivative y,dy x= "+
Numeric.newton_2nd_derivative(xx,b2,db2));
[Link]("");
[Link]("Newtons method with 2nd derivative y=f(x)=0 ");
w.

[Link]("f(x) is given only ");


[Link]("Newton_2nd_derivative y, x= "+
Numeric.newton_2nd_derivative(xx,b2));
[Link]("");
[Link]("Secant method with 2nd derivative y=f(x)=0 ");
[Link]("f(x) is given only ");
[Link]("Secant_2nd_derivative y, x= "+
Numeric.secant_2nd_derivative(xx,b2));
ww

[Link]("");
[Link]("Newtons method for system of equations");
[Link]("yi=fi(xi)=0,i=0,n ");
[Link]("fi(xi) and dfi(xi)/dxj,i=1,n,j=1,n is given");
[Link](" "+[Link]([Link](x,b1,db1)));
[Link]("");
[Link]("Newtons method for system of equations");
[Link]("yi=fi(xi)=0,i=0,n ");

260
261

[Link]("fi(xi),i=1,n is given(derivative matrix is


notrequired)");

m
[Link](" "+[Link]([Link](x,b1)));

}
}

o
Çözüm seti :

Roots of equations :
Newtons method y=f(x)=0 f(x) and df(x)/dx is given
Newton y,dy x= 1.895494267033981

i.c
Newtons method y=f(x)=0 f(x) is given
Newton y, x= 1.895494267033981

Newtons method with 2nd derivative y=f(x)=0


f(x) and df(x)/dx is given
Newton_2nd_derivative y,dy x= 1.895494267033981

f(x) is given only


Newton_2nd_derivative y,

f(x) is given only


Secant_2nd_derivative y,
dil
Newtons method with 2nd derivative y=f(x)=0

x= 1.895494267033981

Secant method with 2nd derivative y=f(x)=0

x= 1.895494267033981
va
Newtons method for system of equations
yi=fi(xi)=0,i=0,n
fi(xi) and dfi(xi)/dxj,i=1,n,j=1,n is given
1.0673460858066892
0.13922766688686042

Newtons method for system of equations


ja

yi=fi(xi)=0,i=0,n
fi(xi),i=1,n is given(derivative matrix is notrequired)
1.0673460858066897
0.1392276668868614

2. Türev – İntegral
w.

//======================================================
// Numerical Analysis package in java
// example to show utilisation of integration (integral)
// and differentiation (derivative) functions
// Dr. Turhan Coban
// =====================================================
ww

import [Link].*;
import Numeric;
import complex;

class f1 extends f_x


{
double func(double x)
{
return x*x;
}

261
262

m
class f2 extends f_x
{
double func(double x)
{
return x;
}
}

o
class fm1 extends f_xi
{
//multivariable function

i.c
double func(double x[],int x_ref)
{
double a=0;
switch(x_ref)
{
case 0: a=(x[0]+x[1]*x[1]+x[2]*2);break;
case 1: a=(x[0]*3+x[1]*x[1]*x[1]+x[2]);break;
case 2: a=(x[0]-5*x[1]*x[1]+x[2]*x[2]*x[2]);break;

dil
}
return a;
}
}

class fm2 extends fi_xi


{
//multivariable function
double[] func(double x[])
va
{
double a[];
a=new double[3];
a[0]=(x[0]+x[1]*x[1]+x[2]*2);
a[1]=(x[0]*3+x[1]*x[1]*x[1]+x[2]);
a[2]=(x[0]-5*x[1]*x[1]+x[2]*x[2]*x[2]);
return a;
}
ja

class integ1
{
public static void main(String args[]) throws IOException
{
w.

f1 b1;
b1=new f1();
f2 b2;
b2=new f2();
fm1 b3;
b3=new fm1();
double x[];
fm2 b4;
ww

b4=new fm2();
x=new double[3];
x[0]=1;
x[1]=2;
x[2]=3;
[Link]("integral of class f1 : "+
[Link](b1,0.0,1.0));
[Link]("romberg integral of class f1 : "+
Numeric.integral_romberg(b1,0.0,1.0));

262
263

[Link]("integral of class f2 : "+


[Link](b2,0.0,1.0));

m
[Link]("Derivative of class f1 : "+
[Link](b1,1.0));
[Link]("Derivative of class f2 : "+
[Link](b2,1.0));

[Link]("Derivative of fm1,0 : "+


[Link](b3,1,x,0));

o
[Link]("Derivative of fm2,0 : "+
[Link](b4,1,x,0));
[Link]("Derivative of fm1,0 : "+
[Link](b3,1,x,0));

i.c
[Link]("Derivative of fm2,0 : "+
[Link](b4,1,x,0));
[Link]();
}
}

çözüm :

integral of class

integral of class
Derivative of class
Derivative of class
Derivative of fm1,0
Derivative of fm2,0
Derivative of fm1,0
:
:
:
dil
f1 : 0.333333333333329
romberg integral of class f1 : 0.3333333333333333
f2 : 0.49999999999999384
f1 : 1.9999999999994864
f2 : 0.9999999999998606
3.0000000000028932
3.0000000000028932
3.0000000000028932
va
Derivative of fm2,0 : 3.0000000000028932

3. Least square polinom uydurma

//===========================================
// Polynomial least square curve fitting
// Dr. Turhan Coban
//===========================================
ja

import [Link].*;
import Numeric;
import Text;
w.

class least
{
public static void main(String args[]) throws IOException
{
//polynomial least square curve fitting
double e[]; //coefficients of polynomial least square
e=new double[20];
double xi[];
ww

xi=new double[500];
double yi[];
yi=new double[500];
DataInputStream cin=new DataInputStream([Link]);
[Link]("name of input file : ");
String in_name=[Link](cin);
[Link](" ");
DataInputStream fin=new DataInputStream(new FileInputStream(in_name));
PrintStream fout=new PrintStream(new FileOutputStream("[Link]"));

263
264

int i=-1;
try {

m
while(fin != null)
{
i++;
xi[i]=[Link](fin);
yi[i]=[Link](fin);
[Link](" "+xi[i]+" "+yi[i]);
}

o
} catch(EOFException e_eof) {[Link]("end of file"); }
[Link]("degree of curve fitting : ");
int n=[Link](cin);
e=Numeric.poly_least_square(xi,yi,n);

i.c
[Link]([Link](e));
[Link]([Link](e));
[Link]("least square error : "+[Link](xi,yi,e));
[Link]("would you like to send curve fitted data to a data
file (y/n) ");
char answer=[Link](cin);
if(answer=='y')
{

dil
[Link]("name of output file : ");
String out_name=[Link](cin);
PrintStream fout1=new PrintStream(new FileOutputStream(out_name));
double xmin,xmax;
[Link]("minimum x : ");
xmin=[Link](cin);
[Link]("maximum x : ");
xmax=[Link](cin);
[Link]("number of data points : ");
va
int n_data=[Link](cin);
double x;
for(i=0;i<n_data;i++)
{
x=xmin+(xmax-xmin)/(n_data-1.0)*i;
[Link](" "+x+" "+Numeric.f_least_square(e,x));
[Link](" "+x+" "+Numeric.f_least_square(e,x));
} //end of for
ja

}//end of if
}
}

4. Diferansiyel denklemler :
w.

//======================================================
// Numerical Analysis package in java
// example to show differential equation solution
// and differentiation (derivative) functions
// Dr. Turhan Coban
// =====================================================
ww

import [Link].*;
import Numeric;
import complex;
import Matrix;

class fm1 extends f_xi


{
//multivariable function
double func(double x[],int x_ref)

264
265

{
//x[0] is x, x[1] is y

m
//this is a representation of equation : dy/dx=y
//solution of this equation is e(x)
if(x_ref==0) return x[1];
else return 0;
}
}

o
class dif1
{
public static void main(String args[]) throws IOException

i.c
{

fm1 b3=new fm1();


double x[];
x=new double[1];
x[0]=1;
//RK5 differential equation to solve differential equation dy/dx=y
//with limits 0 to 1 exact solution is e=2.7182818

dil
//boundary condition x=0 y=1 is given
//final value x=1 to be calculated by the method
[Link]([Link](Numeric.RK4(b3,0.0,1.0,1.0,50)));
}
}

1.0
1.02020134
1.0408107741377959
va
1.0618365464618167
1.0832870675613175
1.1051709179307265
1.1274968514019572
1.1502737986460576
1.1735108707455981
1.197217362839226
1.2214027578398445
ja

1.2460767302279048
1.271249149921327
1.2969300862235986
1.3231298118516308
1.3498588070449815
1.3771277637580916
w.

1.4049475899372086
1.4333294138837107
1.4622845887055762
1.4918246968587778
1.5219615547804188
1.5527072176154666
1.5840739840389706
1.6160744011756962
ww

1.648721269619143
1.682027648551951
1.7160068609697496
1.7506724990105325
1.7860384293916938
1.8221187989569014
1.8589280403350215
1.896480877713363
1.9347923327275491

265
266

1.9738777304703714
2.0137527056220317

m
2.0544332087042223
2.095935512460547
2.1382762183658373
2.1814722632669596
2.2255409261577848
2.270499835091013
2.3163669742296302

o
2.363160691040814
2.4108997036351645
2.4596031082541976
2.5092903869090972

i.c
2.5599814151737794
2.611696470135386
2.6644562385053905
2.7182818248945586

//======================================================
// Numerical Analysis package in java
// example to show differential equation solution

dil
// and differentiation (derivative) functions
// Dr. Turhan Coban
// =====================================================
import [Link].*;
import Numeric;
import complex;
import Matrix;
va
class fm1 extends f_xi
{
//multivariable function
double func(double x[],int x_ref)
{
//x[0] is x, x[1] is y
if(x_ref==0) return -2.0*x[0]-x[1];
else return 0;
ja

}
}

class dif2
{
w.

public static void main(String args[]) throws IOException


{

fm1 b3=new fm1();


double x[];
x=new double[1];
x[0]=1;
//RK5 differential equation to solve equation dy/dx=-2x-y
ww

//initial value is given as x=0 y=-1 at x=0.4 y will be determined


[Link]
([Link](Matrix.T(Numeric.RKF45(b3,0.0,0.4,-1.0,10))));
}
}

Cözüm :
0.0 -1.0

266
267

0.0050 -0.9950377826066799
0.01 -0.9901501844020889

m
0.015 -0.9853368332473136
0.02 -0.9805973588593618
0.025 -0.9759313928019077
0.030000000000000002-0.9713385684760812
0.035 -0.9668185211113052
0.04 -0.9623708877561767
0.045 -0.9579953072693951

o
0.049999999999999996-0.9536914203107341
0.05499999999999999-0.94945886933206
0.05999999999999999-0.9452972985683943
0.06499999999999999-0.9412063540290199

i.c
0.06999999999999999-0.9371856834886335
0.075 -0.9332349364785408
0.08 -0.9293537642778962
0.085 -0.9255418199049855
0.09000000000000001-0.9217987581085532
0.09500000000000001-0.9181242353591716
0.10000000000000002-0.9145179098406548
0.10500000000000002-0.9109794414415133

dil
0.11000000000000003-0.9075084917464531
0.11500000000000003-0.9041047240279163
0.12000000000000004-0.9007678032376644
0.12500000000000003-0.8974973959984025
0.13000000000000003-0.8942931705954467
0.13500000000000004-0.891154796968432
0.14000000000000004-0.8880819467030621
0.14500000000000005-0.8850742930228999
0.15000000000000005-0.8821315107811996
va
0.15500000000000005-0.8792532764527788
0.16000000000000006-0.8764392681259321
0.16500000000000006-0.8736891654943832
0.17000000000000007-0.8710026498492798
0.17500000000000007-0.8683794040712255
0.18000000000000008-0.8658191126223544
0.18500000000000008-0.8633214615384427
0.19000000000000009-0.8608861384210608
ja

0.1950000000000001-0.8585128324297647
0.2000000000000001-0.856201234274326
0.2050000000000001-0.8539510362070005
0.2100000000000001-0.8517619320148359
0.2150000000000001-0.849633617012017
0.2200000000000001-0.8475657880322502
w.

0.22500000000000012-0.8455581434211851
0.23000000000000012-0.843610383028874
0.23500000000000013-0.8417222082022695
0.24000000000000013-0.8398933217777589
0.24500000000000013-0.8381234280737365
0.2500000000000001-0.8364122328832122
0.2550000000000001-0.8347594434664576
0.2600000000000001-0.8331647685436885
ww

0.2650000000000001-0.8316279182877833
0.27000000000000013-0.8301486043170393
0.27500000000000013-0.8287265396879636
0.28000000000000014-0.8273614388881004
0.28500000000000014-0.8260530178288946
0.29000000000000015-0.8248009938385901
0.29500000000000015-0.8236050856551641
0.30000000000000016-0.8224650134192967
0.30500000000000016-0.8213804986673754

267
268

0.31000000000000016-0.8203512643245341
0.31500000000000017-0.8193770346977273

m
0.3200000000000002-0.8184575354688391
0.3250000000000002-0.8175924936878259
0.3300000000000002-0.8167816377658933
0.3350000000000002-0.8160246974687078
0.3400000000000002-0.8153214039096416
0.3450000000000002-0.8146714895430517
0.3500000000000002-0.8140746881575915

o
0.3550000000000002-0.8135307348695573
0.3600000000000002-0.8130393661162659
0.3650000000000002-0.812600319649468
0.3700000000000002-0.8122133345287916

i.c
0.3750000000000002-0.8118781511152201
0.3800000000000002-0.8115945110646018
0.38500000000000023-0.8113621573211925
0.39000000000000024-0.8111808341112298
0.39500000000000024-0.8110502869365394
0.4 -0.8109702625681743

//======================================================

dil
// Numerical Analysis package in java
// example to show differential equation solution
// and differentiation (derivative) functions
// Dr. Turhan Coban
// =====================================================
import [Link].*;
import Numeric;
import complex;
import Matrix;
va
class fm1 extends f_xi
{
//multivariable function
double func(double x[],int x_ref)
{
//x[0] is x, x[1] is y
if(x_ref==0) return -2.0*x[0]-x[1];
ja

else return 0;
}
}

class dif3
w.

{
public static void main(String args[]) throws IOException
{

fm1 b3=new fm1();


double x[];
x=new double[1];
x[0]=1;
ww

//RK4 differential equation to solve equation dy/dx=-2x-y


[Link]([Link](Numeric.RK4(b3,0.0,0.4,-1.0,100)));
[Link]();
}
}

Çözüm :

268
269

-1.0

m
-0.9960239680320001
-0.992095744511233
-0.9882151385858677
-0.9843819601659565
-0.9805960199203918
-0.9768571292738785

o
-0.9731651004039156
-0.9695197462377918
-0.9659208804495921
-0.9623683174572164
-0.9588618724194105

i.c
-0.955401361232808
-0.9519866005289858
-0.9486174076715289
-0.945293600753109
-0.942014998592574
-0.9387814207320486
-0.9355926874340476
-0.9324486196785992

dil
-0.9293490391603817
-0.9262937682858702
-0.9232826301704945
-0.9203154486358103
-0.9173920482066786
-0.9145122541084599
-0.9116758922642163
-0.9088827892919272
-0.9061327725017148
va
-0.903425669893081
-0.900761310152156
-0.898139522648956
-0.8955601374346547
-0.8930229852388627
-0.8905278974669202
-0.888074706197199
-0.8856632441784156
ja

-0.8832933448269559
-0.8809648422242088
-0.8786775711139124
-0.8764313668995095
-0.8742260656415141
-0.872061504054888
w.

-0.8699375195064296
-0.8678539500121697
-0.8658106342347813
-0.8638074114809979
-0.8618441216990421
-0.8599206054760645
-0.8580367040355941
-0.8561922592349969
ww

-0.854387113562946
-0.8526211101369017
-0.8508940927006006
-0.8492059056215563
-0.8475563938885688
-0.8459454031092447
-0.8443727795075264
-0.8428383699212321
-0.8413420217996048

269
270

-0.8398835832008722
-0.8384629027898148

m
-0.8370798298353451
-0.8357342142080957
-0.8344259063780173
-0.8331547574119857
-0.8319206189714199
-0.8307233433099079
-0.8295627832708429

o
-0.8284387922850687
-0.8273512243685349
-0.826299934119961
-0.8252847767185101

i.c
-0.8243056079214711
-0.8233622840619519
-0.8224546620465801
-0.8215825993532133
-0.8207459540286591
-0.8199445846864039
-0.8191783505043502
-0.8184471112225643

dil
-0.8177507271410314
-0.8170890591174206
-0.8164619685648588
-0.8158693174497131
-0.8153109682893825
-0.8147867841500976
-0.8142966286447304
-0.8138403659306118
-0.8134178607073579
va
-0.8130289782147054
-0.8126735842303556
-0.8123515450678265
-0.8120627275743135
-0.8118069991285605
-0.8115842276387357
-0.8113942815403203
-0.811237029794002
ja

-0.8111123418835786
-0.8110200878138704
-0.8109601381086393
w.
ww

270
271

m
EK A TEXT SINIFI

//============================================
// Numerical Analysis Package in Java
// Class Text to read data from screen or file
// and write (by using print) to screen or file

o
// formatted c printf like comand structure
// Dr. Turhan Coban
//============================================
import [Link].*;
import [Link].*;

i.c
class Text
{
/*
Text class by J M Bishop Aug 1996
Text book : Java gently, Addison Westley Longman 1997
ISBN 0-201-59399-8
provides simple input from the keyboard and files.

dil
Routines provided are:
public static void prompt(String s);
public static int readInt(DataInputStream in);
public static int readDouble (DataInputStreamin);
public static int readString (DataInputStream in);
public static int readChar (DataInputStream in);
----------------------------------------------------
Sample use :
va
--------- reading a double--------------
DataInputStream cin=new DataInputStream([Link]);
double number;
number=[Link](cin);
------ reading data from a file "[Link]"------
DataInputStream fin=new DataInputStream
(new FileInputStream("[Link]"));
double number;
number=[Link](fin);
ja

------ printing data into a file "[Link]"----


PrintStream fout=new PrintStream
(new FileOutputStream("[Link]"));
String a="turhan";
[Link](a);
----------------------------------------------------
w.

*/

public Text () {} ;
private static StringTokenizer T;
private static String S;

public static void prompt (String s) {


ww

[Link](s + " ");


[Link]();
}

public static int readInt (DataInputStream in) throws


IOException
{
if (T==null) refresh(in);
while (true)

271
272

{
try {

m
String item = [Link]();
return [Link]([Link]()).intValue();
}
catch (NoSuchElementException e1) { refresh (in);
} catch(NumberFormatException e2)
{ [Link]("Error in number, try again.");}
}

o
}

public static char readChar (DataInputStream in) throws

i.c
IOException
{
if (T==null) refresh(in);
while (true)
{
try {
return [Link]().charAt(0);
}

dil
catch(NoSuchElementException e1) {refresh (in);}
}
}

public static double readDouble(DataInputStream in) throws


IOException
{
if(T==null) refresh(in);
va
while (true) {
try {
String item = [Link]();
return [Link] ([Link]()).doubleValue();
} catch(NoSuchElementException e1) {
refresh (in);
} catch(NumberFormatException e2) {
[Link]("Error in number, try
ja

again.");
}
}
}

public static String readString(DataInputStream in) throws


w.

IOException
{
if(T==null) refresh (in);
while (true) {
try {return [Link]();}
catch (NoSuchElementException e1) {
refresh (in);
}
ww

}
}

public static String readStringLine(DataInputStream in) throws


IOException
{
//reads a line of strings from DataInputStream in
int ch;
String r = "";

272
273

boolean done = false;


while (!done)

m
{ try
{ ch = [Link]();
if (ch < 0 || (char)ch == '\n' || (char)ch == '\0')
done = true;
else
r = r + (char) ch;
}

o
catch([Link] e)
{ done = true;
}
}

i.c
return [Link](0,([Link]()-1));
}

private static void refresh (DataInputStream in) throws


IOException
{
S = [Link] ();

dil
if (S==null) throw new EOFException();
T=new StringTokenizer (S);
}
/*
* Following part of the class Text is adapted from Core Java Book
* Originally defined as Format class
* Gary Cornell and Cay S. Horstmann, Core Java (Book/CD-ROM)
* Published By SunSoft Press/Prentice-Hall
* Copyright (C) 1996 Sun Microsystems Inc.
va
* All Rights Reserved. ISBN 0-13-565755-5
*
* Permission to use, copy, modify, and distribute this
* software and its documentation for NON-COMMERCIAL purposes
* and without fee is hereby granted provided that this
* copyright notice appears in all copies.
*
* THE AUTHORS AND PUBLISHER MAKE NO REPRESENTATIONS OR
ja

* WARRANTIES ABOUT THE SUITABILITY OF THE SOFTWARE, EITHER


* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
* IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
* PARTICULAR PURPOSE, OR NON-INFRINGEMENT. THE AUTHORS
* AND PUBLISHER SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED
* BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
w.

* THIS SOFTWARE OR ITS DERIVATIVES.


*/

/**
* A class for formatting numbers that follows printf conventions.
* Also implements C-like atoi and atof functions
* @version 1.01 15 Feb 1996
* @author Cay Horstmann
ww

*/

/**
* Formats the number following printf conventions.
* Main limitation: Can only handle one format parameter at a time
* Use multiple Format objects to format more than one number
* @param s the format string following printf conventions
* The string has a prefix, a format code and a suffix. The prefix and
suffix

273
274

* become part of the formatted output. The format code directs the
* formatting of the (single) parameter to be formatted. The code has the

m
* following structure
* <ul>
* <li> a % (required)
* <li> a modifier (optional)
* <dl>
* <dt> + <dd> forces display of + for positive numbers
* <dt> 0 <dd> show leading zeroes

o
* <dt> - <dd> align left in the field
* <dt> space <dd> prepend a space in front of positive numbers
* <dt> # <dd> use "alternate" format. Add 0 or 0x for octal or
hexadecimal numbers. Don't suppress trailing zeroes in general floating

i.c
point format.
* </dl>
* <li> an integer denoting field width (optional)
* <li> a period followed by an integer denoting precision (optional)
* <li> a format descriptor (required)
* <dl>
* <dt>f <dd> floating point number in fixed format
* <dt>e, E <dd> floating point number in exponential notation (scientific

dil
format). The E format results in an uppercase E for the exponent
(1.14130E+003), the e format in a lowercase e.
* <dt>g, G <dd> floating point number in general format (fixed format for
small numbers, exponential format for large numbers). Trailing zeroes are
suppressed. The G format results in an uppercase E for the exponent (if
any), the g format in a lowercase e.
* <dt>d, i <dd> integer in decimal
* <dt>x <dd> integer in hexadecimal
* <dt>o <dd> integer in octal
va
* <dt>s <dd> string
* <dt>c <dd> character
* </dl>
* </ul>
* @exception IllegalArgumentException if bad format
*/

public Text(String s)
ja

{ width = 0;
precision = -1;
pre = "";
post = "";
leading_zeroes = false;
show_plus = false;
w.

alternate = false;
show_space = false;
left_align = false;
fmt = ' ';

int state = 0;
int length = [Link]();
int parse_state = 0;
ww

// 0 = prefix, 1 = flags, 2 = width, 3 = precision,


// 4 = format, 5 = end
int i = 0;

while (parse_state == 0)
{ if (i >= length) parse_state = 5;
else if ([Link](i) == '%')
{ if (i < length - 1)
{ if ([Link](i + 1) == '%')

274
275

{ pre = pre + '%';


i++;

m
}
else
parse_state = 1;
}
else throw new [Link]();
}
else

o
pre = pre + [Link](i);
i++;
}
while (parse_state == 1)

i.c
{ if (i >= length) parse_state = 5;
else if ([Link](i) == ' ') show_space = true;
else if ([Link](i) == '-') left_align = true;
else if ([Link](i) == '+') show_plus = true;
else if ([Link](i) == '0') leading_zeroes = true;
else if ([Link](i) == '#') alternate = true;
else { parse_state = 2; i--; }
i++;

dil
}
while (parse_state == 2)
{ if (i >= length) parse_state = 5;
else if ('0' <= [Link](i) && [Link](i) <= '9')
{ width = width * 10 + [Link](i) - '0';
i++;
}
else if ([Link](i) == '.')
{ parse_state = 3;
va
precision = 0;
i++;
}
else
parse_state = 4;
}
while (parse_state == 3)
{ if (i >= length) parse_state = 5;
ja

else if ('0' <= [Link](i) && [Link](i) <= '9')


{ precision = precision * 10 + [Link](i) - '0';
i++;
}
else
parse_state = 4;
w.

}
if (parse_state == 4)
{ if (i >= length) parse_state = 5;
else fmt = [Link](i);
i++;
}
if (i < length)
post = [Link](i, length);
ww

/**
* prints a formatted number following printf conventions
* @param s a PrintStream
* @param fmt the format string
* @param x the double to print
*/

275
276

public static void print([Link] s, String fmt, double x)


{ [Link](new Text(fmt).form(x));

m
}

/**
* prints a formatted number following printf conventions
* @param s a PrintStream
* @param fmt the format string
* @param x the long to print

o
*/
public static void print([Link] s, String fmt, long x)
{ [Link](new Text(fmt).form(x));
}

i.c
/**
* prints a formatted number following printf conventions
* @param s a PrintStream
* @param fmt the format string
* @param x the character to
*/

dil
public static void print([Link] s, String fmt, char x)
{ [Link](new Text(fmt).form(x));
}

/**
* prints a formatted number following printf conventions
* @param s a PrintStream, fmt the format string
* @param x a string that represents the digits to print
*/
va
public static void print([Link] s, String fmt, String x)
{ [Link](new Text(fmt).form(x));
}

/**
* Converts a string of digits (decimal, octal or hex) to an integer
* @param s a string
ja

* @return the numeric value of the prefix of s representing a base 10


integer
*/

public static int atoi(String s)


{ return (int)atol(s);
w.

/**
* Converts a string of digits (decimal, octal or hex) to a long integer
* @param s a string
* @return the numeric value of the prefix of s representing a base 10
integer
*/
ww

public static long atol(String s)


{ int i = 0;

while (i < [Link]() && [Link]([Link](i))) i++;


if (i < [Link]() && [Link](i) == '0')
{ if (i + 1 < [Link]() && ([Link](i + 1) == 'x' || [Link](i +
1) == 'X'))
return parseLong([Link](i + 2), 16);

276
277

else return parseLong(s, 8);


}

m
else return parseLong(s, 10);
}

private static long parseLong(String s, int base)


{ int i = 0;
int sign = 1;
long r = 0;

o
while (i < [Link]() && [Link]([Link](i))) i++;
if (i < [Link]() && [Link](i) == '-') { sign = -1; i++; }
else if (i < [Link]() && [Link](i) == '+') { i++; }

i.c
while (i < [Link]())
{ char ch = [Link](i);
if ('0' <= ch && ch < '0' + base)
r = r * base + ch - '0';
else if ('A' <= ch && ch < 'A' + base - 10)
r = r * base + ch - 'A' + 10 ;
else if ('a' <= ch && ch < 'a' + base - 10)
r = r * base + ch - 'a' + 10 ;

dil
else
return r * sign;
i++;
}
return r * sign;
}

/**
* Converts a string of digits to an double
va
* @param s a string
*/

public static double atof(String s)


{ int i = 0;
int sign = 1;
double r = 0; // integer part
double f = 0; // fractional part
ja

double p = 1; // exponent of fractional part


int state = 0; // 0 = int part, 1 = frac part

while (i < [Link]() && [Link]([Link](i))) i++;


if (i < [Link]() && [Link](i) == '-') { sign = -1; i++; }
else if (i < [Link]() && [Link](i) == '+') { i++; }
w.

while (i < [Link]())


{ char ch = [Link](i);
if ('0' <= ch && ch <= '9')
{ if (state == 0)
r = r * 10 + ch - '0';
else if (state == 1)
{ p = p / 10;
r = r + p * (ch - '0');
ww

}
}
else if (ch == '.')
{ if (state == 0) state = 1;
else return sign * r;
}
else if (ch == 'e' || ch == 'E')
{ long e = (int)parseLong([Link](i + 1), 10);
return sign * r * [Link](10, e);

277
278

}
else return sign * r;

m
i++;
}
return sign * r;
}

/**
* Formats a double into a string (like sprintf in C)

o
* @param x the number to format
* @return the formatted string
* @exception IllegalArgumentException if bad argument
*/

i.c
public String form(double x)
{ String r;
if (precision < 0) precision = 6;
int s = 1;
if (x < 0) { x = -x; s = -1; }
if (fmt == 'f')
r = fixed_Text(x);

dil
else if (fmt == 'e' || fmt == 'E' || fmt == 'g' || fmt == 'G')
r = exp_Text(x);
else throw new [Link]();

return pad(sign(s, r));


}

/**
* Formats a long integer into a string (like sprintf in C)
va
* @param x the number to format
* @return the formatted string
*/

public String form(long x)


{ String r;
int s = 0;
if (fmt == 'd' || fmt == 'i')
ja

{ s = 1;
if (x < 0) { x = -x; s = -1; }
r = "" + x;
}
else if (fmt == 'o')
r = convert(x, 3, 7, "01234567");
w.

else if (fmt == 'x')


r = convert(x, 4, 15, "0123456789abcdef");
else if (fmt == 'X')
r = convert(x, 4, 15, "0123456789ABCDEF");
else throw new [Link]();

return pad(sign(s, r));


}
ww

/**
* Formats a character into a string (like sprintf in C)
* @param x the value to format
* @return the formatted string
*/

public String form(char c)


{ if (fmt != 'c')

278
279

throw new [Link]();

m
String r = "" + c;
return pad(r);
}

/**
* Formats a string into a larger string (like sprintf in C)
* @param x the value to format

o
* @return the formatted string
*/

public String form(String s)

i.c
{ if (fmt != 's')
throw new [Link]();
if (precision >= 0) s = [Link](0, precision);
return pad(s);
}

/**

dil
* a test stub for the format class
*/

public static void main(String[] a)


{ double x = 1.23456789012;
double y = 123;
double z = 1.2345e30;
double w = 1.02;
double u = 1.234e-5;
va
int d = 0xCAFE;
[Link]([Link], "x = |%f|\n", x);
[Link]([Link], "u = |%20f|\n", u);
[Link]([Link], "x = |% .5f|\n", x);
[Link]([Link], "w = |%20.5f|\n", w);
[Link]([Link], "x = |%020.5f|\n", x);
[Link]([Link], "x = |%+20.5f|\n", x);
[Link]([Link], "x = |%+020.5f|\n", x);
ja

[Link]([Link], "x = |% 020.5f|\n", x);


[Link]([Link], "y = |%#+20.5f|\n", y);
[Link]([Link], "y = |%-+20.5f|\n", y);
[Link]([Link], "z = |%20.5f|\n", z);

[Link]([Link], "x = |%e|\n", x);


w.

[Link]([Link], "u = |%20e|\n", u);


[Link]([Link], "x = |% .5e|\n", x);
[Link]([Link], "w = |%20.5e|\n", w);
[Link]([Link], "x = |%020.5e|\n", x);
[Link]([Link], "x = |%+20.5e|\n", x);
[Link]([Link], "x = |%+020.5e|\n", x);
[Link]([Link], "x = |% 020.5e|\n", x);
[Link]([Link], "y = |%#+20.5e|\n", y);
ww

[Link]([Link], "y = |%-+20.5e|\n", y);

[Link]([Link], "x = |%g|\n", x);


[Link]([Link], "z = |%g|\n", z);
[Link]([Link], "w = |%g|\n", w);
[Link]([Link], "u = |%g|\n", u);
[Link]([Link], "y = |%.2g|\n", y);
[Link]([Link], "y = |%#.2g|\n", y);

279
280

[Link]([Link], "d = |%d|\n", d);


[Link]([Link], "d = |%20d|\n", d);

m
[Link]([Link], "d = |%020d|\n", d);
[Link]([Link], "d = |%+20d|\n", d);
[Link]([Link], "d = |% 020d|\n", d);
[Link]([Link], "d = |%-20d|\n", d);
[Link]([Link], "d = |%20.8d|\n", d);
[Link]([Link], "d = |%x|\n", d);
[Link]([Link], "d = |%20X|\n", d);

o
[Link]([Link], "d = |%#20x|\n", d);
[Link]([Link], "d = |%020X|\n", d);
[Link]([Link], "d = |%20.8x|\n", d);
[Link]([Link], "d = |%o|\n", d);

i.c
[Link]([Link], "d = |%020o|\n", d);
[Link]([Link], "d = |%#20o|\n", d);
[Link]([Link], "d = |%#020o|\n", d);
[Link]([Link], "d = |%20.12o|\n", d);

[Link]([Link], "s = |%-20s|\n", "Hello");


[Link]([Link], "s = |%-20c|\n", '!');
}

}
dil
private static String repeat(char c, int n)
{ if (n <= 0) return "";
StringBuffer s = new StringBuffer(n);
for (int i = 0; i < n; i++) [Link](c);
return [Link]();
va
private static String convert(long x, int n, int m, String d)
{ if (x == 0) return "0";
String r = "";
while (x != 0)
{ r = [Link]((int)(x & m)) + r;
x = x >>> n;
}
return r;
ja

private String pad(String r)


{ String p = repeat(' ', width - [Link]());
if (left_align) return pre + r + p + post;
else return pre + p + r + post;
w.

private String sign(int s, String r)


{ String p = "";
if (s < 0) p = "-";
else if (s > 0)
{ if (show_plus) p = "+";
else if (show_space) p = " ";
ww

}
else
{ if (fmt == 'o' && alternate && [Link]() > 0 && [Link](0) !=
'0') p = "0";
else if (fmt == 'x' && alternate) p = "0x";
else if (fmt == 'X' && alternate) p = "0X";
}
int w = 0;
if (leading_zeroes)

280
281

w = width;
else if ((fmt == 'd' || fmt == 'i' || fmt == 'x' || fmt == 'X' || fmt

m
== 'o')
&& precision > 0) w = precision;

return p + repeat('0', w - [Link]() - [Link]()) + r;


}

o
private String fixed_Text(double d)
{ String f = "";

if (d > 0x7FFFFFFFFFFFFFFFL) return exp_Text(d);

i.c
long l = (long)(precision == 0 ? d + 0.5 : d);
f = f + l;

double fr = d - l; // fractional part


if (fr >= 1 || fr < 0) return exp_Text(d);

return f + frac_part(fr);

dil
}

private String frac_part(double fr)


// precondition: 0 <= fr < 1
{ String z = "";
if (precision > 0)
{ double factor = 1;
String leading_zeroes = "";
for (int i = 1; i <= precision && factor <= 0x7FFFFFFFFFFFFFFFL;
va
i++)
{ factor *= 10;
leading_zeroes = leading_zeroes + "0";
}
long l = (long) (factor * fr + 0.5);

z = leading_zeroes + l;
z = [Link]([Link]() - precision, [Link]());
ja

if (precision > 0 || alternate) z = "." + z;


if ((fmt == 'G' || fmt == 'g') && !alternate)
// remove trailing zeroes and decimal point
w.

{ int t = [Link]() - 1;
while (t >= 0 && [Link](t) == '0') t--;
if (t >= 0 && [Link](t) == '.') t--;
z = [Link](0, t + 1);
}
return z;
}
ww

private String exp_Text(double d)


{ String f = "";
int e = 0;
double dd = d;
double factor = 1;
while (dd > 10) { e++; factor /= 10; dd = dd / 10; }
while (dd < 1) { e--; factor *= 10; dd = dd * 10; }
if ((fmt == 'g' || fmt == 'G') && e >= -4 && e < precision)
return fixed_Text(d);

281
282

d = d * factor;

m
f = f + fixed_Text(d);

if (fmt == 'e' || fmt == 'g')


f = f + "e";
else
f = f + "E";

o
String p = "000";
if (e >= 0)
{ f = f + "+";
p = p + e;

i.c
}
else
{ f = f + "-";
p = p + (-e);
}

return f + [Link]([Link]() - 3, [Link]());


}

private
private
private
private
private
private
private
private
int width;
int precision;
String pre;
String post;
dil
boolean leading_zeroes;
boolean show_plus;
boolean alternate;
boolean show_space;
va
private boolean left_align;
private char fmt; // one of cdeEfgGiosxXos
}
ja
w.
ww

282
283

m
EK B JAVA KÜTÜPHANESİ İNDEKSİ

class [Link]
class [Link] (implements [Link],
[Link], [Link], [Link],
[Link], [Link], [Link],
[Link], [Link], [Link],

o
[Link])
interface [Link] (extends [Link])
interface [Link] (extends [Link])
interface [Link] (extends [Link])
interface [Link]

i.c
interface [Link] (extends [Link])
class [Link].Adler32 (implements [Link])
interface [Link]
interface [Link]
class [Link]
interface [Link]
interface [Link]
class [Link]
class [Link] (implements [Link], [Link])

dil
class [Link] (implements [Link])
class [Link] (implements [Link].LayoutManager2, [Link])
class [Link] (implements [Link], [Link])
interface [Link] (extends [Link])
class [Link].CRC32 (implements [Link])
class [Link] (implements [Link], [Link])
class [Link]
interface [Link] (extends [Link])
interface [Link] (extends [Link])
class [Link] (implements [Link].LayoutManager2, [Link])
va
interface [Link]
class [Link] (implements [Link])
interface [Link] (extends [Link])
class [Link] (implements [Link])
interface [Link] (extends [Link])
interface [Link] (extends [Link])
interface [Link]
interface [Link] (extends [Link])
ja

class [Link] (implements [Link])


class [Link]
class [Link]
interface [Link]
interface [Link]
class [Link]
class [Link]
w.

class [Link] (implements [Link], [Link])


class [Link]
class [Link] (implements [Link])
class [Link] (implements [Link])
class [Link]
class [Link]
class [Link]
class [Link]
class [Link] (implements [Link], [Link],
ww

[Link])
class [Link]
class [Link]
class [Link] (implements [Link])
class [Link] (implements [Link])
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]

283
284

class [Link]
class [Link]

m
class [Link] (implements [Link])
class [Link]
class [Link] (implements [Link])
class [Link] (implements [Link])
class [Link]
class [Link]
class [Link]
class [Link] (implements [Link])

o
interface [Link] (extends [Link])
interface [Link]
interface [Link]
class [Link] (implements [Link])
class [Link] (implements [Link])

i.c
interface [Link] (extends [Link])
interface [Link] (extends [Link])
class [Link]
interface [Link]
class [Link] (implements [Link])
interface [Link]
interface [Link] (extends [Link])
interface [Link]

dil
interface [Link]
interface [Link]
interface [Link] (extends [Link], [Link])
interface [Link] (extends [Link], [Link])
class [Link]
interface [Link]
interface [Link]
interface [Link]
class [Link]
class [Link]
va
class [Link]
class [Link] (implements [Link])
class [Link] (implements [Link], [Link])
class [Link]
class [Link]
class [Link]
class [Link] (implements [Link], [Link])
interface [Link]
class [Link] (implements [Link], [Link])
ja

class [Link]
interface [Link] (extends [Link])
class [Link]
class [Link] (implements [Link], [Link])
class [Link]
class [Link]
w.

class [Link] (implements [Link])


interface [Link]
class [Link]
class [Link]
interface [Link]
class [Link] (implements [Link])
interface [Link]
interface [Link] (extends [Link])
class [Link] (implements [Link])
ww

class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]

284
285

class [Link]
class [Link]

m
class [Link]
class [Link]
class [Link]
class [Link]
interface [Link] (extends [Link])
class [Link]
class [Link]
class [Link]

o
class [Link]
class [Link]
class [Link]
class [Link]
class [Link] (implements [Link])

i.c
class [Link]
class [Link] (implements [Link])
class [Link]
class [Link] (implements [Link])
class [Link]
interface [Link] (extends [Link])
interface [Link]
interface [Link]

dil
class [Link] (implements [Link])
class [Link] (implements [Link], [Link])
class [Link] (implements [Link])
interface [Link] (extends [Link])
class [Link] (implements [Link])
class [Link] (implements [Link])
interface [Link]
class [Link] (implements [Link], [Link])
class [Link] (implements [Link])
class [Link]
va
class [Link]
class [Link] (implements [Link])
class [Link]
class [Link]
interface [Link] (extends [Link])
class [Link]
class [Link] (implements [Link], [Link])
class [Link] (implements [Link].LayoutManager2, [Link])
class [Link] (implements [Link], [Link])
ja

interface [Link] (extends [Link])


class [Link] (implements [Link], [Link])
class [Link]
class [Link]
class [Link]
interface [Link]
w.

class [Link] (implements [Link], [Link])


class [Link]
class [Link]
class [Link]
class [Link]
interface [Link]
interface [Link]
class [Link] (implements [Link])
class [Link]
ww

class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link] (implements [Link])
class [Link]
class [Link]
class [Link]

285
286

class [Link] (implements [Link])


class [Link]

m
class [Link]
class [Link] (implements [Link], [Link])
class [Link]
class [Link]
class [Link]
class [Link] (implements [Link], [Link])
class [Link]
interface [Link] (extends [Link])

o
interface [Link]
interface [Link] (extends [Link])
class [Link] (implements [Link])
interface [Link] (extends [Link])
class [Link]

i.c
class [Link]
interface [Link] (extends [Link])
interface [Link]
interface [Link].LayoutManager2 (extends [Link])
class [Link] (implements [Link])
interface [Link] (extends [Link])
interface [Link] (extends [Link])
interface [Link]

dil
class [Link]
class [Link] (implements [Link])
class [Link] (implements [Link], [Link])
class [Link]
class [Link]
class [Link] (implements [Link])
interface [Link]
class [Link] (implements [Link])
interface [Link] (extends [Link])
class [Link] (implements [Link])
va
class [Link] (implements [Link])
class [Link]
class [Link] (implements [Link])
class [Link] (implements [Link])
class [Link]
interface [Link]
interface [Link]
interface [Link] (extends [Link])
interface [Link] (extends [Link])
ja

class [Link] (implements [Link])


class [Link]
class [Link] (implements [Link])
class [Link]
class [Link] (implements [Link])
interface [Link] (extends [Link])
w.

class [Link] (implements [Link])


interface [Link] (extends [Link])
class [Link]
class [Link] (implements [Link])
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
ww

class [Link]
class [Link]
class [Link]
class [Link] (implements [Link])
interface [Link] (extends [Link])
interface [Link]
interface [Link] (extends [Link])
class [Link] (implements [Link])
class [Link]
interface [Link]

286
287

class [Link]
class [Link]

m
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link] (implements [Link])
class [Link]
class [Link]

o
class [Link] (implements [Link])
class [Link]
class [Link]
class [Link]
class [Link] (implements [Link], [Link])

i.c
class [Link]
interface [Link]
interface [Link] (extends [Link])
class [Link]
interface [Link]
class [Link] (implements [Link])
class [Link] (implements [Link])
class [Link] (implements [Link], [Link])

dil
interface [Link] (extends [Link])
interface [Link] (extends [Link])
interface [Link]
interface [Link]
class [Link]
interface [Link] (extends [Link])
class [Link]
interface [Link] (extends [Link])
class [Link] (implements [Link])
interface [Link]
va
class [Link]
class [Link] (implements [Link])
interface [Link] (extends [Link])
class [Link]
interface [Link]
class [Link]
class [Link] (implements [Link])
class [Link]
class [Link] (implements [Link], [Link])
ja

class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
w.

class [Link]
class [Link]
class [Link]
class [Link]
class [Link] (implements [Link], [Link])
interface [Link] (extends [Link])
interface [Link]
interface [Link]
interface [Link]
ww

class [Link]
class [Link] (implements [Link], [Link])
class [Link]
class [Link]
class [Link]
interface [Link] (extends [Link])
class [Link] (implements [Link])
class [Link]
class [Link]
class [Link]

287
288

class [Link]
class [Link]

m
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]

o
class [Link]
class [Link]
class [Link]
class [Link]
interface [Link]

i.c
interface [Link]
interface [Link]
class [Link]
interface [Link] (extends [Link])
interface [Link] (extends [Link])
class [Link]
class [Link]
class [Link]

dil
interface [Link]
interface [Link] (extends [Link])
interface [Link] (extends [Link])
class [Link]
interface [Link]
class [Link]
class [Link] (implements [Link])
interface [Link]
class [Link]
class [Link] (implements [Link])
va
interface [Link]
class [Link]
class [Link]
interface [Link]
class [Link]
class [Link] (implements [Link])
class [Link] (implements [Link])
class [Link] (implements [Link])
class [Link] (implements [Link],
ja

[Link])
class [Link] (implements [Link])
class [Link]
interface [Link] (extends [Link])
interface [Link] (extends [Link])
interface [Link] (extends [Link])
w.

interface [Link] (extends [Link])


class [Link] (implements [Link])
class [Link]
class [Link] (implements [Link])
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
ww

class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]

288
289

class [Link]
class [Link]

m
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]

o
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]

i.c
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]

dil
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
va
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
ja

class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
w.

class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
ww

class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]

289
290

class [Link]
class [Link]

m
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]

o
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]

i.c
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]

dil
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
va
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link] (implements [Link], [Link])
class [Link]
class [Link]
ja

interface [Link]
class [Link]
class [Link] (implements [Link])
class [Link] (implements [Link])
class [Link]
class [Link]
w.

class [Link]
class [Link]
interface [Link]
interface [Link]
class [Link] (implements [Link])
class [Link] (implements [Link], [Link])
class [Link]
interface [Link] (extends [Link])
class [Link] (implements [Link])
ww

interface [Link]
class [Link]
class [Link] (implements [Link])
interface [Link] (extends [Link])
interface [Link] (extends [Link])
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]

290
291

EK C JAVADA KULLANILAN METODLARIN LİSTESİ

m
Not : Bu liste ingilizce açıklamalarıyla verilmiştir. Listenin Türkçesi hazırlanacaktır.

a. Variable in class [Link]


ABORT. Static variable in interface [Link]

o
An image which was being tracked asynchronously was aborted before production was complete.
ABORTED. Static variable in class [Link]
Flag indicating the download of some media was aborted.
abortGrabbing(). Method in class [Link]
Request the PixelGrabber to abort the image fetch.
abs(). Method in class [Link]

i.c
Returns a BigDecimal whose value is the absolute value of this number, and whose scale is [Link]().
abs(). Method in class [Link]
Returns a BigInteger whose value is the absolute value of this number.
abs(double). Static method in class [Link]
Returns the absolute value of a double value.
abs(float). Static method in class [Link]
Returns the absolute value of a float value.
abs(int). Static method in class [Link]
Returns the absolute value of an int value.
abs(long). Static method in class [Link]

dil
Returns the absolute value of a long value.
ABSTRACT. Static variable in class [Link]
AbstractMethodError(). Constructor for class [Link]
Constructs an AbstractMethodError with no detail message.
AbstractMethodError(String). Constructor for class [Link]
Constructs an AbstractMethodError with the specified detail message.
accept(). Method in class [Link]
Listens for a connection to be made to this socket and accepts it.
accept(File, String). Method in interface [Link]
Tests if a specified file should be included in a file list.
va
accept(SocketImpl). Method in class [Link]
Accepts a connection.
acceptsURL(String). Method in interface [Link]
Returns true if the driver thinks that it can open a connection to the given URL.
AccessException(String). Constructor for class [Link]
Create a new AccessException with a description.
AccessException(String, Exception). Constructor for class [Link]
Create a new AccessException with a description and detail exception.
AclNotFoundException(). Constructor for class [Link]
Constructs an AclNotFoundException.
ja

acos(double). Static method in class [Link]


Returns the arc cosine of an angle, in the range of 0.0 through pi.
action(Event, Object). Method in class [Link]
ACTION_EVENT. Static variable in class [Link]
An action event.
ACTION_EVENT_MASK. Static variable in class [Link]
The event mask for selecting action events.
ACTION_FIRST. Static variable in class [Link]
w.

Marks the first integer id for the range of action event ids.
ACTION_LAST. Static variable in class [Link]
Marks the last integer id for the range of action event ids.
ACTION_PERFORMED. Static variable in class [Link]
An action performed event type.
ActionEvent(Object, int, String). Constructor for class [Link]
Constructs an ActionEvent object with the specified source object.
ActionEvent(Object, int, String, int). Constructor for class [Link]
Constructs an ActionEvent object with the specified source object.
ww

actionPerformed(ActionEvent). Method in interface [Link]


Invoked when an action occurs.
actionPerformed(ActionEvent). Method in class [Link]
Handles the actionPerformed event by invoking the actionPerformed methods on listener-a and listener-b.
ACTIVE_CAPTION. Static variable in class [Link]
The array index for the active caption background color.
ACTIVE_CAPTION_BORDER. Static variable in class [Link]
The array index for the active caption border color.
ACTIVE_CAPTION_TEXT. Static variable in class [Link]
The array index for the action caption text color.
activeCaption. Static variable in class [Link]
The background color for captions in window borders.

291
292

activeCaptionBorder. Static variable in class [Link]


The border color for captions in window borders.
activeCaptionText. Static variable in class [Link]

m
The text color for captions in window borders.
activeCount(). Static method in class [Link]
Returns the current number of active threads in this thread group.
activeCount(). Method in class [Link]
Returns an estimate of the number of active threads in this thread group.
activeGroupCount(). Method in class [Link]
Returns an estimate of the number of active groups in this thread group.
AD. Static variable in class [Link]

o
Useful constant for GregorianCalendar.
add(ActionListener, ActionListener). Static method in class [Link]
Adds action-listener-a with action-listener-b and returns the resulting multicast listener.
add(AdjustmentListener, AdjustmentListener). Static method in class [Link]
Adds adjustment-listener-a with adjustment-listener-b and returns the resulting multicast listener.

i.c
add(BigDecimal). Method in class [Link]
Returns a BigDecimal whose value is (this + val), and whose scale is MAX([Link](), [Link]).
add(BigInteger). Method in class [Link]
Returns a BigInteger whose value is (this + val).
add(Component). Method in class [Link]
Adds the specified component to this container.
add(Component, int). Method in class [Link]
Adds the specified component to this container at the given position in the container's component list.
add(Component, Object). Method in class [Link]
Adds the specified component to this container at the specified index.

dil
add(Component, Object, int). Method in class [Link]
Adds the specified component to this container with the specified constraints at the specified index.
add(ComponentListener, ComponentListener). Static method in class [Link]
Adds component-listener-a with component-listener-b and returns the resulting multicast listener.
add(ContainerListener, ContainerListener). Static method in class [Link]
Adds container-listener-a with container-listener-b and returns the resulting multicast listener.
add(FocusListener, FocusListener). Static method in class [Link]
Adds focus-listener-a with focus-listener-b and returns the resulting multicast listener.
add(int, int). Method in class [Link]
Date Arithmetic function.
add(int, int). Method in class [Link]
va
Overrides Calendar Date Arithmetic function.
add(int, int). Method in class [Link]
Adds a point to a rectangle.
add(ItemListener, ItemListener). Static method in class [Link]
Adds item-listener-a with item-listener-b and returns the resulting multicast listener.
add(KeyListener, KeyListener). Static method in class [Link]
Adds key-listener-a with key-listener-b and returns the resulting multicast listener.
add(Menu). Method in class [Link]
Adds the specified menu to the menu bar.
add(MenuItem). Method in class [Link]
ja

Adds the specified item to this menu.


add(MouseListener, MouseListener). Static method in class [Link]
Adds mouse-listener-a with mouse-listener-b and returns the resulting multicast listener.
add(MouseMotionListener, MouseMotionListener). Static method in class [Link]
Adds mouse-motion-listener-a with mouse-motion-listener-b and returns the resulting multicast listener.
add(Point). Method in class [Link]
Adds a point to a rectangle.
w.

add(PopupMenu). Method in class [Link]


Adds the specified popup menu to the component.
add(Rectangle). Method in class [Link]
Adds a rectangle to a rectangle.
add(String). Method in class [Link]
Adds an item to this Choice.
add(String). Method in class [Link]
Adds the specified item to the end of scrolling list.
add(String). Method in class [Link]
Adds an item with with the specified label to this menu.
ww

add(String, Component). Method in class [Link]


Adds the specified component to this container.
add(String, int). Method in interface [Link]
add(String, int). Method in class [Link]
Adds the specified item to the scrolling list at the specified position.
add(String, int). Method in interface [Link]
add(TextListener, TextListener). Static method in class [Link]
add(WindowListener, WindowListener). Static method in class [Link]
Adds window-listener-a with window-listener-b and returns the resulting multicast listener.
addActionListener(ActionListener). Method in class [Link]
Adds the specified action listener to receive action events from this button.
addActionListener(ActionListener). Method in class [Link]

292
293

Adds the specified action listener to receive action events from this list.
addActionListener(ActionListener). Method in class [Link]
Adds the specified action listener to receive action events from this menu item.

m
addActionListener(ActionListener). Method in class [Link]
Adds the specified action listener to recieve action events from this textfield.
addAdjustmentListener(AdjustmentListener). Method in interface [Link]
Add a listener to recieve adjustment events when the value of the adjustable object changes.
addAdjustmentListener(AdjustmentListener). Method in class [Link]
Adds the specified adjustment listener to recieve adjustment events from this scrollbar.
addCertificate(Certificate). Method in class [Link]
Adds a certificate for this identity.

o
addComponentListener(ComponentListener). Method in class [Link]
Adds the specified component listener to receive component events from this component.
addConsumer(ImageConsumer). Method in class [Link]
Adds an ImageConsumer to the list of consumers interested in data for this image.
addConsumer(ImageConsumer). Method in interface [Link]

i.c
This method is used to register an ImageConsumer with the ImageProducer for access to the image data during a later
reconstruction of the Image.
addConsumer(ImageConsumer). Method in class [Link]
Adds an ImageConsumer to the list of consumers interested in data for this image.
addContainerListener(ContainerListener). Method in class [Link]
Adds the specified container listener to receive container events from this container.
addElement(Object). Method in class [Link]
Adds the specified component to the end of this vector, increasing its size by one.
addEntry(Principal, AclEntry). Method in interface [Link]
Adds an ACL entry to this ACL.

dil
addFocusListener(FocusListener). Method in class [Link]
Adds the specified focus listener to receive focus events from this component.
addHelpMenu(Menu). Method in interface [Link]
addIdentity(Identity). Method in class [Link]
Adds an identity to this identity scope.
addImage(Image, int). Method in class [Link]
Adds an image to the list of images being tracked.
addImage(Image, int, int, int). Method in class [Link]
Adds a scaled image to the list of images being tracked.
addImpl(Component, Object, int). Method in class [Link]
Adds the specified component to this container at the specified index.
va
addImpl(Component, Object, int). Method in class [Link]
Adds the specified component to this scroll pane container.
addInternal(EventListener, EventListener). Static method in class [Link]
Returns the resulting multicast listener from adding listener-a and listener-b together.
addItem(MenuItem). Method in interface [Link]
addItem(String). Method in class [Link]
Adds an item to this Choice.
addItem(String). Method in class [Link]
Adds the specified item to the end of scrolling list.
addItem(String, int). Method in interface [Link]
ja

addItem(String, int). Method in class [Link]


Adds the specified item to the scrolling list at the specified position.
addItem(String, int). Method in interface [Link]
DEPRECATED: Replaced by add(String, int).
addItemListener(ItemListener). Method in class [Link]
Adds the specified item listener to recieve item events from this checkbox.
addItemListener(ItemListener). Method in class [Link]
w.

Adds the specified item listener to recieve item events from this checkbox menu item.
addItemListener(ItemListener). Method in class [Link]
Adds the specified item listener to recieve item events from this choice.
addItemListener(ItemListener). Method in interface [Link]
Add a listener to recieve item events when the state of an item changes.
addItemListener(ItemListener). Method in class [Link]
Adds the specified item listener to recieve item events from this list.
addKeyListener(KeyListener). Method in class [Link]
Adds the specified key listener to receive key events from this component.
addLayoutComponent(Component, Object). Method in class [Link]
ww

Adds the specified component to the layout, using the specified constraint object.
addLayoutComponent(Component, Object). Method in class [Link]
Adds the specified component to the layout, using the specified constraint object.
addLayoutComponent(Component, Object). Method in class [Link]
Adds the specified component to the layout, using the specified constraint object.
addLayoutComponent(Component, Object). Method in interface [Link].LayoutManager2
Adds the specified component to the layout, using the specified constraint object.
addLayoutComponent(String, Component). Method in class [Link]
Replaced by addLayoutComponent(Component, Object).
addLayoutComponent(String, Component). Method in class [Link]
Replaced by addLayoutComponent(Component, Object).
addLayoutComponent(String, Component). Method in class [Link]

293
294

Adds the specified component to the layout.


addLayoutComponent(String, Component). Method in class [Link]
Adds the specified component with the specified name to the layout.

m
addLayoutComponent(String, Component). Method in class [Link]
Adds the specified component with the specified name to the layout.
addLayoutComponent(String, Component). Method in interface [Link]
Adds the specified component with the specified name to the layout.
addMember(Principal). Method in interface [Link]
Adds the specified member to the group.
addMenu(Menu). Method in interface [Link]
addMouseListener(MouseListener). Method in class [Link]

o
Adds the specified mouse listener to receive mouse events from this component.
addMouseMotionListener(MouseMotionListener). Method in class [Link]
Adds the specified mouse motion listener to receive mouse motion events from this component.
addNotify(). Method in class [Link]
Creates the peer of the button.

i.c
addNotify(). Method in class [Link]
Creates the peer of the canvas.
addNotify(). Method in class [Link]
Creates the peer of the Checkbox.
addNotify(). Method in class [Link]
Creates the peer of the checkbox item.
addNotify(). Method in class [Link]
Creates the Choice's peer.
addNotify(). Method in class [Link]
Notifies the Component that it has been added to a container and if a peer is required, it should be created.

dil
addNotify(). Method in class [Link]
Notifies the container to create a peer.
addNotify(). Method in class [Link]
Creates the frame's peer.
addNotify(). Method in class [Link]
Creates the file dialog's peer.
addNotify(). Method in class [Link]
Creates the Frame's peer.
addNotify(). Method in class [Link]
Creates the peer for this label.
addNotify(). Method in class [Link]
va
Creates the peer for the list.
addNotify(). Method in class [Link]
Creates the menu's peer.
addNotify(). Method in class [Link]
Creates the menu bar's peer.
addNotify(). Method in class [Link]
Creates the menu item's peer.
addNotify(). Method in class [Link]
Creates the Panel's peer.
addNotify(). Method in class [Link]
ja

Creates the popup menu's peer.


addNotify(). Method in class [Link]
Creates the Scrollbar's peer.
addNotify(). Method in class [Link]
Creates the scroll pane's peer.
addNotify(). Method in class [Link]
Creates the TextArea's peer.
w.

addNotify(). Method in class [Link]


Creates the TextField's peer.
addNotify(). Method in class [Link]
Creates the Window's peer.
addObserver(Observer). Method in class [Link]
Adds an observer to the set of observers for this object.
addOwner(Principal, Principal). Method in interface [Link]
Adds an owner.
addPermission(Permission). Method in interface [Link]
Adds the specified permission to this ACL entry.
ww

addPoint(int, int). Method in class [Link]


Appends a point to a polygon.
addPropertyChangeListener(PropertyChangeListener). Method in interface [Link]
Register a listener for the PropertyChange event.
addPropertyChangeListener(PropertyChangeListener). Method in class [Link]
Add a PropertyChangeListener to the listener list.
addPropertyChangeListener(PropertyChangeListener). Method in interface [Link]
Register a listener for the PropertyChange event.
addPropertyChangeListener(PropertyChangeListener). Method in class [Link]
Register a listener for the PropertyChange event.
addProvider(Provider). Static method in class [Link]
Adds a provider to the next position available.

294
295

address. Variable in class [Link]


The IP address of the remote end of this socket.
addSeparator(). Method in class [Link]

m
Adds a separator line, or a hypen, to the menu at the current position.
addSeparator(). Method in interface [Link]
addSystemThread(). Method in class [Link]
Add the calling thread to the list of threads which aren't suspended by the RemoteDebugger.
addSystemThread(Thread). Method in class [Link]
Add the specified thread to the list of threads which aren't suspended by the RemoteDebugger.
addTextListener(TextListener). Method in class [Link]
Adds the specified text event listener to recieve text events from this textcomponent.

o
addVetoableChangeListener(VetoableChangeListener). Method in class [Link]
Add a VetoableListener to the listener list.
addWindowListener(WindowListener). Method in class [Link]
Adds the specified window listener to receive window events from this window.
AdjustForGravity(GridBagConstraints, Rectangle). Method in class [Link]

i.c
ADJUSTMENT_EVENT_MASK. Static variable in class [Link]
The event mask for selecting adjustment events.
ADJUSTMENT_FIRST. Static variable in class [Link]
Marks the first integer id for the range of adjustment event ids.
ADJUSTMENT_LAST. Static variable in class [Link]
Marks the last integer id for the range of adjustment event ids.
ADJUSTMENT_VALUE_CHANGED. Static variable in class [Link]
The adjustment value changed event.
AdjustmentEvent(Adjustable, int, int, int). Constructor for class [Link]
Constructs a AdjustmentEvent object with the specified Adjustable source, type, and value.

dil
adjustmentValueChanged(AdjustmentEvent). Method in interface [Link]
Invoked when the value of the adjustable has changed.
adjustmentValueChanged(AdjustmentEvent). Method in class [Link]
Handles the adjustmentValueChanged event by invoking the adjustmentValueChanged methods on listener-a and listener-b.
Adler32(). Constructor for class [Link].Adler32
after(Date). Method in class [Link]
Tests if this date is after the specified date.
after(Object). Method in class [Link]
Compares the time field records.
after(Object). Method in class [Link]
Overrides Calendar Compares the time field records.
va
after(Timestamp). Method in class [Link]
Is this timestamp later than the timestamp argument?
ALLBITS. Static variable in interface [Link]
A static image which was previously drawn is now complete and can be drawn again in its final form.
allowsMultipleSelections(). Method in class [Link]
allowThreadSuspension(boolean). Method in class [Link]
Used by VM to control lowmem implicit suspension.
allowUserInteraction. Variable in class [Link]
If true, this URL is being examined in a context in which it makes sense to allow user interactions such as popping up an
authentication dialog.
ja

allProceduresAreCallable(). Method in interface [Link]


Can all the procedures returned by getProcedures be called by the current user?
allTablesAreSelectable(). Method in interface [Link]
Can all the tables returned by getTable be SELECTed by the current user?
AlreadyBoundException(). Constructor for class [Link]
AlreadyBoundException(String). Constructor for class [Link]
ALT_MASK. Static variable in class [Link]
w.

The alt modifier constant.


ALT_MASK. Static variable in class [Link]
The alt modifier constant.
ALT_MASK. Static variable in class [Link]
The alt key modifier constant.
AM. Static variable in class [Link]
Useful constant for hour in 12-hour clock.
AM_PM. Static variable in class [Link]
Useful constant for date and time.
AM_PM_FIELD. Static variable in class [Link]
ww

Useful constant for AM_PM field alignment.


anchor. Variable in class [Link]
and(BigInteger). Method in class [Link]
Returns a BigInteger whose value is (this & val).
and(BitSet). Method in class [Link]
Performs a logical AND of this target bit set with the argument bit set.
andNot(BigInteger). Method in class [Link]
Returns a BigInteger whose value is (this & ~val).
annotateClass(Class). Method in class [Link]
Subclasses may implement this method to allow class data to be stored in the stream.
append(boolean). Method in class [Link]
Appends the string representation of the boolean argument to the string buffer.

295
296

append(char). Method in class [Link]


Appends the string representation of the char argument to this string buffer.
append(char[]). Method in class [Link]

m
Appends the string representation of the char array argument to this string buffer.
append(char[], int, int). Method in class [Link]
Appends the string representation of a subarray of the char array argument to this string buffer.
append(double). Method in class [Link]
Appends the string representation of the double argument to this string buffer.
append(float). Method in class [Link]
Appends the string representation of the float argument to this string buffer.
append(int). Method in class [Link]

o
Appends the string representation of the int argument to this string buffer.
append(long). Method in class [Link]
Appends the string representation of the long argument to this string buffer.
append(Object). Method in class [Link]
Appends the string representation of the Object argument to this string buffer.

i.c
append(String). Method in class [Link]
Appends the string to this string buffer.
append(String). Method in class [Link]
Appends the given text to the end.
appendText(String). Method in class [Link]
Applet(). Constructor for class [Link]
appletResize(int, int). Method in interface [Link]
Called when the applet wants to be resized.
applyLocalizedPattern(String). Method in class [Link]
Apply the given pattern to this Format object.

dil
applyLocalizedPattern(String). Method in class [Link]
Apply the given localized pattern string to this date format.
applyPattern(String). Method in class [Link]
Sets the pattern.
applyPattern(String). Method in class [Link]
Apply the given pattern to this Format object.
applyPattern(String). Method in class [Link]
Sets the pattern.
applyPattern(String). Method in class [Link]
Apply the given unlocalized pattern string to this date format.
APRIL. Static variable in class [Link]
va
Useful constant for month.
AreaAveragingScaleFilter(int, int). Constructor for class [Link]
Constructs an AreaAveragingScaleFilter that scales the pixels from its source Image as specified by the width and height
parameters.
areFieldsSet. Variable in class [Link]
The flag which tells if the time fields are set for the calendar.
arg. Variable in class [Link]
An arbitrary argument.
ArithmeticException(). Constructor for class [Link]
Constructs an ArithmeticException with no detail message.
ja

ArithmeticException(String). Constructor for class [Link]


Constructs an ArithmeticException with the specified detail message.
ArrangeGrid(Container). Method in class [Link]
arraycopy(Object, int, Object, int, int). Static method in class [Link]
Copies an array from the specified source array, beginning at the specified position, to the specified position of the destination
array.
ArrayIndexOutOfBoundsException(). Constructor for class [Link]
w.

Constructs an ArrayIndexOutOfBoundsException with no detail message.


ArrayIndexOutOfBoundsException(int). Constructor for class [Link]
Constructs a new ArrayIndexOutOfBoundsException class with an argument indicating the illegal index.
ArrayIndexOutOfBoundsException(String). Constructor for class [Link]
Constructs an ArrayIndexOutOfBoundsException class with the specified detail message.
ArrayStoreException(). Constructor for class [Link]
Constructs an ArrayStoreException with no detail message.
ArrayStoreException(String). Constructor for class [Link]
Constructs an ArrayStoreException with the specified detail message.
arrayTypeName(int). Method in class [Link]
ww

Return the element type as a string.


asin(double). Static method in class [Link]
Returns the arc sine of an angle, in the range of -pi/2 through pi/2.
atan(double). Static method in class [Link]
Returns the arc tangent of an angle, in the range of -pi/2 through pi/2.
atan2(double, double). Static method in class [Link]
Converts rectangular coordinates (b, a) to polar (r, theta).
attributeNames(). Method in class [Link]
AUGUST. Static variable in class [Link]
Useful constant for month.
available(). Method in class [Link]
Returns the number of bytes that can be read from this input stream without blocking.

296
297

available(). Method in class [Link]


Returns the number of bytes that can be read from this input stream without blocking.
available(). Method in class [Link]

m
Returns the number of bytes that can be read from this file input stream without blocking.
available(). Method in class [Link]
Returns the number of bytes that can be read from this input stream without blocking.
available(). Method in class [Link]
Returns the number of bytes that can be read from this input stream without blocking.
available(). Method in class [Link]
Returns the number of bytes that can be read from this input stream without blocking.
available(). Method in interface [Link]

o
Returns the number of bytes that can be read without blocking.
available(). Method in class [Link]
Returns the number of bytes that can be read without blocking.
available(). Method in class [Link]
Returns the number of bytes that can be read from this input stream without blocking.

i.c
available(). Method in class [Link]
Returns the number of bytes that can be read from this input stream without blocking.
available(). Method in class [Link]
Returns the number of bytes available on the current stream.
available(). Method in class [Link]
Returns the number of bytes that can be read from this socket without blocking.
available(). Method in class [Link]
Returns the number of bytes that can be read from the input stream without blocking.
avoidingGui(). Method in interface [Link]
AWTError(String). Constructor for class [Link]

dil
AWTEvent(Event). Constructor for class [Link]
Constructs an AWTEvent object from the parameters of a 1.0-style event.
AWTEvent(Object, int). Constructor for class [Link]
Constructs an AWTEvent object with the specified source object and type.
AWTEventMulticaster(EventListener, EventListener). Constructor for class [Link]
Creates an event multicaster instance which chains listener-a with listener-b.
AWTException(String). Constructor for class [Link]
Constructs an AWTException with the specified detail message.
va
B

b. Variable in class [Link]


BACK_SPACE. Static variable in class [Link]
The BackSpace key.
BC. Static variable in class [Link]
Useful constant for GregorianCalendar.
BeanDescriptor(Class). Constructor for class [Link]
Create a BeanDescriptor for a bean that doesn't have a customizer.
BeanDescriptor(Class, Class). Constructor for class [Link]
ja

Create a BeanDescriptor for a bean that has a customizer.


Beans(). Constructor for class [Link]
beep(). Method in class [Link]
Emits an audio beep.
before(Date). Method in class [Link]
Tests if this date is before the specified date.
before(Object). Method in class [Link]
w.

Compares the time field records.


before(Object). Method in class [Link]
Overrides Calendar Compares the time field records.
before(Timestamp). Method in class [Link]
Is this timestamp earlier than the timestamp argument?
beginValidate(). Method in interface [Link]
BEST_COMPRESSION. Static variable in class [Link]
Compression level for best compression.
BEST_SPEED. Static variable in class [Link]
Compression level for fastest compression.
ww

bestRowNotPseudo. Static variable in interface [Link]


BEST ROW PSEUDO_COLUMN - is NOT a pseudo column.
bestRowPseudo. Static variable in interface [Link]
BEST ROW PSEUDO_COLUMN - is a pseudo column.
bestRowSession. Static variable in interface [Link]
BEST ROW SCOPE - valid for remainder of current session.
bestRowTemporary. Static variable in interface [Link]
BEST ROW SCOPE - very temporary, while using row.
bestRowTransaction. Static variable in interface [Link]
BEST ROW SCOPE - valid for remainder of current transaction.
bestRowUnknown. Static variable in interface [Link]
BEST ROW PSEUDO_COLUMN - may or may not be pseudo column.

297
298

BigDecimal(BigInteger). Constructor for class [Link]


Translates a BigInteger into a BigDecimal.
BigDecimal(BigInteger, int). Constructor for class [Link]

m
Translates a BigInteger and a scale into a BigDecimal.
BigDecimal(double). Constructor for class [Link]
Translates a double into a BigDecimal.
BigDecimal(String). Constructor for class [Link]
Constructs a BigDecimal from a string containing an optional minus sign followed by a sequence of zero or more decimal
digits, optionally followed by a fraction, which consists of a decimal point followed by zero or more decimal digits.
BIGINT. Static variable in class [Link]
BigInteger(byte[]). Constructor for class [Link]

o
Translates a byte array containing the two's-complement representation of a (signed) integer into a BigInteger.
BigInteger(int, byte[]). Constructor for class [Link]
Translates the sign-magnitude representation of an integer into a BigInteger.
BigInteger(int, int, Random). Constructor for class [Link]
Returns a randomly selected BigInteger with the specified bitLength that is probably prime.

i.c
BigInteger(int, Random). Constructor for class [Link]
Returns a random number uniformly distributed on [0, 2**numBits - 1] (assuming a fair source of random bits is provided in
rndSrc).
BigInteger(String). Constructor for class [Link]
Translates a string containing an optional minus sign followed by a sequence of one or more decimal digits into a BigInteger.
BigInteger(String, int). Constructor for class [Link]
Translates a string containing an optional minus sign followed by a sequence of one or more digits in the specified radix into a
BigInteger.
BINARY. Static variable in class [Link]
bind(InetAddress, int). Method in class [Link]

dil
Binds this socket to the specified port number on the specified host.
bind(int, InetAddress). Method in class [Link]
Binds a datagram socket to a local port and address.
bind(String, Remote). Static method in class [Link]
Binds the name to the specified remote object.
bind(String, Remote). Method in interface [Link]
Binds the name to the specified remote object.
BindException(). Constructor for class [Link]
Construct a new BindException with no detailed message.
BindException(String). Constructor for class [Link]
Constructs a new BindException with the specified detail message as to why the bind error occurred.
va
BIT. Static variable in class [Link]
bitCount(). Method in class [Link]
Returns the number of bits in the two's complement representation of this number that differ from its sign bit.
bitLength(). Method in class [Link]
Returns the number of bits in the minimal two's-complement representation of this number, *excluding* a sign bit, i.e.,
(ceil(log2(this < 0 ? -this : this + 1))).
BitSet(). Constructor for class [Link]
Creates a new bit set.
BitSet(int). Constructor for class [Link]
Creates a bit set whose initial size is the specified number of bits.
ja

black. Static variable in class [Link]


The color black.
BLOCK_DECREMENT. Static variable in class [Link]
The block decrement adjustment type.
BLOCK_INCREMENT. Static variable in class [Link]
The block increment adjustment type.
blue. Static variable in class [Link]
w.

The color blue.


BOLD. Static variable in class [Link]
The bold style constant.
Boolean(boolean). Constructor for class [Link]
Allocates a Boolean object representing the value argument.
Boolean(String). Constructor for class [Link]
Allocates a Boolean object representing the value true if the string argument is not null and is equal, ignoring case, to the
string "true".
booleanValue(). Method in class [Link]
Returns the value of this Boolean object as a boolean.
ww

BorderLayout(). Constructor for class [Link]


Constructs a new BorderLayout with no gaps between components.
BorderLayout(int, int). Constructor for class [Link]
Constructs a BorderLayout with the specified gaps.
BOTH. Static variable in class [Link]
bottom. Variable in class [Link]
The inset from the bottom.
BOTTOM_ALIGNMENT. Static variable in class [Link]
Ease of use constant for getAlignmentY().
bounds. Variable in class [Link]
bounds(). Method in class [Link]
BreakIterator(). Constructor for class [Link]

298
299

Constructor.
breakpointEvent(RemoteThread). Method in interface [Link]
A breakpoint has been hit in the specified thread.

m
BRIEF. Static variable in class [Link]
brighter(). Method in class [Link]
Returns a brighter version of this color.
buf. Variable in class [Link]
The buffer where data is stored.
buf. Variable in class [Link]
The buffer where data is stored.
buf. Variable in class [Link]

o
The byte array containing the data.
buf. Variable in class [Link]
The buffer where data is stored.
buf. Variable in class [Link]
Character buffer

i.c
buf. Variable in class [Link]
The buffer where data is stored.
buf. Variable in class [Link]
Output buffer for writing compressed data.
buf. Variable in class [Link]
Input buffer for decompression.
buf. Variable in class [Link]
The push back buffer.
buffer. Variable in class [Link]
The circular buffer into which incoming data is placed.

dil
buffer. Variable in class [Link]
The string from which bytes are read.
BufferedInputStream(InputStream). Constructor for class [Link]
Creates a new buffered input stream to read data from the specified input stream with a default 512-byte buffer size.
BufferedInputStream(InputStream, int). Constructor for class [Link]
Creates a new buffered input stream to read data from the specified input stream with the specified buffer size.
BufferedOutputStream(OutputStream). Constructor for class [Link]
Creates a new buffered output stream to write data to the specified underlying output stream with a default 512-byte buffer
size.
BufferedOutputStream(OutputStream, int). Constructor for class [Link]
Creates a new buffered output stream to write data to the specified underlying output stream with the specified buffer size.
va
BufferedReader(Reader). Constructor for class [Link]
Create a buffering character-input stream that uses a default-sized input buffer.
BufferedReader(Reader, int). Constructor for class [Link]
Create a buffering character-input stream that uses an input buffer of the specified size.
BufferedWriter(Writer). Constructor for class [Link]
Create a buffered character-output stream that uses a default-sized output buffer.
BufferedWriter(Writer, int). Constructor for class [Link]
Create a new buffered character-output stream that uses an output buffer of the given size.
Button(). Constructor for class [Link]
Constructs a Button with no label.
ja

Button(String). Constructor for class [Link]


Constructs a Button with the specified label.
BUTTON1_MASK. Static variable in class [Link]
The mouse button1 modifier constant.
BUTTON2_MASK. Static variable in class [Link]
The mouse button2 modifier constant.
BUTTON3_MASK. Static variable in class [Link]
w.

The mouse button3 modifier constant.


Byte(byte). Constructor for class [Link]
Constructs a Byte object initialized to the specified byte value.
Byte(String). Constructor for class [Link]
Constructs a Byte object initialized to the value specified by the String parameter.
ByteArrayInputStream(byte[]). Constructor for class [Link]
Creates a new byte array input stream that reads data from the specified byte array.
ByteArrayInputStream(byte[], int, int). Constructor for class [Link]
Creates a new byte array input stream that reads data from the specified byte array.
ByteArrayOutputStream(). Constructor for class [Link]
ww

Creates a new byte array output stream.


ByteArrayOutputStream(int). Constructor for class [Link]
Creates a new byte array output stream, with a buffer capacity of the specified size, in bytes.
bytesTransferred. Variable in class [Link]
Reports how many bytes had been transferred as part of the I/O operation before it was interrupted.
bytesWidth(byte[], int, int). Method in class [Link]
Returns the total advance width for showing the specified array of bytes in this Font.
byteValue(). Method in class [Link]
Returns the value of this Byte as a byte.
byteValue(). Method in class [Link]
Returns the value of this Double as a byte (by casting to a byte).
byteValue(). Method in class [Link]

299
300

Returns the value of this Float as a byte (by casting to a byte).


byteValue(). Method in class [Link]
Returns the value of this Integer as a byte.

m
byteValue(). Method in class [Link]
Returns the value of this Long as a byte.
byteValue(). Method in class [Link]
Returns the value of the specified number as a byte.
byteValue(). Method in class [Link]
Returns the value of this Short as a byte.

o
C

calendar. Variable in class [Link]


The calendar that DateFormat uses to produce the time field values needed to implement date/time formatting.

i.c
Calendar(). Constructor for class [Link]
Constructs a Calendar with the default time zone as returned by [Link](), and the default locale.
Calendar(TimeZone, Locale). Constructor for class [Link]
Constructs a Calendar with the given time zone and locale.
CANADA. Static variable in class [Link]
Useful constant for country.
CANADA_FRENCH. Static variable in class [Link]
Useful constant for country.
cancel(). Method in interface [Link]
Cancel can be used by one thread to cancel a statement that is being executed by another thread.

dil
canFilterIndexColorModel. Variable in class [Link]
This boolean indicates whether or not it is acceptable to apply the color filtering of the filterRGB method to the color table
entries of an IndexColorModel object in lieu of pixel by pixel filtering.
CANONICAL_DECOMPOSITION. Static variable in class [Link]
Decomposition mode value.
canRead(). Method in class [Link]
Tests if the application can read from the specified file.
Canvas(). Constructor for class [Link]
Constructs a new Canvas.
canWrite(). Method in class [Link]
Tests if the application can write to this file.
va
capacity(). Method in class [Link]
Returns the current capacity of the String buffer.
capacity(). Method in class [Link]
Returns the current capacity of this vector.
capacityIncrement. Variable in class [Link]
The amount by which the capacity of the vector is automatically incremented when its size becomes greater than its capacity.
CAPS_LOCK. Static variable in class [Link]
The CapsLock action-key.
CardLayout(). Constructor for class [Link]
Creates a new card layout with gaps of size zero.
ja

CardLayout(int, int). Constructor for class [Link]


Creates a card layout with the specified gaps.
catchExceptions(). Method in class [Link]
Enter the debugger when an instance of this class is thrown.
ceil(double). Static method in class [Link]
Returns the smallest (closest to negative infinity) double value that is not less than the argument and is equal to a mathematical
integer.
w.

CENTER. Static variable in class [Link]


The center layout constraint.
CENTER. Static variable in class [Link]
The right alignment variable.
CENTER. Static variable in class [Link]
CENTER. Static variable in class [Link]
The center alignment.
CENTER_ALIGNMENT. Static variable in class [Link]
Ease of use constant for getAlignmentY() and getAlignmentX().
certificates(). Method in class [Link]
ww

Returns a copy of all the certificates for this identity.


CHAR. Static variable in class [Link]
CHAR_UNDEFINED. Static variable in class [Link]
KEY_PRESSED and KEY_RELEASED events which do not map to a valid Unicode character do not have a defined
keyChar.
Character(char). Constructor for class [Link]
Constructs a Character object and initializes it so that it represents the primitive value argument.
CharArrayReader(char[]). Constructor for class [Link]
Create an CharArrayReader from the specified array of chars.
CharArrayReader(char[], int, int). Constructor for class [Link]
Create an CharArrayReader from the specified array of chars.
CharArrayWriter(). Constructor for class [Link]

300
301

Creates a new CharArrayWriter.


CharArrayWriter(int). Constructor for class [Link]
Creates a new CharArrayWriter with the specified initial size.

m
charAt(int). Method in class [Link]
Returns the character at the specified index.
charAt(int). Method in class [Link]
Returns the character at a specific index in this string buffer.
CharConversionException(). Constructor for class [Link]
provides no detailed message
CharConversionException(String). Constructor for class [Link]
provides a detailed message

o
charsWidth(char[], int, int). Method in class [Link]
Returns the total advance width for showing the specified array of characters in this Font.
charValue(). Method in class [Link]
Returns the value of this Character object.
charWidth(char). Method in class [Link]

i.c
Returns the advance width of the specified character in this Font.
charWidth(int). Method in class [Link]
Returns the advance width of the specified character in this Font.
checkAccept(String, int). Method in class [Link]
For now stubs can't accept connections on any port.
checkAccept(String, int). Method in class [Link]
Throws a SecurityException if the calling thread is not permitted to accept a socket connection from the specified host
and port number.
checkAccess(). Method in class [Link]
Determines if the currently running thread has permission to modify this thread.

dil
checkAccess(). Method in class [Link]
Determines if the currently running thread has permission to modify this thread group.
checkAccess(Thread). Method in class [Link]
Stubs are not allowed to manipulate threads.
checkAccess(Thread). Method in class [Link]
Throws a SecurityException if the calling thread is not allowed to modify the thread argument.
checkAccess(ThreadGroup). Method in class [Link]
Stubs are not allowed to manipulate thread groups.
checkAccess(ThreadGroup). Method in class [Link]
Throws a SecurityException if the calling thread is not allowed to modify the thread group argument.
checkAll(). Method in class [Link]
va
Checks to see if all images have finished loading but does not start loading the images if they are not already loading.
checkAll(boolean). Method in class [Link]
Checks to see if all images have finished loading.
checkAwtEventQueueAccess(). Method in class [Link]
Checks to see if an client can get access to the AWT event queue (disallowed from stubs).
checkAwtEventQueueAccess(). Method in class [Link]
Tests if a client can get access to the AWT event queue.
Checkbox(). Constructor for class [Link]
Constructs a Checkbox with an empty label.
Checkbox(String). Constructor for class [Link]
ja

Constructs a Checkbox with the specified label.


Checkbox(String, boolean). Constructor for class [Link]
Constructs a Checkbox with the specified label.
Checkbox(String, boolean, CheckboxGroup). Constructor for class [Link]
Constructs a Checkbox with the specified label, set to the specified state, and in the specified check box group.
Checkbox(String, CheckboxGroup, boolean). Constructor for class [Link]
Constructs a Checkbox with the specified label, set to the specified state, and in the specified check box group.
w.

CheckboxGroup(). Constructor for class [Link]


Creates a new CheckboxGroup.
CheckboxMenuItem(). Constructor for class [Link]
Creates a checkbox menu item with an empty label, initially set to off (false state).
CheckboxMenuItem(String). Constructor for class [Link]
Creates the checkbox item with the specified label, initially set to off (false state).
CheckboxMenuItem(String, boolean). Constructor for class [Link]
Creates a checkbox menu item with the specified label and state.
checkConnect(String, int). Method in class [Link]
Stubs can make connections if called through the RMI transport.
ww

checkConnect(String, int). Method in class [Link]


Throws a SecurityException if the calling thread is not allowed to open a socket connection to the specified host and port
number.
checkConnect(String, int, Object). Method in class [Link]
Downloaded classes (including stubs) can make connections if called through the RMI transport.
checkConnect(String, int, Object). Method in class [Link]
Throws a SecurityException if the specified security context is not allowed to open a socket connection to the specified
host and port number.
checkCreateClassLoader(). Method in class [Link]
Stubs are not allowed to create class loaders, or even execute any of ClassLoader's methods.
checkCreateClassLoader(). Method in class [Link]
Throws a SecurityException if the calling thread is not allowed to create a new class loader.

301
302

checkDelete(String). Method in class [Link]


Check if a file with the specified system dependent file name can be deleted.
checkDelete(String). Method in class [Link]

m
Throws a SecurityException if the calling thread is not allowed to delete the specified file.
CheckedInputStream(InputStream, Checksum). Constructor for class [Link]
Creates an input stream using the specified Checksum.
CheckedOutputStream(OutputStream, Checksum). Constructor for class [Link]
Creates an output stream with the specified Checksum.
checkError(). Method in class [Link]
Flushes this print stream's underlying output stream, and tests if there has been an error on the underlying output stream.
checkError(). Method in class [Link]

o
Flush the stream and check its error state.
checkExec(String). Method in class [Link]
Stubs are not allowed to fork processes.
checkExec(String). Method in class [Link]
Throws a SecurityException if the calling thread is not allowed to create a subprocss.

i.c
checkExit(int). Method in class [Link]
Stubs are not allowed to exit the VM.
checkExit(int). Method in class [Link]
Throws a SecurityException if the calling thread is not allowed to cause the Java Virtual Machine to halt with the
specified status code.
checkID(int). Method in class [Link]
Checks to see if all images tagged with the indicated ID have finished loading, but does not start loading the images if they are
not already loading.
checkID(int, boolean). Method in class [Link]
Checks to see if all images tagged with the indicated ID have finished loading.

dil
checkImage(Image, ImageObserver). Method in class [Link]
Returns the status of the construction of a screen representation of the specified image.
checkImage(Image, int, int, ImageObserver). Method in class [Link]
Returns the status of the construction of a scaled screen representation of the specified image.
checkImage(Image, int, int, ImageObserver). Method in interface [Link]
checkImage(Image, int, int, ImageObserver). Method in class [Link]
Returns the status of the construction of the indicated method at the indicated width and height for the default screen.
checkLink(String). Method in class [Link]
Stubs are not allowed to link dynamic libraries.
checkLink(String). Method in class [Link]
Throws a SecurityException if the calling thread is not allowed to dynamic link the library code specified by the string
va
argument file.
checkListen(int). Method in class [Link]
For now stubs can't listen on any port.
checkListen(int). Method in class [Link]
Throws a SecurityException if the calling thread is not allowed to wait for a connection request on the specified local port
number.
checkMemberAccess(Class, int). Method in class [Link]
Checks to see if client code can access class members.
checkMemberAccess(Class, int). Method in class [Link]
Tests if a client is allowed to access members.
ja

checkMulticast(InetAddress). Method in class [Link]


Checks to see if current execution context is allowed to use (join/leave/send/receive) IP multicast (disallowed from stubs).
checkMulticast(InetAddress). Method in class [Link]
Tests if current execution context is allowed to use (join/leave/send/receive) IP multicast.
checkMulticast(InetAddress, byte). Method in class [Link]
Checks to see if current execution context is allowed to use (join/leave/send/receive) IP multicast (disallowed from stubs).
checkMulticast(InetAddress, byte). Method in class [Link]
w.

Tests to see if current execution context is allowed to use (join/leave/send/receive) IP multicast.


checkPackageAccess(String). Method in class [Link]
Check if a stub can access a package.
checkPackageAccess(String). Method in class [Link]
Throws a SecurityException if the calling thread is not allowed to access the package specified by the argument.
checkPackageDefinition(String). Method in class [Link]
Check if a stub can define classes in a package.
checkPackageDefinition(String). Method in class [Link]
Throws a SecurityException if the calling thread is not allowed to define classes in the package specified by the argument.
checkPermission(Permission). Method in interface [Link]
ww

Checks if the specified permission is part of the permission set in this entry.
checkPermission(Principal, Permission). Method in interface [Link]
Checks whether or not the specified principal has the specified permission.
checkPrintJobAccess(). Method in class [Link]
Disallow printing from stubs.
checkPrintJobAccess(). Method in class [Link]
Tests if a client can initiate a print job request.
checkPropertiesAccess(). Method in class [Link]
Stubs are not allowed to access the entire system properties list, only properties explicitly labeled as accessible to stubs.
checkPropertiesAccess(). Method in class [Link]
Throws a SecurityException if the calling thread is not allowed to access or modify the system properties.
checkPropertyAccess(String). Method in class [Link]

302
303

Stubs can access the system property named by key only if its twin [Link] property is set to true.
checkPropertyAccess(String). Method in class [Link]
Throws a SecurityException if the calling thread is not allowed to access the system property with the specified key

m
name.
checkRead(FileDescriptor). Method in class [Link]
Stubs are not allowed to open file descriptors for reading unless it is done through a socket, in which case other access
restrictions still apply.
checkRead(FileDescriptor). Method in class [Link]
Throws a SecurityException if the calling thread is not allowed to read from the specified file descriptor.
checkRead(String). Method in class [Link]
Check if a stub can read a particular file.

o
checkRead(String). Method in class [Link]
Throws a SecurityException if the calling thread is not allowed to read the file specified by the string argument.
checkRead(String, Object). Method in class [Link]
No file reads are valid from a stub.
checkRead(String, Object). Method in class [Link]

i.c
Throws a SecurityException if the specified security context is not allowed to read the file specified by the string
argument.
checkSecurityAccess(String). Method in class [Link]
Stubs cannot perform security provider operations.
checkSecurityAccess(String). Method in class [Link]
Tests access to certain operations for a security API action.
checkSetFactory(). Method in class [Link]
Check if a stub can set a networking-related object factory.
checkSetFactory(). Method in class [Link]
Throws a SecurityException if the calling thread is not allowed to set the socket factory used by ServerSocket or

dil
Socket, or the stream handler factory used by URL.
checkSystemClipboardAccess(). Method in class [Link]
Checks to see if an client can get access to the System Clipboard (disallowed from stubs).
checkSystemClipboardAccess(). Method in class [Link]
Tests if a client can get access to the system clipboard.
checkTopLevelWindow(Object). Method in class [Link]
Allow caller to create top-level windows.
checkTopLevelWindow(Object). Method in class [Link]
Returns false if the calling thread is not trusted to bring up the top-level window indicated by the window argument.
checkWrite(FileDescriptor). Method in class [Link]
Stubs are not allowed to open file descriptors for writing unless it is done through a socket, in which case other access
va
restrictions still apply.
checkWrite(FileDescriptor). Method in class [Link]
Throws a SecurityException if the calling thread is not allowed to write to the specified file descriptor.
checkWrite(String). Method in class [Link]
Check if a Stub can write a particular file.
checkWrite(String). Method in class [Link]
Throws a SecurityException if the calling thread is not allowed to write to the file specified by the string argument.
childResized(int, int). Method in interface [Link]
CHINA. Static variable in class [Link]
Useful constant for country.
ja

CHINESE. Static variable in class [Link]


Useful constant for language.
Choice(). Constructor for class [Link]
Constructs a new Choice.
ChoiceFormat(double[], String[]). Constructor for class [Link]
Constructs with the limits and the corresponding formats.
ChoiceFormat(String). Constructor for class [Link]
w.

Constructs with limits and corresponding formats based on the pattern.


choices. Variable in class [Link]
If the value may be selected from a particular set of values, then this is an array of the possible values.
ClassCastException(). Constructor for class [Link]
Constructs a ClassCastException with no detail message.
ClassCastException(String). Constructor for class [Link]
Constructs a ClassCastException with the specified detail message.
ClassCircularityError(). Constructor for class [Link]
Constructs a ClassCircularityError with no detail message.
ClassCircularityError(String). Constructor for class [Link]
ww

Constructs a ClassCircularityError with the specified detail message.


classDepth(String). Method in class [Link]
Returns the stack depth of the specified class.
ClassFormatError(). Constructor for class [Link]
Constructs a ClassFormatError with no detail message.
ClassFormatError(String). Constructor for class [Link]
Constructs a ClassFormatError with the specified detail message.
ClassLoader(). Constructor for class [Link]
Constructs a new class loader and initializes it.
classLoaderDepth(). Method in class [Link]
Returns the stack depth of the most recently executing method from a class defined using a class loader.
classname. Variable in class [Link]

303
304

ClassNotFoundException(). Constructor for class [Link]


Constructs a ClassNotFoundException with no detail message.
ClassNotFoundException(String). Constructor for class [Link]

m
Constructs a ClassNotFoundException with the specified detail message.
clean(ObjID[], long, VMID, boolean). Method in interface [Link]
The clean call removes the 'vmid' from the reference list of each remote object indicated in 'id's.
clear(). Method in class [Link]
Clears the values of all the time fields.
clear(). Method in class [Link]
Clears this hashtable so that it contains no keys.
clear(). Method in class [Link]

o
clear(). Method in interface [Link]
DEPRECATED: Replaced by removeAll().
clear(int). Method in class [Link]
Sets the bit specified by the index to false.
clear(int). Method in class [Link]

i.c
Clears the value in the given time field.
clearBit(int). Method in class [Link]
Returns a BigInteger whose value is equivalent to this number with the designated bit cleared.
clearBreakpoint(int). Method in class [Link]
Clear a breakpoint at a specific address in a class.
clearBreakpointLine(int). Method in class [Link]
Clear a breakpoint at a specified line.
clearBreakpointMethod(RemoteField). Method in class [Link]
Clear a breakpoint at the start of a specified method.
clearChanged(). Method in class [Link]

dil
Indicates that this object has no longer changed, or that it has already notified all of its observers of its most recent change.
clearParameters(). Method in interface [Link]

In general, parameter values remain in force for repeated use of a Statement.


clearRect(int, int, int, int). Method in class [Link]
Clears the specified rectangle by filling it with the background color of the current drawing surface.
clearWarnings(). Method in interface [Link]
After this call, getWarnings returns null until a new warning is reported for this Connection.
clearWarnings(). Method in interface [Link]
After this call getWarnings returns null until a new warning is reported for this ResultSet.
clearWarnings(). Method in interface [Link]
va
After this call, getWarnings returns null until a new warning is reported for this Statement.
clickCount. Variable in class [Link]
The number of consecutive clicks.
Clipboard(String). Constructor for class [Link]
Creates a clipboard object.
clipRect(int, int, int, int). Method in class [Link]
Intersects the current clip with the specified rectangle.
clone(). Method in interface [Link]
Clones this ACL entry.
clone(). Method in class [Link]
ja

Clones this BitSet.


clone(). Method in class [Link]
Create a copy of this boundary
clone(). Method in class [Link]
Overrides Cloneable
clone(). Method in interface [Link]
Create a copy of this iterator
w.

clone(). Method in class [Link]


Overrides Cloneable
clone(). Method in class [Link]
Overrides Cloneable
clone(). Method in class [Link]
Overrides Cloneable
clone(). Method in class [Link]
Overrides Cloneable
clone(). Method in class [Link]
Standard override; no change in semantics.
ww

clone(). Method in class [Link]


Standard override.
clone(). Method in class [Link]
Creates a new object of the same class as this object.
clone(). Method in class [Link]
Overrides Cloneable
clone(). Method in class [Link]
Creates a new object of the same class as this object.
clone(). Method in class [Link]
Creates a shallow copy of this hashtable.
clone(). Method in class [Link]
Clones this object.

304
305

clone(). Method in class [Link]


Creates a new object of the same class as this object.
clone(). Method in class [Link]

m
Overrides Cloneable
clone(). Method in class [Link]
Returns a clone if the implementation is cloneable.
clone(). Method in class [Link]
Overrides Cloneable
clone(). Method in class [Link]
Overrides Cloneable
clone(). Method in class [Link]

o
Creates a new object of the same class as this object.
clone(). Method in class [Link]
Standard override; no change in semantics.
clone(). Method in class [Link]
Returns a clone if the implementation is cloneable.

i.c
clone(). Method in class [Link]
Overrides Cloneable
clone(). Method in class [Link]
Overrides Cloneable
clone(). Method in class [Link]
Create a copy of this boundary
clone(). Method in class [Link]
Overrides Cloneable
clone(). Method in class [Link]
Returns a clone of the remote object that is distinct from the original.

dil
clone(). Method in class [Link]
Returns a clone of this vector.
CloneNotSupportedException(). Constructor for class [Link]
Constructs a CloneNotSupportedException with no detail message.
CloneNotSupportedException(String). Constructor for class [Link]
Constructs a CloneNotSupportedException with the specified detail message.
close(). Method in class [Link]
Close the stream.
close(). Method in class [Link]
Close the stream.
close(). Method in class [Link]
va
Close the stream.
close(). Method in class [Link]
Close the stream.
close(). Method in interface [Link]
In some cases, it is desirable to immediately release a Connection's database and JDBC resources instead of waiting for them
to be automatically released; the close method provides this immediate release.
close(). Method in class [Link]
Closes this datagram socket.
close(). Method in class [Link]
Close the socket.
ja

close(). Method in class [Link]


Writes remaining compressed data to the output stream and closes the underlying stream.
close(). Method in class [Link]
Closes this file input stream and releases any system resources associated with the stream.
close(). Method in class [Link]
Closes this file output stream and releases any system resources associated with this stream.
close(). Method in class [Link]
w.

Closes this input stream and releases any system resources associated with the stream.
close(). Method in class [Link]
Closes this output stream and releases any system resources associated with the stream.
close(). Method in class [Link]
Close the stream.
close(). Method in class [Link]
Close the stream.
close(). Method in class [Link]
Closes the input stream.
close(). Method in class [Link]
ww

Writes remaining compressed data to the output stream and closes the underlying stream.
close(). Method in class [Link]
Closes this input stream and releases any system resources associated with the stream.
close(). Method in class [Link]
Close the stream.
close(). Method in interface [Link]
Closes the input stream.
close(). Method in class [Link]
Closes the input stream.
close(). Method in interface [Link]
Closes the stream.
close(). Method in class [Link]

305
306

Closes the stream.


close(). Method in class [Link]
Closes this output stream and releases any system resources associated with this stream.

m
close(). Method in class [Link]
Close the stream.
close(). Method in class [Link]
Closes this piped input stream and releases any system resources associated with the stream.
close(). Method in class [Link]
Closes this piped output stream and releases any system resources associated with this stream.
close(). Method in class [Link]
Close the stream.

o
close(). Method in class [Link]
Close the stream.
close(). Method in class [Link]
Closes this print stream and releases any resources associated with the underlying output stream.
close(). Method in class [Link]

i.c
Close the stream.
close(). Method in class [Link]
Close the stream.
close(). Method in class [Link]
Closes this random access file stream and releases any system resources associated with the stream.
close(). Method in class [Link]
Close the stream.
close(). Method in class [Link]
Close the connection to the remote debugging agent.
close(). Method in interface [Link]

dil
In some cases, it is desirable to immediately release a ResultSet's database and JDBC resources instead of waiting for this to
happen when it is automatically closed; the close method provides this immediate release.
close(). Method in class [Link]
Closes this input stream and releases any system resources associated with the stream.
close(). Method in class [Link]
Closes this socket.
close(). Method in class [Link]
Closes this socket.
close(). Method in class [Link]
Closes this socket.
close(). Method in interface [Link]
va
In many cases, it is desirable to immediately release a Statements's database and JDBC resources instead of waiting for this to
happen when it is automatically closed; the close method provides this immediate release.
close(). Method in class [Link]
Close the stream.
close(). Method in class [Link]
Close the stream.
close(). Method in class [Link]
Close the stream, flushing it first.
close(). Method in class [Link]
Closes the ZIP file.
ja

close(). Method in class [Link]


Closes the ZIP input stream.
close(). Method in class [Link]
Closes the ZIP output stream as well as the stream being filtered.
closeEntry(). Method in class [Link]
Closes the current ZIP entry and positions the stream for reading the next entry.
closeEntry(). Method in class [Link]
w.

Closes the current ZIP entry and positions the stream for writing the next entry.
Collator(). Constructor for class [Link]
Default constructor.
Color(float, float, float). Constructor for class [Link]
Creates a color with the specified red, green, and blue values in the range (0.0 - 1.0).
Color(int). Constructor for class [Link]
Creates a color with the specified combined RGB value consisting of the red component in bits 16-23, the green component
in bits 8-15, and the blue component in bits 0-7.
Color(int, int, int). Constructor for class [Link]
Creates a color with the specified red, green, and blue values in the range (0 - 255).
ww

ColorModel(int). Constructor for class [Link]


Constructs a ColorModel which describes a pixel of the specified number of bits.
columnNoNulls. Static variable in interface [Link]
COLUMN NULLABLE - might not allow NULL values.
columnNoNulls. Static variable in interface [Link]
Does not allow NULL values.
columnNullable. Static variable in interface [Link]
COLUMN NULLABLE - definitely allows NULL values.
columnNullable. Static variable in interface [Link]
Allows NULL values.
columnNullableUnknown. Static variable in interface [Link]
COLUMN NULLABLE - nullability unknown.

306
307

columnNullableUnknown. Static variable in interface [Link]


Nullability unknown.
columnWeights. Variable in class [Link]

m
columnWidths. Variable in class [Link]
COMBINING_SPACING_MARK. Static variable in class [Link]
command(Object). Static method in class [Link]
Examines the argument type and its fields and perform some documented operation.
commentChar(int). Method in class [Link]
Specified that the character argument starts a single-line comment.
commit(). Method in interface [Link]
Commit makes all changes made since the previous commit/rollback permanent and releases any database locks currently

o
held by the Connection.
compare(String, String). Method in class [Link]
Compares the source string to the target string according to the collation rules for this Collator.
compare(String, String). Method in class [Link]
Compares the character data stored in two different strings based on the collation rules.

i.c
compareTo(BigDecimal). Method in class [Link]
Returns -1, 0 or 1 as this number is less than, equal to, or greater than val.
compareTo(BigInteger). Method in class [Link]
Returns -1, 0 or 1 as this number is less than, equal to, or greater than val.
compareTo(CollationKey). Method in class [Link]
Compare this CollationKey to the target CollationKey.
compareTo(String). Method in class [Link]
Compares two strings lexicographically.
compileClass(Class). Static method in class [Link]
Compiles the specified class.

dil
compileClasses(String). Static method in class [Link]
Compiles all classes whose name matches the specified string.
COMPLETE. Static variable in class [Link]
Flag indicating the download of media completed successfully.
complete(). Method in class [Link]
Fills in any unset fields in the time field list.
COMPLETESCANLINES. Static variable in interface [Link]
The pixels will be delivered in (multiples of) complete scanlines at a time.
Component(). Constructor for class [Link]
Constructs a new Component.
COMPONENT_ADDED. Static variable in class [Link]
va
The component moved event type.
COMPONENT_EVENT_MASK. Static variable in class [Link]
The event mask for selecting component events.
COMPONENT_FIRST. Static variable in class [Link]
Marks the first integer id for the range of component event ids.
COMPONENT_HIDDEN. Static variable in class [Link]
The component hidden event type.
COMPONENT_LAST. Static variable in class [Link]
Marks the last integer id for the range of component event ids.
COMPONENT_MOVED. Static variable in class [Link]
ja

The component moved event type.


COMPONENT_REMOVED. Static variable in class [Link]
The component resized event type.
COMPONENT_RESIZED. Static variable in class [Link]
The component resized event type.
COMPONENT_SHOWN. Static variable in class [Link]
The component shown event type.
w.

ComponentAdapter(). Constructor for class [Link]


componentAdded(ContainerEvent). Method in class [Link]
Handles the componentAdded container event by invoking the componentAdded methods on listener-a and listener-b.
componentAdded(ContainerEvent). Method in class [Link]
componentAdded(ContainerEvent). Method in interface [Link]
Invoked when a component has been added to the container.
ComponentEvent(Component, int). Constructor for class [Link]
Constructs a ComponentEvent object with the specified source component and type.
componentHidden(ComponentEvent). Method in class [Link]
Handles the componentHidden event by invoking the componentHidden methods on listener-a and listener-b.
ww

componentHidden(ComponentEvent). Method in class [Link]


componentHidden(ComponentEvent). Method in interface [Link]
Invoked when component has been hidden.
componentMoved(ComponentEvent). Method in class [Link]
Handles the componentMoved event by invoking the componentMoved methods on listener-a and listener-b.
componentMoved(ComponentEvent). Method in class [Link]
componentMoved(ComponentEvent). Method in interface [Link]
Invoked when component has been moved.
componentRemoved(ContainerEvent). Method in class [Link]
Handles the componentRemoved container event by invoking the componentRemoved methods on listener-a and listener-b.
componentRemoved(ContainerEvent). Method in class [Link]
componentRemoved(ContainerEvent). Method in interface [Link]

307
308

Invoked when a component has been removed from the container.


componentResized(ComponentEvent). Method in class [Link]
Handles the componentResized event by invoking the componentResized methods on listener-a and listener-b.

m
componentResized(ComponentEvent). Method in class [Link]
componentResized(ComponentEvent). Method in interface [Link]
Invoked when component has been resized.
componentShown(ComponentEvent). Method in class [Link]
Handles the componentShown event by invoking the componentShown methods on listener-a and listener-b.
componentShown(ComponentEvent). Method in class [Link]
componentShown(ComponentEvent). Method in interface [Link]
Invoked when component has been shown.

o
comptable. Variable in class [Link]
computeFields(). Method in class [Link]
Converts UTC as milliseconds to time field values.
computeFields(). Method in class [Link]
Overrides Calendar Converts UTC as milliseconds to time field values.

i.c
computeTime(). Method in class [Link]
Converts Calendar's time field values to UTC as milliseconds.
computeTime(). Method in class [Link]
Overrides Calendar Converts time field values to UTC as milliseconds.
concat(String). Method in class [Link]
Concatenates the specified string to the end of this string.
connect(). Method in class [Link]
Opens a communications link to the resource referenced by this URL, if such a connection has not already been established.
connect(InetAddress, int). Method in class [Link]
Connects this socket to the specified port number on the specified host.

dil
connect(PipedInputStream). Method in class [Link]
Connects this piped output stream to a receiver.
connect(PipedOutputStream). Method in class [Link]
Connects this piped input stream to a sender.
connect(PipedReader). Method in class [Link]
Connect the specified piped reader to this writer.
connect(PipedWriter). Method in class [Link]
Connect the specified piped writer to this reader.
connect(String, int). Method in class [Link]
Connects this socket to the specified port on the named host.
connect(String, Properties). Method in interface [Link]
va
Try to make a database connection to the given URL.
connected. Variable in class [Link]
If false, this connection object has not created a communications link to the specified URL.
ConnectException(). Constructor for class [Link]
Construct a new ConnectException with no detailed message.
ConnectException(String). Constructor for class [Link]
Constructs a new ConnectException with the specified detail message as to why the connect error occurred.
ConnectException(String). Constructor for class [Link]
Create A remote exception with the specified string
ConnectException(String, Exception). Constructor for class [Link]
ja

Create A remote exception with the specified string, and the exception specified.
ConnectIOException(String). Constructor for class [Link]
Create A remote exception with the specified string
ConnectIOException(String, Exception). Constructor for class [Link]
Create A remote exception with the specified string, and the exception specified.
CONNECTOR_PUNCTUATION. Static variable in class [Link]
consume(). Method in class [Link]
w.

consume(). Method in class [Link]


Consumes this event so that it will not be processed in the default manner by the source which originated it.
consumed. Variable in class [Link]
consumer. Variable in class [Link]
The consumer of the particular image data stream for which this instance of the ImageFilter is filtering data.
cont(). Method in class [Link]
Resume this thread from a breakpoint, unless it previously suspended.
Container(). Constructor for class [Link]
Constructs a new Container.
CONTAINER_EVENT_MASK. Static variable in class [Link]
ww

The event mask for selecting container events.


CONTAINER_FIRST. Static variable in class [Link]
Marks the first integer id for the range of container event ids.
CONTAINER_LAST. Static variable in class [Link]
Marks the last integer id for the range of container event ids.
ContainerAdapter(). Constructor for class [Link]
ContainerEvent(Component, int, Component). Constructor for class [Link]
Constructs a ContainerEvent object with the specified source container, type, and child which is being added or removed.
contains(int, int). Method in class [Link]
Checks whether this component "contains" the specified (x, y) location, where x and y are defined to be relative to the
coordinate system of this component.
contains(int, int). Method in class [Link]

308
309

Determines whether the point (x,y) is inside the Polygon.


contains(int, int). Method in class [Link]
Checks whether this rectangle contains the specified point.

m
contains(Object). Method in class [Link]
Tests if some key maps into the specified value in this hashtable.
contains(Object). Method in class [Link]
Tests if the specified object is a component in this vector.
contains(Point). Method in class [Link]
Checks whether this component "contains" the specified point, where x and y in the point are defined to be relative to the
coordinate system of this component.
contains(Point). Method in class [Link]

o
Determines whether the specified point is inside the Polygon.
contains(Point). Method in class [Link]
Checks whether this rectangle contains the specified point.
containsKey(Object). Method in class [Link]
Tests if the specified object is a key in this hashtable.

i.c
ContentHandler(). Constructor for class [Link]
contents. Variable in class [Link]
CONTROL. Static variable in class [Link]
control. Static variable in class [Link]
The background color for control objects.
CONTROL. Static variable in class [Link]
The array index for the control background color.
CONTROL_DK_SHADOW. Static variable in class [Link]
The array index for the control dark shadow color.
CONTROL_HIGHLIGHT. Static variable in class [Link]

dil
The array index for the control highlight color.
CONTROL_LT_HIGHLIGHT. Static variable in class [Link]
The array index for the control light highlight color.
CONTROL_SHADOW. Static variable in class [Link]
The array index for the control shadow color.
CONTROL_TEXT. Static variable in class [Link]
The array index for the control text color.
controlDkShadow. Static variable in class [Link]
The dark shadow color for control objects.
controlDown(). Method in class [Link]
Checks if the control key is down.
va
controlHighlight. Static variable in class [Link]
The light highlight color for control objects.
controlLtHighlight. Static variable in class [Link]
The regular highlight color for control objects.
controlShadow. Static variable in class [Link]
The regular shadow color for control objects.
controlText. Static variable in class [Link]
The text color for control objects.
copyArea(int, int, int, int, int, int). Method in class [Link]
Copies an area of the Component by a distance specified by dx and dy to the right and down.
ja

copyInto(Object[]). Method in class [Link]


Copies the components of this vector into the specified array.
copyValueOf(char[]). Static method in class [Link]
Returns a String that is equivalent to the specified character array.
copyValueOf(char[], int, int). Static method in class [Link]
Returns a String that is equivalent to the specified character array.
cos(double). Static method in class [Link]
w.

Returns the trigonometric cosine of an angle.


count. Variable in class [Link]
The index one greater than the index of the last valid byte in the buffer.
count. Variable in class [Link]
The number of valid bytes in the buffer.
count. Variable in class [Link]
The index one greater than the last valid character in the input stream buffer.
count. Variable in class [Link]
The number of valid bytes in the buffer.
count. Variable in class [Link]
ww

Number of valid characters in buffer


count. Variable in class [Link]
The number of chars in the buffer.
count. Variable in class [Link]
The number of valid characters in the input stream buffer.
countComponents(). Method in class [Link]
countItems(). Method in class [Link]
countItems(). Method in class [Link]
countItems(). Method in class [Link]
countMenus(). Method in class [Link]
countObservers(). Method in class [Link]
Returns the number of observers of this object.

309
310

countStackFrames(). Method in class [Link]


Counts the number of stack frames in this thread.
countTokens(). Method in class [Link]

m
Calculates the number of times that this tokenizer's nextToken method can be called before it generates an exception.
crc. Variable in class [Link]
CRC-32 for uncompressed data.
crc. Variable in class [Link]
CRC-32 of uncompressed data.
CRC32(). Constructor for class [Link].CRC32
create(). Method in class [Link]
Creates a datagram socket

o
create(). Method in class [Link]
Creates a new Graphics object that is a copy of this Graphics object.
create(boolean). Method in class [Link]
Creates either a stream or a datagram socket.
create(int, int, int, int). Method in class [Link]

i.c
Creates a new Graphics object based on this Graphics object, but with a new translation and clip area.
createButton(Button). Method in class [Link]
Uses the specified Peer interface to create a new Button.
createCanvas(Canvas). Method in class [Link]
Uses the specified Peer interface to create a new Canvas.
createCheckbox(Checkbox). Method in class [Link]
Uses the specified Peer interface to create a new Checkbox.
createCheckboxMenuItem(CheckboxMenuItem). Method in class [Link]
Uses the specified Peer interface to create a new CheckboxMenuItem.
createChoice(Choice). Method in class [Link]

dil
Uses the specified Peer interface to create a new Choice.
createComponent(Component). Method in class [Link]
Creates a peer for a component or container.
createContentHandler(String). Method in interface [Link]
Creates a new ContentHandler to read an object from a URLStreamHandler.
createDialog(Dialog). Method in class [Link]
Uses the specified Peer interface to create a new Dialog.
createFileDialog(FileDialog). Method in class [Link]
Uses the specified Peer interface to create a new FileDialog.
createFrame(Frame). Method in class [Link]
Uses the specified Peer interface to create a new Frame.
va
createImage(byte[]). Method in class [Link]
Creates an image which decodes the image stored in the specified byte array.
createImage(byte[], int, int). Method in class [Link]
Creates an image which decodes the image stored in the specified byte array at the specified offset and length.
createImage(ImageProducer). Method in class [Link]
Creates an image from the specified image producer.
createImage(ImageProducer). Method in interface [Link]
createImage(ImageProducer). Method in class [Link]
Creates an image with the specified image producer.
createImage(int, int). Method in class [Link]
ja

Creates an off-screen drawable Image to be used for double buffering.


createImage(int, int). Method in interface [Link]
createLabel(Label). Method in class [Link]
Uses the specified Peer interface to create a new Label.
createList(List). Method in class [Link]
Uses the specified Peer interface to create a new List.
createMenu(Menu). Method in class [Link]
w.

Uses the specified Peer interface to create a new Menu.


createMenuBar(MenuBar). Method in class [Link]
Uses the specified Peer interface to create a new MenuBar.
createMenuItem(MenuItem). Method in class [Link]
Uses the specified Peer interface to create a new MenuItem.
createPanel(Panel). Method in class [Link]
Uses the specified Peer interface to create a new Panel.
createPopupMenu(PopupMenu). Method in class [Link]
Uses the specified Peer interface to create a new PopupMenu.
createRegistry(int). Static method in class [Link]
ww

Create and export a registry on the local host.


createScrollbar(Scrollbar). Method in class [Link]
Uses the specified Peer interface to create a new Scrollbar.
createScrollPane(ScrollPane). Method in class [Link]
Uses the specified Peer interface to create a new scrolling container.
createServerSocket(int). Method in class [Link]
Create a server socket on the specified port (port 0 represents an anonymous port).
createSocket(String, int). Method in class [Link]
Create a client socket connected to the specified host and port.
createSocketImpl(). Method in interface [Link]
Creates a new SocketImpl instance.
createStatement(). Method in interface [Link]

310
311

SQL statements without parameters are normally executed using Statement objects.
createTextArea(TextArea). Method in class [Link]
Uses the specified Peer interface to create a new TextArea.

m
createTextField(TextField). Method in class [Link]
Uses the specified Peer interface to create a new TextField.
createURLStreamHandler(String). Method in interface [Link]
Creates a new URLStreamHandler instance with the specified protocol.
createWindow(Window). Method in class [Link]
Uses the specified Peer interface to create a new Window.
CropImageFilter(int, int, int, int). Constructor for class [Link]
Constructs a CropImageFilter that extracts the absolute rectangular region of pixels from its source Image as specified by the

o
x, y, w, and h parameters.
CROSSHAIR_CURSOR. Static variable in class [Link]
The crosshair cursor type.
CROSSHAIR_CURSOR. Static variable in class [Link]
CTRL_MASK. Static variable in class [Link]

i.c
The control modifier constant.
CTRL_MASK. Static variable in class [Link]
The control modifier constant.
CTRL_MASK. Static variable in class [Link]
The control key modifier constant.
CURRENCY_SYMBOL. Static variable in class [Link]
current(). Method in class [Link]
Return character index of the text boundary that was most recently returned by next(), previous(), first(), or last()
current(). Method in interface [Link]
Get the character at the current position (as returned by getIndex()).

dil
current(). Method in class [Link]
Get the character at the current position (as returned by getIndex()).
currentClassLoader(). Method in class [Link]
Returns an object describing the most recent class loader executing on the stack.
currentLoadedClass(). Method in class [Link]
Returns the current Class with a ClassLoader on the execution stack.
currentThread(). Static method in class [Link]
Returns a reference to the currently executing thread object.
currentTimeMillis(). Static method in class [Link]
Returns the current time in milliseconds.
Cursor(int). Constructor for class [Link]
va
Creates a new cursor object with the specified type.
cyan. Static variable in class [Link]
The color cyan.

darker(). Method in class [Link]


Returns a darker version of this color.
ja

darkGray. Static variable in class [Link]


The color dark gray.
DASH_PUNCTUATION. Static variable in class [Link]
dataDefinitionCausesTransactionCommit(). Method in interface [Link]
Does a data definition statement within a transaction force the transaction to commit?
dataDefinitionIgnoredInTransactions(). Method in interface [Link]
Is a data definition statement within a transaction ignored?
w.

DataFlavor(Class, String). Constructor for class [Link]


Construct a DataFlavor that represents a Java class

The returned DataFlavor will have the following characteristics

representationClass = representationClass
mimeType = application/x-javaserializedobject

DataFlavor(String, String). Constructor for class [Link]


Construct a DataFlavor that represents a MimeType
ww

The returned DataFlavor will have the following characteristics:

If the mimeType is "application/x-javaserializedobject; class=", the result is the same as calling new
DataFlavor(Class:forName() as above

otherwise:

representationClass = InputStream
mimeType = mimeType

DataFormatException(). Constructor for class [Link]

311
312

Constructs a DataFormatException with no detail message.


DataFormatException(String). Constructor for class [Link]
Constructs a DataFormatException with the specified detail message.

m
DatagramPacket(byte[], int). Constructor for class [Link]
Constructs a DatagramPacket for receiving packets of length ilength.
DatagramPacket(byte[], int, InetAddress, int). Constructor for class [Link]
Constructs a datagram packet for sending packets of length ilength to the specified port number on the specified host.
DatagramSocket(). Constructor for class [Link]
Constructs a datagram socket and binds it to any available port on the local host machine.
DatagramSocket(int). Constructor for class [Link]
Constructs a datagram socket and binds it to the specified port on the local host machine.

o
DatagramSocket(int, InetAddress). Constructor for class [Link]
Creates a datagram socket, bound to the specified local address.
DatagramSocketImpl(). Constructor for class [Link]
DataInputStream(InputStream). Constructor for class [Link]
Creates a new data input stream to read data from the specified input stream.

i.c
DataOutputStream(OutputStream). Constructor for class [Link]
Creates a new data output stream to write data to the specified underlying output stream.
DataTruncation(int, boolean, boolean, int, int). Constructor for class [Link]

Create a DataTruncation object.


DATE. Static variable in class [Link]
Useful constant for date and time.
DATE. Static variable in class [Link]
Date(). Constructor for class [Link]
Allocates a Date object and initializes it so that it represents the time at which it was allocated measured to the nearest

dil
millisecond.
Date(int, int, int). Constructor for class [Link]
Construct a Date
Date(int, int, int). Constructor for class [Link]
Allocates a Date object and initializes it so that it represents midnight, local time, at the beginning of the day specified by the
year, month, and date arguments.
Date(int, int, int, int, int). Constructor for class [Link]
Allocates a Date object and initializes it so that it represents the specified hour and minute, local time, of the date specified by
the year, month, date, hrs, and min arguments.
Date(int, int, int, int, int, int). Constructor for class [Link]
Allocates a Date object and initializes it so that it represents the specified hour, minute, and second, local time of the date
va
specified by the year, month, date, hrs, min, and sec arguments.
Date(long). Constructor for class [Link]
Construct a Date using a milliseconds time value
Date(long). Constructor for class [Link]
Allocates a Date object and initializes it to represent the specified number of milliseconds since January 1, 1970, 00:00:00
GMT.
Date(String). Constructor for class [Link]
Allocates a Date object and initializes it so that it represents the date and time indicated by the string s, which is interpreted as
if by the parse method.
DATE_FIELD. Static variable in class [Link]
ja

Useful constant for DATE field alignment.


DateFormat(). Constructor for class [Link]
DateFormatSymbols(). Constructor for class [Link]
Construct a DateFormatSymbols object by loading format data from resources for the default locale.
DateFormatSymbols(Locale). Constructor for class [Link]
Construct a DateFormatSymbols object by loading format data from resources for the given locale.
DAY_OF_MONTH. Static variable in class [Link]
w.

Useful constant for date and time.


DAY_OF_WEEK. Static variable in class [Link]
Useful constant for date and time.
DAY_OF_WEEK_FIELD. Static variable in class [Link]
Useful constant for DAY_OF_WEEK field alignment.
DAY_OF_WEEK_IN_MONTH. Static variable in class [Link]
Useful constant for date and time.
DAY_OF_WEEK_IN_MONTH_FIELD. Static variable in class [Link]
Useful constant for DAY_OF_WEEK_IN_MONTH field alignment.
DAY_OF_YEAR. Static variable in class [Link]
ww

Useful constant for date and time.


DAY_OF_YEAR_FIELD. Static variable in class [Link]
Useful constant for DAY_OF_YEAR field alignment.
decapitalize(String). Static method in class [Link]
Utility method to take a string and convert it to normal Java variable name capitalization.
DECEMBER. Static variable in class [Link]
Useful constant for month.
DECIMAL. Static variable in class [Link]
DECIMAL_DIGIT_NUMBER. Static variable in class [Link]
DecimalFormat(). Constructor for class [Link]
Create a DecimalFormat using the default pattern and symbols for the default locale.
DecimalFormat(String). Constructor for class [Link]

312
313

Create a DecimalFormat from the given pattern and the symbols for the default locale.
DecimalFormat(String, DecimalFormatSymbols). Constructor for class [Link]
Create a DecimalFormat from the given pattern and symbols.

m
DecimalFormatSymbols(). Constructor for class [Link]
Create a DecimalFormatSymbols object for the default locale.
DecimalFormatSymbols(Locale). Constructor for class [Link]
Create a DecimalFormatSymbols object for the given locale.
DECLARED. Static variable in interface [Link]
Identifies the set of declared members of a class or interface.
decode(InputStream). Method in interface [Link]
Decodes a certificate from an input stream.

o
decode(String). Static method in class [Link]
Decodes a String into a Byte.
decode(String). Static method in class [Link]
Gets the specified Color.
decode(String). Static method in class [Link]

i.c
Gets the specified font using the name passed in.
decode(String). Static method in class [Link]
Decodes a string into an Integer.
decode(String). Static method in class [Link]
Decodes a String into a Short.
def. Variable in class [Link]
Compressor for this stream.
DEFAULT. Static variable in class [Link]
Constant for default style pattern.
DEFAULT_COMPRESSION. Static variable in class [Link]

dil
Default compression level.
DEFAULT_CURSOR. Static variable in class [Link]
The default cursor type (gets set if no cursor is defined).
DEFAULT_CURSOR. Static variable in class [Link]
DEFAULT_STRATEGY. Static variable in class [Link]
Default compression strategy.
defaultConstraints. Variable in class [Link]
defaultReadObject(). Method in class [Link]
Read the non-static and non-transient fields of the current class from this stream.
defaults. Variable in class [Link]
A property list that contains default values for any keys not found in this property list.
va
defaultWriteObject(). Method in class [Link]
Write the non-static and non-transient fields of the current class to this stream.
defineClass(byte[], int, int). Method in class [Link]
Converts an array of bytes into an instance of class Class.
defineClass(String, byte[], int, int). Method in class [Link]
Converts an array of bytes to an instance of class Class.
deflate(). Method in class [Link]
Writes next block of compressed data to the output stream.
deflate(byte[]). Method in class [Link]
Fills specified buffer with compressed data.
ja

deflate(byte[], int, int). Method in class [Link]


Fills specified buffer with compressed data.
DEFLATED. Static variable in class [Link]
Compression method for the deflate algorithm (the only one currently supported).
DEFLATED. Static variable in class [Link]
Compression method for compressed (deflated) entries.
DEFLATED. Static variable in class [Link]
w.

Compression method for compressed (DEFLATED) entries.


Deflater(). Constructor for class [Link]
Creates a new compressor with the default compression level.
Deflater(int). Constructor for class [Link]
Creates a new compressor using the specified compression level.
Deflater(int, boolean). Constructor for class [Link]
Creates a new compressor using the specified compression level.
DeflaterOutputStream(OutputStream). Constructor for class [Link]
Creates a new output stream with a defaul compressor and buffer size.
DeflaterOutputStream(OutputStream, Deflater). Constructor for class [Link]
ww

Creates a new output stream with the specified compressor and a default buffer size.
DeflaterOutputStream(OutputStream, Deflater, int). Constructor for class [Link]
Creates a new output stream with the specified compressor and buffer size.
DELETE. Static variable in class [Link]
The Delete key.
delete(). Method in class [Link]
Deletes the file specified by this object.
deleteObserver(Observer). Method in class [Link]
Deletes an observer from the set of observers of this object.
deleteObservers(). Method in class [Link]
Clears the observer list so that this object no longer has any observers.
deleteOwner(Principal, Principal). Method in interface [Link]

313
314

Deletes an owner.
deleteShortcut(). Method in class [Link]
Delete any MenuShortcut associated with this MenuItem.

m
deleteShortcut(MenuShortcut). Method in class [Link]
Delete the specified MenuShortcut.
delItem(int). Method in class [Link]
Removes an item from the list.
delItem(int). Method in interface [Link]
delItems(int, int). Method in class [Link]
delItems(int, int). Method in interface [Link]
deliverEvent(Event). Method in class [Link]

o
deliverEvent(Event). Method in class [Link]
delMenu(int). Method in interface [Link]
deregisterDriver(Driver). Static method in class [Link]
Drop a Driver from the DriverManager's list.
description. Variable in class [Link]

i.c
A brief description of the property.
description(). Method in class [Link]
Return a description of the array.
description(). Method in class [Link]
Return a (somewhat verbose) description.
description(). Method in class [Link]
Return a description of the object.
description(). Method in class [Link]
Return the string value, or "null"
description(). Method in class [Link]

dil
Return a description of the RemoteValue.
deselect(int). Method in class [Link]
Deselects the item at the specified index.
deselect(int). Method in interface [Link]
DESELECTED. Static variable in class [Link]
The item de-selected state change type.
DESKTOP. Static variable in class [Link]
The array index for the desktop background color.
desktop. Static variable in class [Link]
The color of the desktop background.
destHeight. Variable in class [Link]
va
destroy(). Method in class [Link]
Called by the browser or applet viewer to inform this applet that it is being reclaimed and that it should destroy any resources
that it has allocated.
destroy(). Method in class [Link]
Kills the subprocess.
destroy(). Method in class [Link]
Destroys this thread, without any cleanup.
destroy(). Method in class [Link]
Destroys this thread group and all of its subgroups.
destWidth. Variable in class [Link]
ja

detail. Variable in class [Link]


detail. Variable in class [Link]
detail. Variable in class [Link]
DGC_ID. Static variable in class [Link]
well-known id for the distributed garbage collector
Dialog(Frame). Constructor for class [Link]
Constructs an initially invisible Dialog with an empty title.
w.

Dialog(Frame, boolean). Constructor for class [Link]


Constructs an initially invisible Dialog with an empty title.
Dialog(Frame, String). Constructor for class [Link]
Constructs an initially invisible Dialog with a title.
Dialog(Frame, String, boolean). Constructor for class [Link]
Constructs an initially invisible Dialog with a title.
Dictionary(). Constructor for class [Link]
digest. Variable in class [Link]
The message digest associated with this stream.
digest. Variable in class [Link]
ww

The message digest associated with this stream.


digest(). Method in class [Link]
Completes the hash computation by performing final operations such as padding.
digest(byte[]). Method in class [Link]
Performs a final update on the digest using the specified array of bytes, then completes the digest computation.
DigestException(). Constructor for class [Link]
Constructs a DigestException with no detail message.
DigestException(String). Constructor for class [Link]
Constructs a DigestException with the specified detail message.
DigestInputStream(InputStream, MessageDigest). Constructor for class [Link]
Creates a digest input stream, using the specified input stream and message digest.
DigestOutputStream(OutputStream, MessageDigest). Constructor for class [Link]

314
315

Creates a digest output stream, using the specified output stream and message digest.
digit(char, int). Static method in class [Link]
Returns the numeric value of the character ch in the specified radix.

m
Dimension(). Constructor for class [Link]
Constructs a Dimension object with 0 width and 0 height.
Dimension(Dimension). Constructor for class [Link]
Constructs a Dimension and initializes it to the specified value.
Dimension(int, int). Constructor for class [Link]
Constructs a Dimension and initializes it to the specified width and specified height.
DirectColorModel(int, int, int, int). Constructor for class [Link]
Constructs a DirectColorModel from the given masks specifying which bits in the pixel contain the red, green and blue color

o
components.
DirectColorModel(int, int, int, int, int). Constructor for class [Link]
Constructs a DirectColorModel from the given masks specifying which bits in the pixel contain the alhpa, red, green and blue
color components.
dirty(ObjID[], long, Lease). Method in interface [Link]

i.c
The dirty call requests leases for the remote object references associated with the object identifiers contained in the array 'ids'.
disable(). Static method in class [Link]
Cause the Compiler to cease operation.
disable(). Method in class [Link]
disable(). Method in interface [Link]
DEPRECATED: Replaced by setEnabled(boolean).
disable(). Method in class [Link]
disable(). Method in interface [Link]
DEPRECATED: Replaced by setEnabled(boolean).
disableEvents(long). Method in class [Link]

dil
Disables the events defined by the specified event mask parameter from being delivered to this component.
disableEvents(long). Method in class [Link]
Disables the events defined by the specified event mask parameter from being delivered to this menu item.
disconnect(). Method in class [Link]
Close the connection to the server.
dispatch(Remote, RemoteCall, int, long). Method in interface [Link]
Unmarshals arguments, calls the actual remote object implementation, and marshals the return value or any exception.
dispatchEvent(AWTEvent). Method in class [Link]
Dispatches an event to this component or one of its sub components.
dispatchEvent(AWTEvent). Method in class [Link]
dispose(). Method in interface [Link]
va
dispose(). Method in class [Link]
Disposes of the Frame.
dispose(). Method in class [Link]
Dispose of the system resources used by this graphics context.
dispose(). Method in interface [Link]
dispose(). Method in class [Link]
Disposes of the Window.
divide(BigDecimal, int). Method in class [Link]
Returns a BigDecimal whose value is (this / val), and whose scale is [Link]().
divide(BigDecimal, int, int). Method in class [Link]
ja

Returns a BigDecimal whose value is (this / val), and whose scale is as specified.
divide(BigInteger). Method in class [Link]
Returns a BigInteger whose value is (this / val).
divideAndRemainder(BigInteger). Method in class [Link]
Returns an array of two BigIntegers.
doesMaxRowSizeIncludeBlobs(). Method in interface [Link]
Did getMaxRowSize() include LONGVARCHAR and LONGVARBINARY blobs?
w.

doInput. Variable in class [Link]


This variable is set by the setDoInput method.
doLayout(). Method in class [Link]
Lays out the component.
doLayout(). Method in class [Link]
Does a layout on this Container.
doLayout(). Method in class [Link]
Lays out this container by resizing its child to its preferred size.
DONE. Static variable in class [Link]
DONE is returned by previous() and next() after all valid boundaries have been returned.
ww

DONE. Static variable in interface [Link]


Constant that is returned when the iterator has reached either the end or the beginning of the text.
done(). Method in interface [Link]
Allow cleanup after the remote call has completed.
done(RemoteCall). Method in interface [Link]
Allows the remote reference to clean up (or reuse) the connection.
dontUseGui(). Method in interface [Link]
This method instructs the bean that it should not use the Gui.
doOutput. Variable in class [Link]
This variable is set by the setDoOutput method.
DOUBLE. Static variable in class [Link]
Double(double). Constructor for class [Link]

315
316

Constructs a newly allocated Double object that represents the primitive double argument.
Double(String). Constructor for class [Link]
Constructs a newly allocated Double object that represents the floating- point value of type double represented by the

m
string.
doubleToLongBits(double). Static method in class [Link]
Returns a representation of the specified floating-point value according to the IEEE 754 floating-point "double format" bit
layout.
doubleValue(). Method in class [Link]
Converts the number to a double.
doubleValue(). Method in class [Link]
Converts the number to a double.

o
doubleValue(). Method in class [Link]
Returns the value of this Byte as a double.
doubleValue(). Method in class [Link]
Returns the double value of this Double.
doubleValue(). Method in class [Link]

i.c
Returns the double value of this Float.
doubleValue(). Method in class [Link]
Returns the value of this Integer as a double.
doubleValue(). Method in class [Link]
Returns the value of this Long as a double.
doubleValue(). Method in class [Link]
Returns the value of the specified number as a double.
doubleValue(). Method in class [Link]
Returns the value of this Short as a double.
DOWN. Static variable in class [Link]

dil
The down arrow action-key.
down(int). Method in class [Link]
Change the current stackframe to be one or more frames lower (as in, toward the current program counter).
drain(). Method in class [Link]
Drain any buffered data in ObjectOutputStream.
draw3DRect(int, int, int, int, boolean). Method in class [Link]
Draws a 3-D highlighted outline of the specified rectangle.
drawArc(int, int, int, int, int, int). Method in class [Link]
Draws the outline of an arc covering the specified rectangle, starting at startAngle and extending for arcAngle degrees, using
the current color.
drawBytes(byte[], int, int, int, int). Method in class [Link]
va
Draws the specified bytes using the current font and color.
drawChars(char[], int, int, int, int). Method in class [Link]
Draws the specified characters using the current font and color.
drawImage(Image, int, int, Color, ImageObserver). Method in class [Link]
Draws as much of the specified image as is currently available at the specified coordinate (x, y) with the given solid
background color.
drawImage(Image, int, int, ImageObserver). Method in class [Link]
Draws as much of the specified image as is currently available at the specified coordinate (x, y).
drawImage(Image, int, int, int, int, Color, ImageObserver). Method in class [Link]
Draws as much of the specified image as has already been scaled to fit inside the specified rectangle with the given solid
ja

background color.
drawImage(Image, int, int, int, int, ImageObserver). Method in class [Link]
Draws as much of the specified image as has already been scaled to fit inside the specified rectangle.
drawImage(Image, int, int, int, int, int, int, int, int, Color, ImageObserver). Method in class [Link]
Draws as much of the specified area of the specified image as is currently available, scaling it on the fly to fit inside the
specified area of the destination drawable surface with the given solid background color.
drawImage(Image, int, int, int, int, int, int, int, int, ImageObserver). Method in class [Link]
w.

Draws as much of the specified area of the specified image as is currently available, scaling it on the fly to fit inside the
specified area of the destination drawable surface.
drawLine(int, int, int, int). Method in class [Link]
Draws a line between the coordinates (x1,y1) and (x2,y2) using the current color.
drawOval(int, int, int, int). Method in class [Link]
Draws the outline of an oval covering the specified rectangle using the current color.
drawPolygon(int[], int[], int). Method in class [Link]
Draws the outline of a polygon defined by arrays of x coordinates and y coordinates using the current color.
drawPolygon(Polygon). Method in class [Link]
Draws the outline of a polygon defined by the specified Polygon object using the current color.
ww

drawPolyline(int[], int[], int). Method in class [Link]


Draws a sequence of connected lines defined by arrays of x coordinates and y coordinates using the current color.
drawRect(int, int, int, int). Method in class [Link]
Draws the outline of the specified rectangle using the current color.
drawRoundRect(int, int, int, int, int, int). Method in class [Link]
Draws the outline of the specified rounded corner rectangle using the current color.
drawString(String, int, int). Method in class [Link]
Draws the specified String using the current font and color.
DriverPropertyInfo(String, String). Constructor for class [Link]
Constructor a DriverPropertyInfo with a name and value; other members default to their initial values.
DST_OFFSET. Static variable in class [Link]
Useful constant for date and time.

316
317

dumpStack(). Method in class [Link]


Dump the stack.
dumpStack(). Static method in class [Link]

m
Prints a stack trace of the current thread.

E. Static variable in class [Link]


The double value that is closer than any other to e, the base of the natural logarithms.

o
E_RESIZE_CURSOR. Static variable in class [Link]
The east-resize cursor type.
E_RESIZE_CURSOR. Static variable in class [Link]
EAST. Static variable in class [Link]
The east layout constraint.

i.c
EAST. Static variable in class [Link]
echoCharIsSet(). Method in class [Link]
Returns true if this TextField has a character set for echoing.
elementAt(int). Method in class [Link]
Returns the component at the specified index.
elementCount. Variable in class [Link]
The number of valid components in the vector.
elementData. Variable in class [Link]
The array buffer into which the components of the vector are stored.
elements(). Method in class [Link]

dil
Returns an enumeration of the values in this dictionary.
elements(). Method in class [Link]
Returns an enumeration of the values in this hashtable.
elements(). Method in class [Link]
Returns an enumeration of the components of this vector.
empty(). Method in class [Link]
Tests if this stack is empty.
EmptyStackException(). Constructor for class [Link]
Constructs a new EmptyStackException with no detail message.
enable(). Static method in class [Link]
Cause the Compiler to resume operation.
va
enable(). Method in class [Link]
enable(). Method in interface [Link]
DEPRECATED: Replaced by setEnabled(boolean).
enable(). Method in class [Link]
enable(). Method in interface [Link]
DEPRECATED: Replaced by setEnabled(boolean).
enable(boolean). Method in class [Link]
enable(boolean). Method in class [Link]
enableEvents(long). Method in class [Link]
Enables the events defined by the specified event mask parameter to be delivered to this component.
ja

enableEvents(long). Method in class [Link]


Enables the events defined by the specified event mask parameter to be delivered to this menu item.
enableReplaceObject(boolean). Method in class [Link]
Enable the stream to do replacement of objects in the stream.
enableResolveObject(boolean). Method in class [Link]
Enable the stream to allow objects read from the stream to be replaced.
ENCLOSING_MARK. Static variable in class [Link]
w.

encode(OutputStream). Method in interface [Link]


Encodes the certificate to an output stream in a format that can be decoded by the decode method.
encode(String). Static method in class [Link]
Translates a string into x-www-form-urlencoded format.
END. Static variable in class [Link]
The end action-key.
end(). Method in class [Link]
Discards unprocessed input and frees internal data.
end(). Method in class [Link]
Discards unprocessed input and frees internal data.
ww

end(). Method in class [Link]


Ends the print job and does any necessary cleanup.
END_PUNCTUATION. Static variable in class [Link]
endsWith(String). Method in class [Link]
Tests if this string ends with the specified suffix.
endValidate(). Method in interface [Link]
engineDigest(). Method in class [Link]
SPI: Completes the hash computation by performing final operations such as padding.
engineGetParameter(String). Method in class [Link]
SPI: Gets the value of the specified algorithm parameter.
engineInitSign(PrivateKey). Method in class [Link]
SPI: Initializes this signature object with the specified private key for signing operations.

317
318

engineInitVerify(PublicKey). Method in class [Link]


SPI: Initializes this signature object with the specified public key for verification operations.
engineReset(). Method in class [Link]

m
SPI: Resets the digest for further use.
engineSetParameter(String, Object). Method in class [Link]
SPI: Sets the specified algorithm parameter to the specified value.
engineSign(). Method in class [Link]
SPI: Returns the signature bytes of all the data updated so far.
engineUpdate(byte). Method in class [Link]
SPI: Updates the digest using the specified byte.
engineUpdate(byte). Method in class [Link]

o
SPI: Updates the data to be signed or verified using the specified byte.
engineUpdate(byte[], int, int). Method in class [Link]
SPI: Updates the digest using the specified array of bytes, starting at the specified offset.
engineUpdate(byte[], int, int). Method in class [Link]
SPI: Updates the data to be signed or verified, using the specified array of bytes, starting at the specified offset.

i.c
engineVerify(byte[]). Method in class [Link]
SPI: Verifies the passed-in signature.
ENGLISH. Static variable in class [Link]
Useful constant for language.
ensureCapacity(int). Method in class [Link]
Ensures that the capacity of the buffer is at least equal to the specified minimum.
ensureCapacity(int). Method in class [Link]
Increases the capacity of this vector, if necessary, to ensure that it can hold at least the number of components specified by
the minimum capacity argument.
ENTER. Static variable in class [Link]

dil
The Enter key.
entries(). Method in interface [Link]
Returns an enumeration of the entries in this ACL.
entries(). Method in class [Link]
Returns an enumeration of the ZIP file entries.
enumerate(Thread[]). Static method in class [Link]
Copies into the specified array every active thread in this thread group and its subgroups.
enumerate(Thread[]). Method in class [Link]
Copies into the specified array every active thread in this thread group and its subgroups.
enumerate(Thread[], boolean). Method in class [Link]
Copies into the specified array every active thread in this thread group.
va
enumerate(ThreadGroup[]). Method in class [Link]
Copies into the specified array references to every active subgroup in this thread group.
enumerate(ThreadGroup[], boolean). Method in class [Link]
Copies into the specified array references to every active subgroup in this thread group.
eof. Variable in class [Link]
True if there is not more data in the buffered part of the stream.
EOFException(). Constructor for class [Link]
Constructs an EOFException with no detail message.
EOFException(String). Constructor for class [Link]
Constructs an EOFException with the specified detail message.
ja

eolIsSignificant(boolean). Method in class [Link]


Determines whether or not ends of line are treated as tokens.
eos. Variable in class [Link]
Indicates end of input stream.
equals(DataFlavor). Method in class [Link]
equals(MenuShortcut). Method in class [Link]
Returns whether this MenuShortcut is the same as another: equality is defined to mean that both MenuShortcuts use the same
w.

key and both either use or don't use the SHIFT key.
equals(Object). Method in class [Link]
Returns true iff x is a BigDecimal whose value is equal to this number.
equals(Object). Method in class [Link]
Returns true iff x is a BigInteger whose value is equal to this number.
equals(Object). Method in class [Link]
Compares this object against the specified object.
equals(Object). Method in class [Link]
Returns true if and only if the argument is not null and is a Boolean object that contains the same boolean value as this
object.
ww

equals(Object). Method in class [Link]


Compares this object to the specified object.
equals(Object). Method in class [Link]
Compares the time field records.
equals(Object). Method in class [Link]
Compares this object against the specified object.
equals(Object). Method in class [Link]
Equality comparision between two
equals(Object). Method in class [Link]
Compare this CollationKey and the target CollationKey for equality.
equals(Object). Method in class [Link]
Compares the equality of two Collators.

318
319

equals(Object). Method in class [Link]


Compares this object against the specified object.
equals(Object). Method in class [Link]

m
Compares this Constructor against the specified object.
equals(Object). Method in class [Link]
Compares two dates.
equals(Object). Method in class [Link]
Overrides equals
equals(Object). Method in class [Link]
Override equals
equals(Object). Method in class [Link]

o
Overrides equals
equals(Object). Method in class [Link]
Override equals
equals(Object). Method in class [Link]
Checks whether two dimension objects have equal values.

i.c
equals(Object). Method in class [Link]
Compares this object against the specified object.
equals(Object). Method in class [Link]
Compares this Field against the specified object.
equals(Object). Method in class [Link]
Compares this object against the specified object.
equals(Object). Method in class [Link]
Compares this object against some other object.
equals(Object). Method in class [Link]
Compares this object to the specifed object.

dil
equals(Object). Method in class [Link]
Overrides Calendar Compares the time field records.
equals(Object). Method in class [Link]
Tests for equality between the specified object and this identity.
equals(Object). Method in class [Link]
Compares this object against the specified object.
equals(Object). Method in class [Link]
Checks whether two insets objects are equal.
equals(Object). Method in class [Link]
Compares this object to the specified object.
equals(Object). Method in class [Link]
va
Compares two Objects for equality.
equals(Object). Method in class [Link]
Compares this object against the specified object.
equals(Object). Method in class [Link]
Equality comparision between two message format objects
equals(Object). Method in class [Link]
Compares this Method against the specified object.
equals(Object). Method in class [Link]
Overrides equals
equals(Object). Method in class [Link]
ja

Compares two Objects for equality.


equals(Object). Method in class [Link]
Two object identifiers are considered equal if they have the same contents.
equals(Object). Method in interface [Link]
Returns true if the object passed matches the permission represented in this interface.
equals(Object). Method in class [Link]
Checks whether two pointers are equal.
w.

equals(Object). Method in interface [Link]


Compares this principal to the specified object.
equals(Object). Method in class [Link]
Checks whether two rectangles are equal.
equals(Object). Method in class [Link]
Compares two remote objects for equality.
equals(Object). Method in class [Link]
Compares the equality of two collation objects.
equals(Object). Method in class [Link]
Compares this object to the specified object.
ww

equals(Object). Method in class [Link]


Override equals.
equals(Object). Method in class [Link]
Compares the equality of two SimpleTimeZone objects.
equals(Object). Method in class [Link]
Compares this string to the specified object.
equals(Object). Method in class [Link]
Compares the equality of two StringCharacterIterator objects.
equals(Object). Method in class [Link]
Compares two Objects for equality.
equals(Object). Method in class [Link]
Compares two URLs.

319
320

equals(Object). Method in class [Link]


Compare this VMID to another, and return true if they are the same identifier.
equals(String, String). Method in class [Link]

m
Convenience method for comparing the equality of two strings based on this Collator's collation rules.
equals(Timestamp). Method in class [Link]
Test Timestamp values for equality
equalsIgnoreCase(String). Method in class [Link]
Compares this String to another object.
ERA. Static variable in class [Link]
Useful constant for date and time.
ERA_FIELD. Static variable in class [Link]

o
Useful constant for ERA field alignment.
err. Static variable in class [Link]
A handle to the standard error stream.
err. Static variable in class [Link]
The "standard" error output stream.

i.c
ERROR. Static variable in interface [Link]
An image which was being tracked asynchronously has encountered an error.
Error(). Constructor for class [Link]
Constructs an Error with no specified detail message.
Error(String). Constructor for class [Link]
Constructs an Error with the specified detail message.
ERRORED. Static variable in class [Link]
Flag indicating the download of some media encountered an error.
ESCAPE. Static variable in class [Link]
The Escape key.

dil
Event(Object, int, Object). Constructor for class [Link]
Constructs an event with the specified target component, event type, and argument.
Event(Object, long, int, int, int, int, int). Constructor for class [Link]
Constructs an event with the specified target component, time stamp, event type, x and y coordinates, keyboard key, state of
the modifier keys and an argument set to null.
Event(Object, long, int, int, int, int, int, Object). Constructor for class [Link]
Constructs an event with the specified target component, time stamp, event type, x and y coordinates, keyboard key, state of
the modifier keys and argument.
EventObject(Object). Constructor for class [Link]
EventObject(Object). Constructor for class [Link]
EventQueue(). Constructor for class [Link]
va
EventSetDescriptor(Class, String, Class, String). Constructor for class [Link]
This constructor creates an EventSetDescriptor assuming that you are following the most simple standard design pattern
where a named event "fred" is (1) delivered as a call on the single method of interface FredListener, (2) has a single argument
of type FredEvent, and (3) where the FredListener may be registered with a call on an addFredListener method of the source
component and removed with a call on a removeFredListener method.
EventSetDescriptor(Class, String, Class, String[], String, String). Constructor for class [Link]
This constructor creates an EventSetDescriptor from scratch using string names.
EventSetDescriptor(String, Class, Method[], Method, Method). Constructor for class [Link]
This constructor creates an EventSetDescriptor from scratch using [Link] and [Link] objects.
EventSetDescriptor(String, Class, MethodDescriptor[], Method, Method). Constructor for class [Link]
ja

This constructor creates an EventSetDescriptor from scratch using [Link] and [Link]
objects.
evt. Variable in class [Link]
The next event.
Exception(). Constructor for class [Link]
Constructs an Exception with no specified detail message.
Exception(String). Constructor for class [Link]
w.

Constructs an Exception with the specified detail message.


exceptionEvent(RemoteThread, String). Method in interface [Link]
An exception has occurred.
ExceptionInInitializerError(). Constructor for class [Link]
Constructs an ExceptionInInitializerError with no detail message.
ExceptionInInitializerError(String). Constructor for class [Link]
Constructs a ExceptionInInitializerError with the specified detail message.
ExceptionInInitializerError(Throwable). Constructor for class [Link]
Constructs a new ExceptionInInitializerError class initialized to the specific throwable
exec(String). Method in class [Link]
ww

Executes the specified string command in a separate process.


exec(String, String[]). Method in class [Link]
Executes the specified string command in a separate process with the specified environment.
exec(String[]). Method in class [Link]
Executes the specified command and arguments in a separate process.
exec(String[], String[]). Method in class [Link]
Executes the specified command and arguments in a separate process with the specified environment.
execute(). Method in interface [Link]
Some prepared statements return multiple results; the execute method handles these complex statements as well as the simpler
form of statements handled by executeQuery and executeUpdate.
execute(String). Method in interface [Link]
Execute a SQL statement that may return multiple results.

320
321

executeCall(). Method in interface [Link]


Do whatever it takes to execute the call.
executeQuery(). Method in interface [Link]

m
A prepared SQL query is executed and its ResultSet is returned.
executeQuery(String). Method in interface [Link]
Execute a SQL statement that returns a single ResultSet.
executeUpdate(). Method in interface [Link]
Execute a SQL INSERT, UPDATE or DELETE statement.
executeUpdate(String). Method in interface [Link]
Execute a SQL INSERT, UPDATE or DELETE statement.
exists(). Method in class [Link]

o
Tests if this File exists.
exit(int). Method in class [Link]
Terminates the currently running Java Virtual Machine.
exit(int). Static method in class [Link]
Terminates the currently running Java Virtual Machine.

i.c
exitValue(). Method in class [Link]
Returns the exit value for the subprocess.
exp(double). Static method in class [Link]
Returns the exponential number e (i.e., 2.718...) raised to the power of a double value.
ExportException(String). Constructor for class [Link]
Create A remote exception with the specified string
ExportException(String, Exception). Constructor for class [Link]
Create A remote exception with the specified string, and the exception specified.
exportObject(Remote). Static method in class [Link]
Export the remote object to make it available to receive incoming calls.

dil
exportObject(Remote, Object). Method in interface [Link]
Find or create a client stub object for the supplied Remote.

F1. Static variable in class [Link]


The F1 function action-key.
F10. Static variable in class [Link]
The F10 function action-key.
va
F11. Static variable in class [Link]
The F11 function action-key.
F12. Static variable in class [Link]
The F12 function action-key.
F2. Static variable in class [Link]
The F2 function action-key.
F3. Static variable in class [Link]
The F3 function action-key.
F4. Static variable in class [Link]
The F4 function action-key.
ja

F5. Static variable in class [Link]


The F5 function action-key.
F6. Static variable in class [Link]
The F6 function action-key.
F7. Static variable in class [Link]
The F7 function action-key.
F8. Static variable in class [Link]
w.

The F8 function action-key.


F9. Static variable in class [Link]
The F9 function action-key.
failure(Exception). Method in interface [Link]
The "failure" callback is invoked when the RMI runtime is unable to create a Socket or ServerSocket via the
RMISocketFactory.
FALSE. Static variable in class [Link]
The Boolean object corresponding to the primitive value false.
fd. Variable in class [Link]
The file descriptor object
ww

fd. Variable in class [Link]


The file descriptor object for this socket.
FeatureDescriptor(). Constructor for class [Link]
FEBRUARY. Static variable in class [Link]
Useful constant for month.
FIELD_COUNT. Static variable in class [Link]
Useful constant for date and time.
FieldPosition(int). Constructor for class [Link]
Creates a FieldPosition object for the given field.
fields. Variable in class [Link]
The time fields containing values into which the millis is computed.
File(File, String). Constructor for class [Link]

321
322

Creates a File instance that represents the file with the specified name in the specified directory.
File(String). Constructor for class [Link]
Creates a File instance that represents the file whose pathname is the given path argument.

m
File(String, String). Constructor for class [Link]
Creates a File instance whose pathname is the pathname of the specified directory, followed by the separator character,
followed by the name argument.
FileDescriptor(). Constructor for class [Link]
FileDialog(Frame). Constructor for class [Link]
Creates a file dialog for loading a file.
FileDialog(Frame, String). Constructor for class [Link]
Creates a file dialog for loading a file.

o
FileDialog(Frame, String, int). Constructor for class [Link]
Creates a file dialog with the specified title and mode.
FileInputStream(File). Constructor for class [Link]
Creates an input file stream to read from the specified File object.
FileInputStream(FileDescriptor). Constructor for class [Link]

i.c
Creates an input file stream to read from the specified file descriptor.
FileInputStream(String). Constructor for class [Link]
Creates an input file stream to read from a file with the specified name.
fileNameMap. Static variable in class [Link]
FileNotFoundException(). Constructor for class [Link]
Constructs a FileNotFoundException with no detail message.
FileNotFoundException(String). Constructor for class [Link]
Constructs a FileNotFoundException with the specified detail message.
FileOutputStream(File). Constructor for class [Link]
Creates a file output stream to write to the specified File object.

dil
FileOutputStream(FileDescriptor). Constructor for class [Link]
Creates an output file stream to write to the specified file descriptor.
FileOutputStream(String). Constructor for class [Link]
Creates an output file stream to write to the file with the specified name.
FileOutputStream(String, boolean). Constructor for class [Link]
Creates an output file with the specified system dependent file name.
FileReader(File). Constructor for class [Link]
FileReader(FileDescriptor). Constructor for class [Link]
FileReader(String). Constructor for class [Link]
FileWriter(File). Constructor for class [Link]
FileWriter(FileDescriptor). Constructor for class [Link]
va
FileWriter(String). Constructor for class [Link]
FileWriter(String, boolean). Constructor for class [Link]
fill. Variable in class [Link]
fill(). Method in class [Link]
Fills input buffer with more data to decompress.
fill3DRect(int, int, int, int, boolean). Method in class [Link]
Paints a 3-D highlighted rectangle filled with the current color.
fillArc(int, int, int, int, int, int). Method in class [Link]
Fills an arc bounded by the specified rectangle, starting at startAngle and extending for arcAngle degrees, with the current
color.
ja

fillInStackTrace(). Method in class [Link]


Fills in the execution stack trace.
fillOval(int, int, int, int). Method in class [Link]
Fills an oval bounded by the specified rectangle with the current color.
fillPolygon(int[], int[], int). Method in class [Link]
Fills a polygon defined by arrays of x coordinates and y coordinates with the current color using an even-odd fill rule
(otherwise known as an alternating rule).
w.

fillPolygon(Polygon). Method in class [Link]


Fills the polygon defined by the specified Polygon object with the current color using an even-odd fill rule (otherwise known
as an alternating rule).
fillRect(int, int, int, int). Method in class [Link]
Fills the specified rectangle with the current color.
fillRoundRect(int, int, int, int, int, int). Method in class [Link]
Fills the specified rounded corner rectangle with the current color.
FILTERED. Static variable in class [Link]
Compression strategy best used for data consisting mostly of small values with a somewhat random distribution.
FilteredImageSource(ImageProducer, ImageFilter). Constructor for class [Link]
ww

Constructs an ImageProducer object from an existing ImageProducer and a filter object.


filterIndexColorModel(IndexColorModel). Method in class [Link]
Filters an IndexColorModel object by running each entry in its color tables through the filterRGB function that
RGBImageFilter subclasses must provide.
FilterInputStream(InputStream). Constructor for class [Link]
Creates an input stream filter built on top of the specified input stream.
FilterOutputStream(OutputStream). Constructor for class [Link]
Creates an output stream filter built on top of the specified underlying output stream.
FilterReader(Reader). Constructor for class [Link]
Create a new filtered reader.
filterRGB(int, int, int). Method in class [Link]
Subclasses must specify a method to convert a single input pixel in the default RGB ColorModel to a single output pixel.

322
323

filterRGBPixels(int, int, int, int, int[], int, int). Method in class [Link]
Filters a buffer of pixels in the default RGB ColorModel by passing them one by one through the filterRGB method.
FilterWriter(Writer). Constructor for class [Link]

m
Create a new filtered writer.
FINAL. Static variable in class [Link]
finalize(). Method in class [Link]
Called by the garbage collector on an object when garbage collection determines that there are no more references to the
object.
finalize(). Method in class [Link]
Frees the compressor when garbage is collected.
finalize(). Method in class [Link]

o
Ensures that the close method of this file input stream is called when there are no more references to it.
finalize(). Method in class [Link]
Ensures that the close method of this file output stream is called when there are no more references to this stream.
finalize(). Method in class [Link]
Disposes of this graphics context once it is no longer referenced.

i.c
finalize(). Method in class [Link]
Frees the decompressor when garbage is collected.
finalize(). Method in class [Link]
Called by the garbage collector on an object when garbage collection determines that there are no more references to the
object.
finalize(). Method in class [Link]
Ends this print job once it is no longer referenced.
finalize(). Method in class [Link]
findClass(String). Method in class [Link]
Find a specified class.

dil
findColumn(String). Method in interface [Link]
Map a Resultset column name to a ResultSet column index.
findEditor(Class). Static method in class [Link]
Locate a value editor for a given target type.
findLoadedClass(String). Method in class [Link]
findSystemClass(String). Method in class [Link]
Finds the system class with the specified name, loading it in if necessary.
finish(). Method in class [Link]
When called, indicates that compression should end with the current contents of the input buffer.
finish(). Method in class [Link]
Finishes writing compressed data to the output stream without closing the underlying stream.
va
finish(). Method in class [Link]
Finishes writing compressed data to the output stream without closing the underlying stream.
finish(). Method in class [Link]
Finishes writing the contents of the ZIP output stream without closing the underlying stream.
finished(). Method in class [Link]
Returns true if the end of the compressed data output stream has been reached.
finished(). Method in class [Link]
Return true if the end of the compressed data stream has been reached.
firePropertyChange(). Method in class [Link]
Report that we have been modified to any interested listeners.
ja

firePropertyChange(String, Object, Object). Method in class [Link]


Report a bound property update to any registered listeners.
fireVetoableChange(String, Object, Object). Method in class [Link]
Report a vetoable property update to any registered listeners.
first(). Method in class [Link]
Return the first boundary.
first(). Method in interface [Link]
w.

Set the position to getBeginIndex() and return the character at that position.
first(). Method in class [Link]
Set the position to getBeginIndex() and return the character at that position.
first(Container). Method in class [Link]
Flip to the first card.
firstElement(). Method in class [Link]
Returns the first component of this vector.
flipBit(int). Method in class [Link]
Returns a BigInteger whose value is equivalent to this number with the designated bit flipped.
FLOAT. Static variable in class [Link]
ww

Float(double). Constructor for class [Link]


Constructs a newly allocated Floatobject that represents the argument converted to type float.
Float(float). Constructor for class [Link]
Constructs a newly allocated Float object that represents the primitive float argument.
Float(String). Constructor for class [Link]
Constructs a newly allocated Float object that represents the floating- point value of type float represented by the string.
floatToIntBits(float). Static method in class [Link]
Returns the bit represention of a single-float value.
floatValue(). Method in class [Link]
Converts this number to a float.
floatValue(). Method in class [Link]
Converts this number to a float.

323
324

floatValue(). Method in class [Link]


Returns the value of this Byte as a float.
floatValue(). Method in class [Link]

m
Returns the float value of this Double.
floatValue(). Method in class [Link]
Returns the float value of this Float object.
floatValue(). Method in class [Link]
Returns the value of this Integer as a float.
floatValue(). Method in class [Link]
Returns the value of this Long as a float.
floatValue(). Method in class [Link]

o
Returns the value of the specified number as a float.
floatValue(). Method in class [Link]
Returns the value of this Short as a float.
floor(double). Static method in class [Link]
Returns the largest (closest to positive infinity) double value that is not greater than the argument and is equal to a

i.c
mathematical integer.
FlowLayout(). Constructor for class [Link]
Constructs a new Flow Layout with a centered alignment and a default 5-unit horizontal and vertical gap.
FlowLayout(int). Constructor for class [Link]
Constructs a new Flow Layout with the specified alignment and a default 5-unit horizontal and vertical gap.
FlowLayout(int, int, int). Constructor for class [Link]
Constructs a new Flow Layout with the specified alignment and gap values.
flush(). Method in class [Link]
Flushes this buffered output stream.
flush(). Method in class [Link]

dil
Flush the stream.
flush(). Method in class [Link]
Flush the stream.
flush(). Method in class [Link]
Flushes this data output stream.
flush(). Method in class [Link]
Flushes this output stream and forces any buffered output bytes to be written out to the stream.
flush(). Method in class [Link]
Flush the stream.
flush(). Method in class [Link]
Flushes all resources being used by this Image object.
va
flush(). Method in interface [Link]
Flushes the stream.
flush(). Method in class [Link]
Flushes the stream.
flush(). Method in class [Link]
Flushes this output stream and forces any buffered output bytes to be written out.
flush(). Method in class [Link]
Flush the stream.
flush(). Method in class [Link]
Flushes this output stream and forces any buffered output bytes to be written out.
ja

flush(). Method in class [Link]


Flush the stream.
flush(). Method in class [Link]
Flushes this print stream.
flush(). Method in class [Link]
Flush the stream.
flush(). Method in class [Link]
w.

Flush the stream.


flush(). Method in class [Link]
Flush the stream.
FOCUS_EVENT_MASK. Static variable in class [Link]
The event mask for selecting focus events.
FOCUS_FIRST. Static variable in class [Link]
Marks the first integer id for the range of focus event ids.
FOCUS_GAINED. Static variable in class [Link]
The focus gained event type.
FOCUS_LAST. Static variable in class [Link]
ww

Marks the last integer id for the range of focus event ids.
FOCUS_LOST. Static variable in class [Link]
The focus lost event type.
FocusAdapter(). Constructor for class [Link]
FocusEvent(Component, int). Constructor for class [Link]
Constructs a permanent-level FocusEvent object with the specified source component and type.
FocusEvent(Component, int, boolean). Constructor for class [Link]
Constructs a FocusEvent object with the specified source component, type, and whether or not the focus event is a
temporary level event.
focusGained(FocusEvent). Method in class [Link]
Handles the focusGained event by invoking the focusGained methods on listener-a and listener-b.
focusGained(FocusEvent). Method in class [Link]

324
325

focusGained(FocusEvent). Method in interface [Link]


Invoked when a component gains the keyboard focus.
focusLost(FocusEvent). Method in class [Link]

m
Handles the focusLost event by invoking the focusLost methods on listener-a and listener-b.
focusLost(FocusEvent). Method in class [Link]
focusLost(FocusEvent). Method in interface [Link]
Invoked when a component loses the keyboard focus.
following(int). Method in class [Link]
Return the first boundary following the specified offset.
font. Variable in class [Link]
The actual font.

o
Font(String, int, int). Constructor for class [Link]
Creates a new font with the specified name, style and point size.
FontMetrics(Font). Constructor for class [Link]
Creates a new FontMetrics object with the specified font.
forClass(). Method in class [Link]

i.c
Return the class in the local VM that this version is mapped to.
forDigit(int, int). Static method in class [Link]
Determines the character representation for a specific digit in the specified radix.
FORMAT. Static variable in class [Link]
Format(). Constructor for class [Link]
format(Date). Method in class [Link]
Formats a Date into a date/time string.
format(Date, StringBuffer, FieldPosition). Method in class [Link]
Formats a Date into a date/time string.
format(Date, StringBuffer, FieldPosition). Method in class [Link]

dil
Overrides DateFormat

Formats a date or time, which is the standard millis since 24:00 GMT, Jan 1, 1970.
format(double). Method in class [Link]
Specialization of format.
format(double, StringBuffer, FieldPosition). Method in class [Link]
Specialization of format.
format(double, StringBuffer, FieldPosition). Method in class [Link]
Specialization of format.
format(double, StringBuffer, FieldPosition). Method in class [Link]
Specialization of format.
va
format(long). Method in class [Link]
Specialization of format.
format(long, StringBuffer, FieldPosition). Method in class [Link]
Specialization of format.
format(long, StringBuffer, FieldPosition). Method in class [Link]
Specialization of format.
format(long, StringBuffer, FieldPosition). Method in class [Link]
Specialization of format.
format(Object). Method in class [Link]
Formats an object to produce a string.
ja

format(Object, StringBuffer, FieldPosition). Method in class [Link]


Overrides Format.
format(Object, StringBuffer, FieldPosition). Method in class [Link]
Formats an object to produce a string.
format(Object, StringBuffer, FieldPosition). Method in class [Link]
Formats an object to produce a string.
format(Object, StringBuffer, FieldPosition). Method in class [Link]
w.

Formats an object to produce a string.


format(Object[], StringBuffer, FieldPosition). Method in class [Link]
Returns pattern with formatted objects.
format(String, Object[]). Static method in class [Link]
Convenience routine.
FormatException(String, int). Constructor for class [Link]
Constructs a FormatException with the specified detail message and offset.
forName(String). Static method in class [Link]
Returns the Class object associated with the class with the given string name.
FRACTION_FIELD. Static variable in class [Link]
ww

Field constant used to construct a FieldPosition object.


Frame(). Constructor for class [Link]
Constructs a new Frame that is initially invisible.
Frame(String). Constructor for class [Link]
Constructs a new, initially invisible Frame with the specified title.
FRAMEBITS. Static variable in interface [Link]
Another complete frame of a multi-frame image which was previously drawn is now available to be drawn again.
FRANCE. Static variable in class [Link]
Useful constant for country.
freeMemory(). Method in class [Link]
Report the free memory available to the Java interpreter being debugged.
freeMemory(). Method in class [Link]

325
326

Returns the amount of free memory in the system.


FRENCH. Static variable in class [Link]
Useful constant for language.

m
FRIDAY. Static variable in class [Link]
Useful constant for days of week.
fromHex(String). Static method in class [Link]
Convert hexadecimal strings to ints.
FULL. Static variable in class [Link]
Constant for full style pattern.
FULL_DECOMPOSITION. Static variable in class [Link]
Decomposition mode value.

o
G

i.c
gc(). Method in class [Link]
Runs the garbage collector.
gc(). Static method in class [Link]
Runs the garbage collector.
gc(RemoteObject[]). Method in class [Link]
Free all objects referenced by the debugger.
gcd(BigInteger). Method in class [Link]
Returns a BigInteger whose value is the greatest common denominator of abs(this) and abs(val).
generateKeyPair(). Method in class [Link]
Generates a key pair.

dil
GERMAN. Static variable in class [Link]
Useful constant for language.
GERMANY. Static variable in class [Link]
Useful constant for country.
get(). Method in class [Link]
Return the boolean's value.
get(). Method in class [Link]
Return the byte's value.
get(). Method in class [Link]
Return the char's value.
get(). Method in class [Link]
va
Return the double's value.
get(). Method in class [Link]
Return the float's value.
get(). Method in class [Link]
Return the int's value.
get(). Method in class [Link]
Return the long's value.
get(). Method in class [Link]
Return the short's value.
get(int). Method in class [Link]
ja

Returns the value of the bit with the specified index.


get(int). Method in class [Link]
Gets the value for a given time field.
get(Integer). Method in class [Link]
Get an object from the remote object cache.
get(Object). Method in class [Link]
Returns the value to which the key is mapped in this dictionary.
w.

get(Object). Method in class [Link]


Returns the value of the field represented by this Field, on the specified object.
get(Object). Method in class [Link]
Returns the value to which the specified key is mapped in this hashtable.
get(Object, int). Static method in class [Link]
Returns the value of the indexed component in the specified array object.
getAbsolutePath(). Method in class [Link]
Returns the absolute pathname of the file represented by this object.
getActionCommand(). Method in class [Link]
Returns the command name associated with this action.
ww

getActionCommand(). Method in class [Link]


Returns the command name of the action event fired by this button.
getActionCommand(). Method in class [Link]
Returns the command name of the action event fired by this menu item.
getAdditionalBeanInfo(). Method in interface [Link]
This method allows a BeanInfo object to return an arbitrary collection of other BeanInfo objects that provide additional
information on the current bean.
getAdditionalBeanInfo(). Method in class [Link]
Claim there are no other relevant BeanInfo objects.
getAddListenerMethod(). Method in class [Link]
getAddress(). Method in class [Link]
Returns the IP address of the machine to which this datagram is being sent or from which the datagram was received.

326
327

getAddress(). Method in class [Link]


Returns the raw IP address of this InetAddress object.
getAdjustable(). Method in class [Link]

m
Returns the Adjustable object where this event originated.
getAdjustmentType(). Method in class [Link]
Returns the type of adjustment which caused the value changed event.
getAdler(). Method in class [Link]
Returns the ADLER-32 value of the uncompressed data.
getAdler(). Method in class [Link]
Returns the ADLER-32 value of the uncompressed data.
getAlgorithm(). Method in interface [Link]

o
Returns the standard algorithm name this key is for.
getAlgorithm(). Method in class [Link]
Returns the standard name of the algorithm for this key generator.
getAlgorithm(). Method in class [Link]
Returns a string that identifies the algorithm, independent of implementation details.

i.c
getAlgorithm(). Method in class [Link]
Returns the name of the algorithm for this signature object.
getAlgorithmProperty(String, String). Static method in class [Link]
Gets a specified property for an algorithm.
getAlignment(). Method in class [Link]
Returns the alignment value for this layout, one of LEFT, CENTER, or RIGHT.
getAlignment(). Method in class [Link]
Gets the current alignment of this label.
getAlignmentX(). Method in class [Link]
Returns the alignment along the x axis.

dil
getAlignmentX(). Method in class [Link]
Returns the alignment along the x axis.
getAlignmentY(). Method in class [Link]
Returns the alignment along the y axis.
getAlignmentY(). Method in class [Link]
Returns the alignment along the y axis.
getAllByName(String). Static method in class [Link]
Determines all the IP addresses of a host, given the host's name.
getAllowUserInteraction(). Method in class [Link]
Returns the value of the allowUserInteraction field for this object.
getAlpha(int). Method in class [Link]
va
The subclass must provide a function which provides the alpha color compoment for the specified pixel.
getAlpha(int). Method in class [Link]
Return the alpha transparency value for the specified pixel in the range 0-255.
getAlpha(int). Method in class [Link]
Returns the alpha transparency value for the specified pixel in the range 0-255.
getAlphaMask(). Method in class [Link]
Returns the mask indicating which bits in a pixel contain the alpha transparency component.
getAlphas(byte[]). Method in class [Link]
Copies the array of alpha transparency values into the given array.
getAmPmStrings(). Method in class [Link]
ja

Gets ampm strings.


getApplet(String). Method in interface [Link]
Finds and returns the applet in the document represented by this applet context with the given name.
getAppletContext(). Method in class [Link]
Determines this applet's context, which allows the applet to query and affect the environment in which it runs.
getAppletContext(). Method in interface [Link]
Gets a handler to the applet's context.
w.

getAppletInfo(). Method in class [Link]


Returns information about this applet.
getApplets(). Method in interface [Link]
Finds all the applets in the document represented by this applet context.
getAscent(). Method in class [Link]
Gets the font ascent.
getAsciiStream(int). Method in interface [Link]
A column value can be retrieved as a stream of ASCII characters and then read in chunks from the stream.
getAsciiStream(String). Method in interface [Link]
A column value can be retrieved as a stream of ASCII characters and then read in chunks from the stream.
ww

getAsText(). Method in interface [Link]


getAsText(). Method in class [Link]
getAudioClip(URL). Method in class [Link]
Returns the AudioClip object specified by the URL argument.
getAudioClip(URL). Method in interface [Link]
Creates an audio clip.
getAudioClip(URL, String). Method in class [Link]
Returns the AudioClip object specified by the URL and name arguments.
getAutoCommit(). Method in interface [Link]
Get the current auto-commit state.
getAvailableIDs(). Static method in class [Link]
Gets all the available IDs supported.

327
328

getAvailableIDs(int). Static method in class [Link]


Gets the available IDs according to the given time zone offset.
getAvailableLocales(). Static method in class [Link]

m
Get the set of Locales for which TextBoundaries are installed
getAvailableLocales(). Static method in class [Link]
Gets the set of locales for which Calendars are installed.
getAvailableLocales(). Static method in class [Link]
Get the set of Locales for which Collators are installed.
getAvailableLocales(). Static method in class [Link]
Gets the set of locales for which DateFormats are installed.
getAvailableLocales(). Static method in class [Link]

o
Get the set of Locales for which NumberFormats are installed
getBackground(). Method in class [Link]
Gets the background color.
getBeanClass(). Method in class [Link]
getBeanDescriptor(). Method in interface [Link]

i.c
getBeanDescriptor(). Method in class [Link]
Deny knowledge about the class and customizer of the bean.
getBeanInfo(Class). Static method in class [Link]
Introspect on a Java bean and learn about all its properties, exposed methods, and events.
getBeanInfo(Class, Class). Static method in class [Link]
Introspect on a Java bean and learn all about its properties, exposed methods, below a given "stop" point.
getBeanInfoSearchPath(). Static method in class [Link]
getBeginIndex(). Method in interface [Link]
Return the start index of the text.
getBeginIndex(). Method in class [Link]

dil
Retrieve the index of the first character in the requested field.
getBeginIndex(). Method in class [Link]
Return the start index of the text.
getBestRowIdentifier(String, String, String, int, boolean). Method in interface [Link]
Get a description of a table's optimal set of columns that uniquely identifies a row.
getBigDecimal(int, int). Method in interface [Link]
Get the value of a NUMERIC parameter as a [Link] object.
getBigDecimal(int, int). Method in interface [Link]
Get the value of a column in the current row as a [Link] object.
getBigDecimal(String, int). Method in interface [Link]
Get the value of a column in the current row as a [Link] object.
va
getBinaryStream(int). Method in interface [Link]
A column value can be retrieved as a stream of uninterpreted bytes and then read in chunks from the stream.
getBinaryStream(String). Method in interface [Link]
A column value can be retrieved as a stream of uninterpreted bytes and then read in chunks from the stream.
getBlockIncrement(). Method in interface [Link]
Gets the block value increment for the adjustable object.
getBlockIncrement(). Method in class [Link]
Gets the block increment for this scrollbar.
getBlue(). Method in class [Link]
Gets the blue component.
ja

getBlue(int). Method in class [Link]


The subclass must provide a function which provides the blue color compoment for the specified pixel.
getBlue(int). Method in class [Link]
Returns the blue color compoment for the specified pixel in the range 0-255.
getBlue(int). Method in class [Link]
Returns the blue color compoment for the specified pixel in the range 0-255.
getBlueMask(). Method in class [Link]
w.

Returns the mask indicating which bits in a pixel contain the blue color component.
getBlues(byte[]). Method in class [Link]
Copies the array of blue color components into the given array.
getBoolean(int). Method in interface [Link]
Get the value of a BIT parameter as a Java boolean.
getBoolean(int). Method in interface [Link]
Get the value of a column in the current row as a Java boolean.
getBoolean(Object). Method in class [Link]
Get the value of a field as a boolean on specified object.
getBoolean(Object, int). Static method in class [Link]
ww

Returns the value of the indexed component in the specified array object, as a boolean.
getBoolean(String). Static method in class [Link]
Returns is true if and only if the system property named by the argument exists and is equal to the string "true".
getBoolean(String). Method in interface [Link]
Get the value of a column in the current row as a Java boolean.
getBoundingBox(). Method in class [Link]
getBounds(). Method in class [Link]
Returns the current bounds of this component.
getBounds(). Method in class [Link]
Returns the bounding box of the shape.
getBounds(). Method in class [Link]
Returns the bounds of this rectangle.

328
329

getBounds(). Method in interface [Link]


Return the bounding box of the shape.
getBuffer(). Method in class [Link]

m
Return the string buffer itself.
getBundle(String). Static method in class [Link]
Get the appropriate ResourceBundle subclass.
getBundle(String, Locale). Static method in class [Link]
Get the appropriate ResourceBundle subclass.
getByName(String). Static method in class [Link]
Determines the IP address of a host, given the host's name.
getByte(int). Method in interface [Link]

o
Get the value of a TINYINT parameter as a Java byte.
getByte(int). Method in interface [Link]
Get the value of a column in the current row as a Java byte.
getByte(Object). Method in class [Link]
Get the value of a field as a byte on specified object.

i.c
getByte(Object, int). Static method in class [Link]
Returns the value of the indexed component in the specified array object, as a byte.
getByte(String). Method in interface [Link]
Get the value of a column in the current row as a Java byte.
getBytes(). Method in class [Link]
Convert this String into bytes according to the platform's default character encoding, storing the result into a new byte array.
getBytes(int). Method in interface [Link]
Get the value of a SQL BINARY or VARBINARY parameter as a Java byte[]
getBytes(int). Method in interface [Link]
Get the value of a column in the current row as a Java byte array.

dil
getBytes(int, int, byte[], int). Method in class [Link]
Copies characters from this string into the destination byte array.
getBytes(String). Method in interface [Link]
Get the value of a column in the current row as a Java byte array.
getBytes(String). Method in class [Link]
Convert this String into bytes according to the specified character encoding, storing the result into a new byte array.
getCalendar(). Method in class [Link]
Gets the calendar associated with this date/time formatter.
getCanonicalPath(). Method in class [Link]
Gets the official, canonical path of the File.
getCaretPosition(). Method in class [Link]
va
Returns the position of the text insertion caret for the text component.
getCaretPosition(). Method in interface [Link]
getCatalog(). Method in interface [Link]
Return the Connection's current catalog name.
getCatalogName(int). Method in interface [Link]
What's a column's table's catalog name?
getCatalogs(). Method in interface [Link]
Get the catalog names available in this database.
getCatalogSeparator(). Method in interface [Link]
What's the separator between catalog and table name?
ja

getCatalogTerm(). Method in interface [Link]


What's the database vendor's preferred term for "catalog"?
getChar(Object). Method in class [Link]
Get the value of a field as a char on specified object.
getChar(Object, int). Static method in class [Link]
Returns the value of the indexed component in the specified array object, as a char.
getCharacterInstance(). Static method in class [Link]
w.

Create BreakIterator for character-breaks using default locale Returns an instance of a BreakIterator implementing character
breaks.
getCharacterInstance(Locale). Static method in class [Link]
Create BreakIterator for character-breaks using specified locale Returns an instance of a BreakIterator implementing
character breaks.
getChars(int, int, char[], int). Method in class [Link]
Copies characters from this string into the destination character array.
getChars(int, int, char[], int). Method in class [Link]
Characters are copied from this string buffer into the destination character array dst.
getCheckboxGroup(). Method in class [Link]
ww

Returns the checkbox group.


getChecksum(). Method in class [Link]
Returns the Checksum for this input stream.
getChecksum(). Method in class [Link]
Returns the Checksum for this output stream.
getChild(). Method in class [Link]
Returns the child component that was added or removed in this event.
getClass(). Method in class [Link]
Returns the runtime class of an object.
getClassContext(). Method in class [Link]
Returns the current execution stack as an array of classes.
getClasses(). Method in class [Link]

329
330

Returns an array containing Class objects representing all the public classes and interfaces that are members of the class
represented by this Class object.
getClassLoader(). Method in class [Link]

m
Determines the class loader for the class.
getClassLoader(). Method in class [Link]
Return the classloader for this class.
getClassName(). Method in class [Link]
Gets parameter passed by constructor.
getClazz(). Method in class [Link]
Returns the object's class.
getClickCount(). Method in class [Link]

o
Return the number of mouse clicks associated with this event.
getClientHost(). Static method in class [Link]
Return the hostname of the current client.
getClientHost(). Method in interface [Link]
Return the hostname of the current client.

i.c
getClip(). Method in class [Link]
Return a Shape object representing the current clipping area.
getClipBounds(). Method in class [Link]
Returns the bounding rectangle of the current clipping area.
getClipRect(). Method in class [Link]
getCodeBase(). Method in class [Link]
Gets the base URL.
getCodeBase(). Method in interface [Link]
Gets the base URL.
getCollationElementIterator(String). Method in class [Link]

dil
Return a CollationElementIterator for the given String.
getCollationKey(String). Method in class [Link]
Transforms the String into a series of bits that can be compared bitwise to other CollationKeys.
getCollationKey(String). Method in class [Link]
Transforms the string into a series of characters that can be compared with [Link].
getColor(). Method in class [Link]
Gets the current color.
getColor(String). Static method in class [Link]
Gets the specified Color property.
getColor(String, Color). Static method in class [Link]
Gets the specified Color property of the specified Color.
va
getColor(String, int). Static method in class [Link]
Gets the specified Color property of the color value.
getColorModel(). Method in class [Link]
Gets the ColorModel used to display the component on the output device.
getColorModel(). Method in interface [Link]
getColorModel(). Method in class [Link]
Get the ColorModel for the pixels stored in the array.
getColorModel(). Method in class [Link]
Returns the ColorModel of the screen.
getColumnCount(). Method in interface [Link]
ja

What's the number of columns in the ResultSet?


getColumnDisplaySize(int). Method in interface [Link]
What's the column's normal max width in chars?
getColumnLabel(int). Method in interface [Link]
What's the suggested column title for use in printouts and displays?
getColumnName(int). Method in interface [Link]
What's a column's name?
w.

getColumnPrivileges(String, String, String, String). Method in interface [Link]


Get a description of the access rights for a table's columns.
getColumns(). Method in class [Link]
Returns the number of columns in this layout.
getColumns(). Method in class [Link]
Returns the number of columns in the TextArea.
getColumns(). Method in class [Link]
Returns the number of columns in this TextField.
getColumns(String, String, String, String). Method in interface [Link]
Get a description of table columns available in a catalog.
ww

getColumnType(int). Method in interface [Link]


What's a column's SQL type?
getColumnTypeName(int). Method in interface [Link]
What's a column's data source specific type name?
getComment(). Method in class [Link]
Returns the comment string for the entry, or null if none.
getComponent(). Method in class [Link]
Returns the component where this event originated.
getComponent(int). Method in class [Link]
Gets the nth component in this container.
getComponentAt(int, int). Method in class [Link]
Returns the component or subcomponent that contains the x,y location.

330
331

getComponentAt(int, int). Method in class [Link]


Locates the component that contains the x,y position.
getComponentAt(Point). Method in class [Link]

m
Returns the component or subcomponent that contains the specified point.
getComponentAt(Point). Method in class [Link]
Locates the component that contains the specified point.
getComponentCount(). Method in class [Link]
Returns the number of components in this panel.
getComponents(). Method in class [Link]
Gets all the components in this container.
getComponentType(). Method in class [Link]

o
If this class represents an array type, returns the Class object representing the component type of the array; otherwise returns
null.
getCompressedSize(). Method in class [Link]
Returns the compressed size of the entry data, or -1 if not known.
getConnection(String). Static method in class [Link]

i.c
Attempt to establish a connection to the given database URL.
getConnection(String, Properties). Static method in class [Link]
Attempt to establish a connection to the given database URL.
getConnection(String, String, String). Static method in class [Link]
Attempt to establish a connection to the given database URL.
getConstraints(Component). Method in class [Link]
Retrieves the constraints for the specified component.
getConstructor(Class[]). Method in class [Link]
Returns a Constructor object that reflects the specified public constructor of the class represented by this Class object.
getConstructors(). Method in class [Link]

dil
Returns an array containing Constructor objects reflecting all the public constructors of the class represented by this Class
object.
getContainer(). Method in class [Link]
Returns the container where this event originated.
getContent(). Method in class [Link]
Returns the contents of this URL.
getContent(). Method in class [Link]
Retrieves the contents of this URL connection.
getContent(URLConnection). Method in class [Link]
Given a URL connect stream positioned at the beginning of the representation of an object, this method reads that stream and
creates an object from it.
va
getContentEncoding(). Method in class [Link]
Returns the value of the content-encoding header field.
getContentLength(). Method in class [Link]
Returns the value of the content-length header field.
getContents(). Method in class [Link]
See class description.
getContents(Object). Method in class [Link]
Returns a transferable object representing the current contents of the clipboard.
getContentType(). Method in class [Link]
Returns the value of the content-type header field.
ja

getContentTypeFor(String). Method in interface [Link]


getCountry(). Method in class [Link]
Getter for programmatic name of field, an uppercased two-letter ISO-3166 code.
getCrc(). Method in class [Link]
Returns the CRC-32 checksum of the uncompressed entry data, or -1 if not known.
getCrossReference(String, String, String, String, String, String). Method in interface [Link]
Get a description of the foreign key columns in the foreign key table that reference the primary key columns of the primary
w.

key table (describe how one table imports another's key.) This should normally return a single foreign key/primary key pair
(most tables only import a foreign key from a table once.) They are ordered by FKTABLE_CAT, FKTABLE_SCHEM,
FKTABLE_NAME, and KEY_SEQ.
getCurrencyInstance(). Static method in class [Link]
Returns a currency format for the current default locale.
getCurrencyInstance(Locale). Static method in class [Link]
Returns a currency format for the specified locale.
getCurrent(). Method in class [Link]
getCurrentFrame(). Method in class [Link]
Get the current stack frame.
ww

getCurrentFrameIndex(). Method in class [Link]


Return the current stackframe index
getCursor(). Method in class [Link]
Gets the cursor set on this component.
getCursorName(). Method in interface [Link]
Get the name of the SQL cursor used by this ResultSet.
getCursorType(). Method in class [Link]
getCustomEditor(). Method in interface [Link]
A PropertyEditor may choose to make available a full custom Component that edits its property value.
getCustomEditor(). Method in class [Link]
A PropertyEditor may chose to make available a full custom Component that edits its property value.
getCustomizerClass(). Method in class [Link]

331
332

getData(). Method in class [Link]


Returns the data received or the data to be sent.
getDatabaseProductName(). Method in interface [Link]

m
What's the name of this database product?
getDatabaseProductVersion(). Method in interface [Link]
What's the version of this database product?
getDataSize(). Method in class [Link]
Get the number of bytes of data that should have been transferred.
getDate(). Method in class [Link]
Returns the day of the month represented by this date.
getDate(). Method in class [Link]

o
Returns the day of the month represented by this date.
getDate(). Method in class [Link]
Returns the value of the date header field.
getDate(int). Method in interface [Link]
Get the value of a SQL DATE parameter as a [Link] object

i.c
getDate(int). Method in interface [Link]
Get the value of a column in the current row as a [Link] object.
getDate(String). Method in interface [Link]
Get the value of a column in the current row as a [Link] object.
getDateFormatSymbols(). Method in class [Link]
Gets the date/time formatting data.
getDateInstance(). Static method in class [Link]
Gets the date formatter with the default formatting style for the default locale.
getDateInstance(int). Static method in class [Link]
Gets the date formatter with the given formatting style for the default locale.

dil
getDateInstance(int, Locale). Static method in class [Link]
Gets the date formatter with the given formatting style for the given locale.
getDateTimeInstance(). Static method in class [Link]
Gets the date/time formatter with the default formatting style for the default locale.
getDateTimeInstance(int, int). Static method in class [Link]
Gets the date/time formatter with the given date and time formatting styles for the default locale.
getDateTimeInstance(int, int, Locale). Static method in class [Link]
Gets the date/time formatter with the given formatting styles for the given locale.
getDay(). Method in class [Link]
Returns the day of the week represented by this date.
getDay(). Method in class [Link]
va
Returns the day of the week represented by this date.
getDecimalFormatSymbols(). Method in class [Link]
Returns the decimal format symbols, which is generally not changed by the programmer or user.
getDecimalSeparator(). Method in class [Link]
character used for decimal sign.
getDeclaredClasses(). Method in class [Link]
Returns an array of Class objects reflecting all the classes and interfaces declared as members of the class represented by this
Class object.
getDeclaredConstructor(Class[]). Method in class [Link]
Returns a Constructor object that reflects the specified declared constructor of the class or interface represented by this Class
ja

object.
getDeclaredConstructors(). Method in class [Link]
Returns an array of Constructor objects reflecting all the constructors declared by the class represented by this Class object.
getDeclaredField(String). Method in class [Link]
Returns a Field object that reflects the specified declared field of the class or interface represented by this Class object.
getDeclaredFields(). Method in class [Link]
Returns an array of Field objects reflecting all the fields declared by the class or interface represented by this Class object.
w.

getDeclaredMethod(String, Class[]). Method in class [Link]


Returns a Method object that reflects the specified declared method of the class or interface represented by this Class object.
getDeclaredMethods(). Method in class [Link]
Returns an array of Method objects reflecting all the methods declared by the class or interface represented by this Class
object.
getDeclaringClass(). Method in class [Link]
If the class or interface represented by this Class object is a member of another class, returns the Class object representing
the class of which it is a member (its declaring class).
getDeclaringClass(). Method in class [Link]
Returns the Class object representing the class that declares the constructor represented by this Constructor object.
ww

getDeclaringClass(). Method in class [Link]


Returns the Class object representing the class or interface that declares the field represented by this Field object.
getDeclaringClass(). Method in interface [Link]
Returns the Class object representing the class or interface that declares the member or constructor represented by this
Member.
getDeclaringClass(). Method in class [Link]
Returns the Class object representing the class or interface that declares the method represented by this Method object.
getDecomposition(). Method in class [Link]
Get the decomposition mode of this Collator.
getDefault(). Static method in class [Link]
Common method of getting the current default Locale.
getDefault(). Static method in class [Link]

332
333

Gets the default TimeZone for this host.


getDefaultAllowUserInteraction(). Static method in class [Link]
Returns the default value of the allowUserInteraction field.

m
getDefaultCursor(). Static method in class [Link]
Return the system default cursor.
getDefaultEventIndex(). Method in interface [Link]
A bean may have a "default" event that is the event that will mostly commonly be used by human's when using the bean.
getDefaultEventIndex(). Method in class [Link]
Deny knowledge of a default event.
getDefaultPropertyIndex(). Method in interface [Link]
A bean may have a "default" property that is the property that will mostly commonly be initially chosen for update by human's

o
who are customizing the bean.
getDefaultPropertyIndex(). Method in class [Link]
Deny knowledge of a default property.
getDefaultRequestProperty(String). Static method in class [Link]
Returns the value of the default request property.

i.c
getDefaultStream(). Static method in class [Link]
Return the current default stream for new logs.
getDefaultToolkit(). Static method in class [Link]
Returns the default toolkit.
getDefaultTransactionIsolation(). Method in interface [Link]
What's the database's default transaction isolation level? The values are defined in [Link].
getDefaultUseCaches(). Method in class [Link]
Returns the default value of a URLConnection's useCaches flag.
getDescent(). Method in class [Link]
Gets the font descent.

dil
getDigit(). Method in class [Link]
character used for a digit in a pattern.
getDirectory(). Method in class [Link]
Gets the directory of the Dialog.
getDisplayCountry(). Method in class [Link]
Getter for display of field to user.
getDisplayCountry(Locale). Method in class [Link]
Getter for display of field to user.
getDisplayLanguage(). Method in class [Link]
Getter for display of field to user.
getDisplayLanguage(Locale). Method in class [Link]
va
Getter for display of field to user.
getDisplayName(). Method in class [Link]
getDisplayName(). Method in class [Link]
Getter for display of the entire locale to user.
getDisplayName(Locale). Method in class [Link]
Getter for display of the entire locale to user.
getDisplayVariant(). Method in class [Link]
Getter for display of field to user.
getDisplayVariant(Locale). Method in class [Link]
Getter for display of field to user If the localized name is not found, returns the variant code.
ja

getDocumentBase(). Method in class [Link]


Gets the document URL.
getDocumentBase(). Method in interface [Link]
Gets the document URL.
getDoInput(). Method in class [Link]
Returns the value of this URLConnection's doInput flag.
getDoOutput(). Method in class [Link]
w.

Returns the value of this URLConnection's doOutput flag.


getDouble(int). Method in interface [Link]
Get the value of a DOUBLE parameter as a Java double.
getDouble(int). Method in interface [Link]
Get the value of a column in the current row as a Java double.
getDouble(Object). Method in class [Link]
Get the value of a field as a double on specified object.
getDouble(Object, int). Static method in class [Link]
Returns the value of the indexed component in the specified array object, as a double.
getDouble(String). Method in interface [Link]
ww

Get the value of a column in the current row as a Java double.


getDriver(String). Static method in class [Link]
Attempt to locate a driver that understands the given URL.
getDriverMajorVersion(). Method in interface [Link]
What's this JDBC driver's major version number?
getDriverMinorVersion(). Method in interface [Link]
What's this JDBC driver's minor version number?
getDriverName(). Method in interface [Link]
What's the name of this JDBC driver?
getDrivers(). Static method in class [Link]
Return an Enumeration of all the currently loaded JDBC drivers which the current caller has access to.
getDriverVersion(). Method in interface [Link]

333
334

What's the version of this JDBC driver?


getEchoChar(). Method in class [Link]
Returns the character to be used for echoing.

m
getEditorSearchPath(). Static method in class [Link]
getElement(int). Method in class [Link]
Return an array element.
getElements(). Method in class [Link]
Returns a copy of the array as instances of RemoteValue.
getElements(int, int). Method in class [Link]
Returns a copy of a portion of the array as instances of RemoteValue.
getElementType(). Method in class [Link]

o
Return the element type as a "TC_" constant, such as "TC_CHAR".
getEncoded(). Method in interface [Link]
Returns the encoded key.
getEncoding(). Method in class [Link]
Return the name of the encoding being used by this stream.

i.c
getEncoding(). Method in class [Link]
Return the name of the encoding being used by this stream.
getEndIndex(). Method in interface [Link]
Return the end index of the text.
getEndIndex(). Method in class [Link]
Retrieve the index of the character following the last character in the requested field.
getEndIndex(). Method in class [Link]
Return the end index of the text.
getEntry(String). Method in class [Link]
Returns the ZIP file entry for the given path name.

dil
getenv(String). Static method in class [Link]
Gets an environment variable.
getEras(). Method in class [Link]
Gets era strings.
getErrorCode(). Method in class [Link]
Get the vendor specific exception code
getErrorOffset(). Method in class [Link]
Returns the position where the error was found.
getErrorOffset(). Method in class [Link]
Returns the position where the error was found.
getErrorsAny(). Method in class [Link]
va
Returns a list of all media that have encountered an error.
getErrorsID(int). Method in class [Link]
Returns a list of media with the specified ID that have encountered an error.
getErrorStream(). Method in class [Link]
Gets the error stream of the subprocess.
getEventSetDescriptors(). Method in interface [Link]
getEventSetDescriptors(). Method in class [Link]
Deny knowledge of event sets.
getException(). Method in class [Link]
Returns the exception that occurred during a static initialization that caused this Error to be created.
ja

getExceptionCatchList(). Method in class [Link]


Return the list of the exceptions the debugger will stop on.
getExceptionTypes(). Method in class [Link]
Returns an array of Class objects that represent the types of the checked exceptions thrown by the underlying constructor
represented by this Constructor object.
getExceptionTypes(). Method in class [Link]
Returns an array of Class objects that represent the types of the checked exceptions thrown by the underlying method
w.

represented by this Method object.


getExpiration(). Method in class [Link]
Returns the value of the expires header field.
getExportedKeys(String, String, String). Method in interface [Link]
Get a description of the foreign key columns that reference a table's primary key columns (the foreign keys exported by a
table).
getExtra(). Method in class [Link]
Returns the extra field data for the entry, or null if none.
getExtraNameCharacters(). Method in interface [Link]
Get all the "extra" characters that can be used in unquoted identifier names (those beyond a-z, A-Z, 0-9 and _).
ww

getFailureHandler(). Static method in class [Link]


Returns the handler for socket creation failure.
getFamily(). Method in class [Link]
Gets the platform specific family name of the font.
getFD(). Method in class [Link]
Returns the opaque file descriptor object associated with this stream.
getFD(). Method in class [Link]
Returns the file descriptor associated with this stream.
getFD(). Method in class [Link]
Returns the opaque file descriptor object associated with this stream.
getField(). Method in class [Link]
Retrieve the field identifier.

334
335

getField(int). Method in class [Link]


Return the static field, specified by index.
getField(int). Method in class [Link]

m
Return an instance variable, specified by slot number.
getField(String). Method in class [Link]
Returns a Field object that reflects the specified public member field of the class or interface represented by this Class object.
getField(String). Method in class [Link]
Return the static field, specified by name.
getField(String). Method in class [Link]
Return an instance variable, specified by name.
getFields(). Method in class [Link]

o
Returns an array containing Field objects reflecting all the accessible public fields of the class or interface represented by this
Class object.
getFields(). Method in class [Link]
Return all the static fields for this class.
getFields(). Method in class [Link]

i.c
Return the instance (non-static) fields of an object.
getFieldValue(int). Method in class [Link]
Return the value of a static field, specified by its index.
getFieldValue(int). Method in class [Link]
Returns the value of an object's instance variable.
getFieldValue(String). Method in class [Link]
Return the value of a static field, specified by name.
getFieldValue(String). Method in class [Link]
Returns the value of an object's instance variable.
getFile(). Method in class [Link]

dil
Gets the file of the Dialog.
getFile(). Method in class [Link]
Returns the file name of this URL.
getFileDescriptor(). Method in class [Link]
Get the datagram socket file descriptor
getFileDescriptor(). Method in class [Link]
Returns the value of this socket's fd field.
getFilenameFilter(). Method in class [Link]
Gets the filter.
getFilePointer(). Method in class [Link]
Returns the current offset in this file.
va
getFilterInstance(ImageConsumer). Method in class [Link]
Returns a unique instance of an ImageFilter object which will actually perform the filtering for the specified ImageConsumer.
getFirstDayOfWeek(). Method in class [Link]
Gets what the first day of the week is; e.g., Sunday in US, Monday in France.
getFloat(int). Method in interface [Link]
Get the value of a FLOAT parameter as a Java float.
getFloat(int). Method in interface [Link]
Get the value of a column in the current row as a Java float.
getFloat(Object). Method in class [Link]
Get the value of a field as a float on specified object.
ja

getFloat(Object, int). Static method in class [Link]


Returns the value of the indexed component in the specified array object, as a float.
getFloat(String). Method in interface [Link]
Get the value of a column in the current row as a Java float.
getFocusOwner(). Method in class [Link]
Returns the child component of this Window which has focus if and only if this Window is active.
getFollowRedirects(). Static method in class [Link]
w.

getFont(). Method in class [Link]


Gets the font of the component.
getFont(). Method in class [Link]
Gets the font.
getFont(). Method in class [Link]
Gets the current font.
getFont(). Method in class [Link]
Gets the font used for this MenuItem.
getFont(). Method in interface [Link]
getFont(String). Static method in class [Link]
ww

Gets a font from the system properties list.


getFont(String, Font). Static method in class [Link]
Gets the specified font from the system properties list.
getFontList(). Method in class [Link]
Returns the names of the available fonts.

For 1.1, the following font names are deprecated (the replacement name follows):
TimesRoman (use Serif)
Helvetica (use SansSerif)
Courier (use Monospaced)

The ZapfDingbats font is also deprecated in 1.1, but only as a separate fontname.

335
336

getFontMetrics(). Method in class [Link]


Gets the font metrics of the current font.
getFontMetrics(Font). Method in class [Link]

m
Gets the font metrics for this component.
getFontMetrics(Font). Method in interface [Link]
getFontMetrics(Font). Method in class [Link]
Gets the font metrics for the specified font.
getFontMetrics(Font). Method in class [Link]
Returns the screen metrics of the font.
getFontPeer(String, int). Method in class [Link]
Uses the specified Peer interface to create a new Font.

o
getForeground(). Method in class [Link]
Gets the foreground color.
getFormat(). Method in interface [Link]
Returns the name of the coding format.
getFormat(). Method in interface [Link]

i.c
Returns the format used to encode the key or null if the key does not support encoding.
getFormats(). Method in class [Link]
Get the formats passed in the constructor.
getFormats(). Method in class [Link]
Gets formats that were set with setFormats.
getG(). Method in interface [Link]
Returns the base, g.
getGraphics(). Method in class [Link]
Gets a Graphics context for this component.
getGraphics(). Method in interface [Link]

dil
getGraphics(). Method in class [Link]
Gets a graphics object to draw into this image.
getGraphics(). Method in class [Link]
Gets a Graphics object that will draw to the next page.
getGreatestMinimum(int). Method in class [Link]
Gets the highest minimum value for the given field if varies.
getGreatestMinimum(int). Method in class [Link]
Returns highest minimum value for the given field if varies.
getGreen(). Method in class [Link]
Gets the green component.
getGreen(int). Method in class [Link]
va
The subclass must provide a function which provides the green color compoment for the specified pixel.
getGreen(int). Method in class [Link]
Returns the green color compoment for the specified pixel in the range 0-255.
getGreen(int). Method in class [Link]
Returns the green color compoment for the specified pixel in the range 0-255.
getGreenMask(). Method in class [Link]
Returns the mask indicating which bits in a pixel contain the green color component.
getGreens(byte[]). Method in class [Link]
Copies the array of green color components into the given array.
getGregorianChange(). Method in class [Link]
ja

Gets the Gregorian Calendar change date.


getGroupingSeparator(). Method in class [Link]
character used for thousands separator.
getGroupingSize(). Method in class [Link]
Return the grouping size.
getGuarantor(). Method in interface [Link]
Returns the guarantor of the certificate, that is, the principal guaranteeing that the public key associated with this certificate is
w.

that of the principal associated with this certificate.


getHAdjustable(). Method in class [Link]
Returns the Adjustable object which represents the state of the horizontal scrollbar.
getHeaderField(int). Method in class [Link]
Returns the value for the nth header field.
getHeaderField(String). Method in class [Link]
Returns the name of the specified header field.
getHeaderFieldDate(String, long). Method in class [Link]
Returns the value of the named field parsed as date.
getHeaderFieldInt(String, int). Method in class [Link]
ww

Returns the value of the named field parsed as a number.


getHeaderFieldKey(int). Method in class [Link]
Returns the key for the nth header field.
getHeight(). Method in class [Link]
Gets the standard height of a line of text in this font.
getHeight(). Method in class [Link]
Get the height of the pixel buffer (after adjusting for image height).
getHeight(ImageObserver). Method in class [Link]
Gets the actual height of the image.
getHelpMenu(). Method in class [Link]
Gets the help menu on the menu bar.
getHgap(). Method in class [Link]

336
337

Returns the horizontal gap between components.


getHgap(). Method in class [Link]
Returns the horizontal gap between components.

m
getHgap(). Method in class [Link]
Returns the horizontal gap between components.
getHgap(). Method in class [Link]
Returns the horizontal gap between components.
getHost(). Method in class [Link]
Returns the host name of this URL, if applicable.
getHostAddress(). Method in class [Link]
Returns the IP address string "%d.%d.%d.%d"

o
getHostName(). Method in class [Link]
Returns the hostname for this address.
getHours(). Method in class [Link]
Returns the hour represented by this date.
getHours(). Method in class [Link]

i.c
Returns the hour represented by this date.
getHSBColor(float, float, float). Static method in class [Link]
A static Color factory for generating a Color object from HSB values.
getHScrollbarHeight(). Method in class [Link]
Returns the height that would be occupied by a horizontal scrollbar, which is independent of whether it is currently displayed
by the scroll pane or not.
getHScrollbarHeight(). Method in interface [Link]
getHumanPresentableName(). Method in class [Link]
Returns the human presentable name for the data foramt that this DataFlavor represents.
getIcon(int). Method in interface [Link]

dil
This method returns an image object that can be used to represent the bean in toolboxes, toolbars, etc.
getIcon(int). Method in class [Link]
Claim there are no icons available.
getIconImage(). Method in class [Link]
Returns the icon image for this Frame.
getID(). Method in class [Link]
Returns the event type.
getId(). Method in class [Link]
Returns the id of the object.
getID(). Method in class [Link]
Gets the ID of this time zone.
va
getIdentifierQuoteString(). Method in interface [Link]
What's the string used to quote SQL identifiers? This returns a space " " if identifier quoting isn't supported.
getIdentity(Principal). Method in class [Link]
Retrieves the identity whose name is the same as that of the specified principal.
getIdentity(PublicKey). Method in class [Link]
Retrieves the identity with the specified public key.
getIdentity(String). Method in class [Link]
Returns the identity in this scope with the specified name (if any).
getIfModifiedSince(). Method in class [Link]
Returns the value of this object's ifModifiedSince field.
ja

getImage(String). Method in class [Link]


Returns an image which gets pixel data from the specified file.
getImage(URL). Method in class [Link]
Returns an Image object that can then be painted on the screen.
getImage(URL). Method in interface [Link]
Returns an Image object that can then be painted on the screen.
getImage(URL). Method in class [Link]
w.

Returns an image which gets pixel data from the specified URL.
getImage(URL, String). Method in class [Link]
Returns an Image object that can then be painted on the screen.
getImportedKeys(String, String, String). Method in interface [Link]
Get a description of the primary key columns that are referenced by a table's foreign key columns (the primary keys imported
by a table).
getInCheck(). Method in class [Link]
Tests if there is a security check in progress.
getIndex(). Method in interface [Link]
Return the current index.
ww

getIndex(). Method in class [Link]


Get the index of the column or parameter that was truncated.
getIndex(). Method in class [Link]
Retrieve the current parse position.
getIndex(). Method in class [Link]
Return the current index.
getIndexedPropertyType(). Method in class [Link]
getIndexedReadMethod(). Method in class [Link]
getIndexedWriteMethod(). Method in class [Link]
getIndexInfo(String, String, String, boolean, boolean). Method in interface [Link]
Get a description of a table's indices and statistics.
getInetAddress(). Method in class [Link]

337
338

Returns the local address of this server socket.


getInetAddress(). Method in class [Link]
Returns the address to which the socket is connected.

m
getInetAddress(). Method in class [Link]
Returns the value of this socket's address field.
getInfinity(). Method in class [Link]
character used to represent infinity.
getInfo(). Method in class [Link]
Returns general information previously specified for this identity.
getInfo(). Method in class [Link]
Returns a human-readable description of the provider and its services.

o
getInputStream(). Method in class [Link]
Gets the input stream of the subprocess.
getInputStream(). Method in interface [Link]
Get the InputStream that the stub/skeleton should get results/arguments from.
getInputStream(). Method in class [Link]

i.c
Returns an input stream for this socket.
getInputStream(). Method in class [Link]
Returns an input stream for this socket.
getInputStream(). Method in class [Link]
Returns an input stream that reads from this open connection.
getInputStream(ZipEntry). Method in class [Link]
Returns an input stream for reading the contents of the specified ZIP file entry.
getInsets(). Method in class [Link]
Returns the insets of the container.
getInsets(). Method in interface [Link]

dil
getInstance(). Static method in class [Link]
Gets a Calendar using the default timezone and locale.
getInstance(). Static method in class [Link]
Gets the Collator for the current default locale.
getInstance(). Static method in class [Link]
Get a default date/time formatter that uses the SHORT style for both the date and the time.
getInstance(). Static method in class [Link]
Returns the default number format for the current default locale.
getInstance(Locale). Static method in class [Link]
Gets a Calendar using the default timezone and given locale.
getInstance(Locale). Static method in class [Link]
va
Gets the Collator for the desired locale.
getInstance(Locale). Static method in class [Link]
Returns the default number format for the specified locale.
getInstance(String). Static method in class [Link]
Generates a KeyPairGenerator object that implements the algorithm requested, as available in the environment.
getInstance(String). Static method in class [Link]
Generates a MessageDigest object that implements the specified digest algorithm.
getInstance(String). Static method in class [Link]
Generates a Signature object that implements the specified algorithm.
getInstance(String, String). Static method in class [Link]
ja

Generates a KeyPairGenerator object implementing the specified algorithm, as supplied from the specified provider, if such an
algorithm is available from the provider.
getInstance(String, String). Static method in class [Link]
Generates a MessageDigest object implementing the specified algorithm, as supplied from the specified provider, if such an
algorithm is available from the provider.
getInstance(String, String). Static method in class [Link]
Generates a Signature object implementing the specified algorithm, as supplied from the specified provider, if such an
w.

algorithm is available from the provider.


getInstance(TimeZone). Static method in class [Link]
Gets a Calendar using the given timezone and default locale.
getInstance(TimeZone, Locale). Static method in class [Link]
Gets a Calendar using the given timezone and given locale.
getInstanceField(int). Method in class [Link]
Return the instance field, specified by its index.
getInstanceFields(). Method in class [Link]
Return all the instance fields for this class.
getInstanceOf(Object, Class). Static method in class [Link]
ww

From a given bean, obtain an object representing a specified type view of that source object.
getInt(int). Method in interface [Link]
Get the value of an INTEGER parameter as a Java int.
getInt(int). Method in interface [Link]
Get the value of a column in the current row as a Java int.
getInt(Object). Method in class [Link]
Get the value of a field as a int on specified object.
getInt(Object, int). Static method in class [Link]
Returns the value of the indexed component in the specified array object, as an int.
getInt(String). Method in interface [Link]
Get the value of a column in the current row as a Java int.
getInteger(String). Static method in class [Link]

338
339

Determines the integer value of the system property with the specified name.
getInteger(String, int). Static method in class [Link]
Determines the integer value of the system property with the specified name.

m
getInteger(String, Integer). Static method in class [Link]
Determines the integer value of the system property with the specified name.
getInterface(). Method in class [Link]
Retrieve the address of the network interface used for multicast packets.
getInterfaces(). Method in class [Link]
Determines the interfaces implemented by the class or interface represented by this object.
getInterfaces(). Method in class [Link]
Return the interfaces for this class.

o
getISO3Country(). Method in class [Link]
Getter for the three-letter ISO country abbreviation of the locale.
getISO3Language(). Method in class [Link]
Getter for the three-letter ISO language abbreviation of the locale.
getItem(). Method in class [Link]

i.c
Returns the item where the event occurred.
getItem(int). Method in class [Link]
Returns the String at the specified index in the Choice.
getItem(int). Method in class [Link]
Gets the item associated with the specified index.
getItem(int). Method in class [Link]
Returns the item located at the specified index of this menu.
getItemCount(). Method in class [Link]
Returns the number of items in this Choice.
getItemCount(). Method in class [Link]

dil
Returns the number of items in the list.
getItemCount(). Method in class [Link]
Returns the number of elements in this menu.
getItems(). Method in class [Link]
Returns the items in the list.
getItemSelectable(). Method in class [Link]
Returns the ItemSelectable object where this event originated.
getJavaInitializationString(). Method in interface [Link]
This method is intended for use when generating Java code to set the value of the property.
getJavaInitializationString(). Method in class [Link]
This method is intended for use when generating Java code to set the value of the property.
va
getKey(). Method in class [Link]
Return the raw keycode of this MenuShortcut.
getKey(). Method in class [Link]
Gets parameter passed by constructor.
getKeyChar(). Method in class [Link]
Returns the character associated with the key in this event.
getKeyCode(). Method in class [Link]
Returns the integer key-code associated with the key in this event.
getKeyModifiersText(int). Static method in class [Link]
Returns a String describing the modifier key(s), such as "Shift", or "Ctrl+Shift".
ja

getKeys(). Method in class [Link]


Implementation of [Link].
getKeys(). Method in class [Link]
Implementation of [Link].
getKeys(). Method in class [Link]
Return an enumeration of the keys.
getKeyText(int). Static method in class [Link]
w.

Returns a String describing the keyCode, such as "HOME", "F1" or "A".


getLabel(). Method in class [Link]
Gets the label of the button.
getLabel(). Method in class [Link]
Gets the label of the check box.
getLabel(). Method in class [Link]
Gets the label for this menu item.
getLanguage(). Method in class [Link]
Getter for programmatic name of field, an lowercased two-letter ISO-639 code.
getLastModified(). Method in class [Link]
ww

Returns the value of the last-modified header field.


getLayout(). Method in class [Link]
Gets the layout manager for this container.
getLayoutAlignmentX(Container). Method in class [Link]
Returns the alignment along the x axis.
getLayoutAlignmentX(Container). Method in class [Link]
Returns the alignment along the x axis.
getLayoutAlignmentX(Container). Method in class [Link]
Returns the alignment along the x axis.
getLayoutAlignmentX(Container). Method in interface [Link].LayoutManager2
Returns the alignment along the x axis.
getLayoutAlignmentY(Container). Method in class [Link]

339
340

Returns the alignment along the y axis.


getLayoutAlignmentY(Container). Method in class [Link]
Returns the alignment along the y axis.

m
getLayoutAlignmentY(Container). Method in class [Link]
Returns the alignment along the y axis.
getLayoutAlignmentY(Container). Method in interface [Link].LayoutManager2
Returns the alignment along the y axis.
getLayoutDimensions(). Method in class [Link]
GetLayoutInfo(Container, int). Method in class [Link]
Print the layout constraints.
getLayoutOrigin(). Method in class [Link]

o
getLayoutWeights(). Method in class [Link]
getLeading(). Method in class [Link]
Gets the standard leading, or line spacing, for the font.
getLeastMaximum(int). Method in class [Link]
Gets the lowest maximum value for the given field if varies.

i.c
getLeastMaximum(int). Method in class [Link]
Returns lowest maximum value for the given field if varies.
getLength(). Method in class [Link]
Returns the length of the data to be sent or the length of the data received.
getLength(Object). Static method in class [Link]
Returns the length of the specified array object, as an int.
getLimits(). Method in class [Link]
Get the limits passed in the constructor.
getLineIncrement(). Method in class [Link]
getLineInstance(). Static method in class [Link]

dil
Create BreakIterator for line-breaks using default locale.
getLineInstance(Locale). Static method in class [Link]
Create BreakIterator for line-breaks using default locale.
getLineNumber(). Method in class [Link]
Returns the current line number.
getLineNumber(). Method in class [Link]
Get the current line number.
getLineNumber(). Method in class [Link]
Return the source file line number.
getLineNumbers(). Method in class [Link]
Return an array of all the class's source file line numbers which have code associated with them.
va
getListenerMethodDescriptors(). Method in class [Link]
getListenerMethods(). Method in class [Link]
getListenerType(). Method in class [Link]
getLocalAddress(). Method in class [Link]
Gets the local address to which the socket is bound.
getLocalAddress(). Method in class [Link]
Gets the local address to which the socket is bound.
getLocale(). Method in class [Link]
Gets the Locale for the applet, if it has been set.
getLocale(). Method in class [Link]
ja

Gets the locale of the component.


getLocale(). Method in class [Link]
Gets the locale.
getLocale(). Method in class [Link]
Gets the Locale for the window, if it has been set.
getLocalHost(). Static method in class [Link]
Returns the local host.
w.

getLocalizedInputStream(InputStream). Method in class [Link]


Creates a localized version of an input stream.
getLocalizedMessage(). Method in class [Link]
Creates a localized description of this Throwable.
getLocalizedOutputStream(OutputStream). Method in class [Link]
Creates a localized version of an output stream.
getLocalPatternChars(). Method in class [Link]
Gets localized date-time pattern characters.
getLocalPort(). Method in class [Link]
Returns the port number on the local host to which this socket is bound.
ww

getLocalPort(). Method in class [Link]


Get the local port.
getLocalPort(). Method in class [Link]
Returns the port on which this socket is listening.
getLocalPort(). Method in class [Link]
Returns the local port to which this socket is bound.
getLocalPort(). Method in class [Link]
Returns the value of this socket's localport field.
getLocalVariable(String). Method in class [Link]
Return a specific (named) stack variable.
getLocalVariables(). Method in class [Link]
Return an array of all valid local variables and method arguments for this stack frame.

340
341

getLocation(). Method in class [Link]


Returns the current location of this component.
getLocation(). Method in class [Link]

m
Returns the location of this point.
getLocation(). Method in class [Link]
Returns the location of this rectangle.
getLocationOnScreen(). Method in class [Link]
Returns the current location of this component in the screen's coordinate space.
getLocationOnScreen(). Method in interface [Link]
getLog(). Static method in class [Link]
Returns stream for the RMI call log.

o
getLoginTimeout(). Static method in class [Link]
Get the maximum time in seconds that all drivers can wait when attempting to log in to a database.
getLogStream(). Static method in class [Link]
Get the logging/tracing PrintStream that is used by the DriverManager and all drivers.
getLong(int). Method in interface [Link]

i.c
Get the value of a BIGINT parameter as a Java long.
getLong(int). Method in interface [Link]
Get the value of a column in the current row as a Java long.
getLong(Object). Method in class [Link]
Get the value of a field as a long on specified object.
getLong(Object, int). Static method in class [Link]
Returns the value of the indexed component in the specified array object, as a long.
getLong(String). Static method in class [Link]
Determines the long value of the system property with the specified name.
getLong(String). Method in interface [Link]

dil
Get the value of a column in the current row as a Java long.
getLong(String, Long). Static method in class [Link]
Determines the long value of the system property with the specified name.
getLong(String, long). Static method in class [Link]
Determines the long value of the system property with the specified name.
getLowestSetBit(). Method in class [Link]
Returns the index of the rightmost (lowest-order) one bit in this number (i.e., the number of zero bits to the right of the
rightmost one bit).
getMajorVersion(). Method in interface [Link]
Get the driver's major version number.
getMapSize(). Method in class [Link]
va
Returns the size of the color component arrays in this IndexColorModel.
getMaxAdvance(). Method in class [Link]
Gets the maximum advance width of any character in this Font.
getMaxAscent(). Method in class [Link]
Gets the maximum ascent of all characters in this Font.
getMaxBinaryLiteralLength(). Method in interface [Link]
How many hex characters can you have in an inline binary literal?
getMaxCatalogNameLength(). Method in interface [Link]
What's the maximum length of a catalog name?
getMaxCharLiteralLength(). Method in interface [Link]
ja

What's the max length for a character literal?


getMaxColumnNameLength(). Method in interface [Link]
What's the limit on column name length?
getMaxColumnsInGroupBy(). Method in interface [Link]
What's the maximum number of columns in a "GROUP BY" clause?
getMaxColumnsInIndex(). Method in interface [Link]
What's the maximum number of columns allowed in an index?
w.

getMaxColumnsInOrderBy(). Method in interface [Link]


What's the maximum number of columns in an "ORDER BY" clause?
getMaxColumnsInSelect(). Method in interface [Link]
What's the maximum number of columns in a "SELECT" list?
getMaxColumnsInTable(). Method in interface [Link]
What's the maximum number of columns in a table?
getMaxConnections(). Method in interface [Link]
How many active connections can we have at a time to this database?
getMaxCursorNameLength(). Method in interface [Link]
What's the maximum cursor name length?
ww

getMaxDecent(). Method in class [Link]


For backward compatibility only.
getMaxDescent(). Method in class [Link]
Gets the maximum descent of all characters in this Font.
getMaxFieldSize(). Method in interface [Link]
The maxFieldSize limit (in bytes) is the maximum amount of data returned for any column value; it only applies to BINARY,
VARBINARY, LONGVARBINARY, CHAR, VARCHAR, and LONGVARCHAR columns.
getMaximum(). Method in interface [Link]
Gets the maximum value of the adjustable object.
getMaximum(). Method in class [Link]
Returns the maximum value of this Scrollbar.
getMaximum(int). Method in class [Link]

341
342

Gets the maximum value for the given time field.


getMaximum(int). Method in class [Link]
Returns maximum value for the given field.

m
getMaximumFractionDigits(). Method in class [Link]
Returns the maximum number of digits allowed in the fraction portion of a number.
getMaximumIntegerDigits(). Method in class [Link]
Returns the maximum number of digits allowed in the integer portion of a number.
getMaximumSize(). Method in class [Link]
Returns the maximum size of this component.
getMaximumSize(). Method in class [Link]
Returns the maximum size of this container.

o
getMaxIndexLength(). Method in interface [Link]
What's the maximum length of an index (in bytes)?
getMaxPriority(). Method in class [Link]
Returns the maximum priority of this thread group.
getMaxProcedureNameLength(). Method in interface [Link]

i.c
What's the maximum length of a procedure name?
getMaxRows(). Method in interface [Link]
The maxRows limit is the maximum number of rows that a ResultSet can contain.
getMaxRowSize(). Method in interface [Link]
What's the maximum length of a single row?
getMaxSchemaNameLength(). Method in interface [Link]
What's the maximum length allowed for a schema name?
getMaxStatementLength(). Method in interface [Link]
What's the maximum length of a SQL statement?
getMaxStatements(). Method in interface [Link]

dil
How many active statements can we have open at one time to this database?
getMaxTableNameLength(). Method in interface [Link]
What's the maximum length of a table name?
getMaxTablesInSelect(). Method in interface [Link]
What's the maximum number of tables in a SELECT?
getMaxUserNameLength(). Method in interface [Link]
What's the maximum length of a user name?
getMenu(int). Method in class [Link]
Gets the specified menu.
getMenu(String). Method in class [Link]
Get an object from a ResourceBundle.
va
getMenuBar(). Method in class [Link]
Gets the menu bar for this Frame.
getMenuBar(String). Method in class [Link]
Get an object from a ResourceBundle.
getMenuCount(). Method in class [Link]
Counts the number of menus on the menu bar.
getMenuShortcutKeyMask(). Method in class [Link]
Return the Event modifier mask appropriate for shortcuts.
getMessage(). Method in class [Link]
Produce the message, include the classname if present.
ja

getMessage(). Method in class [Link]


Produce the message, include the message from the nested exception if there is one.
getMessage(). Method in class [Link]
Produce the message, include the message from the nested exception if there is one.
getMessage(). Method in class [Link]
Returns the detail message of this throwable object.
getMessage(). Method in class [Link]
w.

Produce the message, include the message from the nested exception if there is one.
getMessageDigest(). Method in class [Link]
Returns the message digest associated with this stream.
getMessageDigest(). Method in class [Link]
Returns the message digest associated with this stream.
getMetaData(). Method in interface [Link]
A Connection's database is able to provide information describing its tables, its supported SQL grammar, its stored
procedures, the capabilities of this connection, etc.
getMetaData(). Method in interface [Link]
The number, types and properties of a ResultSet's columns are provided by the getMetaData method.
ww

getMethod(). Method in class [Link]


getMethod(). Method in class [Link]
Returns the compression method of the entry, or -1 if not specified.
getMethod(String). Method in class [Link]
Return the method, specified by name.
getMethod(String, Class[]). Method in class [Link]
Returns a Method object that reflects the specified public member method of the class or interface represented by this Class
object.
getMethodDescriptors(). Method in interface [Link]
getMethodDescriptors(). Method in class [Link]
Deny knowledge of methods.
getMethodLineNumber(int). Method in class [Link]

342
343

Return the first line number of the specified method, or throws NoSuchLineNumber exception.
getMethodLineNumber(String). Method in class [Link]
Return the first line number of the specified method, or throws NoSuchLineNumber exception.

m
getMethodName(). Method in class [Link]
Get the method name referenced by this stackframe.
getMethodNames(). Method in class [Link]
Return the names of all methods supported by this class.
getMethods(). Method in class [Link]
Returns an array containing Method objects reflecting all the public member methods of the class or interface represented by
this Class object, including those declared by the class or interface and and those inherited from superclasses and
superinterfaces.

o
getMethods(). Method in class [Link]
Return the class's methods.
getMimeType(). Method in class [Link]
Returns the MIME type string for this DataFlavor
getMinimalDaysInFirstWeek(). Method in class [Link]

i.c
Gets what the minimal days required in the first week of the year are; e.g., if the first week is defined as one that contains the
first day of the first month of a year, getMinimalDaysInFirstWeek returns 1.
getMinimum(). Method in interface [Link]
Gets the minimum value of the adjustable object.
getMinimum(). Method in class [Link]
Returns the minimum value of this Scrollbar.
getMinimum(int). Method in class [Link]
Gets the minimum value for the given time field.
getMinimum(int). Method in class [Link]
Returns minimum value for the given field.

dil
getMinimumFractionDigits(). Method in class [Link]
Returns the minimum number of digits allowed in the fraction portion of a number.
getMinimumIntegerDigits(). Method in class [Link]
Returns the minimum number of digits allowed in the integer portion of a number.
getMinimumSize(). Method in class [Link]
Returns the mininimum size of this component.
getMinimumSize(). Method in interface [Link]
getMinimumSize(). Method in class [Link]
Returns the minimum size of this container.
getMinimumSize(). Method in class [Link]
Returns the minimum dimensions needed for the list.
va
getMinimumSize(). Method in class [Link]
Returns the minimum size Dimensions of the TextArea.
getMinimumSize(). Method in class [Link]
Returns the minimum size Dimensions needed for this TextField.
getMinimumSize(int). Method in class [Link]
Returns the minimum dimensions needed for the amount of rows in the list.
getMinimumSize(int). Method in interface [Link]
getMinimumSize(int). Method in class [Link]
Returns the minimum size Dimensions needed for this TextField with the specified amount of columns.
getMinimumSize(int). Method in interface [Link]
ja

getMinimumSize(int, int). Method in class [Link]


Returns the specified minimum size Dimensions of the TextArea.
getMinimumSize(int, int). Method in interface [Link]
getMinorVersion(). Method in interface [Link]
Get the driver's minor version number.
GetMinSize(Container, GridBagLayoutInfo). Method in class [Link]
getMinusSign(). Method in class [Link]
w.

character used to represent minus sign.


getMinutes(). Method in class [Link]
Returns the number of minutes past the hour represented by this date.
getMinutes(). Method in class [Link]
Returns the number of minutes past the hour represented by this date.
getMode(). Method in class [Link]
Gets the mode of the file dialog.
getModifiers(). Method in class [Link]
Returns the modifiers held down during this action event.
getModifiers(). Method in class [Link]
ww

Returns the Java language modifiers for this class or interface, encoded in an integer.
getModifiers(). Method in class [Link]
Returns the Java language modifiers for the constructor represented by this Constructor object, as an integer.
getModifiers(). Method in class [Link]
Returns the Java language modifiers for the field represented by this Field object, as an integer.
getModifiers(). Method in class [Link]
Returns the modifiers flag for this event.
getModifiers(). Method in interface [Link]
Returns the Java language modifiers for the member or constructor represented by this Member, as an integer.
getModifiers(). Method in class [Link]
Returns the Java language modifiers for the method represented by this Method object, as an integer.
getModifiers(). Method in class [Link]

343
344

Returns a string with the field's modifiers, such as "public", "static", "final", etc.
getMonth(). Method in class [Link]
Returns the month represented by this date.

m
getMonth(). Method in class [Link]
Returns the month represented by this date.
getMonths(). Method in class [Link]
Gets month strings.
getMoreResults(). Method in interface [Link]
getMoreResults moves to a Statement's next result.
getMultiplier(). Method in class [Link]
Get the multiplier for use in percent, permill, etc.

o
getName(). Method in interface [Link]
Returns the name of this ACL.
getName(). Method in class [Link]
Returns the fully-qualified name of the type (class, interface, array, or primitive) represented by this Class object, as a String.
getName(). Method in class [Link]

i.c
Returns the name of this clipboard object.
getName(). Method in class [Link]
Gets the name of the component.
getName(). Method in class [Link]
Returns the name of this constructor, as a string.
getName(). Method in class [Link]
getName(). Method in class [Link]
Returns the name of the field represented by this Field object.
getName(). Method in class [Link]
Returns the name of the file represented by this object.

dil
getName(). Method in class [Link]
Gets the logical name of the font.
getName(). Method in class [Link]
Returns this identity's name.
getName(). Method in interface [Link]
Returns the simple name of the underlying member or constructor represented by this Member.
getName(). Method in class [Link]
Gets the name of the menu component.
getName(). Method in class [Link]
Returns the name of the method represented by this Method object, as a String.
getName(). Method in class [Link]
va
The name of the class described by this descriptor.
getName(). Method in interface [Link]
Returns the name of this principal.
getName(). Method in class [Link]
Returns the name of this provider.
getName(). Method in class [Link]
Returns the name of the class.
getName(). Method in class [Link]
Returns the name of the field.
getName(). Method in class [Link]
ja

Return the name of a stack variable or argument.


getName(). Method in class [Link]
Return the name of the thread.
getName(). Method in class [Link]
Return the threadgroup's name.
getName(). Method in class [Link]
Returns this thread's name.
w.

getName(). Method in class [Link]


Returns the name of this thread group.
getName(). Method in class [Link]
Returns the name of the entry.
getName(). Method in class [Link]
Returns the path name of the ZIP file.
getNaN(). Method in class [Link]
character used to represent NaN.
getNanos(). Method in class [Link]
Get the Timestamp's nanos value
ww

getNativeContainer(Component). Static method in class [Link]


Give native peers the ability to query the native container given a native component (eg the direct parent may be lightweight).
getNegativePrefix(). Method in class [Link]
Get the negative prefix.
getNegativeSuffix(). Method in class [Link]
Get the negative suffix.
getNewValue(). Method in class [Link]
getNextEntry(). Method in class [Link]
Reads the next ZIP file entry and positions stream at the beginning of the entry data.
getNextEvent(). Method in class [Link]
Remove an event from the queue and return it.
getNextException(). Method in class [Link]

344
345

Get the exception chained to this one.


getNextWarning(). Method in class [Link]
Get the warning chained to this one

m
getNumberInstance(). Method in class [Link]
Gets the number formatter which this date/time formatter uses to format and parse a time.
getNumberInstance(). Static method in class [Link]
Returns a general-purpose number format for the current default locale.
getNumberInstance(Locale). Static method in class [Link]
Returns a general-purpose number format for the specified locale.
getNumericFunctions(). Method in interface [Link]
Get a comma separated list of math functions.

o
getNumericValue(char). Static method in class [Link]
Returns the Unicode numeric value of the character as a nonnegative integer.
getObject(int). Method in interface [Link]
Get the value of a parameter as a Java object.
getObject(int). Method in interface [Link]

i.c
Get the value of a column in the current row as a Java object.
getObject(String). Method in class [Link]
Get an object from a ResourceBundle.
getObject(String). Method in interface [Link]

Get the value of a column in the current row as a Java object.


getOffset(int, int, int, int, int, int). Method in class [Link]
Overrides TimeZone Gets offset, for current date, modified in case of daylight savings.
getOffset(int, int, int, int, int, int). Method in class [Link]

dil
Gets the time zone offset, for current date, modified in case of daylight savings.
getOldValue(). Method in class [Link]
getOperation(). Method in class [Link]
Returns the name of the method.
getOperations(). Method in interface [Link]
getOrientation(). Method in interface [Link]
Gets the orientation of the adjustable object.
getOrientation(). Method in class [Link]
Returns the orientation for this Scrollbar.
getOutputStream(). Method in class [Link]
Return the current stream to which output from this log is sent.
va
getOutputStream(). Method in class [Link]
Gets the output stream of the subprocess.
getOutputStream(). Method in interface [Link]
Return the output stream the stub/skeleton should put arguments/results into.
getOutputStream(). Method in class [Link]
Returns an output stream for this socket.
getOutputStream(). Method in class [Link]
Returns an output stream for this socket.
getOutputStream(). Method in class [Link]
Returns an output stream that writes to this connection.
ja

getP(). Method in interface [Link]


Returns the prime, p.
getPageDimension(). Method in class [Link]
Returns the dimensions of the page in pixels.
getPageIncrement(). Method in class [Link]
getPageResolution(). Method in class [Link]
Returns the resolution of the page in pixels per inch.
w.

getParameter(). Method in class [Link]


Is this a truncated parameter value?
getParameter(String). Method in class [Link]
Returns the value of the named parameter in the HTML tag.
getParameter(String). Method in interface [Link]
Returns the value of the named parameter in the HTML tag.
getParameter(String). Method in class [Link]
Gets the value of the specified algorithm parameter.
getParameterDescriptors(). Method in class [Link]
getParameterInfo(). Method in class [Link]
ww

Returns information about the parameters than are understood by this applet.
getParameterTypes(). Method in class [Link]
Returns an array of Class objects that represent the formal parameter types, in declaration order, of the constructor
represented by this Constructor object.
getParameterTypes(). Method in class [Link]
Returns an array of Class objects that represent the formal parameter types, in declaration order, of the method represented
by this Method object.
getParams(). Method in interface [Link]
Returns the DSA-specific key parameters.
getParent(). Method in class [Link]
Gets the parent of the component.
getParent(). Method in class [Link]

345
346

Returns the parent directory of the file represented by this object.


getParent(). Method in class [Link]
Returns the parent container.

m
getParent(). Method in class [Link]
Returns the parent of this thread group.
getPath(). Method in class [Link]
Returns the pathname of the file represented by this object.
getPatternSeparator(). Method in class [Link]
character used to separate positive and negative subpatterns in a pattern.
getPC(). Method in class [Link]
Get the program counter referenced by this stackframe.

o
getPeer(). Method in class [Link]
getPeer(). Method in class [Link]
Gets the peer of the font.
getPeer(). Method in class [Link]
getPercent(). Method in class [Link]

i.c
character used for percent sign.
getPercentInstance(). Static method in class [Link]
Returns a percentage format for the current default locale.
getPercentInstance(Locale). Static method in class [Link]
Returns a percentage format for the specified locale.
getPerMill(). Method in class [Link]
character used for mille percent sign.
getPermissions(Principal). Method in interface [Link]
Returns an enumeration for the set of allowed permissions for the specified principal (representing an entity such as an
individual or a group).

dil
getPixels(). Method in class [Link]
Get the pixel buffer.
getPixelSize(). Method in class [Link]
Returns the number of bits per pixel described by this ColorModel.
getPoint(). Method in class [Link]
Returns the x,y position of the event relative to the source component.
getPort(). Method in class [Link]
Returns the port number on the remote host to which this datagram is being sent or from which the datagram was received.
getPort(). Method in class [Link]
Returns the remote port to which this socket is connected.
getPort(). Method in class [Link]
va
Returns the value of this socket's port field.
getPort(). Method in class [Link]
Returns the port number of this URL.
getPositivePrefix(). Method in class [Link]
Get the positive prefix.
getPositiveSuffix(). Method in class [Link]
Get the positive suffix.
getPrecision(int). Method in interface [Link]
What's a column's number of decimal digits?
getPredefinedCursor(int). Static method in class [Link]
ja

Returns a cursor object with the specified predefined type.


getPreferredSize(). Method in class [Link]
Returns the preferred size of this component.
getPreferredSize(). Method in interface [Link]
getPreferredSize(). Method in class [Link]
Returns the preferred size of this container.
getPreferredSize(). Method in class [Link]
w.

Returns the preferred dimensions needed for the list.


getPreferredSize(). Method in class [Link]
Returns the preferred size Dimensions of the TextArea.
getPreferredSize(). Method in class [Link]
Returns the preferred size Dimensions needed for this TextField.
getPreferredSize(int). Method in class [Link]
Returns the preferred dimensions needed for the list with the specified amount of rows.
getPreferredSize(int). Method in interface [Link]
getPreferredSize(int). Method in class [Link]
Returns the preferred size Dimensions needed for this TextField with the specified amount of columns.
ww

getPreferredSize(int). Method in interface [Link]


getPreferredSize(int, int). Method in class [Link]
Returns the specified row and column Dimensions of the TextArea.
getPreferredSize(int, int). Method in interface [Link]
getPrimaryKeys(String, String, String). Method in interface [Link]
Get a description of a table's primary key columns.
getPrincipal(). Method in interface [Link]
Returns the principal for which permissions are granted or denied by this ACL entry.
getPrincipal(). Method in interface [Link]
Returns the principal of the principal-key pair being guaranteed by the guarantor.
getPrintJob(). Method in interface [Link]
Returns the PrintJob object from which this PrintGraphics object originated.

346
347

getPrintJob(Frame, String, Properties). Method in class [Link]


Returns a PrintJob object which is the result of initiating a print operation on the toolkit's platform.
getPriority(). Method in class [Link]

m
Returns this thread's priority.
getPrivate(). Method in class [Link]
Returns the private key from this key pair.
getPrivateKey(). Method in class [Link]
Returns this signer's private key.
getProcedureColumns(String, String, String, String). Method in interface [Link]
Get a description of a catalog's stored procedure parameters and result columns.
getProcedures(String, String, String). Method in interface [Link]

o
Get a description of stored procedures available in a catalog.
getProcedureTerm(). Method in interface [Link]
What's the database vendor's preferred term for "procedure"?
getPropagationId(). Method in class [Link]
The "propagationId" field is reserved for future use.

i.c
getProperties(). Static method in class [Link]
Determines the current system properties.
getProperty(String). Method in class [Link]
Searches for the property with the specified key in this property list.
getProperty(String). Static method in class [Link]
Gets a security property.
getProperty(String). Static method in class [Link]
Gets the system property indicated by the specified key.
getProperty(String, ImageObserver). Method in class [Link]
Gets a property of the image by name.

dil
getProperty(String, String). Method in class [Link]
Searches for the property with the specified key in this property list.
getProperty(String, String). Static method in class [Link]
Gets the system property indicated by the specified key.
getProperty(String, String). Static method in class [Link]
Gets a property with the specified key and default.
getPropertyChangeEvent(). Method in class [Link]
getPropertyDescriptors(). Method in interface [Link]
getPropertyDescriptors(). Method in class [Link]
Deny knowledge of properties.
getPropertyEditorClass(). Method in class [Link]
va
getPropertyInfo(String, Properties). Method in interface [Link]

The getPropertyInfo method is intended to allow a generic GUI tool to discover what properties it should prompt a human for
in order to get enough information to connect to a database.
getPropertyName(). Method in class [Link]
getPropertyType(). Method in class [Link]
getProtocol(). Method in class [Link]
Returns the protocol name this URL.
getProvider(String). Static method in class [Link]
Returns the provider installed with the specified name, if any.
ja

getProviders(). Static method in class [Link]


Returns all providers currently installed.
getPublic(). Method in class [Link]
Returns the public key from this key pair.
getPublicKey(). Method in interface [Link]
Returns the key of the principal-key pair being guaranteed by the guarantor.
getPublicKey(). Method in class [Link]
w.

Returns this identity's public key.


getQ(). Method in interface [Link]
Returns the subprime, q.
getQueryTimeout(). Method in interface [Link]
The queryTimeout limit is the number of seconds the driver will wait for a Statement to execute.
getRawOffset(). Method in class [Link]
Overrides TimeZone Gets the GMT offset for this time zone.
getRawOffset(). Method in class [Link]
Gets unmodified offset, NOT modified in case of daylight savings.
getRead(). Method in class [Link]
ww

Was this a read truncation?


getReadMethod(). Method in class [Link]
getRed(). Method in class [Link]
Gets the red component.
getRed(int). Method in class [Link]
The subclass must provide a function which provides the red color compoment for the specified pixel.
getRed(int). Method in class [Link]
Returns the red color compoment for the specified pixel in the range 0-255.
getRed(int). Method in class [Link]
Returns the red color compoment for the specified pixel in the range 0-255.
getRedMask(). Method in class [Link]
Returns the mask indicating which bits in a pixel contain the red color component.

347
348

getReds(byte[]). Method in class [Link]


Copies the array of red color components into the given array.
getRef(). Method in class [Link]

m
Returns the anchor (also known as the "reference") of this URL.
getRefClass(ObjectOutput). Method in interface [Link]
Returns the class name of the ref type to be serialized onto the stream 'out'.
getRegistry(). Static method in class [Link]
Returns the remote object Registry for the local host.
getRegistry(int). Static method in class [Link]
Returns the remote object Registry on the current host at the specified port.
getRegistry(String). Static method in class [Link]

o
Returns the remote object Registry on the specified host at a default (i.e., well-known) port number.
getRegistry(String, int). Static method in class [Link]
Returns the remote object Registry on the specified host at the specified port.
getRemaining(). Method in class [Link]
Returns the total number of bytes remaining in the input buffer.

i.c
getRemoteClass(). Method in class [Link]
Get the class this stackframe references.
getRemoveListenerMethod(). Method in class [Link]
getRepresentationClass(). Method in class [Link]
Returns the Class which objects supporting this DataFlavor will return when this DataFlavor is requested.
getRequestMethod(). Method in class [Link]
Get the request method.
getRequestProperty(String). Method in class [Link]
Returns the value of the named general request property for this connection.
getResource(String). Method in class [Link]

dil
getResource(String). Method in class [Link]
Find a resource with a given name.
getResourceAsStream(String). Method in class [Link]
Find a resource with a given name.
getResourceAsStream(String). Method in class [Link]
Get an InputStream on a given resource.
getResponseCode(). Method in class [Link]
Gets HTTP response status.
getResponseMessage(). Method in class [Link]
Gets the HTTP response message, if any, returned along with the response code from a server.
getResultSet(). Method in interface [Link]
va
getResultSet returns the current result as a ResultSet.
getResultStream(boolean). Method in interface [Link]
Returns an output stream (may put out header information relating to the success of the call).
getReturnType(). Method in class [Link]
Returns a Class object that represents the formal return type of the method represented by this Method object.
getRGB(). Method in class [Link]
Gets the RGB value representing the color in the default RGB ColorModel.
getRGB(). Method in class [Link]
Gets the "current" RGB value representing the symbolic color.
getRGB(int). Method in class [Link]
ja

Returns the color of the pixel in the default RGB color model.
getRGB(int). Method in class [Link]
Returns the color of the pixel in the default RGB color model.
getRGB(int). Method in class [Link]
Returns the color of the pixel in the default RGB color model.
getRGBdefault(). Static method in class [Link]
Return a ColorModel which describes the default format for integer RGB values used throughout the AWT image interfaces.
w.

getRows(). Method in class [Link]


Returns the number of rows in this layout.
getRows(). Method in class [Link]
Returns the number of visible lines in this list.
getRows(). Method in class [Link]
Returns the number of rows in the TextArea.
getRules(). Method in class [Link]
Gets the table-based rules for the collation object.
getRuntime(). Static method in class [Link]
Returns the runtime object associated with the current Java application.
ww

getScale(int). Method in interface [Link]


What's a column's number of digits to right of the decimal point?
getScaledInstance(int, int, int). Method in class [Link]
Returns a scaled version of this image.
getSchemaName(int). Method in interface [Link]
What's a column's table's schema?
getSchemas(). Method in interface [Link]
Get the schema names available in this database.
getSchemaTerm(). Method in interface [Link]
What's the database vendor's preferred term for "schema"?
getScope(). Method in class [Link]
Returns this identity's scope.

348
349

getScreenResolution(). Method in class [Link]


Returns the screen resolution in dots-per-inch.
getScreenSize(). Method in class [Link]

m
Gets the size of the screen.
getScrollbarDisplayPolicy(). Method in class [Link]
Returns the display policy for the scrollbars.
getScrollbarVisibility(). Method in class [Link]
Returns the enumerated value describing which scrollbars the text area has.
getScrollPosition(). Method in class [Link]
Returns the current x,y position within the child which is displayed at the 0,0 location of the scrolled panel's view port.
getSearchStringEscape(). Method in interface [Link]

o
This is the string that can be used to escape '_' or '%' in the string pattern style catalog search parameters.
getSeconds(). Method in class [Link]
Returns the number of seconds past the minute represented by this date.
getSeconds(). Method in class [Link]
Returns the number of seconds past the minute represented by this date.

i.c
getSecurityContext(). Method in class [Link]
Returns the security context (e.g., a URL).
getSecurityContext(). Method in class [Link]
Creates an object that encapsulates the current execution environment.
getSecurityContext(ClassLoader). Method in interface [Link]
Returns the security context of the given class loader (e.g., a URL)
getSecurityContext(ClassLoader). Static method in class [Link]
Returns the security context of the given class loader
getSecurityManager(). Static method in class [Link]
Gets the system security interface.

dil
getSeed(int). Static method in class [Link]
Returns the given number of seed bytes, computed using the seed generation algorithm that this class uses to seed itself.
getSelectedCheckbox(). Method in class [Link]
Gets the current choice.
getSelectedIndex(). Method in class [Link]
Returns the index of the currently selected item.
getSelectedIndex(). Method in class [Link]
Get the selected item on the list or -1 if no item is selected.
getSelectedIndexes(). Method in class [Link]
Returns the selected indexes on the list.
getSelectedIndexes(). Method in interface [Link]
va
getSelectedItem(). Method in class [Link]
Returns a String representation of the current choice.
getSelectedItem(). Method in class [Link]
Returns the selected item on the list or null if no item is selected.
getSelectedItems(). Method in class [Link]
Returns the selected items on the list in an array of Strings.
getSelectedObjects(). Method in class [Link]
Returns the an array (length 1) containing the checkbox label or null if the checkbox is not selected.
getSelectedObjects(). Method in class [Link]
Returns the an array (length 1) containing the checkbox menu item label or null if the checkbox is not selected.
ja

getSelectedObjects(). Method in class [Link]


Returns an array (length 1) containing the currently selected item.
getSelectedObjects(). Method in interface [Link]
Returns the selected items or null if no items are selected.
getSelectedObjects(). Method in class [Link]
Returns the selected items on the list in an array of Objects.
getSelectedText(). Method in class [Link]
w.

Returns the selected text contained in this TextComponent.


getSelectionEnd(). Method in class [Link]
Returns the selected text's end position.
getSelectionEnd(). Method in interface [Link]
getSelectionStart(). Method in class [Link]
Returns the selected text's start position.
getSelectionStart(). Method in interface [Link]
getSentenceInstance(). Static method in class [Link]
Create BreakIterator for sentence-breaks using default locale Returns an instance of a BreakIterator implementing sentence
breaks.
ww

getSentenceInstance(Locale). Static method in class [Link]


Create BreakIterator for sentence-breaks using specified locale Returns an instance of a BreakIterator implementing sentence
breaks.
getSerialVersionUID(). Method in class [Link]
Return the serialVersionUID for this class.
getShort(int). Method in interface [Link]
Get the value of a SMALLINT parameter as a Java short.
getShort(int). Method in interface [Link]
Get the value of a column in the current row as a Java short.
getShort(Object). Method in class [Link]
Get the value of a field as a short on specified object.
getShort(Object, int). Static method in class [Link]

349
350

Returns the value of the indexed component in the specified array object, as a short.
getShort(String). Method in interface [Link]
Get the value of a column in the current row as a Java short.

m
getShortcut(). Method in class [Link]
Return the MenuShortcut associated with this MenuItem, or null if none has been specified.
getShortcutMenuItem(MenuShortcut). Method in class [Link]
Return the MenuItem associated with a MenuShortcut, or null if none has been specified.
getShortDescription(). Method in class [Link]
getShortMonths(). Method in class [Link]
Gets short month strings.
getShortWeekdays(). Method in class [Link]

o
Gets short weekday strings.
getSigners(). Method in class [Link]
Get the signers of this class.
getSize(). Method in class [Link]
Returns the current size of this component.

i.c
getSize(). Method in class [Link]
Returns the size of this Dimension object.
getSize(). Method in class [Link]
Gets the point size of the font.
getSize(). Method in class [Link]
Returns the size (width by height) of this rectangle.
getSize(). Method in class [Link]
Return the number of elements in the array.
getSize(). Method in class [Link]
Returns the uncompressed size of the entry data, or -1 if not known.

dil
getSocketFactory(). Static method in class [Link]
Returns the socket factory used by RMI.
getSoLinger(). Method in class [Link]
Returns setting for SO_LINGER.
getSoTimeout(). Method in class [Link]
Retrive setting for SO_TIMEOUT.
getSoTimeout(). Method in class [Link]
Retrive setting for SO_TIMEOUT.
getSoTimeout(). Method in class [Link]
Returns setting for SO_TIMEOUT.
getSource(). Method in class [Link]
va
getSource(). Method in class [Link]
Gets the object that produces the pixels for the image.
getSourceFile(). Method in class [Link]
Get the source file referenced by this stackframe.
getSourceFileName(). Method in class [Link]
Get the name of the source file referenced by this stackframe.
getSourcePath(). Method in class [Link]
Return the source file path the Agent is currently using.
getSourceString(). Method in class [Link]
Returns the String that this CollationKey represents.
ja

getSQLKeywords(). Method in interface [Link]


Get a comma separated list of all a database's SQL keywords that are NOT also SQL92 keywords.
getSQLState(). Method in class [Link]
Get the SQLState
getStackVariable(String). Method in class [Link]
Return a stack variable from the current stackframe.
getStackVariables(). Method in class [Link]
w.

Return the arguments and local variable from the current stackframe.
getState(). Method in class [Link]
Returns the boolean state of the Checkbox.
getState(). Method in class [Link]
Returns the state of this MenuItem.
getStateChange(). Method in class [Link]
Returns the state change type which generated the event.
getStaticFields(). Method in class [Link]
Return all the static fields for this class.
getStatus(). Method in class [Link]
ww

Return the status of the pixels.


getStatus(). Method in class [Link]
Return the thread status description
getStrength(). Method in class [Link]
Returns this Collator's strength property.
getString(int). Method in interface [Link]
Get the value of a CHAR, VARCHAR, or LONGVARCHAR parameter as a Java String.
getString(int). Method in interface [Link]
Get the value of a column in the current row as a Java String.
getString(String). Method in class [Link]
Get an object from a ResourceBundle.
getString(String). Method in interface [Link]

350
351

Get the value of a column in the current row as a Java String.


getStringArray(String). Method in class [Link]
Get an object from a ResourceBundle.

m
getStringFunctions(). Method in interface [Link]
Get a comma separated list of string functions.
getStyle(). Method in class [Link]
Gets the style of the font.
getSuperclass(). Method in class [Link]
If this object represents any class other than the class Object, then the object that represents the superclass of that class is
returned.
getSuperclass(). Method in class [Link]

o
Return the superclass for this class.
getSystemClipboard(). Method in class [Link]
Returns an instance of the "system" clipboard which interfaces with the clipboard facilities on the native platform.
getSystemEventQueue(). Method in class [Link]
Get the application's or applet's EventQueue instance.

i.c
getSystemEventQueueImpl(). Method in class [Link]
getSystemFunctions(). Method in interface [Link]
Get a comma separated list of system functions.
getSystemResource(String). Static method in class [Link]
Find a resource with a given name.
getSystemResourceAsStream(String). Static method in class [Link]
Get an InputStream on a given resource..
getSystemScope(). Static method in class [Link]
Returns the system's identity scope.
getTableName(int). Method in interface [Link]

dil
What's a column's table name?
getTablePrivileges(String, String, String). Method in interface [Link]
Get a description of the access rights for each table available in a catalog.
getTables(String, String, String, String[]). Method in interface [Link]
Get a description of tables available in a catalog.
getTableTypes(). Method in interface [Link]
Get the table types available in this database.
getTags(). Method in interface [Link]
If the property value must be one of a set of known tagged values, then this method should return an array of the tags.
getTags(). Method in class [Link]
If the property value must be one of a set of known tagged values, then this method should return an array of the tag values.
va
getTargetException(). Method in class [Link]
Get the thrown target exception.
getTcpNoDelay(). Method in class [Link]
Tests if TCP_NODELAY is enabled.
getText(). Method in class [Link]
Get the text being scanned
getText(). Method in class [Link]
Gets the text of this label.
getText(). Method in class [Link]
Returns the text contained in this TextComponent.
ja

getText(). Method in interface [Link]


getThreadGroup(). Method in class [Link]
Returns the thread group into which to instantiate any new thread being created at the time this is being called.
getThreadGroup(). Method in class [Link]
Returns this thread's thread group.
getTime(). Method in class [Link]
Gets this Calendar's current time.
w.

getTime(). Method in class [Link]


Returns the number of milliseconds since January 1, 1970, 00:00:00 GMT represented by this date.
getTime(). Method in class [Link]
Returns the modification time of the entry, or -1 if not specified.
getTime(int). Method in interface [Link]
Get the value of a SQL TIME parameter as a [Link] object.
getTime(int). Method in interface [Link]
Get the value of a column in the current row as a [Link] object.
getTime(String). Method in interface [Link]
Get the value of a column in the current row as a [Link] object.
ww

getTimeDateFunctions(). Method in interface [Link]


Get a comma separated list of time and date functions.
getTimeInMillis(). Method in class [Link]
Gets this Calendar's current time as a long.
getTimeInstance(). Static method in class [Link]
Gets the time formatter with the default formatting style for the default locale.
getTimeInstance(int). Static method in class [Link]
Gets the time formatter with the given formatting style for the default locale.
getTimeInstance(int, Locale). Static method in class [Link]
Gets the time formatter with the given formatting style for the given locale.
getTimestamp(int). Method in interface [Link]
Get the value of a SQL TIMESTAMP parameter as a [Link] object.

351
352

getTimestamp(int). Method in interface [Link]


Get the value of a column in the current row as a [Link] object.
getTimestamp(String). Method in interface [Link]

m
Get the value of a column in the current row as a [Link] object.
getTimeZone(). Method in class [Link]
Gets the time zone.
getTimeZone(). Method in class [Link]
Gets the time zone.
getTimeZone(String). Static method in class [Link]
Gets the TimeZone for the given ID.
getTimezoneOffset(). Method in class [Link]

o
Returns the local time-zone offset.
getTitle(). Method in class [Link]
Gets the title of the Dialog.
getTitle(). Method in class [Link]
Gets the title of the Frame.

i.c
getToolkit(). Method in class [Link]
Gets the toolkit of the component.
getToolkit(). Method in interface [Link]
getToolkit(). Method in class [Link]
Returns the toolkit of this frame.
getTotalIn(). Method in class [Link]
Returns the total number of bytes input so far.
getTotalIn(). Method in class [Link]
Returns the total number of bytes input so far.
getTotalOut(). Method in class [Link]

dil
Returns the total number of bytes output so far.
getTotalOut(). Method in class [Link]
Returns the total number of bytes output so far.
getTransactionIsolation(). Method in interface [Link]
Get this Connection's current transaction isolation mode.
getTransferData(DataFlavor). Method in class [Link]
If the data was requested in the "[Link]" flavor, return the String representing the selection.
getTransferData(DataFlavor). Method in interface [Link]
Returns an object which represents the data to be transferred.
getTransferDataFlavors(). Method in class [Link]
Returns the array of flavors in which it can provide the data.
va
getTransferDataFlavors(). Method in interface [Link]
Returns an array of DataFlavor objects indicating the flavors the data can be provided in.
getTransferSize(). Method in class [Link]
Get the number of bytes of data actually transferred.
getTransparentPixel(). Method in class [Link]
Returns the index of the transparent pixel in this IndexColorModel or -1 if there is no transparent pixel.
getTreeLock(). Method in class [Link]
Gets the locking object for AWT component-tree and layout operations.
getTTL(). Method in class [Link]
Retrieve the TTL (time-to-live) option.
ja

getTTL(). Method in class [Link]


Get the default time-to-live for multicast packets sent out on the socket.
getType(). Method in class [Link]
Returns the type for this cursor.
getType(). Method in class [Link]
Returns a Class object that identifies the declared type for the field represented by this Field object.
getType(). Method in class [Link]
w.

Returns a Type object for the field.


getType(). Method in class [Link]
Returns a Type object for the field.
getType(). Method in class [Link]
Returns the RemoteValue's type.
getType(char). Static method in class [Link]
Returns a value indicating a character category.
getTypedName(). Method in class [Link]
Returns a string describing the field with its full type.
getTypeInfo(). Method in interface [Link]
ww

Get a description of all the standard SQL types supported by this database.
getUnicodeStream(int). Method in interface [Link]
A column value can be retrieved as a stream of Unicode characters and then read in chunks from the stream.
getUnicodeStream(String). Method in interface [Link]
A column value can be retrieved as a stream of Unicode characters and then read in chunks from the stream.
getUnitIncrement(). Method in interface [Link]
Gets the unit value increment for the adjustable object.
getUnitIncrement(). Method in class [Link]
Gets the unit increment for this scrollbar.
getUpdateCount(). Method in interface [Link]
getUpdateCount returns the current result as an update count; if the result is a ResultSet or there are no more results, -1 is
returned.

352
353

getUpdateRect(). Method in class [Link]


Returns the rectangle representing the area which needs to be repainted in response to this event.
getURL(). Method in interface [Link]

m
What's the url for this database?
getURL(). Method in class [Link]
Returns the value of this URLConnection's URL field.
getUseCaches(). Method in class [Link]
Returns the value of this URLConnection's useCaches field.
getUserName(). Method in interface [Link]
What's our user name as known to the database?
getVAdjustable(). Method in class [Link]

o
Returns the Adjustable object which represents the state of the vertical scrollbar.
getValue(). Method in interface [Link]
Gets the current value of the adjustable object.
getValue(). Method in class [Link]
Returns the current value in the adjustment event.

i.c
getValue(). Method in class [Link].Adler32
Returns checksum value.
getValue(). Method in interface [Link]
Returns the current checksum value.
getValue(). Method in class [Link].CRC32
Returns CRC-32 value.
getValue(). Method in class [Link]
Returns the lease duration.
getValue(). Method in interface [Link]
getValue(). Method in class [Link]

dil
getValue(). Method in class [Link]
Return the value of a stack variable or argument.
getValue(). Method in class [Link]
Returns the current value of this Scrollbar.
getValue(String). Method in class [Link]
Retrieve a named attribute with this feature.
getVariant(). Method in class [Link]
Getter for programmatic name of field.
getVersion(). Method in class [Link]
Returns the version number for this provider.
getVersionColumns(String, String, String). Method in interface [Link]
va
Get a description of a table's columns that are automatically updated when any value in a row is updated.
getVgap(). Method in class [Link]
Returns the vertical gap between components.
getVgap(). Method in class [Link]
Returns the vertical gap between components.
getVgap(). Method in class [Link]
Returns the vertical gap between components.
getVgap(). Method in class [Link]
Returns the vertical gap between components.
getViewportSize(). Method in class [Link]
ja

Returns the current size of the scroll pane's view port.


getVisible(). Method in class [Link]
getVisibleAmount(). Method in interface [Link]
Gets the length of the propertional indicator.
getVisibleAmount(). Method in class [Link]
Returns the visible amount of this Scrollbar.
getVisibleIndex(). Method in class [Link]
w.

Gets the index of the item that was last made visible by the method makeVisible.
getVMID(). Method in class [Link]
Returns the client VMID associated with the lease.
getVScrollbarWidth(). Method in class [Link]
Returns the width that would be occupied by a vertical scrollbar, which is independent of whether it is currently displayed by
the scroll pane or not.
getVScrollbarWidth(). Method in interface [Link]
getWarnings(). Method in interface [Link]
The first warning reported by calls on this Connection is returned.
getWarnings(). Method in interface [Link]
ww

The first warning reported by calls on this ResultSet is returned.


getWarnings(). Method in interface [Link]
The first warning reported by calls on this Statement is returned.
getWarningString(). Method in class [Link]
Gets the warning string for this window.
getWeekdays(). Method in class [Link]
Gets weekday strings.
getWhen(). Method in class [Link]
Returns the timestamp of when this event occurred.
getWidth(). Method in class [Link]
Get the width of the pixel buffer (after adjusting for image width).

353
354

getWidth(ImageObserver). Method in class [Link]


Gets the actual width of the image.
getWidths(). Method in class [Link]

m
Gets the advance widths of the first 256 characters in the Font.
getWindow(). Method in class [Link]
Returns the window where this event originated.
getWordInstance(). Static method in class [Link]
Create BreakIterator for word-breaks using default locale.
getWordInstance(Locale). Static method in class [Link]
Create BreakIterator for word-breaks using default locale.
getWriteMethod(). Method in class [Link]

o
getX(). Method in interface [Link]
Returns the value of the private key, x.
getX(). Method in class [Link]
Returns the x position of the event relative to the source component.
getY(). Method in interface [Link]

i.c
Returns the value of the public key, y.
getY(). Method in class [Link]
Returns the y position of the event relative to the source component.
getYear(). Method in class [Link]
Returns the year represented by this date, minus 1900.
getYear(). Method in class [Link]
Returns the year represented by this date, minus 1900.
getZeroDigit(). Method in class [Link]
character used for zero.
getZoneStrings(). Method in class [Link]

dil
Gets timezone strings.
GOT_FOCUS. Static variable in class [Link]
A component gained the focus.
gotFocus(Event, Object). Method in class [Link]
grabPixels(). Method in class [Link]
Request the Image or ImageProducer to start delivering pixels and wait for all of the pixels in the rectangle of interest to be
delivered.
grabPixels(long). Method in class [Link]
Request the Image or ImageProducer to start delivering pixels and wait for all of the pixels in the rectangle of interest to be
delivered or until the specified timeout has elapsed.
Graphics(). Constructor for class [Link]
va
Constructs a new Graphics object.
gray. Static variable in class [Link]
The color gray.
green. Static variable in class [Link]
The color green.
GregorianCalendar(). Constructor for class [Link]
Constructs a default GregorianCalendar using the current time in the default time zone with the default locale.
GregorianCalendar(int, int, int). Constructor for class [Link]
Constructs a GregorianCalendar with the given date set in the default time zone with the default locale.
GregorianCalendar(int, int, int, int, int). Constructor for class [Link]
ja

Constructs a GregorianCalendar with the given date and time set for the default time zone with the default locale.
GregorianCalendar(int, int, int, int, int, int). Constructor for class [Link]
Constructs a GregorianCalendar with the given date and time set for the default time zone with the default locale.
GregorianCalendar(Locale). Constructor for class [Link]
Constructs a GregorianCalendar based on the current time in the default time zone with the given locale.
GregorianCalendar(TimeZone). Constructor for class [Link]
Constructs a GregorianCalendar based on the current time in the given time zone with the default locale.
w.

GregorianCalendar(TimeZone, Locale). Constructor for class [Link]


Constructs a GregorianCalendar based on the current time in the given time zone with the given locale.
GridBagConstraints(). Constructor for class [Link]
GridBagLayout(). Constructor for class [Link]
Creates a gridbag layout.
gridheight. Variable in class [Link]
GridLayout(). Constructor for class [Link]
Creates a grid layout with a default of one column per component, in a single row.
GridLayout(int, int). Constructor for class [Link]
Creates a grid layout with the specified rows and columns.
ww

GridLayout(int, int, int, int). Constructor for class [Link]


Creates a grid layout with the specified rows, columns, horizontal gap, and vertical gap.
gridwidth. Variable in class [Link]
gridx. Variable in class [Link]
gridy. Variable in class [Link]
grow(int, int). Method in class [Link]
Grows the rectangle horizontally and vertically.
guessContentTypeFromName(String). Static method in class [Link]
Tries to determine the content type of an object, based on the specified "file" component of a URL.
guessContentTypeFromStream(InputStream). Static method in class [Link]
Tries to determine the type of an input stream based on the characters at the beginning of the input stream.
GZIP_MAGIC. Static variable in class [Link]

354
355

GZIP header magic number.


GZIPInputStream(InputStream). Constructor for class [Link]
Creates a new input stream with a default buffer size.

m
GZIPInputStream(InputStream, int). Constructor for class [Link]
Creates a new input stream with the specified buffer size.
GZIPOutputStream(OutputStream). Constructor for class [Link]
Creates a new output stream with a default buffer size.
GZIPOutputStream(OutputStream, int). Constructor for class [Link]
Creates a new output stream with the specified buffer size.

o
H

HAND_CURSOR. Static variable in class [Link]


The hand cursor type.

i.c
HAND_CURSOR. Static variable in class [Link]
handleEvent(AWTEvent). Method in interface [Link]
handleEvent(Event). Method in class [Link]
handleGetObject(String). Method in class [Link]
Override of ResourceBundle, same semantics
handleGetObject(String). Method in class [Link]
Override of ResourceBundle, same semantics
handleGetObject(String). Method in class [Link]
Get an object from a ResourceBundle.
hasChanged(). Method in class [Link]

dil
Tests if this object has changed.
hashCode(). Method in class [Link]
Computes a hash code for this object.
hashCode(). Method in class [Link]
Computes a hash code for this object.
hashCode(). Method in class [Link]
Returns a hash code value for this bit set.
hashCode(). Method in class [Link]
Returns a hash code for this Boolean.
hashCode(). Method in class [Link]
Returns a hashcode for this Byte.
va
hashCode(). Method in class [Link]
Returns a hash code for this Character.
hashCode(). Method in class [Link]
Generates a hash code for the message format object.
hashCode(). Method in class [Link]
Creates a hash code for this CollationKey.
hashCode(). Method in class [Link]
Generates the hash code for this Collator.
hashCode(). Method in class [Link]
Computes the hash code.
ja

hashCode(). Method in class [Link]


Returns a hashcode for this Constructor.
hashCode(). Method in class [Link]
Returns a hash code value for this object.
hashCode(). Method in class [Link]
Overrides hashCode
hashCode(). Method in class [Link]
w.

Override hashCode.
hashCode(). Method in class [Link]
Overrides hashCode
hashCode(). Method in class [Link]
Override hashCode
hashCode(). Method in class [Link]
Returns a hashcode for this Double.
hashCode(). Method in class [Link]
Returns a hashcode for this Field.
hashCode(). Method in class [Link]
ww

Computes a hashcode for the file.


hashCode(). Method in class [Link]
Returns a hashcode for this Float.
hashCode(). Method in class [Link]
Returns a hashcode for this font.
hashCode(). Method in class [Link]
Override hashCode.
hashCode(). Method in class [Link]
Returns a hashcode for this identity.
hashCode(). Method in class [Link]
Returns a hashcode for this IP address.
hashCode(). Method in class [Link]

355
356

Returns a hashcode for this Integer.


hashCode(). Method in class [Link]
Override hashCode.

m
hashCode(). Method in class [Link]
Computes a hashcode for this Long.
hashCode(). Method in class [Link]
Generates a hash code for the message format object.
hashCode(). Method in class [Link]
Returns a hashcode for this Method.
hashCode(). Method in class [Link]
Overrides hashCode

o
hashCode(). Method in class [Link]
Returns a hash code value for the object.
hashCode(). Method in class [Link]
The hashcode is the object number.
hashCode(). Method in class [Link]

i.c
Returns the hashcode for this Point.
hashCode(). Method in interface [Link]
Returns a hashcode for this principal.
hashCode(). Method in class [Link]
Returns the hashcode for this Rectangle.
hashCode(). Method in class [Link]
Returns a hashcode for a remote object.
hashCode(). Method in class [Link]
Generates the hash code for the table-based collation object
hashCode(). Method in class [Link]

dil
Returns a hashcode for this Short.
hashCode(). Method in class [Link]
Override hashCode.
hashCode(). Method in class [Link]
Override hashCode.
hashCode(). Method in class [Link]
Returns a hashcode for this string.
hashCode(). Method in class [Link]
Compute a hashcode for this enumeration
hashCode(). Method in class [Link]
Returns a hash code value for the object.
va
hashCode(). Method in class [Link]
Creates an integer suitable for hash table indexing.
hashCode(). Method in class [Link]
Compute hash code for this VMID.
Hashtable(). Constructor for class [Link]
Constructs a new, empty hashtable with a default capacity and load factor.
Hashtable(int). Constructor for class [Link]
Constructs a new, empty hashtable with the specified initial capacity and default load factor.
Hashtable(int, float). Constructor for class [Link]
Constructs a new, empty hashtable with the specified initial capacity and the specified load factor.
ja

hasMoreElements(). Method in interface [Link]


Tests if this enumeration contains more elements.
hasMoreElements(). Method in class [Link]
Returns the same value as the hasMoreTokens method.
hasMoreTokens(). Method in class [Link]
Tests if there are more tokens available from this tokenizer's string.
height. Variable in class [Link]
w.

The height dimension.


HEIGHT. Static variable in interface [Link]
The height of the base image is now available and can be taken from the height argument to the imageUpdate callback
method.
height. Variable in class [Link]
The height of the rectangle.
hide(). Method in class [Link]
hide(). Method in interface [Link]
DEPRECATED: Replaced by setVisible(boolean).
HOME. Static variable in class [Link]
ww

The home action-key.


HORIZONTAL. Static variable in interface [Link]
The horizontal orientation.
HORIZONTAL. Static variable in class [Link]
HORIZONTAL. Static variable in class [Link]
The horizontal Scrollbar variable.
HOUR. Static variable in class [Link]
Useful constant for date and time.
HOUR0_FIELD. Static variable in class [Link]
Useful constant for zero-based HOUR field alignment.
HOUR1_FIELD. Static variable in class [Link]
Useful constant for one-based HOUR field alignment.

356
357

HOUR_OF_DAY. Static variable in class [Link]


Useful constant for date and time.
HOUR_OF_DAY0_FIELD. Static variable in class [Link]

m
Useful constant for zero-based HOUR_OF_DAY field alignment.
HOUR_OF_DAY1_FIELD. Static variable in class [Link]
Useful constant for one-based HOUR_OF_DAY field alignment.
HSBtoRGB(float, float, float). Static method in class [Link]
Returns the RGB value defined by the default RGB ColorModel, of the color corresponding to the given HSB color
components.
HTTP_ACCEPTED. Static variable in class [Link]
HTTP_BAD_GATEWAY. Static variable in class [Link]

o
HTTP_BAD_METHOD. Static variable in class [Link]
HTTP_BAD_REQUEST. Static variable in class [Link]
4XX: client error
HTTP_CLIENT_TIMEOUT. Static variable in class [Link]
HTTP_CONFLICT. Static variable in class [Link]

i.c
HTTP_CREATED. Static variable in class [Link]
HTTP_ENTITY_TOO_LARGE. Static variable in class [Link]
HTTP_FORBIDDEN. Static variable in class [Link]
HTTP_GATEWAY_TIMEOUT. Static variable in class [Link]
HTTP_GONE. Static variable in class [Link]
HTTP_INTERNAL_ERROR. Static variable in class [Link]
HTTP_LENGTH_REQUIRED. Static variable in class [Link]
HTTP_MOVED_PERM. Static variable in class [Link]
HTTP_MOVED_TEMP. Static variable in class [Link]
HTTP_MULT_CHOICE. Static variable in class [Link]

dil
3XX: relocation/redirect
HTTP_NO_CONTENT. Static variable in class [Link]
HTTP_NOT_ACCEPTABLE. Static variable in class [Link]
HTTP_NOT_AUTHORITATIVE. Static variable in class [Link]
HTTP_NOT_FOUND. Static variable in class [Link]
HTTP_NOT_MODIFIED. Static variable in class [Link]
HTTP_OK. Static variable in class [Link]
2XX: generally "OK"
HTTP_PARTIAL. Static variable in class [Link]
HTTP_PAYMENT_REQUIRED. Static variable in class [Link]
HTTP_PRECON_FAILED. Static variable in class [Link]
va
HTTP_PROXY_AUTH. Static variable in class [Link]
HTTP_REQ_TOO_LONG. Static variable in class [Link]
HTTP_RESET. Static variable in class [Link]
HTTP_SEE_OTHER. Static variable in class [Link]
HTTP_SERVER_ERROR. Static variable in class [Link]
5XX: server error
HTTP_UNAUTHORIZED. Static variable in class [Link]
HTTP_UNAVAILABLE. Static variable in class [Link]
HTTP_UNSUPPORTED_TYPE. Static variable in class [Link]
HTTP_USE_PROXY. Static variable in class [Link]
ja

HTTP_VERSION. Static variable in class [Link]


HttpURLConnection(URL). Constructor for class [Link]
Constructor for the URLStreamHandler.
HUFFMAN_ONLY. Static variable in class [Link]
Compression strategy for Huffman coding only.
w.

ICON_COLOR_16x16. Static variable in interface [Link]


Constant to indicate a 16 x 16 color icon.
ICON_COLOR_32x32. Static variable in interface [Link]
Constant to indicate a 32 x 32 color icon.
ICON_MONO_16x16. Static variable in interface [Link]
Constant to indicate a 16 x 16 monochrome icon.
ICON_MONO_32x32. Static variable in interface [Link]
ww

Constant to indicate a 32 x 32 monochrome icon.


id. Variable in class [Link]
id. Variable in class [Link]
The type of this event.
IDENTICAL. Static variable in class [Link]
Collator strength value.
identities(). Method in class [Link]
Returns an enumeration of all identities in this identity scope.
Identity(). Constructor for class [Link]
Constructor for serialization only.
Identity(String). Constructor for class [Link]
Constructs an identity with the specified name and no scope.

357
358

Identity(String, IdentityScope). Constructor for class [Link]


Constructs an identity with the specified name and scope.
identityEquals(Identity). Method in class [Link]

m
Tests for equality between the specified identity and this identity.
identityHashCode(Object). Static method in class [Link]
Returns the same hashcode for the given object as would be returned by the default method hashCode(), whether or not the
given object's class overrides hashCode().
IdentityScope(). Constructor for class [Link]
This constructor is used for serialization only and should not be used by subclasses.
IdentityScope(String). Constructor for class [Link]
Constructs a new identity scope with the specified name.

o
IdentityScope(String, IdentityScope). Constructor for class [Link]
Constructs a new identity scope with the specified name and scope.
IEEEremainder(double, double). Static method in class [Link]
Computes the remainder operation on two arguments as prescribed by the IEEE 754 standard.
ifModifiedSince. Variable in class [Link]

i.c
Some protocols support skipping the fetching of the object unless the object has been modified more recently than a certain
time.
ignoreExceptions(). Method in class [Link]
Don't enter the debugger when an instance of this class is thrown.
IllegalAccessError(). Constructor for class [Link]
Constructs an IllegalAccessError with no detail message.
IllegalAccessError(String). Constructor for class [Link]
Constructs an IllegalAccessError with the specified detail message.
IllegalAccessException(). Constructor for class [Link]
Constructs an IllegalAccessException without a detail message.

dil
IllegalAccessException(String). Constructor for class [Link]
Constructs an IllegalAccessException with a detail message.
IllegalArgumentException(). Constructor for class [Link]
Constructs an IllegalArgumentException with no detail message.
IllegalArgumentException(String). Constructor for class [Link]
Constructs an IllegalArgumentException with the specified detail message.
IllegalComponentStateException(). Constructor for class [Link]
Constructs an IllegalComponentStateException with no detail message.
IllegalComponentStateException(String). Constructor for class [Link]
Constructs an IllegalComponentStateException with the specified detail message.
IllegalMonitorStateException(). Constructor for class [Link]
va
Constructs an IllegalMonitorStateException with no detail message.
IllegalMonitorStateException(String). Constructor for class [Link]
Constructs an IllegalMonitorStateException with the specified detail message.
IllegalStateException(). Constructor for class [Link]
Constructs an IllegalStateException with no detail message.
IllegalStateException(String). Constructor for class [Link]
Constructs an IllegalStateException with the specified detail message.
IllegalThreadStateException(). Constructor for class [Link]
Constructs an IllegalThreadStateException with no detail message.
IllegalThreadStateException(String). Constructor for class [Link]
ja

Constructs an IllegalThreadStateException with the specified detail message.


Image(). Constructor for class [Link]
IMAGEABORTED. Static variable in interface [Link]
The image creation process was deliberately aborted.
imageComplete(int). Method in interface [Link]
The imageComplete method is called when the ImageProducer is finished delivering all of the pixels that the source image
contains, or when a single frame of a multi-frame animation has been completed, or when an error in loading or producing the
w.

image has occured.


imageComplete(int). Method in class [Link]
Filters the information provided in the imageComplete method of the ImageConsumer interface.
imageComplete(int). Method in class [Link]
The imageComplete method is part of the ImageConsumer API which this class must implement to retrieve the pixels.
IMAGEERROR. Static variable in interface [Link]
An error was encountered while producing the image.
ImageFilter(). Constructor for class [Link]
imageUpdate(Image, int, int, int, int, int). Method in class [Link]
Repaints the component when the image has changed.
ww

imageUpdate(Image, int, int, int, int, int). Method in interface [Link]


This method is called when information about an image which was previously requested using an asynchronous interface
becomes available.
implAccept(Socket). Method in class [Link]
Subclasses of ServerSocket use this method to override accept() to return their own subclass of socket.
importedKeyCascade. Static variable in interface [Link]
IMPORT KEY UPDATE_RULE and DELETE_RULE - for update, change imported key to agree with primary key
update; for delete, delete rows that import a deleted key.
importedKeyInitiallyDeferred. Static variable in interface [Link]
IMPORT KEY DEFERRABILITY - see SQL92 for definition
importedKeyInitiallyImmediate. Static variable in interface [Link]
IMPORT KEY DEFERRABILITY - see SQL92 for definition

358
359

importedKeyNoAction. Static variable in interface [Link]


IMPORT KEY UPDATE_RULE and DELETE_RULE - do not allow update or delete of primary key if it has been
imported.

m
importedKeyNotDeferrable. Static variable in interface [Link]
IMPORT KEY DEFERRABILITY - see SQL92 for definition
importedKeyRestrict. Static variable in interface [Link]
IMPORT KEY UPDATE_RULE and DELETE_RULE - do not allow update or delete of primary key if it has been
imported.
importedKeySetDefault. Static variable in interface [Link]
IMPORT KEY UPDATE_RULE and DELETE_RULE - change imported key to default values if its primary key has been
updated or deleted.

o
importedKeySetNull. Static variable in interface [Link]
IMPORT KEY UPDATE_RULE and DELETE_RULE - change imported key to NULL if its primary key has been updated
or deleted.
in. Static variable in class [Link]
A handle to the standard input stream.

i.c
in. Variable in class [Link]
The underlying input stream.
in. Variable in class [Link]
The underlying character-input stream, or null if the stream has been closed
in. Variable in class [Link]
in. Static variable in class [Link]
The "standard" input stream.
INACTIVE_CAPTION. Static variable in class [Link]
The array index for the inactive caption background color.
INACTIVE_CAPTION_BORDER. Static variable in class [Link]

dil
The array index for the inactive caption border color.
INACTIVE_CAPTION_TEXT. Static variable in class [Link]
The array index for the inactive caption text color.
inactiveCaption. Static variable in class [Link]
The background color for inactive captions in window borders.
inactiveCaptionBorder. Static variable in class [Link]
The border color for inactive captios in window borders.
inactiveCaptionText. Static variable in class [Link]
The text color for inactive captions in window borders.
inCheck. Variable in class [Link]
This field is true if there is a security check in progress; false otherwise.
va
inClass(String). Method in class [Link]
Tests if the specified String is in this Class.
inClassLoader(). Method in class [Link]
Tests if the current ClassLoader is equal to null.
IncompatibleClassChangeError(). Constructor for class [Link]
Constructs an IncompatibleClassChangeError with no detail message.
IncompatibleClassChangeError(String). Constructor for class [Link]
Constructs an IncompatibleClassChangeError with the specified detail message.
inDaylightTime(Date). Method in class [Link]
Overrides TimeZone Queries if the given date is in Daylight Savings Time.
ja

inDaylightTime(Date). Method in class [Link]


Queries if the given date is in Daylight Savings Time in this time zone.
IndexColorModel(int, int, byte[], byte[], byte[]). Constructor for class [Link]
Constructs an IndexColorModel from the given arrays of red, green, and blue components.
IndexColorModel(int, int, byte[], byte[], byte[], byte[]). Constructor for class [Link]
Constructs an IndexColorModel from the given arrays of red, green, blue and alpha components.
IndexColorModel(int, int, byte[], byte[], byte[], int). Constructor for class [Link]
w.

Constructs an IndexColorModel from the given arrays of red, green, and blue components.
IndexColorModel(int, int, byte[], int, boolean). Constructor for class [Link]
Constructs an IndexColorModel from a single arrays of packed red, green, blue and optional alpha components.
IndexColorModel(int, int, byte[], int, boolean, int). Constructor for class [Link]
Constructs an IndexColorModel from a single arrays of packed red, green, blue and optional alpha components.
IndexedPropertyDescriptor(String, Class). Constructor for class [Link]
This constructor constructs an IndexedPropertyDescriptor for a property that follows the standard Java conventions by
having getFoo and setFoo accessor methods, for both indexed access and array access.
IndexedPropertyDescriptor(String, Class, String, String, String, String). Constructor for class
[Link]
ww

This constructor takes the name of a simple property, and method names for reading and writing the property, both indexed
and non-indexed.
IndexedPropertyDescriptor(String, Method, Method, Method, Method). Constructor for class
[Link]
This constructor takes the name of a simple property, and Method objects for reading and writing the property.
indexOf(int). Method in class [Link]
Returns the index within this string of the first occurrence of the specified character.
indexOf(int, int). Method in class [Link]
Returns the index within this string of the first occurrence of the specified character, starting the search at the specified index.
indexOf(Object). Method in class [Link]
Searches for the first occurence of the given argument, testing for equality using the equals method.
indexOf(Object, int). Method in class [Link]

359
360

Searches for the first occurence of the given argument, beginning the search at index, and testing for equality using the
equals method.
indexOf(String). Method in class [Link]

m
Returns the index within this string of the first occurrence of the specified substring.
indexOf(String, int). Method in class [Link]
Returns the index within this string of the first occurrence of the specified substring, starting at the specified index.
IndexOutOfBoundsException(). Constructor for class [Link]
Constructs an IndexOutOfBoundsException with no detail message.
IndexOutOfBoundsException(String). Constructor for class [Link]
Constructs an IndexOutOfBoundsException with the specified detail message.
inf. Variable in class [Link]

o
Decompressor for this stream.
inflate(byte[]). Method in class [Link]
Uncompresses bytes into specified buffer.
inflate(byte[], int, int). Method in class [Link]
Uncompresses bytes into specified buffer.

i.c
Inflater(). Constructor for class [Link]
Creates a new decompressor.
Inflater(boolean). Constructor for class [Link]
Creates a new decompressor.
InflaterInputStream(InputStream). Constructor for class [Link]
Creates a new input stream with a default decompressor and buffer size.
InflaterInputStream(InputStream, Inflater). Constructor for class [Link]
Creates a new input stream with the specified decompressor and a default buffer size.
InflaterInputStream(InputStream, Inflater, int). Constructor for class [Link]
Creates a new input stream with the specified decompressor and buffer size.

dil
info. Static variable in class [Link]
The background color for info(help) text.
INFO. Static variable in class [Link]
The array index for the info background color.
INFO_TEXT. Static variable in class [Link]
The array index for the info text color.
infoText. Static variable in class [Link]
The text color for info(help) text.
init(). Method in class [Link]
Called by the browser or applet viewer to inform this applet that it has been loaded into the system.
initialize(DSAParams, SecureRandom). Method in interface [Link]
va
Initializes the key pair generator using p, q and g, the DSA family parameters.
initialize(int). Method in class [Link]
Initializes the key pair generator for a certain strength using a system-provided source of randomness.
initialize(int, boolean, SecureRandom). Method in interface [Link]
Initializes the key pair generator for a given modulus length, without parameters.
initialize(int, SecureRandom). Method in class [Link]
Initializes the key pair generator for a certain strength.
initSign(PrivateKey). Method in class [Link]
Initialize this object for signing.
initVerify(PublicKey). Method in class [Link]
ja

Initializes this object for verification.


InputStream(). Constructor for class [Link]
InputStreamReader(InputStream). Constructor for class [Link]
Create an InputStreamReader that uses the default character encoding.
InputStreamReader(InputStream, String). Constructor for class [Link]
Create an InputStreamReader that uses the named character encoding.
inScope(). Method in class [Link]
w.

Return whether variable is in scope.


INSERT. Static variable in class [Link]
The Insert key.
insert(int, boolean). Method in class [Link]
Inserts the string representation of the boolean argument into this string buffer.
insert(int, char). Method in class [Link]
Inserts the string representation of the char argument into this string buffer.
insert(int, char[]). Method in class [Link]
Inserts the string representation of the char array argument into this string buffer.
insert(int, double). Method in class [Link]
ww

Inserts the string representation of the double argument into this string buffer.
insert(int, float). Method in class [Link]
Inserts the string representation of the float argument into this string buffer.
insert(int, int). Method in class [Link]
Inserts the string representation of the second int argument into this string buffer.
insert(int, long). Method in class [Link]
Inserts the string representation of the long argument into this string buffer.
insert(int, Object). Method in class [Link]
Inserts the string representation of the Object argument into this string buffer.
insert(int, String). Method in class [Link]
Inserts the string into this string buffer.
insert(MenuItem, int). Method in class [Link]

360
361

Inserts the MenuItem to this menu at the specified position.


insert(String, int). Method in class [Link]
Inserts the item into this choice at the specified position.

m
insert(String, int). Method in class [Link]
Inserts an item with the specified label to this menu at the specified position.
insert(String, int). Method in class [Link]
Inserts the specified text at the specified position.
insert(String, int). Method in interface [Link]
insertElementAt(Object, int). Method in class [Link]
Inserts the specified object as a component in this vector at the specified index.
insertProviderAt(Provider, int). Static method in class [Link]

o
Adds a new provider, at a specified position.
insertSeparator(int). Method in class [Link]
Inserts a separator at the specified position
insertText(String, int). Method in class [Link]
insertText(String, int). Method in interface [Link]

i.c
DEPRECATED: Replaced by insert(String, int).
insets. Variable in class [Link]
insets(). Method in class [Link]
insets(). Method in interface [Link]
DEPRECATED: Replaced by getInsets().
Insets(int, int, int, int). Constructor for class [Link]
Constructs and initializes a new Inset with the specified top, left, bottom, and right insets.
inside(int, int). Method in class [Link]
inside(int, int). Method in class [Link]
inside(int, int). Method in class [Link]

dil
instantiate(ClassLoader, String). Static method in class [Link]
Instantiate a bean.
InstantiationError(). Constructor for class [Link]
Constructs an InstantiationError with no detail message.
InstantiationError(String). Constructor for class [Link]
Constructs an InstantiationError with the specified detail message.
InstantiationException(). Constructor for class [Link]
Constructs an InstantiationException with no detail message.
InstantiationException(String). Constructor for class [Link]
Constructs an InstantiationException with the specified detail message.
intBitsToFloat(int). Static method in class [Link]
va
Returns the single-float corresponding to a given bit represention.
INTEGER. Static variable in class [Link]
Integer(int). Constructor for class [Link]
Constructs a newly allocated Integer object that represents the primitive int argument.
Integer(String). Constructor for class [Link]
Constructs a newly allocated Integer object that represents the value represented by the string.
INTEGER_FIELD. Static variable in class [Link]
Field constant used to construct a FieldPosition object.
INTERFACE. Static variable in class [Link]
intern(). Method in class [Link]
ja

Returns a canonical representation for the string object.


InternalError(). Constructor for class [Link]
Constructs an InternalError with no detail message.
InternalError(String). Constructor for class [Link]
Constructs an InternalError with the specified detail message.
internalGet(int). Method in class [Link]
Gets the value for a given time field.
w.

interrupt(). Method in class [Link]


Interrupts this thread.
interrupted(). Static method in class [Link]
Tests is the current thread has been interrupted.
InterruptedException(). Constructor for class [Link]
Constructs an InterruptedException with no detail message.
InterruptedException(String). Constructor for class [Link]
Constructs an InterruptedException with the specified detail message.
InterruptedIOException(). Constructor for class [Link]
Constructs an InterruptedIOException with no detail message.
ww

InterruptedIOException(String). Constructor for class [Link]


Constructs an InterruptedIOException with the specified detail message.
intersection(Rectangle). Method in class [Link]
Computes the intersection of two rectangles.
intersects(Rectangle). Method in class [Link]
Checks if two rectangles intersect.
IntrospectionException(String). Constructor for class [Link]
intValue(). Method in class [Link]
Converts this number to an int.
intValue(). Method in class [Link]
Converts this number to an int.
intValue(). Method in class [Link]

361
362

Returns the value of this Byte as an int.


intValue(). Method in class [Link]
Returns the integer value of this Double (by casting to an int).

m
intValue(). Method in class [Link]
Returns the integer value of this Float (by casting to an int).
intValue(). Method in class [Link]
Returns the value of this Integer as an int.
intValue(). Method in class [Link]
Returns the value of this Long as an int.
intValue(). Method in class [Link]
Returns the value of the specified number as an int.

o
intValue(). Method in class [Link]
Returns the value of this Short as an int.
invalidate(). Method in class [Link]
Invalidates the component.
invalidate(). Method in class [Link]

i.c
Invalidates the container.
invalidateLayout(Container). Method in class [Link]
Invalidates the layout, indicating that if the layout manager has cached information it should be discarded.
invalidateLayout(Container). Method in class [Link]
Invalidates the layout, indicating that if the layout manager has cached information it should be discarded.
invalidateLayout(Container). Method in class [Link]
Invalidates the layout, indicating that if the layout manager has cached information it should be discarded.
invalidateLayout(Container). Method in interface [Link].LayoutManager2
Invalidates the layout, indicating that if the layout manager has cached information it should be discarded.
InvalidClassException(String). Constructor for class [Link]

dil
Report a InvalidClassException for the specified reason.
InvalidClassException(String, String). Constructor for class [Link]
InvalidKeyException(). Constructor for class [Link]
Constructs an InvalidKeyException with no detail message.
InvalidKeyException(String). Constructor for class [Link]
Constructs an InvalidKeyException with the specified detail message.
InvalidObjectException(String). Constructor for class [Link]
Raised by a class when it is explicitly disallowing itself to be serialized.
InvalidParameterException(). Constructor for class [Link]
Constructs an InvalidParameterException with no detail message.
InvalidParameterException(String). Constructor for class [Link]
va
Constructs an InvalidParameterException with the specified detail message.
InvocationTargetException(). Constructor for class [Link]
InvocationTargetException(Throwable). Constructor for class [Link]
Constructs a InvocationTargetException with a target exception.
InvocationTargetException(Throwable, String). Constructor for class [Link]
Constructs a InvocationTargetException with a target exception and a detail message.
invoke(Object, Object[]). Method in class [Link]
Invokes the underlying method represented by this Method object, on the specified object with the specified parameters.
invoke(RemoteCall). Method in interface [Link]
Executes the remote call.
ja

IOException(). Constructor for class [Link]


Constructs an IOException with no detail message.
IOException(String). Constructor for class [Link]
Constructs an IOException with the specified detail message.
ipadx. Variable in class [Link]
ipady. Variable in class [Link]
isAbsolute(). Method in class [Link]
w.

Tests if the file represented by this File object is an absolute pathname.


isAbstract(int). Static method in class [Link]
Return true if the specifier integer includes the abstract modifier.
isActionKey(). Method in class [Link]
Returns whether or not the key in this event is an "action" key.
isActive(). Method in class [Link]
Determines if this applet is active.
isActive(). Method in interface [Link]
Determines if the applet is active.
isAlive(). Method in class [Link]
ww

Tests if this thread is alive.


isAltDown(). Method in class [Link]
Returns whether or not the Alt modifier is down on this event.
isAncestorOf(Component). Method in class [Link]
Checks if the component is contained in the component hierarchy of this container.
isArray(). Method in class [Link]
If this Class object represents an array type, returns true, otherwise returns false.
isAssignableFrom(Class). Method in class [Link]
Determines if the class or interface represented by this Class object is either the same as, or is a superclass or superinterface
of, the class or interface represented by the specified Class parameter.
isAutoIncrement(int). Method in interface [Link]
Is the column automatically numbered, thus read-only?

362
363

isBold(). Method in class [Link]


Returns true if the font is bold.
isBound(). Method in class [Link]

m
Updates to "bound" properties will cause a "PropertyChange" event to get fired when the property is changed.
isCaseSensitive(int). Method in interface [Link]
Does a column's case matter?
isCatalogAtStart(). Method in interface [Link]
Does a catalog appear at the start of a qualified table name? (Otherwise it appears at the end)
isClosed(). Method in interface [Link]
Tests to see if a Connection is closed.
isConstrained(). Method in class [Link]

o
Attempted updates to "Constrained" properties will cause a "VetoableChange" event to get fired when the property is
changed.
isConsumed(). Method in class [Link]
isConsumed(). Method in class [Link]
Returns whether or not this event has been consumed.

i.c
isConsumer(ImageConsumer). Method in class [Link]
Determines whether an ImageConsumer is on the list of consumers currently interested in data for this image.
isConsumer(ImageConsumer). Method in interface [Link]
This method determines if a given ImageConsumer object is currently registered with this ImageProducer as one of its
consumers.
isConsumer(ImageConsumer). Method in class [Link]
Determine if an ImageConsumer is on the list of consumers currently interested in data for this image.
isControlDown(). Method in class [Link]
Returns whether or not the Control modifier is down on this event.
isCurrency(int). Method in interface [Link]

dil
Is the column a cash value?
isDaemon(). Method in class [Link]
Tests if this thread is a daemon thread.
isDaemon(). Method in class [Link]
Tests if this thread group is a daemon thread group.
isDataFlavorSupported(DataFlavor). Method in class [Link]
Returns whether the requested flavor is supported by this object.
isDataFlavorSupported(DataFlavor). Method in interface [Link]
Returns whether or not the specified data flavor is supported for this object.
isDecimalSeparatorAlwaysShown(). Method in class [Link]
Allows you to get the behavior of the decimal separator with integers.
va
isDefined(char). Static method in class [Link]
Determines if a character has a defined meaning in Unicode.
isDefinitelyWritable(int). Method in interface [Link]
Will a write on the column definitely succeed?
isDesignTime(). Static method in class [Link]
Test if we are in design-mode.
isDestroyed(). Method in class [Link]
Tests if this thread group has not been destroyed.
isDigit(char). Static method in class [Link]
Determines if the specified character is a digit.
ja

isDirectory(). Method in class [Link]


Tests if the file represented by this File object is a directory.
isDirectory(). Method in class [Link]
Returns true if this is a directory entry.
isEditable(). Method in class [Link]
Returns the boolean indicating whether this TextComponent is editable or not.
isEmpty(). Method in class [Link]
w.

Tests if this dictionary maps no keys to value.


isEmpty(). Method in class [Link]
Tests if this hashtable maps no keys to values.
isEmpty(). Method in class [Link]
Determines whether the rectangle is empty.
isEmpty(). Method in class [Link]
Tests if this vector has no components.
isEnabled(). Method in class [Link]
Checks if this Component is enabled.
isEnabled(). Method in class [Link]
ww

Checks whether the menu item is enabled.


isEqual(byte[], byte[]). Static method in class [Link]
Compares two digests for equality.
isErrorAny(). Method in class [Link]
Checks the error status of all of the images.
isErrorID(int). Method in class [Link]
Checks the error status of all of the images with the specified ID.
isExpert(). Method in class [Link]
The "expert" flag is used to distinguish between those features that are intended for expert users from those that are intended
for normal users.
isFile(). Method in class [Link]
Tests if the file represented by this File object is a "normal" file.

363
364

isFinal(int). Static method in class [Link]


Return true if the specifier integer includes the final modifier.
isFocusTraversable(). Method in class [Link]

m
Returns whether this component can be traversed using Tab or Shift-Tab keyboard focus traversal.
isFocusTraversable(). Method in interface [Link]
isGroupingUsed(). Method in class [Link]
Returns true if grouping is used in this format.
isGuiAvailable(). Static method in class [Link]
isHidden(). Method in class [Link]
The "hidden" flag is used to identify features that are intended only for tool use, and which should not be exposed to humans.
isIdentifierIgnorable(char). Static method in class [Link]

o
Determines if the specified character should be regarded as an ignorable character in a Java identifier or a Unicode identifier.
isInDefaultEventSet(). Method in class [Link]
Report if an event set is in the "default set".
isIndexSelected(int). Method in class [Link]
Returns true if the item at the specified index has been selected; false otherwise.

i.c
isInfinite(). Method in class [Link]
Returns true if this Double value is infinitely large in magnitude.
isInfinite(). Method in class [Link]
Returns true if this Float value is infinitely large in magnitude.
isInfinite(double). Static method in class [Link]
Returns true if the specified number is infinitely large in magnitude.
isInfinite(float). Static method in class [Link]
Returns true if the specified number is infinitely large in magnitude.
isInstance(Object). Method in class [Link]
This method is the dynamic equivalent of the Java language instanceof operator.

dil
isInstanceOf(Object, Class). Static method in class [Link]
Check if a bean can be viewed as a given target type.
isInterface(). Method in class [Link]
Determines if the specified Class object represents an interface type.
isInterface(). Method in class [Link]
Is this RemoteClass an interface?
isInterface(int). Static method in class [Link]
Return true if the specifier integer includes the interface modifier.
isInterrupted(). Method in class [Link]
Tests if the current thread has been interrupted.
isISOControl(char). Static method in class [Link]
va
Determines if the specified character is an ISO control character.
isItalic(). Method in class [Link]
Returns true if the font is italic.
isJavaIdentifierPart(char). Static method in class [Link]
Determines if the specified character may be part of a Java identifier as other than the first character.
isJavaIdentifierStart(char). Static method in class [Link]
Determines if the specified character is permissible as the first character in a Java identifier.
isJavaLetter(char). Static method in class [Link]
Determines if the specified character is a "Java" letter, that is, the character is permissible as the first character in an identifier
in the Java language.
ja

isJavaLetterOrDigit(char). Static method in class [Link]


Determines if the specified character is a "Java" letter or digit, that is, the character is permissible as a non-initial character in
an identifier in the Java language.
isLeapYear(int). Method in class [Link]
Determines if the given year is a leap year.
isLenient(). Method in class [Link]
Tell whether date/time interpretation is to be lenient.
w.

isLenient(). Method in class [Link]


Tell whether date/time parsing is to be lenient.
isLetter(char). Static method in class [Link]
Determines if the specified character is a letter.
isLetterOrDigit(char). Static method in class [Link]
Determines if the specified character is a letter or digit.
isLowerCase(char). Static method in class [Link]
Determines if the specified character is a lowercase character.
isMember(Principal). Method in interface [Link]
Returns true if the passed principal is a member of the group.
ww

isMetaDown(). Method in class [Link]


Returns whether or not the Meta modifier is down on this event.
isMimeTypeEqual(DataFlavor). Method in class [Link]
Convenience function equivalent to calling: isMimeTypeEqual([Link]());
isMimeTypeEqual(String). Method in class [Link]
Is the string representation of the MIME type passed in equivalent to the MIME type of this DataFlavor.
isModal(). Method in class [Link]
Returns true if the Dialog is modal.
isMulticastAddress(). Method in class [Link]
Utility routine to check if the InetAddress is a IP multicast address.
isMultipleMode(). Method in class [Link]
Returns true if this list allows multiple selections.

364
365

isNaN(). Method in class [Link]


Returns true if this Double value is the special Not-a-Number (NaN) value.
isNaN(). Method in class [Link]

m
Returns true if this Float value is Not-a-Number (NaN).
isNaN(double). Static method in class [Link]
Returns true if the specified number is the special Not-a-Number (NaN) value.
isNaN(float). Static method in class [Link]
Returns true if the specified number is the special Not-a-Number (NaN) value.
isNative(int). Static method in class [Link]
Return true if the specifier integer includes the native modifier.
isNegative(). Method in interface [Link]

o
Returns true if this is a negative ACL entry (one denying the associated principal the set of permissions in the entry), false
otherwise.
isNullable(int). Method in interface [Link]
Can you put a NULL in this column?
isObject(). Method in class [Link]

i.c
Returns whether the RemoteValue is an Object (as opposed to a primitive type, such as int).
isOwner(Principal). Method in interface [Link]
Returns true if the given principal is an owner of the ACL.
isPaintable(). Method in interface [Link]
isPaintable(). Method in class [Link]
isParseIntegerOnly(). Method in class [Link]
Returns true if this format will parse numbers as integers only.
isPlain(). Method in class [Link]
Returns true if the font is plain.
isPopupTrigger(). Method in class [Link]

dil
Returns whether or not this mouse event is the popup-menu trigger event for the platform.
isPrimitive(). Method in class [Link]
Determines if the specified Class object represents a primitive Java type.
isPrivate(int). Static method in class [Link]
Return true if the specifier integer includes the private modifier.
isProbablePrime(int). Method in class [Link]
Returns true if this BigInteger is probably prime, false if it's definitely composite.
isProtected(int). Static method in class [Link]
Return true if the specifier integer includes the protected modifier.
isPublic(int). Static method in class [Link]
Return true if the specified integer includes the public modifier.
va
isReadOnly(). Method in interface [Link]
Tests to see if the connection is in read-only mode.
isReadOnly(). Method in interface [Link]
Is the database in read-only mode?
isReadOnly(int). Method in interface [Link]
Is a column definitely not writable?
isResizable(). Method in class [Link]
Returns true if the user can resize the dialog.
isResizable(). Method in class [Link]
Returns true if the user can resize the Frame.
ja

isSearchable(int). Method in interface [Link]


Can the column be used in a where clause?
isSelected(int). Method in class [Link]
isSet. Variable in class [Link]
The flags which tell if a specified time field for the calendar is set.
isSet(int). Method in class [Link]
Determines if the given time field has a value set.
w.

isShiftDown(). Method in class [Link]


Returns whether or not the Shift modifier is down on this event.
isShowing(). Method in class [Link]
Checks if this Component is showing on screen.
isShowing(). Method in class [Link]
Checks if this Window is showing on screen.
isSigned(int). Method in interface [Link]
Is the column a signed number?
isSpace(char). Static method in class [Link]
Determines if the specified character is ISO-LATIN-1 white space.
ww

isSpaceChar(char). Static method in class [Link]


Determines if the specified character is a Unicode space character.
isStatic(). Method in class [Link]
Returns whether the field is static (a class variable or method).
isStatic(int). Static method in class [Link]
Return true if the specifier integer includes the static modifier.
isString(). Method in class [Link]
Returns whether the RemoteValue is an instance of [Link].
isSuspended(). Method in class [Link]
Return whether this thread is suspended.
isSynchronized(int). Static method in class [Link]
Return true if the specifier integer includes the final modifier.

365
366

isTearOff(). Method in class [Link]


Returns true if this is a tear-off menu.
isTemporary(). Method in class [Link]

m
Returns whether or not this focus change event is a temporary change.
isTimeSet. Variable in class [Link]
The flag which indicates if the current time is set for the calendar.
isTitleCase(char). Static method in class [Link]
Determines if the specified character is a titlecase character.
isTransient(int). Static method in class [Link]
Return true if the specifier integer includes the transient modifier.
isUnicast(). Method in class [Link]

o
Normally event sources are multicast.
isUnicodeIdentifierPart(char). Static method in class [Link]
Determines if the specified character may be part of a Unicode identifier as other than the first character.
isUnicodeIdentifierStart(char). Static method in class [Link]
Determines if the specified character is permissible as the first character in a Unicode identifier.

i.c
isUnique(). Static method in class [Link]
Return true if an accurate address can be determined for this host.
isUpperCase(char). Static method in class [Link]
Determines if the specified character is an uppercase character.
isValid(). Method in class [Link]
Checks if this Component is valid.
isVisible(). Method in class [Link]
Checks if this Component is visible.
isVolatile(int). Static method in class [Link]
Return true if the specifier integer includes the volatile modifier.

dil
isWhitespace(char). Static method in class [Link]
Determines if the specified character is white space according to Java.
isWritable(int). Method in interface [Link]
Is it possible for a write on the column to succeed?
ITALIAN. Static variable in class [Link]
Useful constant for language.
ITALIC. Static variable in class [Link]
The italicized style constant.
ITALY. Static variable in class [Link]
Useful constant for country.
ITEM_EVENT_MASK. Static variable in class [Link]
va
The event mask for selecting item events.
ITEM_FIRST. Static variable in class [Link]
Marks the first integer id for the range of item event ids.
ITEM_LAST. Static variable in class [Link]
Marks the last integer id for the range of item event ids.
ITEM_STATE_CHANGED. Static variable in class [Link]
The item state changed event type.
ItemEvent(ItemSelectable, int, Object, int). Constructor for class [Link]
Constructs a ItemSelectEvent object with the specified ItemSelectable source, type, item, and item select state.
itemStateChanged(ItemEvent). Method in class [Link]
ja

Handles the itemStateChanged event by invoking the itemStateChanged methods on listener-a and listener-b.
itemStateChanged(ItemEvent). Method in interface [Link]
Invoked when an item's state has been changed.
itrace(boolean). Method in class [Link]
Turn on/off instruction tracing.
w.

JANUARY. Static variable in class [Link]


Useful constant for month.
JAPAN. Static variable in class [Link]
Useful constant for country.
JAPANESE. Static variable in class [Link]
Useful constant for language.
jdbcCompliant(). Method in interface [Link]
ww

Report whether the Driver is a genuine JDBC COMPLIANT (tm) driver.


join(). Method in class [Link]
Waits for this thread to die.
join(InetAddress). Method in class [Link]
Join the multicast group.
join(long). Method in class [Link]
Waits at most millis milliseconds for this thread to die.
join(long, int). Method in class [Link]
Waits at most millis milliseconds plus nanos nanoseconds for this thread to die.
joinGroup(InetAddress). Method in class [Link]
Joins a multicast group.
JULY. Static variable in class [Link]

366
367

Useful constant for month.


JUNE. Static variable in class [Link]
Useful constant for month.

m
K

key. Variable in class [Link]


The key code that was pressed in a keyboard event.
KEY_ACTION. Static variable in class [Link]

o
The action-key press keyboard event.
KEY_ACTION_RELEASE. Static variable in class [Link]
The action-key release keyboard event.
KEY_EVENT_MASK. Static variable in class [Link]
The event mask for selecting key events.

i.c
KEY_FIRST. Static variable in class [Link]
Marks the first integer id for the range of key event ids.
KEY_LAST. Static variable in class [Link]
Marks the last integer id for the range of key event ids.
KEY_PRESS. Static variable in class [Link]
The key press keyboard event.
KEY_PRESSED. Static variable in class [Link]
The key pressed event type.
KEY_RELEASE. Static variable in class [Link]
The key release keyboard event.

dil
KEY_RELEASED. Static variable in class [Link]
The key released event type.
KEY_TYPED. Static variable in class [Link]
The key typed event type.
KeyAdapter(). Constructor for class [Link]
keyDown(Event, int). Method in class [Link]
KeyEvent(Component, int, long, int, int). Constructor for class [Link]
KeyEvent(Component, int, long, int, int, char). Constructor for class [Link]
Constructs a KeyEvent object with the specified source component, type, modifiers, and key.
KeyException(). Constructor for class [Link]
Constructs a KeyException with no detail message.
va
KeyException(String). Constructor for class [Link]
Constructs a KeyException with the specified detail message.
KeyManagementException(). Constructor for class [Link]
Constructs a KeyManagementException with no detail message.
KeyManagementException(String). Constructor for class [Link]
Constructs a KeyManagementException with the specified detail message.
KeyPair(PublicKey, PrivateKey). Constructor for class [Link]
Constructs a key with the specified public key and private key.
KeyPairGenerator(String). Constructor for class [Link]
Creates a KeyPairGenerator object for the specified algorithm.
ja

keyPressed(KeyEvent). Method in class [Link]


Handles the keyPressed event by invoking the keyPressed methods on listener-a and listener-b.
keyPressed(KeyEvent). Method in class [Link]
keyPressed(KeyEvent). Method in interface [Link]
Invoked when a key has been pressed.
keyReleased(KeyEvent). Method in class [Link]
Handles the keyReleased event by invoking the keyReleased methods on listener-a and listener-b.
w.

keyReleased(KeyEvent). Method in class [Link]


keyReleased(KeyEvent). Method in interface [Link]
Invoked when a key has been released.
keys(). Method in class [Link]
Returns an enumeration of the keys in this dictionary.
keys(). Method in class [Link]
Returns an enumeration of the keys in this hashtable.
keyTyped(KeyEvent). Method in class [Link]
Handles the keyTyped event by invoking the keyTyped methods on listener-a and listener-b.
keyTyped(KeyEvent). Method in class [Link]
ww

keyTyped(KeyEvent). Method in interface [Link]


Invoked when a key has been typed.
keyUp(Event, int). Method in class [Link]
KOREA. Static variable in class [Link]
Useful constant for country.
KOREAN. Static variable in class [Link]
Useful constant for language.

367
368

Label(). Constructor for class [Link]


Constructs an empty label.
Label(String). Constructor for class [Link]

m
Constructs a new label with the specified String of text.
Label(String, int). Constructor for class [Link]
Constructs a new label with the specified String of text and the specified alignment.
last(). Method in class [Link]
Return the last boundary.
last(). Method in interface [Link]
Set the position to getEndIndex()-1, return the character at that position.
last(). Method in class [Link]

o
Set the position to getEndIndex() and return the character at that position.
last(Container). Method in class [Link]
Flips to the last card of the specified container.
lastElement(). Method in class [Link]
Returns the last component of the vector.

i.c
lastIndexOf(int). Method in class [Link]
Returns the index within this string of the last occurrence of the specified character.
lastIndexOf(int, int). Method in class [Link]
Returns the index within this string of the last occurrence of the specified character, searching backward starting at the
specified index.
lastIndexOf(Object). Method in class [Link]
Returns the index of the last occurrence of the specified object in this vector.
lastIndexOf(Object, int). Method in class [Link]
Searches backwards for the specified object, starting from the specified index, and returns an index to it.
lastIndexOf(String). Method in class [Link]

dil
Returns the index within this string of the rightmost occurrence of the specified substring.
lastIndexOf(String, int). Method in class [Link]
Returns the index within this string of the last occurrence of the specified substring.
lastModified(). Method in class [Link]
Returns the time that the file represented by this File object was last modified.
LastOwnerException(). Constructor for class [Link]
Constructs a LastOwnerException.
lastPageFirst(). Method in class [Link]
Returns true if the last page will be printed first.
layout(). Method in class [Link]
layout(). Method in class [Link]
va
layout(). Method in class [Link]
layoutContainer(Container). Method in class [Link]
Lays out the specified container.
layoutContainer(Container). Method in class [Link]
Performs a layout in the specified panel.
layoutContainer(Container). Method in class [Link]
Lays out the container.
layoutContainer(Container). Method in class [Link]
Lays out the container in the specified panel.
layoutContainer(Container). Method in class [Link]
ja

Lays out the container in the specified panel.


layoutContainer(Container). Method in interface [Link]
Lays out the container in the specified panel.
layoutInfo. Variable in class [Link]
Lease(VMID, long). Constructor for class [Link]
Constructs a lease with a specific VMID and lease duration.
leave(InetAddress). Method in class [Link]
w.

Leave the multicast group.


leaveGroup(InetAddress). Method in class [Link]
Leave a multicast group.
LEFT. Static variable in class [Link]
The left arrow action-key.
LEFT. Static variable in class [Link]
The left alignment variable.
left. Variable in class [Link]
The inset from the left.
LEFT. Static variable in class [Link]
ww

The left alignment.


LEFT_ALIGNMENT. Static variable in class [Link]
Ease of use constant for getAlignmentX().
len. Variable in class [Link]
Length of input buffer.
length. Variable in class [Link]
The number of bytes available to be read in the current buffer.
length(). Method in class [Link]
Returns the length of the file represented by this File object.
length(). Method in class [Link]
Returns the length of this file.
length(). Method in class [Link]

368
369

Returns the length of this string.


length(). Method in class [Link]
Returns the length (character count) of this string buffer.

m
LETTER_NUMBER. Static variable in class [Link]
lightGray. Static variable in class [Link]
The color light gray.
LINE_SEPARATOR. Static variable in class [Link]
lineno(). Method in class [Link]
Return the current line number.
LineNumberInputStream(InputStream). Constructor for class [Link]
Constructs a newline number input stream that reads its input from the specified input stream.

o
LineNumberReader(Reader). Constructor for class [Link]
Create a new line-numbering reader, using the default input-buffer size.
LineNumberReader(Reader, int). Constructor for class [Link]
Create a new line-numbering reader, reading characters into a buffer of the given size.
LinkageError(). Constructor for class [Link]

i.c
Constructs a LinkageError with no detail message.
LinkageError(String). Constructor for class [Link]
Constructs a LinkageError with the specified detail message.
list(). Method in class [Link]
Prints a listing to [Link].
list(). Method in class [Link]
Returns a list of the files in the directory specified by this File object.
List(). Constructor for class [Link]
Creates a new scrolling list initialized with no visible Lines or multiple selections.
list(). Method in interface [Link]

dil
Returns an array of the names in the registry.
list(). Method in class [Link]
Prints information about this thread group to the standard output.
list(FilenameFilter). Method in class [Link]
Returns a list of the files in the directory specified by this File that satisfy the specified filter.
List(int). Constructor for class [Link]
Creates a new scrolling list initialized with the specified number of visible lines and a boolean stating whether multiple
selections are allowed or not.
List(int, boolean). Constructor for class [Link]
Creates a new scrolling list initialized with the specified number of visible lines and a boolean stating whether multiple
selections are allowed or not.
va
list(PrintStream). Method in class [Link]
Prints a listing to the specified print stream.
list(PrintStream). Method in class [Link]
Prints this property list out to the specified output stream.
list(PrintStream, int). Method in class [Link]
Prints out a list, starting at the specified indention, to the specified print stream.
list(PrintStream, int). Method in class [Link]
Prints out a list, starting at the specified indention, to the specified out stream.
list(PrintWriter). Method in class [Link]
Prints a listing to the specified print writer.
ja

list(PrintWriter). Method in class [Link]


Prints this property list out to the specified output stream.
list(PrintWriter, int). Method in class [Link]
Prints out a list, starting at the specified indention, to the specified print writer.
list(PrintWriter, int). Method in class [Link]
Prints out a list, starting at the specified indention, to the specified print writer.
list(String). Static method in class [Link]
w.

Returns an array of strings of the URLs in the registry.


LIST_DESELECT. Static variable in class [Link]
LIST_SELECT. Static variable in class [Link]
listBreakpoints(). Method in class [Link]
Return a list of the breakpoints which are currently set.
listClasses(). Method in class [Link]
List the currently known classes.
listen(int). Method in class [Link]
Sets the maximum queue length for incoming connection indications (a request to connect) to the count argument.
ListResourceBundle(). Constructor for class [Link]
ww

listThreadGroups(RemoteThreadGroup). Method in class [Link]


List threadgroups
listThreads(boolean). Method in class [Link]
List a threadgroup's threads
LOAD. Static variable in class [Link]
The file load variable.
load(InputStream). Method in class [Link]
Reads a property list from an input stream.
load(String). Method in class [Link]
Loads the specified filename as a dynamic library.
load(String). Static method in class [Link]
Loads the specified filename as a dynamic library.

369
370

LOAD_FILE. Static variable in class [Link]


A file loading event.
loadClass(String). Method in class [Link]

m
Requests the class loader to load a class with the specified name.
loadClass(String). Method in interface [Link]
Load class using [Link] property.
loadClass(String). Static method in class [Link]
Load a class from the URL specified in the [Link] property.
loadClass(String, boolean). Method in class [Link]
Resolves the specified name to a Class.
loadClass(URL, String). Method in interface [Link]

o
Load class from codebase URL specified.
loadClass(URL, String). Static method in class [Link]
Load a class from a URL.
loadImage(String). Method in class [Link]
This is a utility method to help in loading icon images.

i.c
LOADING. Static variable in class [Link]
Flag indicating some media is currently being loaded.
loadLibrary(String). Method in class [Link]
Loads the dynamic library with the specified library name.
loadLibrary(String). Static method in class [Link]
Loads the system library specified by the libname argument.
loadSystemColors(int[]). Method in class [Link]
Fills in the provided int array with the current system color values
locale. Variable in class [Link]
The locale for the component.

dil
Locale(String, String). Constructor for class [Link]
Construct a locale from language, country.
Locale(String, String, String). Constructor for class [Link]
Construct a locale from language, country, variant.
localPort. Variable in class [Link]
localport. Variable in class [Link]
The local port number to which this socket is connected.
locate(int, int). Method in class [Link]
locate(int, int). Method in class [Link]
location(). Method in class [Link]
location(int, int). Method in class [Link]
va
lock. Variable in class [Link]
The object used to synchronize operations on this stream.
lock. Variable in class [Link]
The object used to synchronize operations on this stream.
log(double). Static method in class [Link]
Returns the natural logarithm (base e) of a double value.
log(String). Static method in class [Link]
Return the LogStream identified by the given name.
LONG. Static variable in class [Link]
Constant for long style pattern.
ja

Long(long). Constructor for class [Link]


Constructs a newly allocated Long object that represents the primitive long argument.
Long(String). Constructor for class [Link]
Constructs a newly allocated Long object that represents the value represented by the string.
longBitsToDouble(long). Static method in class [Link]
Returns the double-float corresponding to a given bit represention.
longValue(). Method in class [Link]
w.

Converts this number to a long.


longValue(). Method in class [Link]
Converts this number to a long.
longValue(). Method in class [Link]
Returns the value of this Byte as a long.
longValue(). Method in class [Link]
Returns the long value of this Double (by casting to a long).
longValue(). Method in class [Link]
Returns the long value of this Float (by casting to a long).
longValue(). Method in class [Link]
ww

Returns the value of this Integer as a long.


longValue(). Method in class [Link]
Returns the value of this Long as a long.
longValue(). Method in class [Link]
Returns the value of the specified number as a long.
longValue(). Method in class [Link]
Returns the value of this Short as a long.
LONGVARBINARY. Static variable in class [Link]
LONGVARCHAR. Static variable in class [Link]
lookup(Class). Static method in class [Link]
Find the descriptor for a class that can be serialized.
lookup(String). Static method in class [Link]

370
371

Returns the remote object for the URL.


lookup(String). Method in interface [Link]
Returns the remote object associated with the specified name in the registry.

m
lookupConstraints(Component). Method in class [Link]
Retrieves the constraints for the specified component.
loop(). Method in interface [Link]
Starts playing this audio clip in a loop.
LOST_FOCUS. Static variable in class [Link]
A component lost the focus.
lostFocus(Event, Object). Method in class [Link]
lostOwnership(Clipboard, Transferable). Method in interface [Link]

o
Notifies this object that it is no longer the owner of the contents of the clipboard.
lostOwnership(Clipboard, Transferable). Method in class [Link]
LOWERCASE_LETTER. Static variable in class [Link]
lowerCaseMode(boolean). Method in class [Link]
Determines whether or not word token are automatically lowercased.

i.c
M

magenta. Static variable in class [Link]


The color magneta.
makeVisible(int). Method in class [Link]
Forces the item at the specified index to be visible.
makeVisible(int). Method in interface [Link]

dil
MalformedURLException(). Constructor for class [Link]
Constructs a MalformedURLException with no detail message.
MalformedURLException(String). Constructor for class [Link]
Constructs a MalformedURLException with the specified detail message.
MARCH. Static variable in class [Link]
Useful constant for month.
mark. Variable in class [Link]
The currently marked position in the stream.
mark(int). Method in class [Link]
Marks the current position in this input stream.
mark(int). Method in class [Link]
va
Mark the present position in the stream.
mark(int). Method in class [Link]
Set the current marked position in the stream.
mark(int). Method in class [Link]
Mark the present position in the stream.
mark(int). Method in class [Link]
Marks the current position in this input stream.
mark(int). Method in class [Link]
Mark the present position in the stream.
mark(int). Method in class [Link]
ja

Marks the current position in this input stream.


mark(int). Method in class [Link]
Marks the current position in this input stream.
mark(int). Method in class [Link]
Mark the present position in the stream.
mark(int). Method in class [Link]
Mark the present position in the stream.
w.

mark(int). Method in class [Link]


Mark the present position in the stream.
markedPos. Variable in class [Link]
Position of mark in buffer
marklimit. Variable in class [Link]
The maximum read ahead allowed after a call to the mark method before subsequent calls to the reset method fail.
markpos. Variable in class [Link]
The value of the pos field at the time the last mark method was called.
markSupported(). Method in class [Link]
Tests if this input stream supports the mark and reset methods.
ww

markSupported(). Method in class [Link]


Tell whether this stream supports the mark() operation, which it does.
markSupported(). Method in class [Link]
Tests if ByteArrayInputStream supports mark/reset.
markSupported(). Method in class [Link]
Tell whether this stream supports the mark() operation, which it does.
markSupported(). Method in class [Link]
Tests if this input stream supports the mark and reset methods.
markSupported(). Method in class [Link]
Tell whether this stream supports the mark() operation.
markSupported(). Method in class [Link]
Tests if this input stream supports the mark and reset methods.

371
372

markSupported(). Method in class [Link]


Tests if the input stream supports the mark and reset methods.
markSupported(). Method in class [Link]

m
Tell whether this stream supports the mark() operation, which it does not.
markSupported(). Method in class [Link]
Tell whether this stream supports the mark() operation.
markSupported(). Method in class [Link]
Tell whether this stream supports the mark() operation, which it does.
MarshalException(String). Constructor for class [Link]
Create a new marshal exception with a descriptive string.
MarshalException(String, Exception). Constructor for class [Link]

o
Create a new marshal exception with a descriptive string and an exception.
MATH_SYMBOL. Static variable in class [Link]
max(BigDecimal). Method in class [Link]
Returns the BigDecimal whose value is the greater of this and val.
max(BigInteger). Method in class [Link]

i.c
Returns the BigInteger whose value is the greater of this and val.
max(double, double). Static method in class [Link]
Returns the greater of two double values.
max(float, float). Static method in class [Link]
Returns the greater of two float values.
max(int, int). Static method in class [Link]
Returns the greater of two int values.
max(long, long). Static method in class [Link]
Returns the greater of two long values.
MAX_PRIORITY. Static variable in class [Link]

dil
The maximum priority that a thread can have.
MAX_RADIX. Static variable in class [Link]
The maximum radix available for conversion to and from Strings.
MAX_VALUE. Static variable in class [Link]
The maximum value a Byte can have.
MAX_VALUE. Static variable in class [Link]
The constant value of this field is the largest value of type char.
MAX_VALUE. Static variable in class [Link]
The largest positive value of type double.
MAX_VALUE. Static variable in class [Link]
The largest positive value of type float.
va
MAX_VALUE. Static variable in class [Link]
The largest value of type int.
MAX_VALUE. Static variable in class [Link]
The largest value of type long.
MAX_VALUE. Static variable in class [Link]
The maximum value a Short can have.
MAXGRIDSIZE. Static variable in class [Link]
maximumLayoutSize(Container). Method in class [Link]
Returns the maximum dimensions for this layout given the components in the specified target container.
maximumLayoutSize(Container). Method in class [Link]
ja

Returns the maximum dimensions for this layout given the components in the specified target container.
maximumLayoutSize(Container). Method in class [Link]
Returns the maximum dimensions for this layout given the components in the specified target container.
maximumLayoutSize(Container). Method in interface [Link].LayoutManager2
Returns the maximum size of this component.
MAY. Static variable in class [Link]
Useful constant for month.
w.

MediaTracker(Component). Constructor for class [Link]


Creates a Media tracker to track images for a given Component.
MEDIUM. Static variable in class [Link]
Constant for medium style pattern.
members(). Method in interface [Link]
Returns an enumeration of the members in the group.
MemoryImageSource(int, int, ColorModel, byte[], int, int). Constructor for class [Link]
Constructs an ImageProducer object which uses an array of bytes to produce data for an Image object.
MemoryImageSource(int, int, ColorModel, byte[], int, int, Hashtable). Constructor for class [Link]
Constructs an ImageProducer object which uses an array of bytes to produce data for an Image object.
ww

MemoryImageSource(int, int, ColorModel, int[], int, int). Constructor for class [Link]
Constructs an ImageProducer object which uses an array of integers to produce data for an Image object.
MemoryImageSource(int, int, ColorModel, int[], int, int, Hashtable). Constructor for class [Link]
Constructs an ImageProducer object which uses an array of integers to produce data for an Image object.
MemoryImageSource(int, int, int[], int, int). Constructor for class [Link]
Constructs an ImageProducer object which uses an array of integers in the default RGB ColorModel to produce data for an
Image object.
MemoryImageSource(int, int, int[], int, int, Hashtable). Constructor for class [Link]
Constructs an ImageProducer object which uses an array of integers in the default RGB ColorModel to produce data for an
Image object.
MENU. Static variable in class [Link]
The array index for the menu background color.

372
373

menu. Static variable in class [Link]


The background color for menus.
Menu(). Constructor for class [Link]

m
Constructs a new Menu with an empty label.
Menu(String). Constructor for class [Link]
Constructs a new Menu with the specified label.
Menu(String, boolean). Constructor for class [Link]
Constructs a new Menu with the specified label.
MENU_TEXT. Static variable in class [Link]
The array index for the menu text color.
MenuBar(). Constructor for class [Link]

o
Creates a new menu bar.
MenuComponent(). Constructor for class [Link]
MenuItem(). Constructor for class [Link]
Constructs a new MenuItem with an empty label and no keyboard shortcut.
MenuItem(String). Constructor for class [Link]

i.c
Constructs a new MenuItem with the specified label and no keyboard shortcut.
MenuItem(String, MenuShortcut). Constructor for class [Link]
Create a MenuItem with an associated keyboard shortcut.
MenuShortcut(int). Constructor for class [Link]
Constructs a new MenuShortcut for the specified key.
MenuShortcut(int, boolean). Constructor for class [Link]
Constructs a new MenuShortcut for the specified key.
menuText. Static variable in class [Link]
The text color for menus.
MessageDigest(String). Constructor for class [Link]

dil
Creates a message digest with the specified algorithm name.
MessageFormat(String). Constructor for class [Link]
Constructs with the specified pattern.
META_MASK. Static variable in class [Link]
The meta modifier constant.
META_MASK. Static variable in class [Link]
The meta modifier constant.
META_MASK. Static variable in class [Link]
The meta key modifier constant.
metaDown(). Method in class [Link]
Checks if the meta key is down.
va
method. Variable in class [Link]
methodArgument(). Method in class [Link]
Return whether variable is a method argument.
MethodDescriptor(Method). Constructor for class [Link]
MethodDescriptor(Method, ParameterDescriptor[]). Constructor for class [Link]
MILLISECOND. Static variable in class [Link]
Useful constant for date and time.
MILLISECOND_FIELD. Static variable in class [Link]
Useful constant for MILLISECOND field alignment.
min(BigDecimal). Method in class [Link]
ja

Returns the BigDecimal whose value is the lesser of this and val.
min(BigInteger). Method in class [Link]
Returns the BigInteger whose value is the lesser of this and val.
min(double, double). Static method in class [Link]
Returns the smaller of two double values.
min(float, float). Static method in class [Link]
Returns the smaller of two float values.
w.

min(int, int). Static method in class [Link]


Returns the smaller of two int values.
min(long, long). Static method in class [Link]
Returns the smaller of two long values.
MIN_PRIORITY. Static variable in class [Link]
The minimum priority that a thread can have.
MIN_RADIX. Static variable in class [Link]
The minimum radix available for conversion to and from Strings.
MIN_VALUE. Static variable in class [Link]
The minimum value a Byte can have.
ww

MIN_VALUE. Static variable in class [Link]


The constant value of this field is the smallest value of type char.
MIN_VALUE. Static variable in class [Link]
The smallest positive value of type double.
MIN_VALUE. Static variable in class [Link]
The smallest positive value of type float.
MIN_VALUE. Static variable in class [Link]
The smallest value of type int.
MIN_VALUE. Static variable in class [Link]
The smallest value of type long.
MIN_VALUE. Static variable in class [Link]
The minimum value a Short can have.

373
374

minimumLayoutSize(Container). Method in class [Link]


Returns the minimum dimensions needed to layout the components contained in the specified target container.
minimumLayoutSize(Container). Method in class [Link]

m
Calculates the minimum size for the specified panel.
minimumLayoutSize(Container). Method in class [Link]
Returns the minimum dimensions needed to layout the components contained in the specified target container.
minimumLayoutSize(Container). Method in class [Link]
Returns the minimum dimensions needed to layout the components contained in the specified panel.
minimumLayoutSize(Container). Method in class [Link]
Returns the minimum dimensions needed to layout the components contained in the specified panel.
minimumLayoutSize(Container). Method in interface [Link]

o
Calculates the minimum size dimensions for the specified panel given the components in the specified parent container.
minimumSize(). Method in class [Link]
minimumSize(). Method in interface [Link]
DEPRECATED: Replaced by getMinimumSize().
minimumSize(). Method in class [Link]

i.c
minimumSize(). Method in class [Link]
minimumSize(). Method in class [Link]
minimumSize(). Method in class [Link]
minimumSize(int). Method in class [Link]
minimumSize(int). Method in interface [Link]
DEPRECATED: Replaced by getMinimumSize(int).
minimumSize(int). Method in class [Link]
minimumSize(int). Method in interface [Link]
DEPRECATED: Replaced by getMinimumSize(int).
minimumSize(int, int). Method in class [Link]

dil
minimumSize(int, int). Method in interface [Link]
DEPRECATED: Replaced by getMinimumSize(int, int).
MINSIZE. Static variable in class [Link]
MINUTE. Static variable in class [Link]
Useful constant for date and time.
MINUTE_FIELD. Static variable in class [Link]
Useful constant for MINUTE field alignment.
MissingResourceException(String, String, String). Constructor for class [Link]
Constructs a MissingResourceException with the specified information.
mkdir(). Method in class [Link]
Creates a directory whose pathname is specified by this File object.
va
mkdirs(). Method in class [Link]
Creates a directory whose pathname is specified by this File object, including any necessary parent directories.
mod(BigInteger). Method in class [Link]
Returns a BigInteger whose value is this mod m.
Modifier(). Constructor for class [Link]
MODIFIER_LETTER. Static variable in class [Link]
MODIFIER_SYMBOL. Static variable in class [Link]
modifiers. Variable in class [Link]
The state of the modifier keys.
modInverse(BigInteger). Method in class [Link]
ja

Returns modular multiplicative inverse of this, mod m.


modPow(BigInteger, BigInteger). Method in class [Link]
Returns a BigInteger whose value is (this ** exponent) mod m.
MONDAY. Static variable in class [Link]
Useful constant for days of week.
MONTH. Static variable in class [Link]
Useful constant for date and time.
w.

MONTH_FIELD. Static variable in class [Link]


Useful constant for MONTH field alignment.
MOUSE_CLICKED. Static variable in class [Link]
The mouse clicked event type.
MOUSE_DOWN. Static variable in class [Link]
The mouse down event.
MOUSE_DRAG. Static variable in class [Link]
The mouse drag event.
MOUSE_DRAGGED. Static variable in class [Link]
The mouse dragged event type.
ww

MOUSE_ENTER. Static variable in class [Link]


The mouse enter event.
MOUSE_ENTERED. Static variable in class [Link]
The mouse entered event type.
MOUSE_EVENT_MASK. Static variable in class [Link]
The event mask for selecting mouse events.
MOUSE_EXIT. Static variable in class [Link]
The mouse exit event.
MOUSE_EXITED. Static variable in class [Link]
The mouse exited event type.
MOUSE_FIRST. Static variable in class [Link]
Marks the first integer id for the range of mouse event ids.

374
375

MOUSE_LAST. Static variable in class [Link]


Marks the last integer id for the range of mouse event ids.
MOUSE_MOTION_EVENT_MASK. Static variable in class [Link]

m
The event mask for selecting mouse motion events.
MOUSE_MOVE. Static variable in class [Link]
The mouse move event.
MOUSE_MOVED. Static variable in class [Link]
The mouse moved event type.
MOUSE_PRESSED. Static variable in class [Link]
The mouse pressed event type.
MOUSE_RELEASED. Static variable in class [Link]

o
The mouse released event type.
MOUSE_UP. Static variable in class [Link]
The mouse up event.
MouseAdapter(). Constructor for class [Link]
mouseClicked(MouseEvent). Method in class [Link]

i.c
Handles the mouseClicked event by invoking the mouseClicked methods on listener-a and listener-b.
mouseClicked(MouseEvent). Method in class [Link]
mouseClicked(MouseEvent). Method in interface [Link]
Invoked when the mouse has been clicked on a component.
mouseDown(Event, int, int). Method in class [Link]
mouseDrag(Event, int, int). Method in class [Link]
mouseDragged(MouseEvent). Method in class [Link]
Handles the mouseDragged event by invoking the mouseDragged methods on listener-a and listener-b.
mouseDragged(MouseEvent). Method in class [Link]
mouseDragged(MouseEvent). Method in interface [Link]

dil
Invoked when a mouse button is pressed on a component and then dragged.
mouseEnter(Event, int, int). Method in class [Link]
mouseEntered(MouseEvent). Method in class [Link]
Handles the mouseEntered event by invoking the mouseEntered methods on listener-a and listener-b.
mouseEntered(MouseEvent). Method in class [Link]
mouseEntered(MouseEvent). Method in interface [Link]
Invoked when the mouse enters a component.
MouseEvent(Component, int, long, int, int, int, int, boolean). Constructor for class [Link]
Constructs a MouseEvent object with the specified source component, type, modifiers, coordinates, and click count.
mouseExit(Event, int, int). Method in class [Link]
mouseExited(MouseEvent). Method in class [Link]
va
Handles the mouseExited event by invoking the mouseExited methods on listener-a and listener-b.
mouseExited(MouseEvent). Method in class [Link]
mouseExited(MouseEvent). Method in interface [Link]
Invoked when the mouse exits a component.
MouseMotionAdapter(). Constructor for class [Link]
mouseMove(Event, int, int). Method in class [Link]
mouseMoved(MouseEvent). Method in class [Link]
Handles the mouseMoved event by invoking the mouseMoved methods on listener-a and listener-b.
mouseMoved(MouseEvent). Method in class [Link]
mouseMoved(MouseEvent). Method in interface [Link]
ja

Invoked when the mouse button has been moved on a component (with no buttons no down).
mousePressed(MouseEvent). Method in class [Link]
Handles the mousePressed event by invoking the mousePressed methods on listener-a and listener-b.
mousePressed(MouseEvent). Method in class [Link]
mousePressed(MouseEvent). Method in interface [Link]
Invoked when a mouse button has been pressed on a component.
mouseReleased(MouseEvent). Method in class [Link]
w.

Handles the mouseReleased event by invoking the mouseReleased methods on listener-a and listener-b.
mouseReleased(MouseEvent). Method in class [Link]
mouseReleased(MouseEvent). Method in interface [Link]
Invoked when a mouse button has been released on a component.
mouseUp(Event, int, int). Method in class [Link]
move(int, int). Method in class [Link]
move(int, int). Method in class [Link]
Changes the point to have the specified location.
move(int, int). Method in class [Link]
MOVE_CURSOR. Static variable in class [Link]
ww

The move cursor type.


MOVE_CURSOR. Static variable in class [Link]
movePointLeft(int). Method in class [Link]
Returns a BigDecimal which is equivalent to this one with the decimal point moved n places to the left.
movePointRight(int). Method in class [Link]
Moves the decimal point the specified number of places to the right.
MulticastSocket(). Constructor for class [Link]
Create a multicast socket.
MulticastSocket(int). Constructor for class [Link]
Create a multicast socket and bind it to a specific port.
multiply(BigDecimal). Method in class [Link]
Returns a BigDecimal whose value is (this * val), and whose scale is [Link]() + [Link].

375
376

multiply(BigInteger). Method in class [Link]


Returns a BigInteger whose value is (this * val).

m
N

N_RESIZE_CURSOR. Static variable in class [Link]


The north-resize cursor type.
N_RESIZE_CURSOR. Static variable in class [Link]
name. Variable in class [Link]

o
The name of the property.
name. Variable in class [Link]
The logical name of this font.
NaN. Static variable in class [Link]
A NaN value of type double.

i.c
NaN. Static variable in class [Link]
The NaN value of type float.
NATIVE. Static variable in class [Link]
nativeSQL(String). Method in interface [Link]
A driver may convert the JDBC sql grammar into its system's native SQL grammar prior to sending it; nativeSQL returns the
native form of the statement that the driver would have sent.
NE_RESIZE_CURSOR. Static variable in class [Link]
The north-east-resize cursor type.
NE_RESIZE_CURSOR. Static variable in class [Link]
needsDictionary(). Method in class [Link]

dil
Returns true if a preset dictionary is needed for decompression.
needsGui(). Method in interface [Link]
needsInput(). Method in class [Link]
Returns true if the input data buffer is empty and setInput() should be called in order to provide more input.
needsInput(). Method in class [Link]
Returns true if no data remains in the input buffer.
negate(). Method in class [Link]
Returns a BigDecimal whose value is -1 * this, and whose scale is [Link]().
negate(). Method in class [Link]
Returns a BigInteger whose value is (-1 * this).
NEGATIVE_INFINITY. Static variable in class [Link]
va
The negative infinity of type double.
NEGATIVE_INFINITY. Static variable in class [Link]
The negative infinity of type float.
NegativeArraySizeException(). Constructor for class [Link]
Constructs a NegativeArraySizeException with no detail message.
NegativeArraySizeException(String). Constructor for class [Link]
Constructs a NegativeArraySizeException with the specified detail message.
newCall(RemoteObject, Operation[], int, long). Method in interface [Link]
Creates an appropriate call object for a new remote method invocation on this object.
newInstance(). Method in class [Link]
ja

Creates a new instance of a class.


newInstance(Class, int). Static method in class [Link]
Creates a new array with the specified component type and length.
newInstance(Class, int[]). Static method in class [Link]
Creates a new array with the specified component type and dimensions.
newInstance(Object[]). Method in class [Link]
Uses the constructor represented by this Constructor object to create and initialize a new instance of the constructor's
w.

declaring class, with the specified initialization parameters.


newLine(). Method in class [Link]
Write a line separator.
newmodel. Variable in class [Link]
newPixels(). Method in class [Link]
Send a whole new buffer of pixels to any ImageConsumers that are currently interested in the data for this image and notify
them that an animation frame is complete.
newPixels(byte[], ColorModel, int, int). Method in class [Link]
Change to a new byte array to hold the pixels for this image.
newPixels(int, int, int, int). Method in class [Link]
ww

Send a rectangular region of the buffer of pixels to any ImageConsumers that are currently interested in the data for this image
and notify them that an animation frame is complete.
newPixels(int, int, int, int, boolean). Method in class [Link]
Send a rectangular region of the buffer of pixels to any ImageConsumers that are currently interested in the data for this image.
newPixels(int[], ColorModel, int, int). Method in class [Link]
Change to a new int array to hold the pixels for this image.
next(). Method in class [Link]
Return the boundary following the current boundary.
next(). Method in interface [Link]
Increment the iterator's index by one and return the character at the new index.
next(). Method in class [Link]
Get the ordering priority of the next character in the string.

376
377

next(). Method in class [Link]


Continue execution of this thread to the next line, but don't step into a method call.
next(). Method in interface [Link]

m
A ResultSet is initially positioned before its first row; the first call to next makes the first row the current row; the second call
makes the second row the current row, etc.
next(). Method in class [Link]
Increment the iterator's index by one and return the character at the new index.
next(Container). Method in class [Link]
Flips to the next card of the specified container.
next(int). Method in class [Link]
Return the nth boundary from the current boundary

o
next(int). Method in class [Link]
Generates the next pseudorandom number.
next(int). Method in class [Link]
Generates an integer containing the user-specified number of pseudo-random bits (right justified, with leading zeros).
nextBytes(byte[]). Method in class [Link]

i.c
Generates a user specified number of random bytes.
nextBytes(byte[]). Method in class [Link]
Generates a user-specified number of random bytes.
nextDouble(). Method in class [Link]
Returns the next pseudorandom, uniformly distributed double value between 0.0 and 1.0 from this random number
generator's sequence.
nextDouble(double). Static method in class [Link]
Finds the least double greater than d.
nextDouble(double, boolean). Static method in class [Link]
nextElement(). Method in interface [Link]

dil
Returns the next element of this enumeration.
nextElement(). Method in class [Link]
Returns the same value as the nextToken method, except that its declared return value is Object rather than String.
nextFloat(). Method in class [Link]
Returns the next pseudorandom, uniformly distributed float value between 0.0 and 1.0 from this random number
generator's sequence.
nextFocus(). Method in class [Link]
nextGaussian(). Method in class [Link]
Returns the next pseudorandom, Gaussian ("normally") distributed double value with mean 0.0 and standard deviation 1.0
from this random number generator's sequence.
nextInt(). Method in class [Link]
va
Returns the next pseudorandom, uniformly distributed int value from this random number generator's sequence.
nextLong(). Method in class [Link]
Returns the next pseudorandom, uniformly distributed long value from this random number generator's sequence.
nextToken(). Method in class [Link]
Parses the next token from the input stream of this tokenizer.
nextToken(). Method in class [Link]
Returns the next token from this string tokenizer.
nextToken(String). Method in class [Link]
Returns the next token in this string tokenizer's string.
NO_COMPRESSION. Static variable in class [Link]
ja

Compression level for no compression.


NO_DECOMPOSITION. Static variable in class [Link]
Decomposition mode value.
NoClassDefFoundError(). Constructor for class [Link]
Constructs a NoClassDefFoundError with no detail message.
NoClassDefFoundError(String). Constructor for class [Link]
Constructs a NoClassDefFoundError with the specified detail message.
w.

NON_SPACING_MARK. Static variable in class [Link]


NONE. Static variable in class [Link]
NORM_PRIORITY. Static variable in class [Link]
The default priority that is assigned to a thread.
normalizeMimeType(String). Method in class [Link]
Called for each MIME type string to give DataFlavor subtypes the opportunity to change how the normalization of MIME
types is accomplished.
normalizeMimeTypeParameter(String, String). Method in class [Link]
Called on DataFlavor for every MIME Type parameter to allow DataFlavor subclasses to handle special parameters like the
text/plain charset parameters, whose values are case insensitive.
ww

NoRouteToHostException(). Constructor for class [Link]


Construct a new NoRouteToHostException with no detailed message.
NoRouteToHostException(String). Constructor for class [Link]
Constructs a new NoRouteToHostException with the specified detail message as to why the remote host cannot be reached.
NORTH. Static variable in class [Link]
The north layout constraint.
NORTH. Static variable in class [Link]
NORTHEAST. Static variable in class [Link]
NORTHWEST. Static variable in class [Link]
NoSessionException(). Constructor for class [Link]
Constructor.
NoSessionException(String). Constructor for class [Link]

377
378

Constructor with a detail message.


NoSuchAlgorithmException(). Constructor for class [Link]
Constructs a NoSuchAlgorithmException with no detail message.

m
NoSuchAlgorithmException(String). Constructor for class [Link]
Constructs a NoSuchAlgorithmException with the specified detail message.
NoSuchElementException(). Constructor for class [Link]
Constructs a NoSuchElementException with no detail message.
NoSuchElementException(String). Constructor for class [Link]
Constructs a NoSuchElementException with the specified detail message.
NoSuchFieldError(). Constructor for class [Link]
Constructs a NoSuchFieldException with no detail message.

o
NoSuchFieldError(String). Constructor for class [Link]
Constructs a NoSuchFieldException with the specified detail message.
NoSuchFieldException(). Constructor for class [Link]
Constructor.
NoSuchFieldException(String). Constructor for class [Link]

i.c
Constructor with a detail message.
NoSuchLineNumberException(). Constructor for class [Link]
Constructor.
NoSuchLineNumberException(String). Constructor for class [Link]
Constructor with a detail message.
NoSuchMethodError(). Constructor for class [Link]
NoSuchMethodError(String). Constructor for class [Link]
Constructs a NoSuchMethodException with the specified detail message.
NoSuchMethodException(). Constructor for class [Link]
Constructs a NoSuchMethodException without a detail message.

dil
NoSuchMethodException(String). Constructor for class [Link]
Constructs a NoSuchMethodException with a detail message.
NoSuchObjectException(String). Constructor for class [Link]
Create a new NoSuchObjectException with a description.
NoSuchProviderException(). Constructor for class [Link]
Constructs a NoSuchProviderException with no detail message.
NoSuchProviderException(String). Constructor for class [Link]
Constructs a NoSuchProviderException with the specified detail message.
not(). Method in class [Link]
Returns a BigInteger whose value is (~this).
NotActiveException(). Constructor for class [Link]
va
Constructor to create a new NotActiveException with no reason.
NotActiveException(String). Constructor for class [Link]
Constructor to create a new NotActiveException with the reason given.
NotBoundException(). Constructor for class [Link]
NotBoundException(String). Constructor for class [Link]
notify(). Method in class [Link]
Wakes up a single thread that is waiting on this object's monitor.
notifyAll(). Method in class [Link]
Wakes up all threads that are waiting on this object's monitor.
notifyObservers(). Method in class [Link]
ja

If this object has changed, as indicated by the hasChanged method, then notify all of its observers and then call the
clearChanged method to indicate that this object has no longer changed.
notifyObservers(Object). Method in class [Link]
If this object has changed, as indicated by the hasChanged method, then notify all of its observers and then call the
clearChanged method to indicate that this object has no longer changed.
NotOwnerException(). Constructor for class [Link]
Constructs a NotOwnerException.
w.

NotSerializableException(). Constructor for class [Link]


NotSerializableException(String). Constructor for class [Link]
NOVEMBER. Static variable in class [Link]
Useful constant for month.
npoints. Variable in class [Link]
The total number of points.
NULL. Static variable in class [Link]
NULLORDER. Static variable in class [Link]
Null order which indicates the end of string is reached by the cursor.
nullPlusNonNullIsNull(). Method in interface [Link]
ww

Are concatenations between NULL and non-NULL values NULL? A JDBC-Compliant driver always returns true.
NullPointerException(). Constructor for class [Link]
Constructs a NullPointerException with no detail message.
NullPointerException(String). Constructor for class [Link]
Constructs a NullPointerException with the specified detail message.
nullsAreSortedAtEnd(). Method in interface [Link]
Are NULL values sorted at the end regardless of sort order?
nullsAreSortedAtStart(). Method in interface [Link]
Are NULL values sorted at the start regardless of sort order?
nullsAreSortedHigh(). Method in interface [Link]
Are NULL values sorted high?
nullsAreSortedLow(). Method in interface [Link]

378
379

Are NULL values sorted low?


NUM_COLORS. Static variable in class [Link]
The number of system colors in the array.

m
NUM_LOCK. Static variable in class [Link]
The NumLock action-key.
Number(). Constructor for class [Link]
numberFormat. Variable in class [Link]
The number formatter that DateFormat uses to format numbers in dates and times.
NumberFormat(). Constructor for class [Link]
NumberFormatException(). Constructor for class [Link]
Constructs a NumberFormatException with no detail message.

o
NumberFormatException(String). Constructor for class [Link]
Constructs a NumberFormatException with the specified detail message.
NUMERIC. Static variable in class [Link]
nval. Variable in class [Link]
If the current token is a number, this field contains the value of that number.

i.c
NW_RESIZE_CURSOR. Static variable in class [Link]
The north-west-resize cursor type.
NW_RESIZE_CURSOR. Static variable in class [Link]

Object(). Constructor for class [Link]


ObjectInputStream(InputStream). Constructor for class [Link]

dil
Create an ObjectInputStream that reads from the specified InputStream.
ObjectOutputStream(OutputStream). Constructor for class [Link]
Creates an ObjectOutputStream that writes to the specified OutputStream.
ObjectStreamException(). Constructor for class [Link]
Create an ObjectStreamException.
ObjectStreamException(String). Constructor for class [Link]
Create an ObjectStreamException with the specified argument.
ObjID(). Constructor for class [Link]
Generate unique object identifier.
ObjID(int). Constructor for class [Link]
Generate a "well-known" object ID.
va
Observable(). Constructor for class [Link]
Creates an observable object with no observers.
OCTOBER. Static variable in class [Link]
Useful constant for month.
okToUseGui(). Method in interface [Link]
This method instructs the bean that it is OK to use the Gui.
on(boolean). Method in class [Link]
Turns the digest function on or off.
on(boolean). Method in class [Link]
Turns the digest function on or off.
ja

openConnection(). Method in class [Link]


Returns a URLConnection object that represents a connection to the remote object referred to by the URL.
openConnection(URL). Method in class [Link]
Opens a connection to the object referenced by the URL argument.
openStream(). Method in class [Link]
Opens a connection to this URL and returns an InputStream for reading from that connection.
Operation(String). Constructor for class [Link]
w.

Creates a new Operation object.


or(BigInteger). Method in class [Link]
Returns a BigInteger whose value is (this | val).
or(BitSet). Method in class [Link]
Performs a logical OR of this bit set with the bit set argument.
orange. Static variable in class [Link]
The color orange.
ordinaryChar(int). Method in class [Link]
Specifies that the character argument is "ordinary" in this tokenizer.
ordinaryChars(int, int). Method in class [Link]
ww

Specifies that all characters c in the range low <= c <= high are "ordinary" in this tokenizer.
origmodel. Variable in class [Link]
OTHER. Static variable in class [Link]
OTHER indicates that the SQL type is database specific and gets mapped to a Java object which can be accessed via
getObject and setObject.
OTHER_LETTER. Static variable in class [Link]
OTHER_NUMBER. Static variable in class [Link]
OTHER_PUNCTUATION. Static variable in class [Link]
OTHER_SYMBOL. Static variable in class [Link]
out. Static variable in class [Link]
A handle to the standard output stream.
out. Variable in class [Link]

379
380

The underlying output stream.


out. Variable in class [Link]
The underlying character-output stream.

m
out. Variable in class [Link]
out. Static variable in class [Link]
The "standard" output stream.
OutOfMemoryError(). Constructor for class [Link]
Constructs an OutOfMemoryError with no detail message.
OutOfMemoryError(String). Constructor for class [Link]
Constructs an OutOfMemoryError with the specified detail message.
outpixbuf. Variable in class [Link]

o
OutputStream(). Constructor for class [Link]
OutputStreamWriter(OutputStream). Constructor for class [Link]
Create an OutputStreamWriter that uses the default character encoding.
OutputStreamWriter(OutputStream, String). Constructor for class [Link]
Create an OutputStreamWriter that uses the named character encoding.

i.c
owner. Variable in class [Link]

pack(). Method in class [Link]


Packs the components of the Window.
packagePrefix. Static variable in interface [Link]
Find loader handler package prefix: assumes that the implementation of the LoaderHandler class is located in the package

dil
defined by the prefix.
packagePrefix. Static variable in interface [Link]
Find server package prefix: assumes that the implementation of server ref classes (e.g., UnicastRef, UnicastServerRef) are
located in the package defined by the prefix.
PAINT. Static variable in class [Link]
The paint event type.
paint(Graphics). Method in class [Link]
Paints the canvas in the default background color.
paint(Graphics). Method in class [Link]
Paints the component.
paint(Graphics). Method in interface [Link]
va
paint(Graphics). Method in class [Link]
Paints the container.
PAINT_FIRST. Static variable in class [Link]
Marks the first integer id for the range of paint event ids.
PAINT_LAST. Static variable in class [Link]
Marks the last integer id for the range of paint event ids.
paintAll(Graphics). Method in class [Link]
Paints the component and its subcomponents.
paintComponents(Graphics). Method in class [Link]
Paints the components in this container.
ja

PaintEvent(Component, int, Rectangle). Constructor for class [Link]


Constructs a FocusEvent object with the specified source component and type.
paintValue(Graphics, Rectangle). Method in interface [Link]
Paint a representation of the value into a given area of screen real estate.
paintValue(Graphics, Rectangle). Method in class [Link]
Paint a representation of the value into a given area of screen real estate.
Panel(). Constructor for class [Link]
w.

Creates a new panel.


Panel(LayoutManager). Constructor for class [Link]
Creates a new panel with the specified layout manager.
PARAGRAPH_SEPARATOR. Static variable in class [Link]
ParameterDescriptor(). Constructor for class [Link]
paramString(). Method in class [Link]
paramString(). Method in class [Link]
paramString(). Method in class [Link]
paramString(). Method in class [Link]
Returns the parameter String of this button.
ww

paramString(). Method in class [Link]


Returns the parameter String of this Checkbox.
paramString(). Method in class [Link]
Returns the parameter String of this button.
paramString(). Method in class [Link]
Returns the parameter String of this Choice.
paramString(). Method in class [Link]
Returns the parameter String of this Component.
paramString(). Method in class [Link]
paramString(). Method in class [Link]
Returns the parameter String of this Container.
paramString(). Method in class [Link]

380
381

paramString(). Method in class [Link]


Returns the parameter String of this Dialog.
paramString(). Method in class [Link]

m
Returns the parameter String of this Event.
paramString(). Method in class [Link]
Returns the parameter String of this file dialog.
paramString(). Method in class [Link]
paramString(). Method in class [Link]
Returns the parameter String of this Frame.
paramString(). Method in class [Link]
paramString(). Method in class [Link]

o
paramString(). Method in class [Link]
Returns the parameter String of this label.
paramString(). Method in class [Link]
Returns the parameter String of this list.
paramString(). Method in class [Link]

i.c
Returns the String parameter of the menu.
paramString(). Method in class [Link]
Returns the String parameter of this MenuComponent.
paramString(). Method in class [Link]
Returns the String parameter of the menu item.
paramString(). Method in class [Link]
paramString(). Method in class [Link]
paramString(). Method in class [Link]
paramString(). Method in class [Link]
Returns the String parameters for this Scrollbar.

dil
paramString(). Method in class [Link]
Returns the parameter String of this Container.
paramString(). Method in class [Link]
Returns the String of parameters for this TextArea.
paramString(). Method in class [Link]
Returns the String of parameters for this TextComponent.
paramString(). Method in class [Link]
paramString(). Method in class [Link]
Returns the String of parameters for this TextField.
paramString(). Method in class [Link]
parent. Variable in class [Link]
va
The parent bundle is consulted by getObject when this bundle does not contain a particular resource.
parentOf(ThreadGroup). Method in class [Link]
Tests if this thread group is either the thread group argument or one of its ancestor thread groups.
parse(String). Static method in class [Link]
Given a string representing a time, parse it and return the time value.
parse(String). Method in class [Link]
Parse a date/time string.
parse(String). Method in class [Link]
Parses the string.
parse(String). Method in class [Link]
ja

Convenience method.
parse(String, ParsePosition). Method in class [Link]
Returns a Long if possible (e.g.
parse(String, ParsePosition). Method in class [Link]
Parse a date/time string according to the given parse position.
parse(String, ParsePosition). Method in class [Link]
Returns a Long if possible (e.g.
w.

parse(String, ParsePosition). Method in class [Link]


Parses the string.
parse(String, ParsePosition). Method in class [Link]
Returns a Long if possible (e.g.
parse(String, ParsePosition). Method in class [Link]
Overrides DateFormat
parseByte(String). Static method in class [Link]
Assuming the specified String represents a byte, returns that byte's value.
parseByte(String, int). Static method in class [Link]
Assuming the specified String represents a byte, returns that byte's value.
ww

ParseException(String, int). Constructor for class [Link]


Constructs a ParseException with the specified detail message and offset.
parseInt(String). Static method in class [Link]
Parses the string argument as a signed decimal integer.
parseInt(String, int). Static method in class [Link]
Parses the string argument as a signed integer in the radix specified by the second argument.
parseLevel(String). Static method in class [Link]
Convert a string name of a logging level to its internal integer representation.
parseLong(String). Static method in class [Link]
Parses the string argument as a signed decimal long.
parseLong(String, int). Static method in class [Link]
Parses the string argument as a signed long in the radix specified by the second argument.

381
382

parseNumbers(). Method in class [Link]


Specifies that numbers should be parsed by this tokenizer.
parseObject(String). Method in class [Link]

m
Parses a string to produce an object.
parseObject(String, ParsePosition). Method in class [Link]
Parse a date/time string into an Object.
parseObject(String, ParsePosition). Method in class [Link]
Parses a string to produce an object.
parseObject(String, ParsePosition). Method in class [Link]
Parses the string.
parseObject(String, ParsePosition). Method in class [Link]

o
Parses a string to produce an object.
ParsePosition(int). Constructor for class [Link]
Create a new ParsePosition with the given initial index.
parseShort(String). Static method in class [Link]
Assuming the specified String represents a short, returns that short's value.

i.c
parseShort(String, int). Static method in class [Link]
Assuming the specified String represents a short, returns that short's value.
parseURL(URL, String, int, int). Method in class [Link]
Parses the string representation of a URL into a URL object.
pathSeparator. Static variable in class [Link]
The system-dependent path separator string.
pathSeparatorChar. Static variable in class [Link]
The system-dependent path separator character.
PAUSE. Static variable in class [Link]
The Pause action-key.

dil
peek(). Method in class [Link]
Looks at the object at the top of this stack without removing it from the stack.
peek(InetAddress). Method in class [Link]
Peek at the packet to see who it is from.
peekEvent(). Method in class [Link]
Return the first event without removing it.
peekEvent(int). Method in class [Link]
permissions(). Method in interface [Link]
Returns an enumeration of the permissions in this ACL entry.
PGDN. Static variable in class [Link]
The page down action-key.
va
PGUP. Static variable in class [Link]
The page up action-key.
PI. Static variable in class [Link]
The double value that is closer than any other to pi, the ratio of the circumference of a circle to its diameter.
pink. Static variable in class [Link]
The color pink.
PIPE_SIZE. Static variable in class [Link]
PipedInputStream(). Constructor for class [Link]
Creates a piped input stream that is not yet connected to a piped output stream.
PipedInputStream(PipedOutputStream). Constructor for class [Link]
ja

Creates a piped input stream connected to the specified piped output stream.
PipedOutputStream(). Constructor for class [Link]
Creates a piped output stream that is not yet connected to a piped input stream.
PipedOutputStream(PipedInputStream). Constructor for class [Link]
Creates a piped output stream connected to the specified piped input stream.
PipedReader(). Constructor for class [Link]
Create a reader that is not yet connected to a piped writer.
w.

PipedReader(PipedWriter). Constructor for class [Link]


Create a reader for the specified piped character-output stream.
PipedWriter(). Constructor for class [Link]
Create a writer that is not yet connected to a piped reader.
PipedWriter(PipedReader). Constructor for class [Link]
Create a writer for the specified piped character-input stream.
pixel_bits. Variable in class [Link]
PixelGrabber(Image, int, int, int, int, boolean). Constructor for class [Link]
Create a PixelGrabber object to grab the (x, y, w, h) rectangular section of pixels from the specified image.
PixelGrabber(Image, int, int, int, int, int[], int, int). Constructor for class [Link]
ww

Create a PixelGrabber object to grab the (x, y, w, h) rectangular section of pixels from the specified image into the given
array.
PixelGrabber(ImageProducer, int, int, int, int, int[], int, int). Constructor for class [Link]
Create a PixelGrabber object to grab the (x, y, w, h) rectangular section of pixels from the image produced by the specified
ImageProducer into the given array.
PLAIN. Static variable in class [Link]
The plain style constant.
plainTextFlavor. Static variable in class [Link]
The DataFlavor representing plain text with unicode encoding, where:

representationClass = InputStream
mimeType = "text/plain; charset=unicode"

382
383

play(). Method in interface [Link]


Starts playing this audio clip.

m
play(URL). Method in class [Link]
Plays the audio clip at the specified absolute URL.
play(URL, String). Method in class [Link]
Plays the audio clip given the URL and a specifier that is relative to it.
PM. Static variable in class [Link]
Useful constant for hour in 12-hour clock.
Point(). Constructor for class [Link]
Constructs and initializes a Point initialized with (0, 0).

o
Point(int, int). Constructor for class [Link]
Constructs and initializes a Point from the specified x and y coordinates.
Point(Point). Constructor for class [Link]
Constructs and initializes a Point with the same location as the specified Point.
Polygon(). Constructor for class [Link]

i.c
Creates an empty polygon.
Polygon(int[], int[], int). Constructor for class [Link]
Constructs and initializes a Polygon from the specified parameters.
pop(). Method in class [Link]
Removes the object at the top of this stack and returns that object as the value of this function.
PopupMenu(). Constructor for class [Link]
Creates a new popup menu.
PopupMenu(String). Constructor for class [Link]
Creates a new popup menu with the specified name.
port. Variable in class [Link]

dil
The port number on the remote host to which this socket is connected.
pos. Variable in class [Link]
The current position in the buffer.
pos. Variable in class [Link]
The index of the next character to read from the input stream buffer.
pos. Variable in class [Link]
Current buffer position
pos. Variable in class [Link]
The current position within the buffer.
pos. Variable in class [Link]
The index of the next character to read from the input stream buffer.
va
POSITIVE_INFINITY. Static variable in class [Link]
The positive infinity of type double.
POSITIVE_INFINITY. Static variable in class [Link]
The positive infinity of type float.
postEvent(AWTEvent). Method in class [Link]
Post a 1.1-style event to the EventQueue.
postEvent(Event). Method in class [Link]
postEvent(Event). Method in class [Link]
Posts the specified event to the menu.
postEvent(Event). Method in interface [Link]
ja

postEvent(Event). Method in class [Link]


pow(double, double). Static method in class [Link]
Returns of value of the first argument raised to the power of the second argument.
pow(int). Method in class [Link]
Returns a BigInteger whose value is (this ** exponent).
PRC. Static variable in class [Link]
Useful constant for country.
w.

predefined. Static variable in class [Link]


preferredLayoutSize(Container). Method in class [Link]
Returns the preferred dimensions for this layout given the components in the specified target container.
preferredLayoutSize(Container). Method in class [Link]
Calculates the preferred size for the specified panel.
preferredLayoutSize(Container). Method in class [Link]
Returns the preferred dimensions for this layout given the components in the specified target container.
preferredLayoutSize(Container). Method in class [Link]
Returns the preferred dimensions for this layout given the components in the specified panel.
preferredLayoutSize(Container). Method in class [Link]
ww

Returns the preferred dimensions for this layout given the components int the specified panel.
preferredLayoutSize(Container). Method in interface [Link]
Calculates the preferred size dimensions for the specified panel given the components in the specified parent container.
PREFERREDSIZE. Static variable in class [Link]
preferredSize(). Method in class [Link]
preferredSize(). Method in interface [Link]
DEPRECATED: Replaced by getPreferredSize().
preferredSize(). Method in class [Link]
preferredSize(). Method in class [Link]
preferredSize(). Method in class [Link]
preferredSize(). Method in class [Link]
preferredSize(int). Method in class [Link]

383
384

preferredSize(int). Method in interface [Link]


DEPRECATED: Replaced by getPreferredSize(int).
preferredSize(int). Method in class [Link]

m
preferredSize(int). Method in interface [Link]
DEPRECATED: Replaced by getPreferredSize(int).
preferredSize(int, int). Method in class [Link]
preferredSize(int, int). Method in interface [Link]
DEPRECATED: Replaced by getPreferredSize(int, int).
prepareCall(String). Method in interface [Link]
A SQL stored procedure call statement is handled by creating a CallableStatement for it.
prepareImage(Image, ImageObserver). Method in class [Link]

o
Prepares an image for rendering on this Component.
prepareImage(Image, int, int, ImageObserver). Method in class [Link]
Prepares an image for rendering on this Component at the specified width and height.
prepareImage(Image, int, int, ImageObserver). Method in interface [Link]
prepareImage(Image, int, int, ImageObserver). Method in class [Link]

i.c
Prepares an image for rendering on the default screen at the specified width and height.
prepareStatement(String). Method in interface [Link]
A SQL statement with or without IN parameters can be pre-compiled and stored in a PreparedStatement object.
previous(). Method in class [Link]
Return the boundary preceding the current boundary.
previous(). Method in interface [Link]
Decrement the iterator's index by one and return the character at the new index.
previous(). Method in class [Link]
Decrement the iterator's index by one and return the character at the new index.
previous(Container). Method in class [Link]

dil
Flips to the previous card of the specified container.
previousDouble(double). Static method in class [Link]
Finds the greatest double less than d.
PRIMARY. Static variable in class [Link]
Collator strength value.
primaryOrder(int). Static method in class [Link]
Get the primary order of a collation order.
print(boolean). Method in class [Link]
Prints the string "true" to the underlying output stream if the value of the boolean argument is true; otherwise, prints the
string "false" to the underlying output stream.
print(boolean). Method in class [Link]
va
Print a boolean.
print(char). Method in class [Link]
Prints the low eight bits of the character argument to this print stream's underlying output stream.
print(char). Method in class [Link]
Print a character.
print(char[]). Method in class [Link]
Prints the low eight bits of each of the characters in the character array to this print stream's underlying output stream.
print(char[]). Method in class [Link]
Print an array of chracters.
print(double). Method in class [Link]
ja

Prints the string representation of the double to this print stream's underlying output stream.
print(double). Method in class [Link]
Print a double.
print(float). Method in class [Link]
Prints the string representation of the float to this print stream's underlying output stream.
print(float). Method in class [Link]
Print a float.
w.

print(Graphics). Method in class [Link]


Prints this component.
print(Graphics). Method in interface [Link]
print(Graphics). Method in class [Link]
Prints the container.
print(int). Method in class [Link]
Prints the string representation of the int to this print stream's underlying output stream.
print(int). Method in class [Link]
Print an integer.
print(long). Method in class [Link]
ww

Prints the string representation of the long to this print stream's underlying output stream.
print(long). Method in class [Link]
Print a long.
print(Object). Method in class [Link]
Prints the string representation of the Object to this print stream's underlying output stream.
print(Object). Method in class [Link]
Print an object.
print(String). Method in class [Link]
If the string argument is null, the string "null" is printed to this print stream's underlying output stream.
print(String). Method in class [Link]
Print a String.
PRINT_SCREEN. Static variable in class [Link]

384
385

The PrintScreen action-key.


printAll(Graphics). Method in class [Link]
Prints the component and its subcomponents.

m
printComponents(Graphics). Method in class [Link]
Prints the components in this container.
printComponents(Graphics). Method in class [Link]
Prints the component in this scroll pane.
PrintJob(). Constructor for class [Link]
println(). Method in class [Link]
Prints a newline character to this print stream's underlying output stream.
println(). Method in class [Link]

o
Finish the line.
println(boolean). Method in class [Link]
Prints the string "true" followed by a newline character to this print stream's underlying output stream if the value of the
boolean argument is true; otherwise prints the string "false" followed by a newline character to the underlying output
stream.

i.c
println(boolean). Method in class [Link]
Print a boolean, and then finish the line.
println(char). Method in class [Link]
Prints the low eight bits of the character argument followed by a newline character to this print stream's underlying output
stream.
println(char). Method in class [Link]
Print a character, and then finish the line.
println(char[]). Method in class [Link]
Prints the low eight bits of each of the characters in the character array, followed by a newline character, to this print stream's
underlying output stream.

dil
println(char[]). Method in class [Link]
Print an array of characters, and then finish the line.
println(double). Method in class [Link]
Prints the string representation of the double followed by a newline to this print stream's underlying output stream.
println(double). Method in class [Link]
Print a double, and then finish the line.
println(float). Method in class [Link]
Prints the string representation of the float followed by a newline to this print stream's underlying output stream.
println(float). Method in class [Link]
Print a float, and then finish the line.
println(int). Method in class [Link]
va
Prints the string representation of the int followed by a newline to this print stream's underlying output stream.
println(int). Method in class [Link]
Print an integer, and then finish the line.
println(long). Method in class [Link]
Prints the string representation of the long followed by a newline to this print stream's underlying output stream.
println(long). Method in class [Link]
Print a long, and then finish the line.
println(Object). Method in class [Link]
Prints the string representation of the Object followed by a newline to this print stream's underlying output stream.
println(Object). Method in class [Link]
ja

Print an Object, and then finish the line.


println(String). Static method in class [Link]
Print a message to the current JDBC log stream
println(String). Method in class [Link]
If the string argument is null, the string "null" followed by a newline character is printed to this print stream's underlying
output stream.
println(String). Method in class [Link]
w.

Print a String, and then finish the line.


printStackTrace(). Method in class [Link]
Prints this Throwable and its backtrace to the standard error stream.
printStackTrace(PrintStream). Method in class [Link]
Prints this Throwable and its backtrace to the specified print stream.
printStackTrace(PrintWriter). Method in class [Link]
Prints this Throwable and its backtrace to the specified print writer.
PrintStream(OutputStream). Constructor for class [Link]
Constructs a new print stream that writes its output to the specified underlying output stream.
PrintStream(OutputStream, boolean). Constructor for class [Link]
ww

Constructs a new print stream that writes its output to the specified underlying output stream.
printToConsole(String). Method in interface [Link]
Print text to the debugger's console window.
PrintWriter(OutputStream). Constructor for class [Link]
Create a new PrintWriter, without automatic line flushing, from an existing OutputStream.
PrintWriter(OutputStream, boolean). Constructor for class [Link]
Create a new PrintWriter from an existing OutputStream.
PrintWriter(Writer). Constructor for class [Link]
Create a new PrintWriter, without automatic line flushing.
PrintWriter(Writer, boolean). Constructor for class [Link]
Create a new PrintWriter.
PRIVATE. Static variable in class [Link]

385
386

PRIVATE_USE. Static variable in class [Link]


procedureColumnIn. Static variable in interface [Link]
COLUMN_TYPE - IN parameter.

m
procedureColumnInOut. Static variable in interface [Link]
COLUMN_TYPE - INOUT parameter.
procedureColumnOut. Static variable in interface [Link]
COLUMN_TYPE - OUT parameter.
procedureColumnResult. Static variable in interface [Link]
COLUMN_TYPE - result column in ResultSet.
procedureColumnReturn. Static variable in interface [Link]
COLUMN_TYPE - procedure return value.

o
procedureColumnUnknown. Static variable in interface [Link]
COLUMN_TYPE - nobody knows.
procedureNoNulls. Static variable in interface [Link]
TYPE NULLABLE - does not allow NULL values.
procedureNoResult. Static variable in interface [Link]

i.c
PROCEDURE_TYPE - Does not return a result.
procedureNullable. Static variable in interface [Link]
TYPE NULLABLE - allows NULL values.
procedureNullableUnknown. Static variable in interface [Link]
TYPE NULLABLE - nullability unknown.
procedureResultUnknown. Static variable in interface [Link]
PROCEDURE_TYPE - May return a result.
procedureReturnsResult. Static variable in interface [Link]
PROCEDURE_TYPE - Returns a result.
Process(). Constructor for class [Link]

dil
processActionEvent(ActionEvent). Method in class [Link]
Processes action events occurring on this button by dispatching them to any registered ActionListener objects.
processActionEvent(ActionEvent). Method in class [Link]
Processes action events occurring on this component by dispatching them to any registered ActionListener objects.
processActionEvent(ActionEvent). Method in class [Link]
Processes action events occurring on this menu item by dispatching them to any registered ActionListener objects.
processActionEvent(ActionEvent). Method in class [Link]
Processes action events occurring on this textfield by dispatching them to any registered ActionListener objects.
processAdjustmentEvent(AdjustmentEvent). Method in class [Link]
Processes adjustment events occurring on this scrollbar by dispatching them to any registered AdjustmentListener objects.
processComponentEvent(ComponentEvent). Method in class [Link]
va
Processes component events occurring on this component by dispatching them to any registered ComponentListener objects.
processContainerEvent(ContainerEvent). Method in class [Link]
Processes container events occurring on this container by dispatching them to any registered ContainerListener objects.
processEvent(AWTEvent). Method in class [Link]
Processes events on this button.
processEvent(AWTEvent). Method in class [Link]
Processes events on this checkbox.
processEvent(AWTEvent). Method in class [Link]
Processes events on this checkbox menu item.
processEvent(AWTEvent). Method in class [Link]
ja

Processes events on this choice.


processEvent(AWTEvent). Method in class [Link]
Processes events occurring on this component.
processEvent(AWTEvent). Method in class [Link]
Processes events on this container.
processEvent(AWTEvent). Method in class [Link]
Processes events on this list.
w.

processEvent(AWTEvent). Method in class [Link]


Processes events occurring on this menu component.
processEvent(AWTEvent). Method in class [Link]
Processes events on this menu item.
processEvent(AWTEvent). Method in class [Link]
Processes events on this scrollbar.
processEvent(AWTEvent). Method in class [Link]
Processes events on this textcomponent.
processEvent(AWTEvent). Method in class [Link]
Processes events on this textfield.
ww

processEvent(AWTEvent). Method in class [Link]


Processes events on this window.
processFocusEvent(FocusEvent). Method in class [Link]
Processes focus events occurring on this component by dispatching them to any registered FocusListener objects.
processItemEvent(ItemEvent). Method in class [Link]
Processes item events occurring on this checkbox by dispatching them to any registered ItemListener objects.
processItemEvent(ItemEvent). Method in class [Link]
Processes item events occurring on this checkbox menu item by dispatching them to any registered ItemListener objects.
processItemEvent(ItemEvent). Method in class [Link]
Processes item events occurring on this choice by dispatching them to any registered ItemListener objects.
processItemEvent(ItemEvent). Method in class [Link]
Processes item events occurring on this list by dispatching them to any registered ItemListener objects.

386
387

processKeyEvent(KeyEvent). Method in class [Link]


Processes key events occurring on this component by dispatching them to any registered KeyListener objects.
processMouseEvent(MouseEvent). Method in class [Link]

m
Processes mouse events occurring on this component by dispatching them to any registered MouseListener objects.
processMouseMotionEvent(MouseEvent). Method in class [Link]
Processes mouse motion events occurring on this component by dispatching them to any registered MouseMotionListener
objects.
processTextEvent(TextEvent). Method in class [Link]
Processes text events occurring on this text component by dispatching them to any registered TextListener objects.
processWindowEvent(WindowEvent). Method in class [Link]
Processes window events occurring on this window by dispatching them to any registered WindowListener objects.

o
PROPERTIES. Static variable in interface [Link]
The properties of the image are now available.
Properties(). Constructor for class [Link]
Creates an empty property list with no default values.
Properties(Properties). Constructor for class [Link]

i.c
Creates an empty property list with the specified defaults.
propertyChange(PropertyChangeEvent). Method in interface [Link]
This method gets called when a bound property is changed.
PropertyChangeEvent(Object, String, Object, Object). Constructor for class [Link]
PropertyChangeSupport(Object). Constructor for class [Link]
PropertyDescriptor(String, Class). Constructor for class [Link]
Constructs a PropertyDescriptor for a property that follows the standard Java convention by having getFoo and setFoo
accessor methods.
PropertyDescriptor(String, Class, String, String). Constructor for class [Link]
This constructor takes the name of a simple property, and method names for reading and writing the property.

dil
PropertyDescriptor(String, Method, Method). Constructor for class [Link]
This constructor takes the name of a simple property, and Method objects for reading and writing the property.
PropertyEditorManager(). Constructor for class [Link]
PropertyEditorSupport(). Constructor for class [Link]
Constructor for use by derived PropertyEditor classes.
PropertyEditorSupport(Object). Constructor for class [Link]
Constructor for use when a PropertyEditor is delegating to us.
propertyNames(). Method in class [Link]
Returns an enumeration of all the keys in this property list, including the keys in the default property list.
PropertyResourceBundle(InputStream). Constructor for class [Link]
Creates a property resource
va
PropertyVetoException(String, PropertyChangeEvent). Constructor for class [Link]
PROTECTED. Static variable in class [Link]
ProtocolException(). Constructor for class [Link]
Constructs a new ProtocolException with no detail message.
ProtocolException(String). Constructor for class [Link]
Constructs a new ProtocolException with the specified detail message.
Provider(String, double, String). Constructor for class [Link]
Constructs a provider with the specified name, version number, and information.
ProviderException(). Constructor for class [Link]
Constructs a ProviderException with no detail message.
ja

ProviderException(String). Constructor for class [Link]


Constructs a ProviderException with the specified detail message.
PUBLIC. Static variable in interface [Link]
Identifies the set of all public members of a class or interface, including inherited members.
PUBLIC. Static variable in class [Link]
push(Object). Method in class [Link]
Pushes an item onto the top of this stack.
w.

pushBack(). Method in class [Link]


Causes the next call to the nextToken method of this tokenizer to return the current value in the ttype field, and not to
modify the value in the nval or sval field.
PushbackInputStream(InputStream). Constructor for class [Link]
Constructs a new pushback input stream that reads its input from the specified input stream.
PushbackInputStream(InputStream, int). Constructor for class [Link]
Creates a new input stream with a push back buffer of specified size.
PushbackReader(Reader). Constructor for class [Link]
Create a new pushback reader with a one-character pushback buffer.
PushbackReader(Reader, int). Constructor for class [Link]
ww

Create a new pushback reader with a pushback buffer of the given size.
put(Object, Object). Method in class [Link]
Maps the specified key to the specified value in this dictionary.
put(Object, Object). Method in class [Link]
Maps the specified key to the specified value in this hashtable.
putNextEntry(ZipEntry). Method in class [Link]
Begins writing a new ZIP file entry and positions the stream to the start of the entry data.

387
388

quitEvent(). Method in interface [Link]


The client interpreter has exited, either by returning from its main thread, or by calling [Link]().
quoteChar(int). Method in class [Link]

m
Specifies that matching pairs of this character delimit string constants in this tokenizer.

random(). Static method in class [Link]


Returns a random number between 0.0 and 1.0.

o
Random(). Constructor for class [Link]
Creates a new random number generator.
Random(long). Constructor for class [Link]
Creates a new random number generator using a single long seed.
RandomAccessFile(File, String). Constructor for class [Link]

i.c
Creates a random access file stream to read from, and optionally to write to, the file specified by the File argument.
RandomAccessFile(String, String). Constructor for class [Link]
Creates a random access file stream to read from, and optionally to write to, a file with the specified name.
RANDOMPIXELORDER. Static variable in interface [Link]
The pixels will be delivered in a random order.
read(). Method in class [Link]
Reads the next byte of data from this buffered input stream.
read(). Method in class [Link]
Read a single character.
read(). Method in class [Link]

dil
Reads the next byte of data from this input stream.
read(). Method in class [Link]
Read a single character.
read(). Method in class [Link]
Reads a byte.
read(). Method in class [Link]
Reads a byte, and updates the message digest (if the digest function is on).
read(). Method in class [Link]
Reads a byte of data from this input stream.
read(). Method in class [Link]
Reads the next byte of data from this input stream.
va
read(). Method in class [Link]
Read a single character.
read(). Method in class [Link]
Reads a byte of uncompressed data.
read(). Method in class [Link]
Reads the next byte of data from this input stream.
read(). Method in class [Link]
Read a single character.
read(). Method in class [Link]
Reads the next byte of data from this input stream.
ja

read(). Method in class [Link]


Read a single character.
read(). Method in interface [Link]
Reads a byte of data.
read(). Method in class [Link]
Reads a byte of data.
read(). Method in class [Link]
w.

Reads the next byte of data from this piped input stream.
read(). Method in class [Link]
Reads the next byte of data from this input stream.
read(). Method in class [Link]
Read a single character.
read(). Method in class [Link]
Reads a byte of data from this file.
read(). Method in class [Link]
Read a single character.
read(). Method in class [Link]
ww

Reads the next byte of data from this input stream.


read(). Method in class [Link]
Reads the next byte of data from this input stream.
read(). Method in class [Link]
Read a single character.
read(byte[]). Method in class [Link]
Reads up to [Link] bytes of data from this data input stream into an array of bytes.
read(byte[]). Method in class [Link]
Reads up to [Link] bytes of data from this input stream into an array of bytes.
read(byte[]). Method in class [Link]
Reads up to [Link] bytes of data from this input stream into an array of bytes.
read(byte[]). Method in class [Link]

388
389

Reads up to [Link] bytes of data from this input stream into an array of bytes.
read(byte[]). Method in interface [Link]
Reads into an array of bytes.

m
read(byte[]). Method in class [Link]
Reads up to [Link] bytes of data from this file into an array of bytes.
read(byte[], int, int). Method in class [Link]
Reads up to len bytes of data from this buffered input stream into an array of bytes.
read(byte[], int, int). Method in class [Link]
Reads up to len bytes of data into an array of bytes from this input stream.
read(byte[], int, int). Method in class [Link]
Reads into an array of bytes.

o
read(byte[], int, int). Method in class [Link]
Reads up to len bytes of data from this data input stream into an array of bytes.
read(byte[], int, int). Method in class [Link]
Reads into a byte array, and updates the message digest (if the digest function is on).
read(byte[], int, int). Method in class [Link]

i.c
Reads up to len bytes of data from this input stream into an array of bytes.
read(byte[], int, int). Method in class [Link]
Reads up to len bytes of data from this input stream into an array of bytes.
read(byte[], int, int). Method in class [Link]
Reads uncompressed data into an array of bytes.
read(byte[], int, int). Method in class [Link]
Reads uncompressed data into an array of bytes.
read(byte[], int, int). Method in class [Link]
Reads up to len bytes of data from this input stream into an array of bytes.
read(byte[], int, int). Method in class [Link]

dil
Reads up to len bytes of data from this input stream into an array of bytes.
read(byte[], int, int). Method in interface [Link]
Reads into an array of bytes.
read(byte[], int, int). Method in class [Link]
Reads into an array of bytes.
read(byte[], int, int). Method in class [Link]
Reads up to len bytes of data from this piped input stream into an array of bytes.
read(byte[], int, int). Method in class [Link]
Reads up to len bytes of data from this input stream into an array of bytes.
read(byte[], int, int). Method in class [Link]
Reads up to len bytes of data from this file into an array of bytes.
va
read(byte[], int, int). Method in class [Link]
Reads up to len bytes of data from this input stream into an array of bytes.
read(byte[], int, int). Method in class [Link]
Reads up to len bytes of data from this input stream into an array of bytes.
read(byte[], int, int). Method in class [Link]
Reads from the current ZIP entry into an array of bytes.
read(char[]). Method in class [Link]
Read characters into an array.
read(char[], int, int). Method in class [Link]
Read characters into a portion of an array.
ja

read(char[], int, int). Method in class [Link]


Read characters into a portion of an array.
read(char[], int, int). Method in class [Link]
Read characters into a portion of an array.
read(char[], int, int). Method in class [Link]
Read characters into a portion of an array.
read(char[], int, int). Method in class [Link]
w.

Read characters into a portion of an array.


read(char[], int, int). Method in class [Link]
Read characters into a portion of an array.
read(char[], int, int). Method in class [Link]
Read characters into a portion of an array.
read(char[], int, int). Method in class [Link]
Read characters into a portion of an array.
read(char[], int, int). Method in class [Link]
Read characters into a portion of an array.
read(DataInput). Static method in class [Link]
ww

Get the uid from the input stream.


read(ObjectInput). Static method in class [Link]
The read method constructs an object id whose contents is read from the specified input stream.
readBoolean(). Method in interface [Link]
Reads a boolean value from the input stream.
readBoolean(). Method in class [Link]
Reads a boolean from this data input stream.
readBoolean(). Method in class [Link]
Reads in a boolean.
readBoolean(). Method in class [Link]
Reads a boolean from this file.
readByte(). Method in interface [Link]

389
390

Reads a signed 8-bit value from the input stream.


readByte(). Method in class [Link]
Reads a signed 8-bit value from this data input stream.

m
readByte(). Method in class [Link]
Reads an 8 bit byte.
readByte(). Method in class [Link]
Reads a signed 8-bit value from this file.
readChar(). Method in interface [Link]
Reads a Unicode char value from the input stream.
readChar(). Method in class [Link]
Reads a Unicode character from this data input stream.

o
readChar(). Method in class [Link]
Reads a 16 bit char.
readChar(). Method in class [Link]
Reads a Unicode character from this file.
readDouble(). Method in interface [Link]

i.c
Reads a double value from the input stream.
readDouble(). Method in class [Link]
Reads a double from this data input stream.
readDouble(). Method in class [Link]
Reads a 64 bit double.
readDouble(). Method in class [Link]
Reads a double from this file.
Reader(). Constructor for class [Link]
Create a new character-stream reader whose critical sections will synchronize on the reader itself.
Reader(Object). Constructor for class [Link]

dil
Create a new character-stream reader whose critical sections will synchronize on the given object.
readExternal(ObjectInput). Method in interface [Link]
The object implements the readExternal method to restore its contents by calling the methods of DataInput for primitive types
and readObject for objects, strings and arrays.
readFloat(). Method in interface [Link]
Reads a float value from the input stream.
readFloat(). Method in class [Link]
Reads a float from this data input stream.
readFloat(). Method in class [Link]
Reads a 32 bit float.
readFloat(). Method in class [Link]
va
Reads a float from this file.
readFully(byte[]). Method in interface [Link]
Reads [Link] bytes into the byte array.
readFully(byte[]). Method in class [Link]
Reads [Link] bytes from this data input stream into the byte array.
readFully(byte[]). Method in class [Link]
Reads bytes, blocking until all bytes are read.
readFully(byte[]). Method in class [Link]
Reads [Link] bytes from this file into the byte array.
readFully(byte[], int, int). Method in interface [Link]
ja

Reads [Link] bytes into the byte array.


readFully(byte[], int, int). Method in class [Link]
Reads exactly len bytes from this data input stream into the byte array.
readFully(byte[], int, int). Method in class [Link]
Reads bytes, blocking until all bytes are read.
readFully(byte[], int, int). Method in class [Link]
Reads exactly len bytes from this file into the byte array.
w.

readInt(). Method in interface [Link]


Reads an int value from the input stream.
readInt(). Method in class [Link]
Reads a signed 32-bit integer from this data input stream.
readInt(). Method in class [Link]
Reads a 32 bit int.
readInt(). Method in class [Link]
Reads a signed 32-bit integer from this file.
readLine(). Method in class [Link]
Read a line of text.
ww

readLine(). Method in interface [Link]


Reads the next line of text from the input stream.
readLine(). Method in class [Link]
Reads the next line of text from this data input stream.
readLine(). Method in class [Link]
Read a line of text.
readLine(). Method in class [Link]
Reads in a line that has been terminated by a \n, \r, \r\n or EOF.
readLine(). Method in class [Link]
Reads the next line of text from this file.
readLong(). Method in interface [Link]
Reads a long value from the input stream.

390
391

readLong(). Method in class [Link]


Reads a signed 64-bit integer from this data input stream.
readLong(). Method in class [Link]

m
Reads a 64 bit long.
readLong(). Method in class [Link]
Reads a signed 64-bit integer from this file.
readObject(). Method in interface [Link]
Read and return an object.
readObject(). Method in class [Link]
Read an object from the ObjectInputStream.
readShort(). Method in interface [Link]

o
Reads a 16-bit value from the input stream.
readShort(). Method in class [Link]
Reads a signed 16-bit number from this data input stream.
readShort(). Method in class [Link]
Reads a 16 bit short.

i.c
readShort(). Method in class [Link]
Reads a signed 16-bit number from this file.
readStreamHeader(). Method in class [Link]
The readStreamHeader method is provided to allow subclasses to read and verify their own stream headers.
readUnsignedByte(). Method in interface [Link]
Reads an unsigned 8-bit value from the input stream.
readUnsignedByte(). Method in class [Link]
Reads an unsigned 8-bit number from this data input stream.
readUnsignedByte(). Method in class [Link]
Reads an unsigned 8 bit byte.

dil
readUnsignedByte(). Method in class [Link]
Reads an unsigned 8-bit number from this file.
readUnsignedShort(). Method in interface [Link]
Reads an unsigned 16-bit value from the input stream.
readUnsignedShort(). Method in class [Link]
Reads an unsigned 16-bit number from this data input stream.
readUnsignedShort(). Method in class [Link]
Reads an unsigned 16 bit short.
readUnsignedShort(). Method in class [Link]
Reads an unsigned 16-bit number from this file.
readUTF(). Method in interface [Link]
va
Reads in a string that has been encoded using a modified UTF-8 format.
readUTF(). Method in class [Link]
Reads in a string that has been encoded using a modified UTF-8 format from this data input stream.
readUTF(). Method in class [Link]
Reads a UTF format String.
readUTF(). Method in class [Link]
Reads in a string from this file.
readUTF(DataInput). Static method in class [Link]
Reads in a string from the specified data input stream.
ready(). Method in class [Link]
ja

Tell whether this stream is ready to be read.


ready(). Method in class [Link]
Tell whether this stream is ready to be read.
ready(). Method in class [Link]
Tell whether this stream is ready to be read.
ready(). Method in class [Link]
Tell whether this stream is ready to be read.
w.

ready(). Method in class [Link]


Tell whether this stream is ready to be read.
ready(). Method in class [Link]
Tell whether this stream is ready to be read.
ready(). Method in class [Link]
Tell whether this stream is ready to be read.
REAL. Static variable in class [Link]
rebind(String, Remote). Static method in class [Link]
Rebind the name to a new object; replaces any existing binding.
rebind(String, Remote). Method in interface [Link]
ww

Rebind the name to a new object, replacing any existing binding.


receive(DatagramPacket). Method in class [Link]
Receives a datagram packet from this socket.
receive(DatagramPacket). Method in class [Link]
Receive the datagram packet.
receive(int). Method in class [Link]
Receives a byte of data.
Rectangle(). Constructor for class [Link]
Constructs a new rectangle, initialized to location (0, 0) and size (0, 0).
Rectangle(Dimension). Constructor for class [Link]
Constructs a rectangle and initializes it to the specified width and height.
Rectangle(int, int). Constructor for class [Link]

391
392

Constructs a rectangle and initializes it with the specified width and height parameters.
Rectangle(int, int, int, int). Constructor for class [Link]
Constructs and initializes a rectangle with the specified parameters.

m
Rectangle(Point). Constructor for class [Link]
Constructs a rectangle and initializes it to the specified point.
Rectangle(Point, Dimension). Constructor for class [Link]
Constructs a rectangle and initializes it to a specified point and dimension.
Rectangle(Rectangle). Constructor for class [Link]
Constructs a new rectangle, initialized to match the values of the specificed rectangle.
red. Static variable in class [Link]
The color red.

o
ref. Variable in class [Link]
regionMatches(boolean, int, String, int, int). Method in class [Link]
Tests if two string regions are equal.
regionMatches(int, String, int, int). Method in class [Link]
Tests if two string regions are equal.

i.c
registerDriver(Driver). Static method in class [Link]
A newly loaded driver class should call registerDriver to make itself known to the DriverManager.
registerEditor(Class, Class). Static method in class [Link]
Register an editor class to be used to editor values of a given target class.
registerOutParameter(int, int). Method in interface [Link]
Before executing a stored procedure call, you must explicitly call registerOutParameter to register the [Link] of each
out parameter.
registerOutParameter(int, int, int). Method in interface [Link]
Use this version of registerOutParameter for registering Numeric or Decimal out parameters.
registerValidation(ObjectInputValidation, int). Method in class [Link]

dil
Register an object to be validated before the graph is returned.
REGISTRY_ID. Static variable in class [Link]
well-known id for the registry
REGISTRY_PORT. Static variable in interface [Link]
Well known port for registry
registryImpl(int). Method in interface [Link]
Constructs and exports a Registry on the specified port.
registryStub(String, int). Method in interface [Link]
Returns a "stub" for contacting a remote registry on the specified host and port.
rehash(). Method in class [Link]
Rehashes the contents of the hashtable into a hashtable with a larger capacity.
va
RELATIVE. Static variable in class [Link]
releaseInputStream(). Method in interface [Link]
Release the input stream.
releaseOutputStream(). Method in interface [Link]
Release the output stream; in some transports this would release the stream.
REMAINDER. Static variable in class [Link]
remainder(BigInteger). Method in class [Link]
Returns a BigInteger whose value is (this % val).
RemoteDebugger(String, DebuggerCallback, boolean). Constructor for class [Link]
Create a remote debugger.
ja

RemoteDebugger(String, String, DebuggerCallback, boolean). Constructor for class [Link]


Create a remote debugger, connecting it with a running Java interpreter.

To connect to a running interpreter, it must be started with the "-debug" option, whereupon it will print out the password for
that debugging session.
remoteEquals(RemoteRef). Method in interface [Link]
w.

Compares two remote objects for equality.


RemoteException(). Constructor for class [Link]
Create a remote exception
RemoteException(String). Constructor for class [Link]
Create a remote exception with the specified string
RemoteException(String, Throwable). Constructor for class [Link]
Create a remote exception with the specified string, and the exception specified.
remoteHashCode(). Method in interface [Link]
Returns a hashcode for a remote object.
RemoteInt(int). Constructor for class [Link]
ww

RemoteObject(). Constructor for class [Link]


Create a remote object.
RemoteObject(RemoteRef). Constructor for class [Link]
Create a remote object, initialized with the specified remote reference.
RemoteServer(). Constructor for class [Link]
RemoteServer(RemoteRef). Constructor for class [Link]
RemoteStub(). Constructor for class [Link]
Constructor for RemoteStub.
RemoteStub(RemoteRef). Constructor for class [Link]
Constructor for RemoteStub, with the specified remote reference.
remoteToString(). Method in interface [Link]
Returns a String that represents the reference of this remote object.

392
393

remove(ActionListener, ActionListener). Static method in class [Link]


Removes the old action-listener from action-listener-l and returns the resulting multicast listener.
remove(AdjustmentListener, AdjustmentListener). Static method in class [Link]

m
Removes the old adjustment-listener from adjustment-listener-l and returns the resulting multicast listener.
remove(Component). Method in class [Link]
Removes the specified component from this container.
remove(ComponentListener, ComponentListener). Static method in class [Link]
Removes the old component-listener from component-listener-l and returns the resulting multicast listener.
remove(ContainerListener, ContainerListener). Static method in class [Link]
Removes the old container-listener from container-listener-l and returns the resulting multicast listener.
remove(EventListener). Method in class [Link]

o
Removes a listener from this multicaster and returns the resulting multicast listener.
remove(FocusListener, FocusListener). Static method in class [Link]
Removes the old focus-listener from focus-listener-l and returns the resulting multicast listener.
remove(int). Method in class [Link]
Removes an item from the choice menu.

i.c
remove(int). Method in interface [Link]
remove(int). Method in class [Link]
Removes the component at the specified index from this container.
remove(int). Method in class [Link]
Removes an item from the list.
remove(int). Method in class [Link]
Deletes the item from this menu at the specified index.
remove(int). Method in class [Link]
Removes the menu located at the specified index from the menu bar.
remove(ItemListener, ItemListener). Static method in class [Link]

dil
Removes the old item-listener from item-listener-l and returns the resulting multicast listener.
remove(KeyListener, KeyListener). Static method in class [Link]
Removes the old key-listener from key-listener-l and returns the resulting multicast listener.
remove(MenuComponent). Method in class [Link]
Removes the specified popup menu from the component.
remove(MenuComponent). Method in class [Link]
Removes the specified menu bar from this Frame.
remove(MenuComponent). Method in class [Link]
Deletes the specified item from this menu.
remove(MenuComponent). Method in class [Link]
Removes the specified menu from the menu bar.
va
remove(MenuComponent). Method in interface [Link]
remove(MouseListener, MouseListener). Static method in class [Link]
Removes the old mouse-listener from mouse-listener-l and returns the resulting multicast listener.
remove(MouseMotionListener, MouseMotionListener). Static method in class [Link]
Removes the old mouse-motion-listener from mouse-motion-listener-l and returns the resulting multicast listener.
remove(Object). Method in class [Link]
Removes the key (and its corresponding value) from this dictionary.
remove(Object). Method in class [Link]
Removes the key (and its corresponding value) from this hashtable.
remove(String). Method in class [Link]
ja

Remove the first occurrence of item from the choice menu.


remove(String). Method in class [Link]
Remove the first occurrence of item from the list.
remove(TextListener, TextListener). Static method in class [Link]
remove(WindowListener, WindowListener). Static method in class [Link]
Removes the old window-listener from window-listener-l and returns the resulting multicast listener.
removeActionListener(ActionListener). Method in class [Link]
w.

Removes the specified action listener so it no longer receives action events from this button.
removeActionListener(ActionListener). Method in class [Link]
Removes the specified action listener so it no longer receives action events from this list.
removeActionListener(ActionListener). Method in class [Link]
Removes the specified action listener so it no longer receives action events from this menu item.
removeActionListener(ActionListener). Method in class [Link]
Removes the specified action listener so that it no longer receives action events from this textfield.
removeAdjustmentListener(AdjustmentListener). Method in interface [Link]
Removes an adjustment listener.
removeAdjustmentListener(AdjustmentListener). Method in class [Link]
ww

Removes the specified adjustment listener so that it no longer receives adjustment events from this scrollbar..
removeAll(). Method in class [Link]
Removes all items from the choice menu.
removeAll(). Method in class [Link]
Removes all the components from this container.
removeAll(). Method in class [Link]
Removes all items from the list.
removeAll(). Method in interface [Link]
removeAll(). Method in class [Link]
Deletes all items from this menu.
removeAllElements(). Method in class [Link]
Removes all components from this vector and sets its size to zero.

393
394

removeCertificate(Certificate). Method in class [Link]


Removes a certificate from this identity.
removeComponentListener(ComponentListener). Method in class [Link]

m
Removes the specified listener so it no longer receives component events from this component.
removeConsumer(ImageConsumer). Method in class [Link]
Removes an ImageConsumer from the list of consumers interested in data for this image.
removeConsumer(ImageConsumer). Method in interface [Link]
This method removes the given ImageConsumer object from the list of consumers currently registered to receive image data.
removeConsumer(ImageConsumer). Method in class [Link]
Remove an ImageConsumer from the list of consumers interested in data for this image.
removeContainerListener(ContainerListener). Method in class [Link]

o
Removes the specified container listener so it no longer receives container events from this container.
removeElement(Object). Method in class [Link]
Removes the first occurrence of the argument from this vector.
removeElementAt(int). Method in class [Link]
Deletes the component at the specified index.

i.c
removeEntry(Principal, AclEntry). Method in interface [Link]
Removes an ACL entry from this ACL.
removeFocusListener(FocusListener). Method in class [Link]
Removes the specified focus listener so it no longer receives focus events from this component.
removeIdentity(Identity). Method in class [Link]
Removes an identity from this identity scope.
removeImage(Image). Method in class [Link]
Remove the specified Image from this MediaTracker.
removeImage(Image, int). Method in class [Link]
Remove the specified Image from the specified ID of this MediaTracker.

dil
removeImage(Image, int, int, int). Method in class [Link]
Remove the specified image with the specified size and ID from this MediaTracker.
removeInternal(EventListener, EventListener). Static method in class [Link]
Returns the resulting multicast listener after removing the old listener from listener-l.
removeItemListener(ItemListener). Method in class [Link]
Removes the specified item listener so that it no longer receives item events from this checkbox.
removeItemListener(ItemListener). Method in class [Link]
Removes the specified item listener so it no longer receives item events from this checkbox menu item.
removeItemListener(ItemListener). Method in class [Link]
Removes the specified item listener so that it no longer receives item events from this choice.
removeItemListener(ItemListener). Method in interface [Link]
va
Removes an item listener.
removeItemListener(ItemListener). Method in class [Link]
Removes the specified item listener so it no longer receives item events from this list.
removeKeyListener(KeyListener). Method in class [Link]
Removes the specified key listener so it no longer receives key events from this component.
removeLayoutComponent(Component). Method in class [Link]
Removes the specified component from the layout.
removeLayoutComponent(Component). Method in class [Link]
Removes the specified component from the layout.
removeLayoutComponent(Component). Method in class [Link]
ja

Removes the specified component from the layout.


removeLayoutComponent(Component). Method in class [Link]
Removes the specified component from the layout.
removeLayoutComponent(Component). Method in class [Link]
Removes the specified component from the layout.
removeLayoutComponent(Component). Method in interface [Link]
Removes the specified component from the layout.
w.

removeMember(Principal). Method in interface [Link]


Removes the specified member from the group.
removeMouseListener(MouseListener). Method in class [Link]
Removes the specified mouse listener so it no longer receives mouse events from this component.
removeMouseMotionListener(MouseMotionListener). Method in class [Link]
Removes the specified mouse motion listener so it no longer receives mouse motion events from this component.
removeNotify(). Method in class [Link]
Notifies the Component that it has been removed from its container and if a peers ecists, it destroys it.
removeNotify(). Method in class [Link]
Notifies the container to remove its peer.
ww

removeNotify(). Method in class [Link]


Removes the peer for this list.
removeNotify(). Method in class [Link]
Removes the menu's peer.
removeNotify(). Method in class [Link]
Removes the menu bar's peer.
removeNotify(). Method in class [Link]
Removes the menu component's peer.
removeNotify(). Method in class [Link]
Removes the TextComponent's peer.
removePermission(Permission). Method in interface [Link]
Removes the specified permission from this ACL entry.

394
395

removePropertyChangeListener(PropertyChangeListener). Method in interface [Link]


Remove a listener for the PropertyChange event.
removePropertyChangeListener(PropertyChangeListener). Method in class [Link]

m
Remove a PropertyChangeListener from the listener list.
removePropertyChangeListener(PropertyChangeListener). Method in interface [Link]
Remove a listener for the PropertyChange event.
removePropertyChangeListener(PropertyChangeListener). Method in class [Link]
Remove a listener for the PropertyChange event.
removeProvider(String). Static method in class [Link]
Removes the provider with the specified name.
removeTextListener(TextListener). Method in class [Link]

o
Removes the specified text event listener so that it no longer receives text events from this textcomponent
removeVetoableChangeListener(VetoableChangeListener). Method in class [Link]
Remove a VetoableChangeListener from the listener list.
removeWindowListener(WindowListener). Method in class [Link]
Removes the specified window listener so that it no longer receives window events from this window.

i.c
renameTo(File). Method in class [Link]
Renames the file specified by this File object to have the pathname given by the File argument.
repaint(). Method in class [Link]
Repaints the component.
repaint(int, int, int, int). Method in class [Link]
Repaints part of the component.
repaint(long). Method in class [Link]
Repaints the component.
repaint(long, int, int, int, int). Method in class [Link]
Repaints part of the component.

dil
repaint(long, int, int, int, int). Method in interface [Link]
replace(char, char). Method in class [Link]
Returns a new string resulting from replacing all occurrences of oldChar in this string with newChar.
replaceItem(String, int). Method in class [Link]
Replaces the item at the given index.
replaceObject(Object). Method in class [Link]
This method will allow trusted subclasses of ObjectOutputStream to substitute one object for another during serialization.
replaceRange(String, int, int). Method in class [Link]
Replaces text from the indicated start to end position with the new text specified.
replaceRange(String, int, int). Method in interface [Link]
replaceText(String, int, int). Method in class [Link]
va
replaceText(String, int, int). Method in interface [Link]
DEPRECATED: Replaced by ReplaceRange(String, int, int).
ReplicateScaleFilter(int, int). Constructor for class [Link]
Constructs a ReplicateScaleFilter that scales the pixels from its source Image as specified by the width and height parameters.
requestFocus(). Method in class [Link]
Requests the input focus.
requestFocus(). Method in interface [Link]
requestTopDownLeftRightResend(ImageConsumer). Method in class [Link]
Requests that a given ImageConsumer have the image data delivered one more time in top-down, left-right order.
requestTopDownLeftRightResend(ImageConsumer). Method in interface [Link]
ja

This method is used by an ImageConsumer to request that the ImageProducer attempt to resend the image data one more
time in TOPDOWNLEFTRIGHT order so that higher quality conversion algorithms which depend on receiving pixels in
order can be used to produce a better output version of the image.
requestTopDownLeftRightResend(ImageConsumer). Method in class [Link]
Requests that a given ImageConsumer have the image data delivered one more time in top-down, left-right order.
required. Variable in class [Link]
"required" is true if a value must be supplied for this property during [Link].
w.

resendTopDownLeftRight(ImageProducer). Method in class [Link]


Responds to a request for a TopDownLeftRight (TDLR) ordered resend of the pixel data from an ImageConsumer.
reset(). Method in class [Link].Adler32
Resets checksum to initial value.
reset(). Method in class [Link]
Repositions this stream to the position at the time the mark method was last called on this input stream.
reset(). Method in class [Link]
Reset the stream to the most recent mark.
reset(). Method in class [Link]
Resets the buffer to the marked position.
ww

reset(). Method in class [Link]


Resets the count field of this byte array output stream to zero, so that all currently accumulated output in the ouput stream is
discarded.
reset(). Method in class [Link]
Reset the stream to the most recent mark, or to the beginning if it has never been marked.
reset(). Method in class [Link]
Resets the buffer so that you can use it again without throwing away the already allocated buffer.
reset(). Method in interface [Link]
Resets the checksum to its initial value.
reset(). Method in class [Link]
Resets the cursor to the beginning of the string.
reset(). Method in class [Link].CRC32

395
396

Resets CRC-32 to initial value.


reset(). Method in class [Link]
Resets deflater so that a new set of input data can be processed.

m
reset(). Method in class [Link]
Repositions this stream to the position at the time the mark method was last called on this input stream.
reset(). Method in class [Link]
Reset the stream.
reset(). Method in class [Link]
Resets inflater so that a new set of input data can be processed.
reset(). Method in class [Link]
Repositions this stream to the position at the time the mark method was last called on this input stream.

o
reset(). Method in class [Link]
Repositions this stream to the position at the time the mark method was last called on this input stream.
reset(). Method in class [Link]
Reset the stream to the most recent mark.
reset(). Method in class [Link]

i.c
Resets the digest for further use.
reset(). Method in class [Link]
Reset will disregard the state of any objects already written to the stream.
reset(). Method in class [Link]
Reset the stream.
reset(). Method in class [Link]
Resets the input stream to begin reading from the first character of this input stream's underlying buffer.
reset(). Method in class [Link]
Reset the stream to the most recent mark, or to the beginning of the string if it has never been marked.
resetCurrentFrameIndex(). Method in class [Link]

dil
Reset the current stackframe
resetSyntax(). Method in class [Link]
Resets this tokenizer's syntax table so that all characters are "ordinary." See the ordinaryChar method for more information
on a character being ordinary.
reshape(int, int, int, int). Method in class [Link]
reshape(int, int, int, int). Method in interface [Link]
DEPRECATED: Replaced by setBounds(int, int, int, int).
reshape(int, int, int, int). Method in class [Link]
resize(Dimension). Method in class [Link]
Requests that this applet be resized.
resize(Dimension). Method in class [Link]
va
resize(int, int). Method in class [Link]
Requests that this applet be resized.
resize(int, int). Method in class [Link]
resize(int, int). Method in class [Link]
resolveClass(Class). Method in class [Link]
Resolves the class so that an instance of the class can be created, or so that one of its methods can be called.
resolveClass(ObjectStreamClass). Method in class [Link]
Subclasses may implement this method to allow classes to be fetched from an alternate source.
resolveObject(Object). Method in class [Link]
This method will allow trusted subclasses of ObjectInputStream to substitute one object for another during deserialization.
ja

ResourceBundle(). Constructor for class [Link]


responseCode. Variable in class [Link]
responseMessage. Variable in class [Link]
resume(). Method in class [Link]
Resume execution of this thread.
resume(). Method in class [Link]
Resumes a suspended thread.
w.

resume(). Method in class [Link]


Resumes all processes in this thread group.
reverse(). Method in class [Link]
The character sequence contained in this string buffer is replaced by the reverse of the sequence.
RGBImageFilter(). Constructor for class [Link]
RGBtoHSB(int, int, int, float[]). Static method in class [Link]
Returns the HSB values corresponding to the color defined by the red, green, and blue components.
RIGHT. Static variable in class [Link]
The right arrow action-key.
RIGHT. Static variable in class [Link]
ww

The right alignment variable.


right. Variable in class [Link]
The inset from the right.
RIGHT. Static variable in class [Link]
The right alignment.
RIGHT_ALIGNMENT. Static variable in class [Link]
Ease of use constant for getAlignmentX().
rint(double). Static method in class [Link]
returns the closest integer to the argument.
RMISecurityException(String). Constructor for class [Link]
Constructs a RMISecurityException with no detail message.
RMISecurityException(String, String). Constructor for class [Link]

396
397

Constructs a RMISecurityException with the specified detail message.


RMISecurityManager(). Constructor for class [Link]
Construct and initialize.

m
RMISocketFactory(). Constructor for class [Link]
roll(int, boolean). Method in class [Link]
Time Field Rolling function.
roll(int, boolean). Method in class [Link]
Overrides Calendar Time Field Rolling function.
rollback(). Method in interface [Link]
Rollback drops all changes made since the previous commit/rollback and releases any database locks currently held by the
Connection.

o
round(double). Static method in class [Link]
Returns the closest long to the argument.
round(float). Static method in class [Link]
Returns the closest int to the argument.
ROUND_CEILING. Static variable in class [Link]

i.c
If the BigDecimal is positive, behave as for ROUND_UP; if negative, behave as for ROUND_DOWN.
ROUND_DOWN. Static variable in class [Link]
Never increment the digit prior to a discarded fraction (i.e., truncate).
ROUND_FLOOR. Static variable in class [Link]
If the BigDecimal is positive, behave as for ROUND_DOWN; if negative behave as for ROUND_UP.
ROUND_HALF_DOWN. Static variable in class [Link]
Behave as for ROUND_UP if the discarded fraction is > .5; otherwise, behave as for ROUND_DOWN.
ROUND_HALF_EVEN. Static variable in class [Link]
Behave as for ROUND_HALF_UP if the digit to the left of the discarded fraction is odd; behave as for
ROUND_HALF_DOWN if it's even.

dil
ROUND_HALF_UP. Static variable in class [Link]
Behave as for ROUND_UP if the discarded fraction is >= .5; otherwise, behave as for ROUND_DOWN.
ROUND_UNNECESSARY. Static variable in class [Link]
This "pseudo-rounding-mode" is actually an assertion that the requested operation has an exact result, hence no rounding is
necessary.
ROUND_UP. Static variable in class [Link]
Always increment the digit prior to a non-zero discarded fraction.
rowHeights. Variable in class [Link]
rowWeights. Variable in class [Link]
RuleBasedCollator(String). Constructor for class [Link]
RuleBasedCollator constructor.
va
run(). Method in interface [Link]
When an object implementing interface Runnable is used to create a thread, starting the thread causes the object's run
method to be called in that separately executing thread.
run(). Method in class [Link]
If this thread was constructed using a separate Runnable run object, then that Runnable object's run method is called;
otherwise, this method does nothing and returns.
run(int, String[]). Method in class [Link]
Load and run a runnable Java class, with any optional parameters.
runFinalization(). Method in class [Link]
Runs the finalization methods of any objects pending finalization.
ja

runFinalization(). Static method in class [Link]


Runs the finalization methods of any objects pending finalization.
runFinalizersOnExit(boolean). Static method in class [Link]
Enable or disable finalization on exit; doing so specifies that the finalizers of all objects that have finalizers that have not yet
been automatically invoked are to be run before the Java runtime exits.
runFinalizersOnExit(boolean). Static method in class [Link]
Enable or disable finalization on exit; doing so specifies that the finalizers of all objects that have finalizers that have not yet
w.

been automatically invoked are to be run before the Java runtime exits.
RuntimeException(). Constructor for class [Link]
Constructs a RuntimeException with no detail message.
RuntimeException(String). Constructor for class [Link]
Constructs a RuntimeException with the specified detail message.

S
ww

S_RESIZE_CURSOR. Static variable in class [Link]


The south-resize cursor type.
S_RESIZE_CURSOR. Static variable in class [Link]
sameFile(URL). Method in class [Link]
Compares two URLs, excluding the "ref" fields.
SATURDAY. Static variable in class [Link]
Useful constant for days of week.
SAVE. Static variable in class [Link]
The file save variable.
save(OutputStream, String). Method in class [Link]
Stores this property list to the specified output stream.
SAVE_FILE. Static variable in class [Link]

397
398

A file saving event.


saveInternal(ObjectOutputStream, String). Method in class [Link]
scale(). Method in class [Link]

m
Returns the scale of this number.
SCALE_AREA_AVERAGING. Static variable in class [Link]
Use the Area Averaging image scaling algorithm.
SCALE_DEFAULT. Static variable in class [Link]
Use the default image scaling algorithm.
SCALE_FAST. Static variable in class [Link]
Choose an image scaling algorithm that gives higher priority to scaling speed than smoothness of the scaled image.
SCALE_REPLICATE. Static variable in class [Link]

o
Use the ReplicateScaleFilter image scaling algorithm.
SCALE_SMOOTH. Static variable in class [Link]
Choose an image scaling algorithm that gives higher priority to image smoothness than scaling speed.
SCROLL_ABSOLUTE. Static variable in class [Link]
The absolute scroll event.

i.c
SCROLL_BEGIN. Static variable in class [Link]
The scroll begin event.
SCROLL_END. Static variable in class [Link]
The scroll end event.
SCROLL_LINE_DOWN. Static variable in class [Link]
The line down scroll event.
SCROLL_LINE_UP. Static variable in class [Link]
The line up scroll event.
SCROLL_LOCK. Static variable in class [Link]
The ScrollLock action-key.

dil
SCROLL_PAGE_DOWN. Static variable in class [Link]
The page down scroll event.
SCROLL_PAGE_UP. Static variable in class [Link]
The page up scroll event.
scrollbar. Static variable in class [Link]
The background color for scrollbars.
SCROLLBAR. Static variable in class [Link]
The array index for the scrollbar background color.
Scrollbar(). Constructor for class [Link]
Constructs a new vertical Scrollbar.
Scrollbar(int). Constructor for class [Link]
va
Constructs a new Scrollbar with the specified orientation.
Scrollbar(int, int, int, int, int). Constructor for class [Link]
Constructs a new Scrollbar with the specified orientation, value, page size, and minumum and maximum values.
SCROLLBARS_ALWAYS. Static variable in class [Link]
Specifies that horizontal/vertical scrollbars should always be shown regardless of the respective sizes of the scrollpane and
child.
SCROLLBARS_AS_NEEDED. Static variable in class [Link]
Specifies that horizontal/vertical scrollbar should be shown only when the size of the child exceeds the size of the scrollpane in
the horizontal/vertical dimension.
SCROLLBARS_BOTH. Static variable in class [Link]
ja

Create and display both vertical and horizontal scrollbars.


SCROLLBARS_HORIZONTAL_ONLY. Static variable in class [Link]
Create and display horizontal scrollbar only.
SCROLLBARS_NEVER. Static variable in class [Link]
Specifies that horizontal/vertical scrollbars should never be shown regardless of the respective sizes of the scrollpane and
child.
SCROLLBARS_NONE. Static variable in class [Link]
w.

Do not create or display any scrollbars for the text area.


SCROLLBARS_VERTICAL_ONLY. Static variable in class [Link]
Create and display vertical scrollbar only.
ScrollPane(). Constructor for class [Link]
Create a new scrollpane container with a scrollbar display policy of "as needed".
ScrollPane(int). Constructor for class [Link]
Create a new scrollpane container.
SE_RESIZE_CURSOR. Static variable in class [Link]
The south-east-resize cursor type.
SE_RESIZE_CURSOR. Static variable in class [Link]
ww

search(Object). Method in class [Link]


Returns where an object is on this stack.
SECOND. Static variable in class [Link]
Useful constant for date and time.
SECOND_FIELD. Static variable in class [Link]
Useful constant for SECOND field alignment.
SECONDARY. Static variable in class [Link]
Collator strength value.
secondaryOrder(int). Static method in class [Link]
Get the secondary order of a collation order.
SecureRandom(). Constructor for class [Link]
This empty constructor automatically seeds the generator.

398
399

SecureRandom(byte[]). Constructor for class [Link]


This constructor uses a user-provided seed in preference to the self-seeding algorithm referred to in the empty constructor
description.

m
SecurityException(). Constructor for class [Link]
Constructs a SecurityException with no detail message.
SecurityException(String). Constructor for class [Link]
Constructs a SecurityException with the specified detail message.
SecurityManager(). Constructor for class [Link]
Constructs a new SecurityManager.
seek(long). Method in class [Link]
Sets the offset from the beginning of this file at which the next read or write occurs.

o
select(int). Method in class [Link]
Selects the item with the specified postion.
select(int). Method in interface [Link]
select(int). Method in class [Link]
Selects the item at the specified index.

i.c
select(int). Method in interface [Link]
select(int, int). Method in class [Link]
Selects the text found between the specified start and end locations.
select(int, int). Method in interface [Link]
select(String). Method in class [Link]
Selects the item with the specified String.
selectAll(). Method in class [Link]
Selects all the text in the TextComponent.
SELECTED. Static variable in class [Link]
The item selected state change type.

dil
send(DatagramPacket). Method in class [Link]
Sends a datagram packet from this socket.
send(DatagramPacket). Method in class [Link]
Sends a datagram packet.
send(DatagramPacket, byte). Method in class [Link]
Sends a datagram packet to the destination, with a TTL (time- to-live) other than the default for the socket.
separator. Static variable in class [Link]
The system-dependent path separator character.
separatorChar. Static variable in class [Link]
The system-dependent path separator string.
SEPTEMBER. Static variable in class [Link]
va
Useful constant for month.
SequenceInputStream(Enumeration). Constructor for class [Link]
Constructs a new sequence input stream initialized to the specified enumeration of input streams.
SequenceInputStream(InputStream, InputStream). Constructor for class [Link]
Constructs a new sequence input stream initialized to read first from the input stream s1, and then from the input stream s2.
ServerCloneException(String). Constructor for class [Link]
Create A remote exception with the specified string
ServerCloneException(String, Exception). Constructor for class [Link]
Create A remote exception with the specified string, and the exception specified.
ServerError(String, Error). Constructor for class [Link]
ja

Create a new "server error" exception with the string and the specified exception.
ServerException(String). Constructor for class [Link]
Create a new server exception with a descriptive string.
ServerException(String, Exception). Constructor for class [Link]
Create a new server exception with a descriptive string and an exception.
ServerNotActiveException(). Constructor for class [Link]
Create a new exception.
w.

ServerNotActiveException(String). Constructor for class [Link]


ServerRuntimeException(String, Exception). Constructor for class [Link]
Create a new runtime exception with the strings and the specified exception.
ServerSocket(int). Constructor for class [Link]
Creates a server socket on a specified port.
ServerSocket(int, int). Constructor for class [Link]
Creates a server socket and binds it to the specified local port number.
ServerSocket(int, int, InetAddress). Constructor for class [Link]
Create a server with the specified port, listen backlog, and local IP address to bind to.
set(int). Method in class [Link]
ww

Sets the bit specified by the index to true.


set(int, int). Method in class [Link]
Sets the time field with the given value.
set(int, int, int). Method in class [Link]
Sets the values for the fields year, month, and date.
set(int, int, int, int, int). Method in class [Link]
Sets the values for the fields year, month, date, hour, and minute.
set(int, int, int, int, int, int). Method in class [Link]
Sets the values for the fields year, month, date, hour, minute, and second.
set(Object, int, Object). Static method in class [Link]
Sets the value of the indexed component of the specified array object to the specified new
value.

399
400

set(Object, Object). Method in class [Link]


Sets the field represented by this Field object on the specified object argument to the
specified new value.

m
set(String, String, int, String, String). Method in class [Link]
Sets the fields of the URL.
setActionCommand(String). Method in class [Link]
Sets the command name of the action event fired by this button.
setActionCommand(String). Method in class [Link]
Sets the command name of the action event fired by this menu item.
setAddress(InetAddress). Method in class [Link]
setAlignment(int). Method in class [Link]

o
Sets the alignment value for this layout.
setAlignment(int). Method in class [Link]
Sets the alignment for this label to the specified alignment.
setAlignment(int). Method in interface [Link]
setAllowUserInteraction(boolean). Method in class [Link]

i.c
Set the value of the allowUserInteraction field of this URLConnection.
setAmPmStrings(String[]). Method in class [Link]
Sets ampm strings.
setAnimated(boolean). Method in class [Link]
Change this memory image into a multi-frame animation or a single-frame static image depending
on the animated parameter.
setAsciiStream(int, InputStream, int). Method in interface [Link]
When a very large ASCII value is input to a LONGVARCHAR parameter, it may be more practical to
send it via a [Link].
setAsText(String). Method in interface [Link]

dil
Set the property value by parsing a given String.
setAsText(String). Method in class [Link]
Set the property value by parsing a given String.
setAutoCommit(boolean). Method in interface [Link]
If a connection is in auto-commit mode, then all its SQL statements will be executed and
committed as individual transactions.
setBackground(Color). Method in class [Link]
Sets the background color.
setBackground(Color). Method in interface [Link]
setBeanInfoSearchPath(String[]). Static method in class [Link]
Change the list of package names that will be used for finding BeanInfo classes.
va
setBigDecimal(int, BigDecimal). Method in interface [Link]
Set a parameter to a [Link] value.
setBinaryStream(int, InputStream, int). Method in interface [Link]
When a very large binary value is input to a LONGVARBINARY parameter, it may be more practical
to send it via a [Link].
setBit(int). Method in class [Link]
Returns a BigInteger whose value is equivalent to this number with the designated bit set.
setBlockIncrement(int). Method in interface [Link]
Sets the block value increment for the adjustable object.
setBlockIncrement(int). Method in class [Link]
ja

Sets the block increment for this scrollbar.


setBoolean(int, boolean). Method in interface [Link]
Set a parameter to a Java boolean value.
setBoolean(Object, boolean). Method in class [Link]
Set the value of a field as a boolean on specified object.
setBoolean(Object, int, boolean). Static method in class [Link]
Sets the value of the indexed component of the specified array object to the specified boolean
w.

value.
setBound(boolean). Method in class [Link]
Updates to "bound" properties will cause a "PropertyChange" event to get fired when the
property is changed.
setBounds(int, int, int, int). Method in class [Link]
Reshapes the Component to the specified bounding box.
setBounds(int, int, int, int). Method in interface [Link]
setBounds(int, int, int, int). Method in class [Link]
Set the bounds of this rectangle to the specified x, y, width, and height.
setBounds(Rectangle). Method in class [Link]
ww

Reshapes the Component to the specified bounding box.


setBounds(Rectangle). Method in class [Link]
Set the bounds of this rectangle to match the specified rectangle.
setBreakpointLine(int). Method in class [Link]
Set a breakpoint at a specified source line number in a class.
setBreakpointMethod(RemoteField). Method in class [Link]
Set a breakpoint at the first line of a class method.
setByte(int, byte). Method in interface [Link]
Set a parameter to a Java byte value.
setByte(Object, byte). Method in class [Link]
Set the value of a field as a byte on specified object.
setByte(Object, int, byte). Static method in class [Link]

400
401

Sets the value of the indexed component of the specified array object to the specified boolean
value.
setBytes(int, byte[]). Method in interface [Link]

m
Set a parameter to a Java array of bytes.
setCalendar(Calendar). Method in class [Link]
Set the calendar to be used by this date format.
setCaretPosition(int). Method in class [Link]
Sets the position of the text insertion caret for the TextComponent
setCaretPosition(int). Method in interface [Link]
setCatalog(String). Method in interface [Link]
A sub-space of this Connection's database may be selected by setting a catalog name.

o
setChanged(). Method in class [Link]
Indicates that this object has changed.
setChar(Object, char). Method in class [Link]
Set the value of a field as a char on specified object.
setChar(Object, int, char). Static method in class [Link]

i.c
Sets the value of the indexed component of the specified array object to the specified byte
value.
setCharAt(int, char). Method in class [Link]
The character at the specified index of this string buffer is set to ch.
setCheckboxGroup(CheckboxGroup). Method in class [Link]
Sets the CheckboxGroup to the specified group.
setCheckboxGroup(CheckboxGroup). Method in interface [Link]
setChoices(double[], String[]). Method in class [Link]
Set the choices to be used in formatting.
setClip(int, int, int, int). Method in class [Link]

dil
Sets the current clip to the rectangle specified by the given coordinates.
setClip(Shape). Method in class [Link]
Set the current clipping area to an arbitrary clip shape.
setColor(Color). Method in class [Link]
Sets the current color to the specified color.
setColorModel(ColorModel). Method in interface [Link]
The ColorModel object used for the majority of the pixels reported using the setPixels method
calls.
setColorModel(ColorModel). Method in class [Link]
Filter the information provided in the setColorModel method of the ImageConsumer interface.
setColorModel(ColorModel). Method in class [Link]
va
The setColorModel method is part of the ImageConsumer API which this class must implement to
retrieve the pixels.
setColorModel(ColorModel). Method in class [Link]
If the ColorModel is an IndexColorModel, and the subclass has set the canFilterIndexColorModel
flag to true, we substitute a filtered version of the color model here and wherever that
original ColorModel object appears in the setPixels methods.
setColumns(int). Method in class [Link]
Sets the number of columns in this layout.
setColumns(int). Method in class [Link]
Sets the number of columns for this TextArea.
ja

setColumns(int). Method in class [Link]


Sets the number of columns in this TextField.
setComment(String). Method in class [Link]
Sets the optional comment string for the entry.
setComment(String). Method in class [Link]
Sets the ZIP file comment.
setConstrained(boolean). Method in class [Link]
w.

Attempted updates to "Constrained" properties will cause a "VetoableChange" event to get fired
when the property is changed.
setConstraints(Component, GridBagConstraints). Method in class [Link]
Sets the constraints for the specified component.
setContentHandlerFactory(ContentHandlerFactory). Static method in class [Link]
Sets the ContentHandlerFactory of an application.
setContents(Transferable, ClipboardOwner). Method in class [Link]
Sets the current contents of the clipboard to the specified transferable object and registers
the specified clipboard owner as the owner of the new contents.
setCrc(long). Method in class [Link]
ww

Sets the CRC-32 checksum of the uncompressed entry data.


setCurrent(Checkbox). Method in class [Link]
setCurrentFrameIndex(int). Method in class [Link]
Set the current stackframe index
setCursor(Cursor). Method in class [Link]
Set the cursor image to a predefined cursor.
setCursor(Cursor). Method in interface [Link]
setCursor(int). Method in class [Link]
setCursorName(String). Method in interface [Link]
setCursorname defines the SQL cursor name that will be used by subsequent Statement execute
methods.
setDaemon(boolean). Method in class [Link]

401
402

Marks this thread as either a daemon thread or a user thread.


setDaemon(boolean). Method in class [Link]
Changes the daemon status of this thread group.

m
setData(byte[]). Method in class [Link]
setDate(int). Method in class [Link]
Sets the day of the month of this date to the specified value.
setDate(int). Method in class [Link]
Sets the day of the month of this date to the specified value.
setDate(int, Date). Method in interface [Link]
Set a parameter to a [Link] value.
setDateFormatSymbols(DateFormatSymbols). Method in class [Link]

o
Allows you to set the date/time formatting data.
setDecimalFormatSymbols(DecimalFormatSymbols). Method in class [Link]
Sets the decimal format symbols, which is generally not changed by the programmer or user.
setDecimalSeparator(char). Method in class [Link]
setDecimalSeparatorAlwaysShown(boolean). Method in class [Link]

i.c
Allows you to set the behavior of the decimal separator with integers.
setDecomposition(int). Method in class [Link]
Set the decomposition mode of this Collator.
setDefault(Locale). Static method in class [Link]
Sets the default.
setDefault(TimeZone). Static method in class [Link]
Sets time zone to using the given TimeZone.
setDefaultAllowUserInteraction(boolean). Static method in class [Link]
Sets the default value of the allowUserInteraction field for all future URLConnection objects
to the specified value.

dil
setDefaultRequestProperty(String, String). Static method in class [Link]
Sets the default value of a general request property.
setDefaultStream(PrintStream). Static method in class [Link]
Set the default stream for new logs.
setDefaultUseCaches(boolean). Method in class [Link]
Sets the default value of the useCaches field to the specified value.
setDesignTime(boolean). Static method in class [Link]
Used to indicate whether of not we are running in an application builder environment.
setDictionary(byte[]). Method in class [Link]
Sets preset dictionary for compression.
setDictionary(byte[]). Method in class [Link]
va
Sets the preset dictionary to the given array of bytes.
setDictionary(byte[], int, int). Method in class [Link]
Sets preset dictionary for compression.
setDictionary(byte[], int, int). Method in class [Link]
Sets the preset dictionary to the given array of bytes.
setDigit(char). Method in class [Link]
setDimensions(int, int). Method in class [Link]
Override the source image's dimensions and pass the dimensions of the rectangular cropped
region to the ImageConsumer.
setDimensions(int, int). Method in interface [Link]
ja

The dimensions of the source image are reported using the setDimensions method call.
setDimensions(int, int). Method in class [Link]
Filters the information provided in the setDimensions method of the ImageConsumer interface.
setDimensions(int, int). Method in class [Link]
The setDimensions method is part of the ImageConsumer API which this class must implement to
retrieve the pixels.
setDimensions(int, int). Method in class [Link]
w.

Override the dimensions of the source image and pass the dimensions of the new scaled size to
the ImageConsumer.
setDirectory(String). Method in class [Link]
Set the directory of the Dialog to the specified directory.
setDirectory(String). Method in interface [Link]
setDisplayName(String). Method in class [Link]
setDoInput(boolean). Method in class [Link]
Sets the value of the doInput field for this URLConnection to the specified value.
setDoOutput(boolean). Method in class [Link]
Sets the value of the doOutput field for this URLConnection to the specified value.
ww

setDouble(int, double). Method in interface [Link]


Set a parameter to a Java double value.
setDouble(Object, double). Method in class [Link]
Set the value of a field as a double on specified object.
setDouble(Object, int, double). Static method in class [Link]
Sets the value of the indexed component of the specified array object to the specified double
value.
setEchoChar(char). Method in class [Link]
Sets the echo character for this TextField.
setEchoChar(char). Method in interface [Link]
setEchoCharacter(char). Method in class [Link]
setEchoCharacter(char). Method in interface [Link]

402
403

DEPRECATED: Replaced by setEchoChar(char echoChar).


setEditable(boolean). Method in class [Link]
Sets the specified boolean to indicate whether or not this TextComponent should be editable.

m
setEditable(boolean). Method in interface [Link]
setEditorSearchPath(String[]). Static method in class [Link]
Change the list of package names that will be used for finding property editors.
setElementAt(Object, int). Method in class [Link]
Sets the component at the specified index of this vector to be the specified object.
setEnabled(boolean). Method in class [Link]
Enables a component.
setEnabled(boolean). Method in interface [Link]

o
setEnabled(boolean). Method in class [Link]
Sets whether or not this menu item can be chosen.
setEnabled(boolean). Method in interface [Link]
setEndRule(int, int, int, int). Method in class [Link]
Sets the daylight savings ending rule.

i.c
setEras(String[]). Method in class [Link]
Sets era strings.
setErr(PrintStream). Static method in class [Link]
Reassigns the "standard" error output stream.
setError(). Method in class [Link]
Indicates that an error has occurred.
setError(). Method in class [Link]
Indicate that an error has occurred.
setEscapeProcessing(boolean). Method in interface [Link]
If escape scanning is on (the default), the driver will do escape substitution before sending

dil
the SQL to the database.
setExpert(boolean). Method in class [Link]
The "expert" flag is used to distinguish between features that are intended for expert users
from those that are intended for normal users.
setExtra(byte[]). Method in class [Link]
Sets the optional extra field data for the entry.
setFailureHandler(RMIFailureHandler). Static method in class [Link]
Set the failure handler to be called by the RMI runtime if socket creation fails.
setField(int, boolean). Method in class [Link]
Set a boolean instance variable, specified by slot.
setField(int, char). Method in class [Link]
va
Set a char instance variable, specified by slot.
setField(int, double). Method in class [Link]
Set a double instance variable, specified by slot.
setField(int, float). Method in class [Link]
Set a float instance variable, specified by slot.
setField(int, int). Method in class [Link]
Set an int instance variable, specified by slot.
setField(int, long). Method in class [Link]
Set a long instance variable, specified by slot.
setField(int, RemoteObject). Method in class [Link]
ja

Set an object instance variable, specified by slot.


setField(String, boolean). Method in class [Link]
Set a boolean instance variable, specified by name.
setField(String, char). Method in class [Link]
Set a char instance variable, specified by name.
setField(String, double). Method in class [Link]
Set a double instance variable, specified by name.
w.

setField(String, float). Method in class [Link]


Set a float instance variable, specified by name.
setField(String, int). Method in class [Link]
Set an int instance variable, specified by name.
setField(String, long). Method in class [Link]
Set a long instance variable, specified by name.
setField(String, RemoteObject). Method in class [Link]
Set an object instance variable, specified by name.
setFile(String). Method in class [Link]
Sets the file for this dialog to the specified file.
ww

setFile(String). Method in interface [Link]


setFilenameFilter(FilenameFilter). Method in class [Link]
Sets the filter for this dialog to the specified filter.
setFilenameFilter(FilenameFilter). Method in interface [Link]
setFirstDayOfWeek(int). Method in class [Link]
Sets what the first day of the week is; e.g., Sunday in US, Monday in France.
setFloat(int, float). Method in interface [Link]
Set a parameter to a Java float value.
setFloat(Object, float). Method in class [Link]
Set the value of a field as a float on specified object.
setFloat(Object, int, float). Static method in class [Link]
Sets the value of the indexed component of the specified array object to the specified float

403
404

value.
setFollowRedirects(boolean). Static method in class [Link]
Sets whether HTTP redirects (requests with response code 3xx) should be automatically followed

m
by this class.
setFont(Font). Method in class [Link]
Sets the font of the component.
setFont(Font). Method in interface [Link]
setFont(Font). Method in class [Link]
Sets the font for all subsequent text rendering operations.
setFont(Font). Method in class [Link]
Sets the font to be used for this MenuItem to the specified font.

o
setForeground(Color). Method in class [Link]
Sets the foreground color.
setForeground(Color). Method in interface [Link]
setFormat(int, Format). Method in class [Link]
Sets formats individually to use on parameters.

i.c
setFormats(Format[]). Method in class [Link]
Sets formats to use on parameters.
setFullBufferUpdates(boolean). Method in class [Link]
Specify whether this animated memory image should always be updated by sending the complete
buffer of pixels whenever there is a change.
setGregorianChange(Date). Method in class [Link]
Sets the GregorianCalendar change date.
setGroupingSeparator(char). Method in class [Link]
setGroupingSize(int). Method in class [Link]
Set the grouping size.

dil
setGroupingUsed(boolean). Method in class [Link]
Set whether or not grouping will be used in this format.
setGuiAvailable(boolean). Static method in class [Link]
Used to indicate whether of not we are running in an environment where GUI interaction is
available.
setHelpMenu(Menu). Method in class [Link]
Sets the help menu to the specified menu on the menu bar.
setHgap(int). Method in class [Link]
Sets the horizontal gap between components.
setHgap(int). Method in class [Link]
Sets the horizontal gap between components.
va
setHgap(int). Method in class [Link]
Sets the horizontal gap between components.
setHgap(int). Method in class [Link]
Sets the horizontal gap between components.
setHidden(boolean). Method in class [Link]
The "hidden" flag is used to identify features that are intended only for tool use, and which
should not be exposed to humans.
setHints(int). Method in class [Link]
Detect if the data is being delivered with the necessary hints to allow the averaging
algorithm to do its work.
ja

setHints(int). Method in interface [Link]


The ImageProducer can deliver the pixels in any order, but the ImageConsumer may be able to
scale or convert the pixels to the destination ColorModel more efficiently or with higher
quality if it knows some information about how the pixels will be delivered up front.
setHints(int). Method in class [Link]
Filters the information provided in the setHints method of the ImageConsumer interface.
setHints(int). Method in class [Link]
w.

The setHints method is part of the ImageConsumer API which this class must implement to
retrieve the pixels.
setHours(int). Method in class [Link]
Sets the hour of this date to the specified value.
setHours(int). Method in class [Link]
Sets the hour of this date to the specified value.
setHumanPresentableName(String). Method in class [Link]
Sets the human presentable name for the data format that this DataFlavor represents.
setIconImage(Image). Method in class [Link]
Sets the image to display when this Frame is iconized.
ww

setIconImage(Image). Method in interface [Link]


setID(String). Method in class [Link]
Sets the time zone ID.
setIfModifiedSince(long). Method in class [Link]
Sets the value of the ifModifiedSince field of this URLConnection to the specified value.
setIn(InputStream). Static method in class [Link]
Reassigns the "standard" input stream.
setInDefaultEventSet(boolean). Method in class [Link]
Mark an event set as being in the "default" set (or not).
setIndex(int). Method in interface [Link]
Set the position to the specified position in the text and return that character.
setIndex(int). Method in class [Link]

404
405

Set the current parse position.


setIndex(int). Method in class [Link]
Set the position to specified position in the text and return that character.

m
setInfinity(String). Method in class [Link]
setInfo(String). Method in class [Link]
Specifies a general information string for this identity.
setInput(byte[]). Method in class [Link]
Sets input data for compression.
setInput(byte[]). Method in class [Link]
Sets input data for decompression.
setInput(byte[], int, int). Method in class [Link]

o
Sets input data for compression.
setInput(byte[], int, int). Method in class [Link]
Sets input data for decompression.
setInt(int, int). Method in interface [Link]
Set a parameter to a Java int value.

i.c
setInt(Object, int). Method in class [Link]
Set the value of a field as an int on specified object.
setInt(Object, int, int). Static method in class [Link]
Sets the value of the indexed component of the specified array object to the specified int
value.
setInterface(InetAddress). Method in class [Link]
Set the outgoing network interface for multicast packets on this socket, to other than the
system default.
setKeyChar(char). Method in class [Link]
setKeyCode(int). Method in class [Link]

dil
setKeyPair(KeyPair). Method in class [Link]
Sets the key pair (public key and private key) for this signer.
setLabel(String). Method in class [Link]
Sets the button with the specified label.
setLabel(String). Method in interface [Link]
setLabel(String). Method in class [Link]
Sets this check box's label to be the specified string.
setLabel(String). Method in interface [Link]
setLabel(String). Method in class [Link]
Sets the label to be the specified label.
setLabel(String). Method in interface [Link]
va
setLayout(LayoutManager). Method in class [Link]
Sets the layout manager for this container.
setLayout(LayoutManager). Method in class [Link]
Sets the layout manager for this container.
setLength(int). Method in class [Link]
setLength(int). Method in class [Link]
Sets the length of this String buffer.
setLenient(boolean). Method in class [Link]
Specify whether or not date/time interpretation is to be lenient.
setLenient(boolean). Method in class [Link]
ja

Specify whether or not date/time parsing is to be lenient.


setLevel(int). Method in class [Link]
Sets the current compression level to the specified value.
setLevel(int). Method in class [Link]
Sets the compression level for subsequent entries which are DEFLATED.
setLineIncrement(int). Method in class [Link]
setLineIncrement(int). Method in interface [Link]
w.

setLineNumber(int). Method in class [Link]


Sets the line number to the specified argument.
setLineNumber(int). Method in class [Link]
Set the current line number.
setLocale(Locale). Method in class [Link]
Sets the locale of the component.
setLocale(Locale). Method in class [Link]
Constructs with the specified pattern and formats for the arguments in that pattern.
setLocalPatternChars(String). Method in class [Link]
Sets localized date-time pattern characters.
ww

setLocation(int, int). Method in class [Link]


Moves the Component to a new location.
setLocation(int, int). Method in class [Link]
Changes the point to have the specificed location.
setLocation(int, int). Method in class [Link]
Moves the rectangle to have the specificed location.
setLocation(Point). Method in class [Link]
Moves the Component to a new location.
setLocation(Point). Method in class [Link]
Changes the point to have the specificed location.
setLocation(Point). Method in class [Link]
Moves the rectangle to have the specificed location.

405
406

setLog(OutputStream). Static method in class [Link]


Log RMI calls to the output stream out.
setLoginTimeout(int). Static method in class [Link]

m
Set the maximum time in seconds that all drivers can wait when attempting to log in to a
database.
setLogStream(PrintStream). Static method in class [Link]
Set the logging/tracing PrintStream that is used by the DriverManager and all drivers.
setLong(int, long). Method in interface [Link]
Set a parameter to a Java long value.
setLong(Object, int, long). Static method in class [Link]
Sets the value of the indexed component of the specified array object to the specified long

o
value.
setLong(Object, long). Method in class [Link]
Set the value of a field as a long on specified object.
setMaxFieldSize(int). Method in interface [Link]
The maxFieldSize limit (in bytes) is set to limit the size of data that can be returned for

i.c
any column value; it only applies to BINARY, VARBINARY, LONGVARBINARY, CHAR, VARCHAR, and
LONGVARCHAR fields.
setMaximum(int). Method in interface [Link]
Sets the maximum value of the adjustable object.
setMaximum(int). Method in class [Link]
Sets the maximum value for this Scrollbar.
setMaximumFractionDigits(int). Method in class [Link]
Sets the maximum number of digits allowed in the fraction portion of a number.
setMaximumIntegerDigits(int). Method in class [Link]
Sets the maximum number of digits allowed in the integer portion of a number.

dil
setMaxPriority(int). Method in class [Link]
Sets the maximum priority of the group.
setMaxRows(int). Method in interface [Link]
The maxRows limit is set to limit the number of rows that any ResultSet can contain.
setMenuBar(MenuBar). Method in class [Link]
Sets the menubar for this Frame to the specified menubar.
setMenuBar(MenuBar). Method in interface [Link]
setMessageDigest(MessageDigest). Method in class [Link]
Associates the specified message digest with this stream.
setMessageDigest(MessageDigest). Method in class [Link]
Associates the specified message digest with this stream.
va
setMethod(int). Method in class [Link]
Sets the compression method for the entry.
setMethod(int). Method in class [Link]
Sets the default compression method for subsequent entries.
setMinimalDaysInFirstWeek(int). Method in class [Link]
Sets what the minimal days required in the first week of the year are; For example, if the
first week is defined as one that contains the first day of the first month of a year, call
the method with value 1.
setMinimum(int). Method in interface [Link]
Sets the minimum value of the adjustable object.
ja

setMinimum(int). Method in class [Link]


Sets the minimum value for this Scrollbar.
setMinimumFractionDigits(int). Method in class [Link]
Sets the minimum number of digits allowed in the fraction portion of a number.
setMinimumIntegerDigits(int). Method in class [Link]
Sets the minimum number of digits allowed in the integer portion of a number.
setMinusSign(char). Method in class [Link]
w.

setMinutes(int). Method in class [Link]


Sets the minutes of this date to the specified value.
setMinutes(int). Method in class [Link]
Sets the minutes of this date to the specified value.
setModal(boolean). Method in class [Link]
Specifies whether this Dialog is modal.
setMode(int). Method in class [Link]
Sets the mode of the file dialog.
setModifiers(int). Method in class [Link]
setMonth(int). Method in class [Link]
ww

Sets the month of this date to the specified value.


setMonth(int). Method in class [Link]
Sets the month of this date to the specified value.
setMonths(String[]). Method in class [Link]
Sets month strings.
setMultipleMode(boolean). Method in class [Link]
Sets whether this list should allow multiple selections or not.
setMultipleMode(boolean). Method in interface [Link]
setMultipleSelections(boolean). Method in class [Link]
setMultipleSelections(boolean). Method in interface [Link]
DEPRECATED: Replaced by setMultipleMode(boolean).
setMultiplier(int). Method in class [Link]

406
407

Set the multiplier for use in percent, permill, etc.


setName(Principal, String). Method in interface [Link]
Sets the name of this ACL.

m
setName(String). Method in class [Link]
Sets the name of the component to the specified string.
setName(String). Method in class [Link]
setName(String). Method in class [Link]
Sets the name of the component to the specified string.
setName(String). Method in class [Link]
Changes the name of this thread to be equal to the argument name.
setNaN(String). Method in class [Link]

o
setNanos(int). Method in class [Link]
Set the Timestamp's nanos value
setNegativePermissions(). Method in interface [Link]
Sets this ACL entry to be a negative one.
setNegativePrefix(String). Method in class [Link]

i.c
Set the negative prefix.
setNegativeSuffix(String). Method in class [Link]
Set the positive suffix.
setNextException(SQLException). Method in class [Link]
Add an SQLException to the end of the chain.
setNextWarning(SQLWarning). Method in class [Link]
Add an SQLWarning to the end of the chain.
setNull(int, int). Method in interface [Link]
Set a parameter to SQL NULL.
setNumberFormat(NumberFormat). Method in class [Link]

dil
Allows you to set the number formatter.
setObject(int, Object). Method in interface [Link]

Set the value of a parameter using an object; use the [Link] equivalent objects for
integral values.
setObject(int, Object, int). Method in interface [Link]
This method is like setObject above, but assumes a scale of zero.
setObject(int, Object, int, int). Method in interface [Link]

Set the value of a parameter using an object; use the [Link] equivalent objects for
integral values.
va
setObject(Object). Method in interface [Link]
Set the object to be customized.
setOrientation(int). Method in class [Link]
Sets the orientation for this Scrollbar.
setOut(PrintStream). Static method in class [Link]
Reassigns the "standard" output stream.
setOutputStream(OutputStream). Method in class [Link]
Set the stream to which output from this log is sent.
setPageIncrement(int). Method in class [Link]
setPageIncrement(int). Method in interface [Link]
ja

setPaintMode(). Method in class [Link]


Sets the logical pixel operation function to the Paint, or overwrite mode.
setParameter(String, Object). Method in class [Link]
Sets the specified algorithm parameter to the specified value.
setParent(ResourceBundle). Method in class [Link]
Set the parent bundle of this bundle.
setParseIntegerOnly(boolean). Method in class [Link]
w.

Sets whether or not numbers should be parsed as integers only.


setPatternSeparator(char). Method in class [Link]
setPercent(char). Method in class [Link]
setPerMill(char). Method in class [Link]
setPixels(int, int, int, int, ColorModel, byte[], int, int). Method in class
[Link]
Combine the components for the delivered byte pixels into the accumulation arrays and send on
any averaged data for rows of pixels that are complete.
setPixels(int, int, int, int, ColorModel, byte[], int, int). Method in class
[Link]
ww

Determine whether the delivered byte pixels intersect the region to be extracted and passes
through only that subset of pixels that appear in the output region.
setPixels(int, int, int, int, ColorModel, byte[], int, int). Method in interface
[Link]
The pixels of the image are delivered using one or more calls to the setPixels method.
setPixels(int, int, int, int, ColorModel, byte[], int, int). Method in class
[Link]
Filters the information provided in the setPixels method of the ImageConsumer interface which
takes an array of bytes.
setPixels(int, int, int, int, ColorModel, byte[], int, int). Method in class
[Link]
The setPixels method is part of the ImageConsumer API which this class must implement to

407
408

retrieve the pixels.


setPixels(int, int, int, int, ColorModel, byte[], int, int). Method in class
[Link]

m
Choose which rows and columns of the delivered byte pixels are needed for the destination
scaled image and pass through just those rows and columns that are needed, replicated as
necessary.
setPixels(int, int, int, int, ColorModel, byte[], int, int). Method in class
[Link]
If the ColorModel object is the same one that has already been converted, then simply passes
the pixels through with the converted ColorModel.
setPixels(int, int, int, int, ColorModel, int[], int, int). Method in class

o
[Link]
Combine the components for the delivered int pixels into the accumulation arrays and send on
any averaged data for rows of pixels that are complete.
setPixels(int, int, int, int, ColorModel, int[], int, int). Method in class
[Link]

i.c
Determine if the delivered int pixels intersect the region to be extracted and pass through
only that subset of pixels that appear in the output region.
setPixels(int, int, int, int, ColorModel, int[], int, int). Method in interface
[Link]
The pixels of the image are delivered using one or more calls to the setPixels method.
setPixels(int, int, int, int, ColorModel, int[], int, int). Method in class
[Link]
Filters the information provided in the setPixels method of the ImageConsumer interface which
takes an array of integers.
setPixels(int, int, int, int, ColorModel, int[], int, int). Method in class

dil
[Link]
The setPixels method is part of the ImageConsumer API which this class must implement to
retrieve the pixels.
setPixels(int, int, int, int, ColorModel, int[], int, int). Method in class
[Link]
Choose which rows and columns of the delivered int pixels are needed for the destination
scaled image and pass through just those rows and columns that are needed, replicated as
necessary.
setPixels(int, int, int, int, ColorModel, int[], int, int). Method in class
[Link]
If the ColorModel object is the same one that has already been converted, then simply passes
va
the pixels through with the converted ColorModel, otherwise converts the buffer of integer
pixels to the default RGB ColorModel and passes the converted buffer to the filterRGBPixels
method to be converted one by one.
setPort(int). Method in class [Link]
setPositivePrefix(String). Method in class [Link]
Set the positive prefix.
setPositiveSuffix(String). Method in class [Link]
Set the positive suffix.
setPrincipal(Principal). Method in interface [Link]
Specifies the principal for which permissions are granted or denied by this ACL entry.
ja

setPriority(int). Method in class [Link]


Changes the priority of this thread.
setPropagationId(Object). Method in class [Link]
setProperties(Hashtable). Method in class [Link]
Passes along the properties from the source object after adding a property indicating the
cropped region.
setProperties(Hashtable). Method in interface [Link]
w.

Sets the extensible list of properties associated with this image.


setProperties(Hashtable). Method in class [Link]
Passes the properties from the source object along after adding a property indicating the
stream of filters it has been run through.
setProperties(Hashtable). Method in class [Link]
The setProperties method is part of the ImageConsumer API which this class must implement to
retrieve the pixels.
setProperties(Hashtable). Method in class [Link]
Passes along the properties from the source object after adding a property indicating the
scale applied.
ww

setProperties(Properties). Static method in class [Link]


Sets the system properties to the Properties argument.
setProperty(String, String). Static method in class [Link]
Sets a security property.
setPropertyEditorClass(Class). Method in class [Link]
Normally PropertyEditors will be found using the PropertyEditorManager.
setPublicKey(PublicKey). Method in class [Link]
Sets this identity's public key.
setQueryTimeout(int). Method in interface [Link]
The queryTimeout limit is the number of seconds the driver will wait for a Statement to
execute.
setRawOffset(int). Method in class [Link]

408
409

Overrides TimeZone Sets the base time zone offset to GMT.


setRawOffset(int). Method in class [Link]
Sets the base time zone offset to GMT.

m
setReadOnly(boolean). Method in interface [Link]
You can put a connection in read-only mode as a hint to enable database optimizations.
setRef(RemoteStub, RemoteRef). Static method in class [Link]
setRequestMethod(String). Method in class [Link]
Set the method for the URL request, one of:
GET
POST
HEAD

o
OPTIONS
PUT
DELETE
TRACE
are legal, subject to protocol restrictions.

i.c
setRequestProperty(String, String). Method in class [Link]
Sets the general request property.
setResizable(boolean). Method in class [Link]
Sets the resizable flag.
setResizable(boolean). Method in interface [Link]
setResizable(boolean). Method in class [Link]
Sets the resizable flag.
setResizable(boolean). Method in interface [Link]
setRows(int). Method in class [Link]
Sets the number of rows in this layout.

dil
setRows(int). Method in class [Link]
Sets the number of rows for this TextArea.
setScale(int). Method in class [Link]
Returns a BigDecimal whose scale is the specified value, and whose value is exactly equal to
this number's.
setScale(int, int). Method in class [Link]
Returns a BigDecimal whose scale is the specified value, and whose integer value is determined
by multiplying or dividing this BigDecimal's integer value by the appropriate power of ten to
maintain the overall value.
setScrollPosition(int, int). Method in class [Link]
Scrolls to the specified position within the child component.
va
setScrollPosition(int, int). Method in interface [Link]
setScrollPosition(Point). Method in class [Link]
Scrolls to the specified position within the child component.
setSeconds(int). Method in class [Link]
Sets the seconds of this date to the specified value.
setSeconds(int). Method in class [Link]
Sets the seconds of this date to the specified value.
setSecurityManager(SecurityManager). Static method in class [Link]
Sets the System security.
setSeed(byte[]). Method in class [Link]
ja

Reseeds this random object.


setSeed(long). Method in class [Link]
Sets the seed of this random number generator using a single long seed.
setSeed(long). Method in class [Link]
Reseeds this random object, using the eight bytes contained in the given long seed.
setSelectedCheckbox(Checkbox). Method in class [Link]
Sets the current choice to the specified Checkbox.
w.

setSelectionEnd(int). Method in class [Link]


Sets the selection end to the specified position.
setSelectionStart(int). Method in class [Link]
Sets the selection start to the specified position.
setShort(int, short). Method in interface [Link]
Set a parameter to a Java short value.
setShort(Object, int, short). Static method in class [Link]
Sets the value of the indexed component of the specified array object to the specified short
value.
setShort(Object, short). Method in class [Link]
ww

Set the value of a field as a short on specified object.


setShortcut(MenuShortcut). Method in class [Link]
Set this MenuItem's MenuShortcut.
setShortDescription(String). Method in class [Link]
You can associate a short descriptive string with a feature.
setShortMonths(String[]). Method in class [Link]
Sets short month strings.
setShortWeekdays(String[]). Method in class [Link]
Sets short weekday strings.
setSigners(Class, Object[]). Method in class [Link]
Sets the signers of a class.
setSize(Dimension). Method in class [Link]

409
410

Resizes the Component to the specified dimension.


setSize(Dimension). Method in class [Link]
Set the size of this Dimension object to match the specified size.

m
setSize(Dimension). Method in class [Link]
Set the size of this rectangle to match the specified size.
setSize(int). Method in class [Link]
Sets the size of this vector.
setSize(int, int). Method in class [Link]
Resizes the Component to the specified width and height.
setSize(int, int). Method in class [Link]
Set the size of this Dimension object to the specified width and height.

o
setSize(int, int). Method in class [Link]
Set the size of this rectangle to the specified width and height.
setSize(long). Method in class [Link]
Sets the uncompressed size of the entry data.
setSocketFactory(RMISocketFactory). Static method in class [Link]

i.c
Set the socket factory from which RMI gets sockets.
setSocketFactory(SocketImplFactory). Static method in class [Link]
Sets the server socket implementation factory for the application.
setSocketImplFactory(SocketImplFactory). Static method in class [Link]
Sets the client socket implementation factory for the application.
setSoLinger(boolean, int). Method in class [Link]
Enable/disable SO_LINGER with the specified linger time.
setSoTimeout(int). Method in class [Link]
Enable/disable SO_TIMEOUT with the specified timeout, in milliseconds.
setSoTimeout(int). Method in class [Link]

dil
Enable/disable SO_TIMEOUT with the specified timeout, in milliseconds.
setSoTimeout(int). Method in class [Link]
Enable/disable SO_TIMEOUT with the specified timeout, in milliseconds.
setSourcePath(String). Method in class [Link]
Specify the list of paths to use when searching for a source file.
setStartRule(int, int, int, int). Method in class [Link]
Sets the daylight savings starting rule.
setStartYear(int). Method in class [Link]
Sets the daylight savings starting year.
setState(boolean). Method in class [Link]
Sets the Checkbox to the specifed boolean state.
va
setState(boolean). Method in class [Link]
Sets the state of this MenuItem if it is a Checkbox.
setState(boolean). Method in interface [Link]
setState(boolean). Method in interface [Link]
setStrategy(int). Method in class [Link]
Sets the compression strategy to the specified value.
setStrength(int). Method in class [Link]
Sets this Collator's strength property.
setString(int, String). Method in interface [Link]
Set a parameter to a Java String value.
ja

setStub(AppletStub). Method in class [Link]


Sets this applet's stub.
setSystemScope(IdentityScope). Static method in class [Link]
Sets the system's identity scope.
setTcpNoDelay(boolean). Method in class [Link]
Enable/disable TCP_NODELAY (disable/enable Nagle's algorithm).
setText(CharacterIterator). Method in class [Link]
w.

Set a new text for scanning.


setText(String). Method in class [Link]
Set a new text string to be scanned.
setText(String). Method in class [Link]
Sets the text for this label to the specified text.
setText(String). Method in interface [Link]
setText(String). Method in class [Link]
Sets the text of this TextComponent to the specified text.
setText(String). Method in interface [Link]
setTime(Date). Method in class [Link]
ww

Sets this Calendar's current time with the given Date.


setTime(int, Time). Method in interface [Link]
Set a parameter to a [Link] value.
setTime(long). Method in class [Link]
Set a Date using a milliseconds time value
setTime(long). Method in class [Link]
Sets this date to represent the specified number of milliseconds since January 1, 1970
00:00:00 GMT.
setTime(long). Method in class [Link]
Set a Time using a milliseconds time value
setTime(long). Method in class [Link]
Sets the modification time of the entry.

410
411

setTimeInMillis(long). Method in class [Link]


Sets this Calendar's current time from the given long value.
setTimestamp(int, Timestamp). Method in interface [Link]

m
Set a parameter to a [Link] value.
setTimeZone(TimeZone). Method in class [Link]
Sets the time zone with the given time zone value.
setTimeZone(TimeZone). Method in class [Link]
Sets the time zone for the calendar of this DateFormat object.
setTitle(String). Method in class [Link]
Sets the title of the Dialog.
setTitle(String). Method in interface [Link]

o
setTitle(String). Method in class [Link]
Sets the title for this Frame to the specified title.
setTitle(String). Method in interface [Link]
setTransactionIsolation(int). Method in interface [Link]
You can call this method to try to change the transaction isolation level using one of the

i.c
TRANSACTION_* values.
setTTL(byte). Method in class [Link]
Set the TTL (time-to-live) option.
setTTL(byte). Method in class [Link]
Set the default time-to-live for multicast packets sent out on this socket.
setUnicast(boolean). Method in class [Link]
Mark an event set as unicast (or not).
setUnicodeStream(int, InputStream, int). Method in interface [Link]
When a very large UNICODE value is input to a LONGVARCHAR parameter, it may be more practical
to send it via a [Link].

dil
setUnitIncrement(Adjustable, int). Method in interface [Link]
setUnitIncrement(int). Method in interface [Link]
Sets the unit value increment for the adjustable object.
setUnitIncrement(int). Method in class [Link]
Sets the unit increment for this scrollbar.
setUpdateRect(Rectangle). Method in class [Link]
Sets the rectangle representing the area which needs to be repainted in response to this
event.
setURL(URL, String, String, int, String, String). Method in class [Link]
Sets the fields of the URL argument to the indicated values.
setURLStreamHandlerFactory(URLStreamHandlerFactory). Static method in class [Link]
va
Sets an application's URLStreamHandlerFactory.
setUseCaches(boolean). Method in class [Link]
Sets the value of the useCaches field of this URLConnection to the specified value.
setValue(Adjustable, int). Method in interface [Link]
setValue(int). Method in interface [Link]
Sets the current value of the adjustable object.
setValue(int). Method in class [Link]
Sets the value of this Scrollbar to the specified value.
setValue(Object). Method in interface [Link]
Set (or change) the object that is to be edited.
ja

setValue(Object). Method in class [Link]


Set (or change) the object that is to be edited.
setValue(String, Object). Method in class [Link]
Associate a named attribute with this feature.
setValues(int, int, int, int). Method in class [Link]
Sets the values for this Scrollbar.
setValues(int, int, int, int). Method in interface [Link]
w.

setVgap(int). Method in class [Link]


Sets the vertical gap between components.
setVgap(int). Method in class [Link]
Sets the vertical gap between components.
setVgap(int). Method in class [Link]
Sets the vertical gap between components.
setVgap(int). Method in class [Link]
Sets the vertical gap between components.
setVisible(boolean). Method in class [Link]
Shows or hides the component depending on the boolean flag b.
ww

setVisible(boolean). Method in interface [Link]


setVisibleAmount(int). Method in interface [Link]
Sets the length of the proportionl indicator of the adjustable object.
setVisibleAmount(int). Method in class [Link]
Sets the visible amount of this Scrollbar, which is the range of values represented by the
width of the scroll bar's bubble.
setWeekdays(String[]). Method in class [Link]
Sets weekday strings.
setXORMode(Color). Method in class [Link]
Sets the logical pixel operation function to the XOR mode, which alternates pixels between the
current color and a new specified XOR alternation color.
setYear(int). Method in class [Link]

411
412

Sets the year of this date to be the specified value plus 1900.
setYear(int). Method in class [Link]
Sets the year of this date to be the specified value plus 1900.

m
setZeroDigit(char). Method in class [Link]
setZoneStrings(String[][]). Method in class [Link]
Sets timezone strings.
SHIFT_MASK. Static variable in class [Link]
The shift modifier constant.
SHIFT_MASK. Static variable in class [Link]
The shift modifier constant.
SHIFT_MASK. Static variable in class [Link]

o
The shift key modifier constant.
shiftDown(). Method in class [Link]
Checks if the shift key is down.
shiftLeft(int). Method in class [Link]
Returns a BigInteger whose value is (this << n).

i.c
shiftRight(int). Method in class [Link]
Returns a BigInteger whose value is (this >> n).
SHORT. Static variable in class [Link]
Constant for short style pattern.
Short(short). Constructor for class [Link]
Constructs a Short object initialized to the specified short value.
Short(String). Constructor for class [Link]
Constructs a Short object initialized to the value specified by the String parameter.
shortcuts(). Method in class [Link]
Get an Enumeration of all MenuShortcuts this MenuBar manages.

dil
shortValue(). Method in class [Link]
Returns the value of this Byte as a short.
shortValue(). Method in class [Link]
Returns the value of this Double as a short (by casting to a short).
shortValue(). Method in class [Link]
Returns the value of this Float as a short (by casting to a short).
shortValue(). Method in class [Link]
Returns the value of this Integer as a short.
shortValue(). Method in class [Link]
Returns the value of this Long as a short.
shortValue(). Method in class [Link]
va
Returns the value of the specified number as a short.
shortValue(). Method in class [Link]
Returns the value of this Short as a short.
show(). Method in class [Link]
show(). Method in interface [Link]
DEPRECATED: Replaced by setVisible(boolean).
show(). Method in class [Link]
Shows the dialog.
show(). Method in class [Link]
Shows the Window.
ja

show(boolean). Method in class [Link]


show(Component, int, int). Method in class [Link]
Shows the popup menu at the x, y position relative to an origin component.
show(Container, String). Method in class [Link]
Flips to the specified component name in the specified container.
show(Event). Method in interface [Link]
showDocument(URL). Method in interface [Link]
w.

Replaces the Web page currently being viewed with the given URL.
showDocument(URL, String). Method in interface [Link]
Requests that the browser or applet viewer show the Web page indicated by the url argument.
showStatus(String). Method in class [Link]
Requests that the argument string be displayed in the "status window".
showStatus(String). Method in interface [Link]
Requests that the argument string be displayed in the "status window".
SIGN. Static variable in class [Link]
Possible state value, signifying that this signature object has been initialized for signing.
sign(). Method in class [Link]
ww

Returns the signature bytes of all the data updated.


Signature(String). Constructor for class [Link]
Creates a Signature object for the specified algorithm.
SignatureException(). Constructor for class [Link]
Constructs a SignatureException with no detail message.
SignatureException(String). Constructor for class [Link]
Constructs a SignatureException with the specified detail message.
Signer(). Constructor for class [Link]
Creates a signer.
Signer(String). Constructor for class [Link]
Creates a signer with the specified identity name.
Signer(String, IdentityScope). Constructor for class [Link]

412
413

Creates a signer with the specified identity name and scope.


signum(). Method in class [Link]
Returns the signum function of this number (i.e., -1, 0 or 1 as the value of this number is

m
negative, zero or positive).
signum(). Method in class [Link]
Returns the signum function of this number (i.e., -1, 0 or 1 as the value of this number is
negative, zero or positive).
SILENT. Static variable in class [Link]
constants for logging levels
SimpleBeanInfo(). Constructor for class [Link]
SimpleDateFormat(). Constructor for class [Link]

o
Construct a SimpleDateFormat using the default pattern for the default locale.
SimpleDateFormat(String). Constructor for class [Link]
Construct a SimpleDateFormat using the given pattern in the default locale.
SimpleDateFormat(String, DateFormatSymbols). Constructor for class [Link]
Construct a SimpleDateFormat using the given pattern and locale-specific symbol data.

i.c
SimpleDateFormat(String, Locale). Constructor for class [Link]
Construct a SimpleDateFormat using the given pattern and locale.
SimpleTimeZone(int, String). Constructor for class [Link]
Constructs a SimpleTimeZone with the given base time zone offset from GMT and time zone ID.
SimpleTimeZone(int, String, int, int, int, int, int, int, int, int). Constructor for class
[Link]
Constructs a SimpleTimeZone with the given base time zone offset from GMT, time zone ID, time
to start and end the daylight time.
SIMPLIFIED_CHINESE. Static variable in class [Link]
Useful constant for language.

dil
sin(double). Static method in class [Link]
Returns the trigonometric sine of an angle.
SINGLEFRAME. Static variable in interface [Link]
The image contain a single static image.
SINGLEFRAMEDONE. Static variable in interface [Link]
One frame of the image is complete but there are more frames to be delivered.
SINGLEPASS. Static variable in interface [Link]
The pixels will be delivered in a single pass.
size. Variable in class [Link]
The point size of this font.
size(). Method in class [Link]
va
Returns the number of bits currently in this bit set.
size(). Method in class [Link]
Returns the current size of the buffer.
size(). Method in class [Link]
Returns the current size of the buffer.
size(). Method in class [Link]
size(). Method in class [Link]
Returns the number of bytes written to this data output stream.
size(). Method in class [Link]
Returns the number of keys in this dictionary.
ja

size(). Method in class [Link]


Returns the number of keys in this hashtable.
size(). Method in class [Link]
Returns the number of identities within this identity scope.
size(). Method in class [Link]
Returns the number of components in this vector.
SkeletonMismatchException(String). Constructor for class [Link]
w.

Create a new SkeletonMismatchException exception with a descriptive string.


SkeletonNotFoundException(String). Constructor for class [Link]
Create a new SkeletonNotFoundException exception with a descriptive string.
SkeletonNotFoundException(String, Exception). Constructor for class
[Link]
Create a new SkeletonNotFoundException with a descriptive string and an exception.
skip(long). Method in class [Link]
Skips over and discards n bytes of data from the input stream.
skip(long). Method in class [Link]
Skip characters.
ww

skip(long). Method in class [Link]


Skips n bytes of input from this input stream.
skip(long). Method in class [Link]
Skip characters.
skip(long). Method in class [Link]
Skips specified number of bytes of input.
skip(long). Method in class [Link]
Skips over and discards n bytes of data from the input stream.
skip(long). Method in class [Link]
Skips over and discards n bytes of data from the input stream.
skip(long). Method in class [Link]
Skip characters.

413
414

skip(long). Method in class [Link]


Skips specified number of bytes of uncompressed data.
skip(long). Method in class [Link]

m
Skips over and discards n bytes of data from this input stream.
skip(long). Method in class [Link]
Skips over and discards n bytes of data from the input stream.
skip(long). Method in class [Link]
Skip characters.
skip(long). Method in interface [Link]
Skips n bytes of input.
skip(long). Method in class [Link]

o
Skip characters.
skip(long). Method in class [Link]
Skips n bytes of input from this input stream.
skip(long). Method in class [Link]
Skip characters.

i.c
skip(long). Method in class [Link]
Skips specified number of bytes in the current ZIP entry.
skipBytes(int). Method in interface [Link]
Skips exactly n bytes of input.
skipBytes(int). Method in class [Link]
Skips exactly n bytes of input in the underlying input stream.
skipBytes(int). Method in class [Link]
Skips bytes, block until all bytes are skipped.
skipBytes(int). Method in class [Link]
Skips exactly n bytes of input.

dil
slashSlashComments(boolean). Method in class [Link]
Determines whether or not the tokenizer recognizes C++-style comments.
slashStarComments(boolean). Method in class [Link]
Determines whether or not the tokenizer recognizes C-style comments.
sleep(long). Static method in class [Link]
Causes the currently executing thread to sleep (temporarily cease execution) for the specified
number of milliseconds.
sleep(long, int). Static method in class [Link]
Causes the currently executing thread to sleep (cease execution) for the specified number of
milliseconds plus the specified number of nanoseconds.
SMALLINT. Static variable in class [Link]
va
Socket(). Constructor for class [Link]
Creates an unconnected socket, with the system-default type of SocketImpl.
Socket(InetAddress, int). Constructor for class [Link]
Creates a stream socket and connects it to the specified port number at the specified IP
address.
Socket(InetAddress, int, boolean). Constructor for class [Link]
Creates a socket and connects it to the specified port number at the specified IP address.
Socket(InetAddress, int, InetAddress, int). Constructor for class [Link]
Creates a socket and connects it to the specified remote address on the specified remote port.
Socket(SocketImpl). Constructor for class [Link]
ja

Creates an unconnected Socket with a user-specified SocketImpl.


Socket(String, int). Constructor for class [Link]
Creates a stream socket and connects it to the specified port number on the named host.
Socket(String, int, boolean). Constructor for class [Link]
Creates a stream socket and connects it to the specified port number on the named host.
Socket(String, int, InetAddress, int). Constructor for class [Link]
Creates a socket and connects it to the specified remote host on the specified remote port.
w.

SocketException(). Constructor for class [Link]


Constructs a new ProtocolException with no detail message.
SocketException(String). Constructor for class [Link]
Constructs a new ProtocolException with the specified detail message.
SocketImpl(). Constructor for class [Link]
SocketSecurityException(String). Constructor for class [Link]
Create A remote exception with the specified string
SocketSecurityException(String, Exception). Constructor for class
[Link]
Create A remote exception with the specified string, and the exception specified.
ww

SOMEBITS. Static variable in interface [Link]


More pixels needed for drawing a scaled variation of the image are available.
source. Variable in class [Link]
SOUTH. Static variable in class [Link]
The south layout constraint.
SOUTH. Static variable in class [Link]
SOUTHEAST. Static variable in class [Link]
SOUTHWEST. Static variable in class [Link]
SPACE_SEPARATOR. Static variable in class [Link]
SQLException(). Constructor for class [Link]
Construct an SQLException; reason defaults to null, SQLState defaults to null and vendorCode
defaults to 0.

414
415

SQLException(String). Constructor for class [Link]


Construct an SQLException with a reason; SQLState defaults to null and vendorCode defaults to
0.

m
SQLException(String, String). Constructor for class [Link]
Construct an SQLException with a reason and SQLState; vendorCode defaults to 0.
SQLException(String, String, int). Constructor for class [Link]
Construct a fully-specified SQLException
SQLWarning(). Constructor for class [Link]
Construct an SQLWarning ; reason defaults to null, SQLState defaults to null and vendorCode
defaults to 0.
SQLWarning(String). Constructor for class [Link]

o
Construct an SQLWarning with a reason; SQLState defaults to null and vendorCode defaults to 0.
SQLWarning(String, String). Constructor for class [Link]
Construct an SQLWarning with a reason and SQLState; vendorCode defaults to 0.
SQLWarning(String, String, int). Constructor for class [Link]
Construct a fully specified SQLWarning.

i.c
sqrt(double). Static method in class [Link]
Returns the square root of a double value.
srccols. Variable in class [Link]
srcHeight. Variable in class [Link]
srcrows. Variable in class [Link]
srcWidth. Variable in class [Link]
Stack(). Constructor for class [Link]
StackFrame(). Constructor for class [Link]
StackOverflowError(). Constructor for class [Link]
Constructs a StackOverflowError with no detail message.

dil
StackOverflowError(String). Constructor for class [Link]
Constructs a StackOverflowError with the specified detail message.
start(). Method in class [Link]
Called by the browser or applet viewer to inform this applet that it should start its
execution.
start(). Method in class [Link]
Causes this thread to begin execution; the Java Virtual Machine calls the run method of this
thread.
START_PUNCTUATION. Static variable in class [Link]
startGrabbing(). Method in class [Link]
Request the PixelGrabber to start fetching the pixels.
va
startProduction(ImageConsumer). Method in class [Link]
Adds an ImageConsumer to the list of consumers interested in data for this image, and
immediately starts delivery of the image data through the ImageConsumer interface.
startProduction(ImageConsumer). Method in interface [Link]
This method both registers the given ImageConsumer object as a consumer and starts an
immediate reconstruction of the image data which will then be delivered to this consumer and
any other consumer which may have already been registered with the producer.
startProduction(ImageConsumer). Method in class [Link]
Adds an ImageConsumer to the list of consumers interested in data for this image, and
immediately start delivery of the image data through the ImageConsumer interface.
ja

startsWith(String). Method in class [Link]


Tests if this string starts with the specified prefix.
startsWith(String, int). Method in class [Link]
Tests if this string starts with the specified prefix.
state. Variable in class [Link]
Current state of this signature object.
STATIC. Static variable in class [Link]
w.

STATICIMAGEDONE. Static variable in interface [Link]


The image is complete and there are no more pixels or frames to be delivered.
status(). Method in class [Link]
DEPRECATED: Replaced by getStatus().
statusAll(boolean). Method in class [Link]
Returns the boolean OR of the status of all of the media being tracked.
statusID(int, boolean). Method in class [Link]
Returns the boolean OR of the status of all of the media with a given ID.
step(boolean). Method in class [Link]
Continue execution of this thread to the next instruction or line.
ww

stop(). Method in class [Link]


Called by the browser or applet viewer to inform this applet that it should stop its
execution.
stop(). Method in interface [Link]
Stops playing this audio clip.
stop(). Method in class [Link]
Stop the remote thread.
stop(). Method in class [Link]
Stop the remote threadgroup.
stop(). Method in class [Link]
Forces the thread to stop executing.
stop(). Method in class [Link]

415
416

Stops all processes in this thread group.


stop(Throwable). Method in class [Link]
Forces the thread to stop executing.

m
STORED. Static variable in class [Link]
Compression method for uncompressed entries.
STORED. Static variable in class [Link]
Compression method for uncompressed (STORED) entries.
storesLowerCaseIdentifiers(). Method in interface [Link]
Does the database treat mixed case unquoted SQL identifiers as case insensitive and store them
in lower case?
storesLowerCaseQuotedIdentifiers(). Method in interface [Link]

o
Does the database treat mixed case quoted SQL identifiers as case insensitive and store them
in lower case?
storesMixedCaseIdentifiers(). Method in interface [Link]
Does the database treat mixed case unquoted SQL identifiers as case insensitive and store them
in mixed case?

i.c
storesMixedCaseQuotedIdentifiers(). Method in interface [Link]
Does the database treat mixed case quoted SQL identifiers as case insensitive and store them
in mixed case?
storesUpperCaseIdentifiers(). Method in interface [Link]
Does the database treat mixed case unquoted SQL identifiers as case insensitive and store them
in upper case?
storesUpperCaseQuotedIdentifiers(). Method in interface [Link]
Does the database treat mixed case quoted SQL identifiers as case insensitive and store them
in upper case?
StreamCorruptedException(). Constructor for class [Link]

dil
Create a StreamCorruptedException with no reason.
StreamCorruptedException(String). Constructor for class [Link]
Create a StreamCorruptedException with a reason.
StreamTokenizer(InputStream). Constructor for class [Link]
Creates a stream tokenizer that parses the specified input stream.
StreamTokenizer(Reader). Constructor for class [Link]
Create a tokenizer that parses the given character stream.
String(). Constructor for class [Link]
Allocates a new String containing no characters.
String(byte[]). Constructor for class [Link]
Construct a new String by converting the specified array of bytes using the platform's default
va
character encoding.
String(byte[], int). Constructor for class [Link]
Allocates a new String containing characters constructed from an array of 8-bit integer
values.
String(byte[], int, int). Constructor for class [Link]
Construct a new String by converting the specified subarray of bytes using the platform's
default character encoding.
String(byte[], int, int, int). Constructor for class [Link]
Allocates a new String constructed from a subarray of an array of 8-bit integer values.
String(byte[], int, int, String). Constructor for class [Link]
ja

Construct a new String by converting the specified subarray of bytes using the specified
character encoding.
String(byte[], String). Constructor for class [Link]
Construct a new String by converting the specified array of bytes using the specified
character encoding.
String(char[]). Constructor for class [Link]
Allocates a new String so that it represents the sequence of characters currently contained in
w.

the character array argument.


String(char[], int, int). Constructor for class [Link]
Allocates a new String that contains characters from a subarray of the character array
argument.
String(String). Constructor for class [Link]
Allocates a new string that contains the same sequence of characters as the string argument.
String(StringBuffer). Constructor for class [Link]
Allocates a new string that contains the sequence of characters currently contained in the
string buffer argument.
StringBuffer(). Constructor for class [Link]
ww

Constructs a string buffer with no characters in it and an initial capacity of 16 characters.


StringBuffer(int). Constructor for class [Link]
Constructs a string buffer with no characters in it and an initial capacity specified by the
length argument.
StringBuffer(String). Constructor for class [Link]
Constructs a string buffer so that it represents the same sequence of characters as the string
argument.
StringBufferInputStream(String). Constructor for class [Link]
Creates a string input stream to read data from the specified string.
StringCharacterIterator(String). Constructor for class [Link]
Construct an iterator with an initial index of 0.
StringCharacterIterator(String, int). Constructor for class [Link]

416
417

Construct an iterator with the specified initial index.


StringCharacterIterator(String, int, int, int). Constructor for class
[Link]

m
Construct an iterator over the given range of the given string, with the index set at the
specified position.
stringFlavor. Static variable in class [Link]
The DataFlavor representing a Java Unicode String class, where:

representationClass = [Link]
mimeType = "application/x-javaserializedobject"

o
StringIndexOutOfBoundsException(). Constructor for class [Link]
Constructs a StringIndexOutOfBoundsException with no detail message.
StringIndexOutOfBoundsException(int). Constructor for class
[Link]
Constructs a new StringIndexOutOfBoundsException class with an argument indicating the illegal

i.c
index.
StringIndexOutOfBoundsException(String). Constructor for class
[Link]
Constructs a StringIndexOutOfBoundsException with the specified detail message.
StringReader(String). Constructor for class [Link]
Create a new string reader.
StringSelection(String). Constructor for class [Link]
Creates a transferable object capable of transferring the specified string in plain text
format.
StringTokenizer(String). Constructor for class [Link]

dil
Constructs a string tokenizer for the specified string.
StringTokenizer(String, String). Constructor for class [Link]
Constructs a string tokenizer for the specified string.
StringTokenizer(String, String, boolean). Constructor for class [Link]
Constructs a string tokenizer for the specified string.
stringWidth(String). Method in class [Link]
Returns the total advance width for showing the specified String in this Font.
StringWriter(). Constructor for class [Link]
Create a new string writer, using the default initial string-buffer size.
StringWriter(int). Constructor for class [Link]
Create a new string writer, using the specified initial string-buffer size.
va
StubNotFoundException(String). Constructor for class [Link]
Create a new StubNotFoundException with a descriptive string.
StubNotFoundException(String, Exception). Constructor for class [Link]
Create a new StubNotFoundException with a descriptive string and an exception.
style. Variable in class [Link]
The style of the font.
substituteColorModel(ColorModel, ColorModel). Method in class [Link]
Registers two ColorModel objects for substitution.
substring(int). Method in class [Link]
Returns a new string that is a substring of this string.
ja

substring(int, int). Method in class [Link]


Returns a new string that is a substring of this string.
subtract(BigDecimal). Method in class [Link]
Returns a BigDecimal whose value is (this - val), and whose scale is MAX([Link](),
[Link]).
subtract(BigInteger). Method in class [Link]
Returns a BigInteger whose value is (this - val).
w.

SUNDAY. Static variable in class [Link]


Useful constant for days of week.
supportsAlterTableWithAddColumn(). Method in interface [Link]
Is "ALTER TABLE" with add column supported?
supportsAlterTableWithDropColumn(). Method in interface [Link]
Is "ALTER TABLE" with drop column supported?
supportsANSI92EntryLevelSQL(). Method in interface [Link]
Is the ANSI92 entry level SQL grammar supported? All JDBC-Compliant drivers must return true.
supportsANSI92FullSQL(). Method in interface [Link]
Is the ANSI92 full SQL grammar supported?
ww

supportsANSI92IntermediateSQL(). Method in interface [Link]


Is the ANSI92 intermediate SQL grammar supported?
supportsCatalogsInDataManipulation(). Method in interface [Link]
Can a catalog name be used in a data manipulation statement?
supportsCatalogsInIndexDefinitions(). Method in interface [Link]
Can a catalog name be used in an index definition statement?
supportsCatalogsInPrivilegeDefinitions(). Method in interface [Link]
Can a catalog name be used in a privilege definition statement?
supportsCatalogsInProcedureCalls(). Method in interface [Link]
Can a catalog name be used in a procedure call statement?
supportsCatalogsInTableDefinitions(). Method in interface [Link]
Can a catalog name be used in a table definition statement?

417
418

supportsColumnAliasing(). Method in interface [Link]


Is column aliasing supported?

m
If so, the SQL AS clause can be used to provide names for computed columns or to provide alias
names for columns as required.
supportsConvert(). Method in interface [Link]
Is the CONVERT function between SQL types supported?
supportsConvert(int, int). Method in interface [Link]
Is CONVERT between the given SQL types supported?
supportsCoreSQLGrammar(). Method in interface [Link]
Is the ODBC Core SQL grammar supported?

o
supportsCorrelatedSubqueries(). Method in interface [Link]
Are correlated subqueries supported? A JDBC-Compliant driver always returns true.
supportsCustomEditor(). Method in interface [Link]
supportsCustomEditor(). Method in class [Link]
supportsDataDefinitionAndDataManipulationTransactions(). Method in interface

i.c
[Link]
Are both data definition and data manipulation statements within a transaction supported?
supportsDataManipulationTransactionsOnly(). Method in interface [Link]
Are only data manipulation statements within a transaction supported?
supportsDifferentTableCorrelationNames(). Method in interface [Link]
If table correlation names are supported, are they restricted to be different from the names
of the tables?
supportsExpressionsInOrderBy(). Method in interface [Link]
Are expressions in "ORDER BY" lists supported?
supportsExtendedSQLGrammar(). Method in interface [Link]

dil
Is the ODBC Extended SQL grammar supported?
supportsFullOuterJoins(). Method in interface [Link]
Are full nested outer joins supported?
supportsGroupBy(). Method in interface [Link]
Is some form of "GROUP BY" clause supported?
supportsGroupByBeyondSelect(). Method in interface [Link]
Can a "GROUP BY" clause add columns not in the SELECT provided it specifies all the columns in
the SELECT?
supportsGroupByUnrelated(). Method in interface [Link]
Can a "GROUP BY" clause use columns not in the SELECT?
supportsIntegrityEnhancementFacility(). Method in interface [Link]
va
Is the SQL Integrity Enhancement Facility supported?
supportsLikeEscapeClause(). Method in interface [Link]
Is the escape character in "LIKE" clauses supported? A JDBC-Compliant driver always returns
true.
supportsLimitedOuterJoins(). Method in interface [Link]
Is there limited support for outer joins? (This will be true if supportFullOuterJoins is
true.)
supportsMinimumSQLGrammar(). Method in interface [Link]
Is the ODBC Minimum SQL grammar supported? All JDBC-Compliant drivers must return true.
supportsMixedCaseIdentifiers(). Method in interface [Link]
ja

Does the database treat mixed case unquoted SQL identifiers as case sensitive and as a result
store them in mixed case? A JDBC-Compliant driver will always return false.
supportsMixedCaseQuotedIdentifiers(). Method in interface [Link]
Does the database treat mixed case quoted SQL identifiers as case sensitive and as a result
store them in mixed case? A JDBC-Compliant driver will always return true.
supportsMultipleResultSets(). Method in interface [Link]
Are multiple ResultSets from a single execute supported?
w.

supportsMultipleTransactions(). Method in interface [Link]


Can we have multiple transactions open at once (on different connections)?
supportsNonNullableColumns(). Method in interface [Link]
Can columns be defined as non-nullable? A JDBC-Compliant driver always returns true.
supportsOpenCursorsAcrossCommit(). Method in interface [Link]
Can cursors remain open across commits?
supportsOpenCursorsAcrossRollback(). Method in interface [Link]
Can cursors remain open across rollbacks?
supportsOpenStatementsAcrossCommit(). Method in interface [Link]
Can statements remain open across commits?
ww

supportsOpenStatementsAcrossRollback(). Method in interface [Link]


Can statements remain open across rollbacks?
supportsOrderByUnrelated(). Method in interface [Link]
Can an "ORDER BY" clause use columns not in the SELECT?
supportsOuterJoins(). Method in interface [Link]
Is some form of outer join supported?
supportsPositionedDelete(). Method in interface [Link]
Is positioned DELETE supported?
supportsPositionedUpdate(). Method in interface [Link]
Is positioned UPDATE supported?
supportsSchemasInDataManipulation(). Method in interface [Link]
Can a schema name be used in a data manipulation statement?

418
419

supportsSchemasInIndexDefinitions(). Method in interface [Link]


Can a schema name be used in an index definition statement?
supportsSchemasInPrivilegeDefinitions(). Method in interface [Link]

m
Can a schema name be used in a privilege definition statement?
supportsSchemasInProcedureCalls(). Method in interface [Link]
Can a schema name be used in a procedure call statement?
supportsSchemasInTableDefinitions(). Method in interface [Link]
Can a schema name be used in a table definition statement?
supportsSelectForUpdate(). Method in interface [Link]
Is SELECT for UPDATE supported?
supportsStoredProcedures(). Method in interface [Link]

o
Are stored procedure calls using the stored procedure escape syntax supported?
supportsSubqueriesInComparisons(). Method in interface [Link]
Are subqueries in comparison expressions supported? A JDBC-Compliant driver always returns
true.
supportsSubqueriesInExists(). Method in interface [Link]

i.c
Are subqueries in 'exists' expressions supported? A JDBC-Compliant driver always returns true.
supportsSubqueriesInIns(). Method in interface [Link]
Are subqueries in 'in' statements supported? A JDBC-Compliant driver always returns true.
supportsSubqueriesInQuantifieds(). Method in interface [Link]
Are subqueries in quantified expressions supported? A JDBC-Compliant driver always returns
true.
supportsTableCorrelationNames(). Method in interface [Link]
Are table correlation names supported? A JDBC-Compliant driver always returns true.
supportsTransactionIsolationLevel(int). Method in interface [Link]
Does the database support the given transaction isolation level?

dil
supportsTransactions(). Method in interface [Link]
Are transactions supported? If not, commit is a noop and the isolation level is
TRANSACTION_NONE.
supportsUnion(). Method in interface [Link]
Is SQL UNION supported?
supportsUnionAll(). Method in interface [Link]
Is SQL UNION ALL supported?
SURROGATE. Static variable in class [Link]
suspend(). Method in class [Link]
Suspend execution of this thread.
suspend(). Method in class [Link]
va
Suspends this thread.
suspend(). Method in class [Link]
Suspends all processes in this thread group.
sval. Variable in class [Link]
If the current token is a word token, this field contains a string giving the characters of
the word token.
SW_RESIZE_CURSOR. Static variable in class [Link]
The south-west-resize cursor type.
SW_RESIZE_CURSOR. Static variable in class [Link]
sync(). Method in class [Link]
ja

Force all system buffers to synchronize with the underlying device.


sync(). Method in class [Link]
Syncs the graphics state; useful when doing animation.
SyncFailedException(String). Constructor for class [Link]
Constructs an SyncFailedException with a detail message.
SYNCHRONIZED. Static variable in class [Link]
w.

TAB. Static variable in class [Link]


The Tab key.
tableIndexClustered. Static variable in interface [Link]
INDEX INFO TYPE - this identifies a clustered index
tableIndexHashed. Static variable in interface [Link]
INDEX INFO TYPE - this identifies a hashed index
ww

tableIndexOther. Static variable in interface [Link]


INDEX INFO TYPE - this identifies some other form of index
tableIndexStatistic. Static variable in interface [Link]
INDEX INFO TYPE - this identifies table statistics that are returned in conjuction with a
table's index descriptions
TAIWAN. Static variable in class [Link]
Useful constant for country.
tan(double). Static method in class [Link]
Returns the trigonometric tangent of an angle.
target. Variable in class [Link]
The target component.
TERTIARY. Static variable in class [Link]

419
420

Collator strength value.


tertiaryOrder(int). Static method in class [Link]
Get the tertiary order of a collation order.

m
testBit(int). Method in class [Link]
Returns true iff the designated bit is set.
text. Static variable in class [Link]
The background color for text components.
TEXT. Static variable in class [Link]
The array index for the text background color.
TEXT_CURSOR. Static variable in class [Link]
The text cursor type.

o
TEXT_CURSOR. Static variable in class [Link]
TEXT_EVENT_MASK. Static variable in class [Link]
The event mask for selecting text events.
TEXT_FIRST. Static variable in class [Link]
Marks the first integer id for the range of adjustment event ids.

i.c
TEXT_HIGHLIGHT. Static variable in class [Link]
The array index for the text highlight color.
TEXT_HIGHLIGHT_TEXT. Static variable in class [Link]
The array index for the text highlight text color.
TEXT_INACTIVE_TEXT. Static variable in class [Link]
The array index for the text inactive text color.
TEXT_LAST. Static variable in class [Link]
Marks the last integer id for the range of adjustment event ids.
TEXT_TEXT. Static variable in class [Link]
The array index for the text text color.

dil
TEXT_VALUE_CHANGED. Static variable in class [Link]
The adjustment value changed event.
TextArea(). Constructor for class [Link]
Constructs a new TextArea.
TextArea(int, int). Constructor for class [Link]
Constructs a new empty TextArea with the specified number of rows and columns.
TextArea(String). Constructor for class [Link]
Constructs a new TextArea with the specified text displayed.
TextArea(String, int, int). Constructor for class [Link]
Constructs a new TextArea with the specified text and number of rows and columns.
TextArea(String, int, int, int). Constructor for class [Link]
va
Constructs a new TextArea with the specified text and number of rows, columns, and scrollbar
visibility.
TextEvent(Object, int). Constructor for class [Link]
Constructs a TextEvent object with the specified TextComponent source, and type.
TextField(). Constructor for class [Link]
Constructs a new TextField.
TextField(int). Constructor for class [Link]
Constructs a new empty TextField with the specified number of columns.
TextField(String). Constructor for class [Link]
Constructs a new TextField initialized with the specified text.
ja

TextField(String, int). Constructor for class [Link]


Constructs a new TextField initialized with the specified text and columns.
textHighlight. Static variable in class [Link]
The background color for highlighted text.
textHighlightText. Static variable in class [Link]
The text color for highlighted text.
textInactiveText. Static variable in class [Link]
w.

The text color for inactive text.


textListener. Variable in class [Link]
textText. Static variable in class [Link]
The text color for text components.
textValueChanged(TextEvent). Method in class [Link]
textValueChanged(TextEvent). Method in interface [Link]
Invoked when the value of the text has changed.
Thread(). Constructor for class [Link]
Allocates a new Thread object.
Thread(Runnable). Constructor for class [Link]
ww

Allocates a new Thread object.


Thread(Runnable, String). Constructor for class [Link]
Allocates a new Thread object.
Thread(String). Constructor for class [Link]
Allocates a new Thread object.
Thread(ThreadGroup, Runnable). Constructor for class [Link]
Allocates a new Thread object.
Thread(ThreadGroup, Runnable, String). Constructor for class [Link]
Allocates a new Thread object so that it has target as its run object, has the specified name
as its name, and belongs to the thread group referred to by group.
Thread(ThreadGroup, String). Constructor for class [Link]
Allocates a new Thread object.

420
421

ThreadDeath(). Constructor for class [Link]


threadDeathEvent(RemoteThread). Method in interface [Link]
A thread has died.

m
ThreadGroup(String). Constructor for class [Link]
Constructs a new thread group.
ThreadGroup(ThreadGroup, String). Constructor for class [Link]
Creates a new thread group.
Throwable(). Constructor for class [Link]
Constructs a new Throwable with no detail message.
Throwable(String). Constructor for class [Link]
Constructs a new Throwable with the specified detail message.

o
THURSDAY. Static variable in class [Link]
Useful constant for days of week.
time. Variable in class [Link]
The current time set for the calendar.
TIME. Static variable in class [Link]

i.c
Time(int, int, int). Constructor for class [Link]
Construct a Time Object
Time(long). Constructor for class [Link]
Construct a Time using a milliseconds time value
TIMESTAMP. Static variable in class [Link]
Timestamp(int, int, int, int, int, int, int). Constructor for class [Link]
Construct a Timestamp Object
Timestamp(long). Constructor for class [Link]
Construct a Timestamp using a milliseconds time value.
TimeZone(). Constructor for class [Link]

dil
TIMEZONE_FIELD. Static variable in class [Link]
Useful constant for TIMEZONE field alignment.
TINYINT. Static variable in class [Link]
TITLECASE_LETTER. Static variable in class [Link]
toBack(). Method in class [Link]
Places this window at the bottom of the stacking order and makes the corresponding adjustment
to other visible windows.
toBack(). Method in interface [Link]
toBigInteger(). Method in class [Link]
Converts this number to a BigInteger.
toBinaryString(int). Static method in class [Link]
va
Creates a string representation of the integer argument as an unsigned integer in base 2.
toBinaryString(long). Static method in class [Link]
Creates a string representation of the long argument as an unsigned integer in base 2.
toByteArray(). Method in class [Link]
Returns the two's-complement representation of this number.
toByteArray(). Method in class [Link]
Creates a newly allocated byte array.
toByteArray(). Method in class [Link]
Converts the CollationKey to a sequence of bits.
toCharArray(). Method in class [Link]
ja

Returns a copy of the input data.


toCharArray(). Method in class [Link]
Converts this string to a new character array.
toExternalForm(). Method in class [Link]
Constructs a string representation of this URL.
toExternalForm(URL). Method in class [Link]
Converts a URL of a specific protocol to a String.
w.

toFront(). Method in class [Link]


Places this window at the top of the stacking order and shows it in front of any other
windows.
toFront(). Method in interface [Link]
toGMTString(). Method in class [Link]
Creates a string representation of this date.
toHex(int). Static method in class [Link]
Convert an int to a hexadecimal string.
toHexString(int). Static method in class [Link]
Creates a string representation of the integer argument as an unsigned integer in base 16.
ww

toHexString(long). Static method in class [Link]


Creates a string representation of the long argument as an unsigned integer in base 16.
toLocaleString(). Method in class [Link]
Creates a string representation of this date in an implementation-dependent form.
toLocalizedPattern(). Method in class [Link]
Synthesizes a localized pattern string that represents the current state of this Format
object.
toLocalizedPattern(). Method in class [Link]
Return a localized pattern string describing this date format.
toLowerCase(). Method in class [Link]
Converts this string to lowercase.
toLowerCase(char). Static method in class [Link]

421
422

The given character is mapped to its lowercase equivalent; if the character has no lowercase
equivalent, the character itself is returned.
toLowerCase(Locale). Method in class [Link]

m
Converts all of the characters in this String to lower case using the rules of the given
locale.
toOctalString(int). Static method in class [Link]
Creates a string representation of the integer argument as an unsigned integer in base 8.
toOctalString(long). Static method in class [Link]
Creates a string representation of the long argument as an unsigned integer in base 8.
Toolkit(). Constructor for class [Link]
TooManyListenersException(). Constructor for class [Link]

o
Constructs a TooManyListenersException with no detail message.
TooManyListenersException(String). Constructor for class [Link]
Constructs a TooManyListenersException with the specified detail message.
top. Variable in class [Link]
The inset from the top.

i.c
TOP_ALIGNMENT. Static variable in class [Link]
Ease of use constant for getAlignmentY().
toPattern(). Method in class [Link]
Gets the pattern.
toPattern(). Method in class [Link]
Synthesizes a pattern string that represents the current state of this Format object.
toPattern(). Method in class [Link]
Gets the pattern.
toPattern(). Method in class [Link]
Return a pattern string describing this date format.

dil
TOPDOWNLEFTRIGHT. Static variable in interface [Link]
The pixels will be delivered in top-down, left-to-right order.
toString(). Method in interface [Link]
Returns a string representation of the ACL contents.
toString(). Method in interface [Link]
Returns a string representation of the contents of this ACL entry.
toString(). Method in class [Link]
Returns a string representation of the object.
toString(). Method in class [Link]
Returns the string representation of this number.
toString(). Method in class [Link]
va
Returns the string representation of this number, radix 10.
toString(). Method in class [Link]
Returns a string representation of this bit set.
toString(). Method in class [Link]
Returns a String object representing this Boolean's value.
toString(). Method in class [Link]
Returns the String representation of this BorderLayout's values.
toString(). Method in class [Link]
Returns a String object representing this Byte's value.
toString(). Method in class [Link]
ja

Creates a newly allocated string.


toString(). Method in class [Link]
Returns the String representation of this CardLayout's values.
toString(). Method in class [Link]
Returns a String object representing this character's value.
toString(). Method in class [Link]
Converts input data to a string.
w.

toString(). Method in class [Link]


Returns the String representation of this CheckboxGroup's values.
toString(). Method in class [Link]
Converts the object to a string.
toString(). Method in class [Link]
Returns the String representation of this Color's values.
toString(). Method in class [Link]
Returns the String representation of this Component's values.
toString(). Method in class [Link]
Return a string describing this Constructor.
ww

toString(). Method in class [Link]


Format a date in JDBC date escape format
toString(). Method in class [Link]
Returns a canonical string representation of the date.
toString(). Method in class [Link]
Prints a string representation of this digest input stream and its associated message digest
object.
toString(). Method in class [Link]
Prints a string representation of this digest output stream and its associated message digest
object.
toString(). Method in class [Link]
Returns the String representation of this Dimension's values.

422
423

toString(). Method in class [Link]


Returns a String representation of this Double object.
toString(). Method in class [Link]

m
Returns the String representation of this Event's values.
toString(). Method in class [Link]
Returns a string representation of the object.
toString(). Method in class [Link]
Return a string describing this Field.
toString(). Method in class [Link]
Returns a string representation of this object.
toString(). Method in class [Link]

o
Returns a String representation of this Float object.
toString(). Method in class [Link]
Returns the String representation of this FlowLayout's values.
toString(). Method in class [Link]
Converts this object to a String representation.

i.c
toString(). Method in class [Link]
Returns the String representation of this FontMetric's values.
toString(). Method in class [Link]
Returns a String object representing this Graphics object's value.
toString(). Method in class [Link]
Returns the String representation of this GridLayout's values.
toString(). Method in class [Link]
Returns the String representation of this GridLayout's values.
toString(). Method in class [Link]
Returns a rather long string representation of this hashtable.

dil
toString(). Method in class [Link]
Returns a short string describing this identity, telling its name and its scope (if any).
toString(). Method in class [Link]
Returns a string representation of this identity scope, including its name, its scope name,
and the number of identities in this identity scope.
toString(). Method in class [Link]
Converts this IP address to a String.
toString(). Method in class [Link]
Returns a String object representing this Inset's values.
toString(). Method in class [Link]
Returns a String object representing this Integer's value.
va
toString(). Method in class [Link]
Getter for the programmatic name of the entire locale, with the language, country and variant
separated by underbars.
toString(). Method in class [Link]
Return log name as string representation
toString(). Method in class [Link]
Returns a String object representing this Long's value.
toString(). Method in class [Link]
Returns the String representation of this MenuComponent's values.
toString(). Method in class [Link]
ja

Returns an internationalized description of the MenuShortcut.


toString(). Method in class [Link]
Returns a string representation of this message digest object.
toString(). Method in class [Link]
Returns a string describing this Method.
toString(). Method in class [Link]
Returns a string representation of the object.
w.

toString(). Method in class [Link]


Return a string describing this ObjectStreamClass.
toString(). Method in class [Link]
Returns a string containing the object id representation.
toString(). Method in class [Link]
Returns a string representation of the object.
toString(). Method in interface [Link]
Prints a string representation of this permission.
toString(). Method in class [Link]
Returns the String representation of this Point's coordinates.
ww

toString(). Method in interface [Link]


Returns a string representation of this principal.
toString(). Method in class [Link]
Returns a string with the name and the version number of this provider.
toString(). Method in class [Link]
Returns the String representation of this Rectangle's values.
toString(). Method in class [Link]
Return a string version of the array.
toString(). Method in class [Link]
Return the boolean's value as a string.
toString(). Method in class [Link]
Return the byte's value as a string.

423
424

toString(). Method in class [Link]


Return the char's value as a string.
toString(). Method in class [Link]

m
Return a (somewhat verbose) description.
toString(). Method in class [Link]
Return the double's value as a string.
toString(). Method in class [Link]
Returns a string representation of the object.
toString(). Method in class [Link]
Return the float's value as a string.
toString(). Method in class [Link]

o
Return the int's value as a string.
toString(). Method in class [Link]
Return the long's value as a string.
toString(). Method in class [Link]
Returns a String that represents the value of this remote object.

i.c
toString(). Method in class [Link]
Return object as a string.
toString(). Method in class [Link]
Return the short's value as a string.
toString(). Method in class [Link]
Return the string value, or "null"
toString(). Method in class [Link]
Returns the implementation address and implementation port of this socket as a String.
toString(). Method in class [Link]
Returns a String object representing this Short's value.

dil
toString(). Method in class [Link]
Returns a string representation of this signature object, providing information that includes
the state of the object and the name of the algorithm used.
toString(). Method in class [Link]
Returns a string of information about the signer.
toString(). Method in class [Link]
Converts this socket to a String.
toString(). Method in class [Link]
Returns the address and port of this socket as a String.
toString(). Method in class [Link]
Returns a string representation of the object.
va
toString(). Method in class [Link]
Returns the string representation of the current stream token.
toString(). Method in class [Link]
This object (which is already a string!) is itself returned.
toString(). Method in class [Link]
Converts to a string representing the data in this string buffer.
toString(). Method in class [Link]
Return the buffer's current value as a string.
toString(). Method in class [Link]
Returns the String representation of this Color's values.
ja

toString(). Method in class [Link]


Returns a string representation of this thread, including the thread's name, priority, and
thread group.
toString(). Method in class [Link]
Returns a string representation of this Thread group.
toString(). Method in class [Link]
Returns a short description of this throwable object.
w.

toString(). Method in class [Link]


Format a time in JDBC date escape format
toString(). Method in class [Link]
Format a timestamp in JDBC timestamp escape format
toString(). Method in class [Link]
Returns a string representation of the object.
toString(). Method in class [Link]
Constructs a string representation of this URL.
toString(). Method in class [Link]
Returns a String representation of this URL connection.
ww

toString(). Method in class [Link]


Returns a string representation of this vector.
toString(). Method in class [Link]
Return string representation of this VMID.
toString(). Method in class [Link]
Returns a string representation of the ZIP entry.
toString(boolean). Method in interface [Link]
Returns a string that represents the contents of the certificate.
toString(boolean). Method in class [Link]
Returns a string representation of this identity, with optionally more details than that
provided by the toString method without any arguments.
toString(byte). Static method in class [Link]

424
425

Returns a new String object representing the specified Byte.


toString(double). Static method in class [Link]
Creates a string representation of the double argument.

m
toString(float). Static method in class [Link]
Returns a String representation for the specified float value.
toString(int). Method in class [Link]
Returns the string representation of this number in the given radix.
toString(int). Method in class [Link]
Creates a newly allocated string.
toString(int). Static method in class [Link]
Returns a new String object representing the specified integer.

o
toString(int). Static method in class [Link]
Return a string describing the access modifier flags in the specified modifier.
toString(int, int). Static method in class [Link]
Creates a string representation of the first argument in the radix specified by the second
argument.

i.c
toString(long). Static method in class [Link]
Returns a new String object representing the specified integer.
toString(long, int). Static method in class [Link]
Creates a string representation of the first argument in the radix specified by the second
argument.
toString(short). Static method in class [Link]
Returns a new String object representing the specified Short.
toString(String). Method in class [Link]
Converts input data to a string, using the specified character encoding.
totalMemory(). Method in class [Link]

dil
Report the total memory usage of the Java interpreter being debugged.
totalMemory(). Method in class [Link]
Returns the total amount of memory in the Java Virtual Machine.
toTitleCase(char). Static method in class [Link]
Converts the character argument to titlecase.
toUpperCase(). Method in class [Link]
Converts this string to uppercase.
toUpperCase(char). Static method in class [Link]
Converts the character argument to uppercase.
toUpperCase(Locale). Method in class [Link]
Converts all of the characters in this String to upper case using the rules of the given
va
locale.
trace(boolean). Method in class [Link]
Turn on/off method call tracing.
traceInstructions(boolean). Method in class [Link]
Enables/Disables tracing of instructions.
traceMethodCalls(boolean). Method in class [Link]
Enables/Disables tracing of method calls.
TRACK. Static variable in class [Link]
The absolute tracking adjustment type.
TRADITIONAL_CHINESE. Static variable in class [Link]
ja

Useful constant for language.


TRANSACTION_NONE. Static variable in interface [Link]
Transactions are not supported.
TRANSACTION_READ_COMMITTED. Static variable in interface [Link]
Dirty reads are prevented; non-repeatable reads and phantom reads can occur.
TRANSACTION_READ_UNCOMMITTED. Static variable in interface [Link]
Dirty reads, non-repeatable reads and phantom reads can occur.
w.

TRANSACTION_REPEATABLE_READ. Static variable in interface [Link]


Dirty reads and non-repeatable reads are prevented; phantom reads can occur.
TRANSACTION_SERIALIZABLE. Static variable in interface [Link]
Dirty reads, non-repeatable reads and phantom reads are prevented.
transferFocus(). Method in class [Link]
Transfers the focus to the next component.
TRANSIENT. Static variable in class [Link]
translate(int, int). Method in class [Link]
Translates an event relative to the given component.
translate(int, int). Method in class [Link]
ww

Translates the origin of the graphics context to the point (x, y) in the current coordinate
system.
translate(int, int). Method in class [Link]
Translates the point.
translate(int, int). Method in class [Link]
Translates the vertices by deltaX, deltaY.
translate(int, int). Method in class [Link]
Translates the rectangle.
translatePoint(int, int). Method in class [Link]
Translates the coordinate position of the event by x, y.
trim(). Method in class [Link]
Removes white space from both ends of this string.

425
426

trimToSize(). Method in class [Link]


Trims the capacity of this vector to be the vector's current size.
TRUE. Static variable in class [Link]

m
The Boolean object corresponding to the primitive value true.
TT_EOF. Static variable in class [Link]
A constant indicating that the end of the stream has been read.
TT_EOL. Static variable in class [Link]
A constant indicating that the end of the line has been read.
TT_NUMBER. Static variable in class [Link]
A constant indicating that a number token has been read.
TT_WORD. Static variable in class [Link]

o
A constant indicating that a word token has been read.
ttype. Variable in class [Link]
After a call to the nextToken method, this field contains the type of the token just read.
TUESDAY. Static variable in class [Link]
Useful constant for days of week.

i.c
TYPE. Static variable in class [Link]
The Class object representing the primitive type boolean.
TYPE. Static variable in class [Link]
The Class object representing the primitive type byte.
TYPE. Static variable in class [Link]
The Class object representing the primitive type char.
TYPE. Static variable in class [Link]
The Class object representing the primitive type double.
TYPE. Static variable in class [Link]
The Class object representing the primitive type float.

dil
TYPE. Static variable in class [Link]
The Class object representing the primitive type int.
TYPE. Static variable in class [Link]
The Class object representing the primitive type long.
TYPE. Static variable in class [Link]
The Class object representing the primitive type short.
TYPE. Static variable in class [Link]
The Class object representing the primitive Java type void.
typeName(). Method in class [Link]
Return this RemoteValue's type ("array").
typeName(). Method in class [Link]
va
Print this RemoteValue's type ("boolean").
typeName(). Method in class [Link]
Print this RemoteValue's type ("byte").
typeName(). Method in class [Link]
Print this RemoteValue's type ("char").
typeName(). Method in class [Link]
Returns the name of the class as its type.
typeName(). Method in class [Link]
Print this RemoteValue's type ("double").
typeName(). Method in class [Link]
ja

Print this RemoteValue's type ("float").


typeName(). Method in class [Link]
Print this RemoteValue's type ("int").
typeName(). Method in class [Link]
Print this RemoteValue's type ("long").
typeName(). Method in class [Link]
Returns the RemoteValue's type name ("Object").
w.

typeName(). Method in class [Link]


Print this RemoteValue's type ("short").
typeName(). Method in class [Link]
Print this RemoteValue's type ("String").
typeName(). Method in class [Link]
Returns the RemoteValue's type as a string.
typeNoNulls. Static variable in interface [Link]
TYPE NULLABLE - does not allow NULL values.
typeNullable. Static variable in interface [Link]
TYPE NULLABLE - allows NULL values.
ww

typeNullableUnknown. Static variable in interface [Link]


TYPE NULLABLE - nullability unknown.
typePredBasic. Static variable in interface [Link]
TYPE INFO SEARCHABLE - Supported except for WHERE ..
typePredChar. Static variable in interface [Link]
TYPE INFO SEARCHABLE - Only supported with WHERE ..
typePredNone. Static variable in interface [Link]
TYPE INFO SEARCHABLE - No support.
typeSearchable. Static variable in interface [Link]
TYPE INFO SEARCHABLE - Supported for all WHERE ...

426
427

m
UID(). Constructor for class [Link]
Create a pure identifier that is unique with respect to the host on which it is generated.
UID(short). Constructor for class [Link]
Create a "well-known" ID.
UK. Static variable in class [Link]
Useful constant for country.
UNASSIGNED. Static variable in class [Link]
unbind(String). Static method in class [Link]

o
Unbind the name.
unbind(String). Method in interface [Link]
Unbind the name.
uncaughtException(Thread, Throwable). Method in class [Link]
Called by the Java Virtual Machine when a thread in this thread group stops because of an

i.c
uncaught exception.
UNDECIMBER. Static variable in class [Link]
Useful constant for month.
UndefinedProperty. Static variable in class [Link]
The UndefinedProperty object should be returned whenever a property which was not defined for
a particular image is fetched.
UnexpectedException(String). Constructor for class [Link]
Create a new UnexpectedException with a description.
UnexpectedException(String, Exception). Constructor for class [Link]
Create a new UnexpectedException with a description, and detail exception.

dil
UnicastRemoteObject(). Constructor for class [Link]
Create and export a new UnicastRemoteObject object using an anonymous port.
UNINITIALIZED. Static variable in class [Link]
Possible state value, signifying that this signature object has not yet been initialized.
union(Rectangle). Method in class [Link]
Computes the union of two rectangles.
UNIT_DECREMENT. Static variable in class [Link]
The unit decrement adjustment type.
UNIT_INCREMENT. Static variable in class [Link]
The unit increment adjustment type.
UnknownError(). Constructor for class [Link]
va
Constructs an UnknownError with no detail message.
UnknownError(String). Constructor for class [Link]
Constructs an UnknownError with the specified detail message.
UnknownHostException(). Constructor for class [Link]
Constructs a new UnknownHostException with no detail message.
UnknownHostException(String). Constructor for class [Link]
Constructs a new UnknownHostException with the specified detail message.
UnknownHostException(String). Constructor for class [Link]
Create a new UnknownHostException with a description.
UnknownHostException(String, Exception). Constructor for class [Link]
ja

Create a new UnknownHostException with a description and detail exception.


UnknownServiceException(). Constructor for class [Link]
Constructs a new UnknownServiceException with no detail message.
UnknownServiceException(String). Constructor for class [Link]
Constructs a new UnknownServiceException with the specified detail message.
UnmarshalException(String). Constructor for class [Link]
Create a new marshal exception with a descriptive string.
w.

UnmarshalException(String, Exception). Constructor for class [Link]


Create a new marshal exception with a descriptive string and an exception.
unread(byte[]). Method in class [Link]
Pushes back an array of bytes.
unread(byte[], int, int). Method in class [Link]
Pushes back an array of bytes.
unread(char[]). Method in class [Link]
Push back an entire array of characters.
unread(char[], int, int). Method in class [Link]
Push back from an array of characters.
ww

unread(int). Method in class [Link]


Pushes back a character so that it is read again by the next call to the read method on this
input stream.
unread(int). Method in class [Link]
Push back a single character.
unreferenced(). Method in interface [Link]
Called when there are no current references to this remote object.
UnsatisfiedLinkError(). Constructor for class [Link]
Constructs an UnsatisfiedLinkError with no detail message.
UnsatisfiedLinkError(String). Constructor for class [Link]
Constructs an UnsatisfiedLinkError with the specified detail message.
UnsupportedEncodingException(). Constructor for class [Link]

427
428

no detailed message
UnsupportedEncodingException(String). Constructor for class [Link]
detailed message

m
UnsupportedFlavorException(DataFlavor). Constructor for class
[Link]
Constructs an UnsupportedFlavorException.
UP. Static variable in class [Link]
The up arrow action-key.
up(int). Method in class [Link]
Change the current stackframe to be one or more frames higher (as in, away from the current
program counter).

o
UPDATE. Static variable in class [Link]
The update event type.
update(byte). Method in class [Link]
Updates the digest using the specified byte.
update(byte). Method in class [Link]

i.c
Updates the data to be signed or verified by a byte.
update(byte[]). Method in class [Link].Adler32
Updates checksum with specified array of bytes.
update(byte[]). Method in class [Link].CRC32
Updates CRC-32 with specified array of bytes.
update(byte[]). Method in class [Link]
Updates the digest using the specified array of bytes.
update(byte[]). Method in class [Link]
Updates the data to be signed or verified, using the specified array of bytes.
update(byte[], int, int). Method in class [Link].Adler32

dil
Updates checksum with specified array of bytes.
update(byte[], int, int). Method in interface [Link]
Updates the current checksum with the specified array of bytes.
update(byte[], int, int). Method in class [Link].CRC32
Updates CRC-32 with specified array of bytes.
update(byte[], int, int). Method in class [Link]
Updates the digest using the specified array of bytes, starting at the specified offset.
update(byte[], int, int). Method in class [Link]
Updates the data to be signed or verified, using the specified array of bytes, starting at the
specified offset.
update(Graphics). Method in class [Link]
va
Updates the component.
update(int). Method in class [Link].Adler32
Updates checksum with specified byte.
update(int). Method in interface [Link]
Updates the current checksum with the specified byte.
update(int). Method in class [Link].CRC32
Updates CRC-32 with specified byte.
update(Observable, Object). Method in interface [Link]
This method is called whenever the observed object is changed.
UPPERCASE_LETTER. Static variable in class [Link]
ja

url. Variable in class [Link]


The URL represents the remote object on the World Wide Web to which this connection is opened.
URL(String). Constructor for class [Link]
Creates a URL object from the String representation.
URL(String, String, int, String). Constructor for class [Link]
Creates a URL object from the specified protocol, host, port number, and file.
URL(String, String, String). Constructor for class [Link]
w.

Creates an absolute URL from the specified protocol name, host name, and file name.
URL(URL, String). Constructor for class [Link]
Creates a URL by parsing the specification spec within a specified context.
URLConnection(URL). Constructor for class [Link]
Constructs a URL connection to the specified URL.
URLStreamHandler(). Constructor for class [Link]
US. Static variable in class [Link]
Useful constant for country.
useCaches. Variable in class [Link]
If true, the protocol is allowed to use caching whenever it can.
ww

useDaylightTime(). Method in class [Link]


Overrides TimeZone Queries if this time zone uses Daylight Savings Time.
useDaylightTime(). Method in class [Link]
Queries if this time zone uses Daylight Savings Time.
usesLocalFilePerTable(). Method in interface [Link]
Does the database use a file for each table?
usesLocalFiles(). Method in interface [Link]
Does the database store tables in a local file?
usesShiftModifier(). Method in class [Link]
Return whether this MenuShortcut must be invoked using the SHIFT key.
usingProxy(). Method in class [Link]
Indicates if the connection is going through a proxy.

428
429

UTC(int, int, int, int, int, int). Static method in class [Link]
Determines the date and time based on the arguments.
UTFDataFormatException(). Constructor for class [Link]

m
Constructs a UTFDataFormatException with no detail message.
UTFDataFormatException(String). Constructor for class [Link]
Constructs a UTFDataFormatException with the specified detail message.

o
valid(). Method in class [Link]
Tests if this file descriptor object is valid.
validate(). Method in class [Link]
Ensures that a component has a valid layout.
validate(). Method in class [Link]

i.c
Validates this Container and all of the components contained within it.
validateObject(). Method in interface [Link]
Validates the object
validateTree(). Method in class [Link]
Recursively descends the container tree and recomputes the layout for any subtrees marked as
needing it (those marked as invalid).
value. Variable in class [Link]
"value" specifies the current value of the property, based on a combination of the information
supplied to getPropertyInfo, the Java environment, and driver supplied default values.
valueOf(boolean). Static method in class [Link]

dil
Returns the string representation of the boolean argument.
valueOf(char). Static method in class [Link]
Returns the string representation of the char * argument.
valueOf(char[]). Static method in class [Link]
Returns the string representation of the char array argument.
valueOf(char[], int, int). Static method in class [Link]
Returns the string representation of a specific subarray of the char array argument.
valueOf(double). Static method in class [Link]
Returns the string representation of the double argument.
valueOf(float). Static method in class [Link]
Returns the string representation of the float argument.
va
valueOf(int). Static method in class [Link]
Returns the string representation of the int argument.
valueOf(long). Static method in class [Link]
Returns a BigDecimal with the given value and a scale of zero.
valueOf(long). Static method in class [Link]
Returns a BigInteger with the specified value.
valueOf(long). Static method in class [Link]
Returns the string representation of the long argument.
valueOf(long, int). Static method in class [Link]
Returns a BigDecimal with a value of (val/10**scale).
ja

valueOf(Object). Static method in class [Link]


Returns the string representation of the Object argument.
valueOf(String). Static method in class [Link]
Returns the boolean value represented by the specified String.
valueOf(String). Static method in class [Link]
Assuming the specified String represents a byte, returns a new Byte object initialized to that
value.
w.

valueOf(String). Static method in class [Link]


Convert a string in JDBC date escape format to a Date value
valueOf(String). Static method in class [Link]
Returns a new Double value initialized to the value represented by the specified String.
valueOf(String). Static method in class [Link]
Returns the floating point value represented by the specified String.
valueOf(String). Static method in class [Link]
Returns a new Integer object initialized to the value of the specified String.
valueOf(String). Static method in class [Link]
Returns a new long object initialized to the value of the specified String.
ww

valueOf(String). Static method in class [Link]


Assuming the specified String represents a short, returns a new Short object initialized to
that value.
valueOf(String). Static method in class [Link]
Convert a string in JDBC time escape format to a Time value
valueOf(String). Static method in class [Link]
Convert a string in JDBC timestamp escape format to a Timestamp value
valueOf(String, int). Static method in class [Link]
Assuming the specified String represents a byte, returns a new Byte object initialized to that
value.
valueOf(String, int). Static method in class [Link]
Returns a new Integer object initialized to the value of the specified String.

429
430

valueOf(String, int). Static method in class [Link]


Returns a new long object initialized to the value of the specified String.
valueOf(String, int). Static method in class [Link]

m
Assuming the specified String represents a short, returns a new Short object initialized to
that value.
VARBINARY. Static variable in class [Link]
VARCHAR. Static variable in class [Link]
Vector(). Constructor for class [Link]
Constructs an empty vector.
Vector(int). Constructor for class [Link]
Constructs an empty vector with the specified initial capacity.

o
Vector(int, int). Constructor for class [Link]
Constructs an empty vector with the specified initial capacity and capacity increment.
VERBOSE. Static variable in class [Link]
VERIFY. Static variable in class [Link]
Possible state value, signifying that this signature object has been initialized for

i.c
verification.
verify(byte[]). Method in class [Link]
Verifies the passed-in signature.
VerifyError(). Constructor for class [Link]
Constructs an VerifyError with no detail message.
VerifyError(String). Constructor for class [Link]
Constructs an VerifyError with the specified detail message.
versionColumnNotPseudo. Static variable in interface [Link]
VERSION COLUMNS PSEUDO_COLUMN - is NOT a pseudo column.
versionColumnPseudo. Static variable in interface [Link]

dil
VERSION COLUMNS PSEUDO_COLUMN - is a pseudo column.
versionColumnUnknown. Static variable in interface [Link]
VERSION COLUMNS PSEUDO_COLUMN - may or may not be pseudo column.
VERTICAL. Static variable in interface [Link]
The vertical orientation.
VERTICAL. Static variable in class [Link]
VERTICAL. Static variable in class [Link]
The vertical Scrollbar variable.
vetoableChange(PropertyChangeEvent). Method in interface [Link]
This method gets called when a constrained property is changed.
VetoableChangeSupport(Object). Constructor for class [Link]
va
VirtualMachineError(). Constructor for class [Link]
Constructs a VirtualMachineError with no detail message.
VirtualMachineError(String). Constructor for class [Link]
Constructs a VirtualMachineError with the specified detail message.
VK_0. Static variable in class [Link]
VK_0 thru VK_9 are the same as ASCII '0' thru '9' (0x30 - 0x39)
VK_1. Static variable in class [Link]
VK_2. Static variable in class [Link]
VK_3. Static variable in class [Link]
VK_4. Static variable in class [Link]
ja

VK_5. Static variable in class [Link]


VK_6. Static variable in class [Link]
VK_7. Static variable in class [Link]
VK_8. Static variable in class [Link]
VK_9. Static variable in class [Link]
VK_A. Static variable in class [Link]
VK_A thru VK_Z are the same as ASCII 'A' thru 'Z' (0x41 - 0x5A)
w.

VK_ACCEPT. Static variable in class [Link]


VK_ADD. Static variable in class [Link]
VK_ALT. Static variable in class [Link]
VK_B. Static variable in class [Link]
VK_BACK_QUOTE. Static variable in class [Link]
VK_BACK_SLASH. Static variable in class [Link]
VK_BACK_SPACE. Static variable in class [Link]
VK_C. Static variable in class [Link]
VK_CANCEL. Static variable in class [Link]
VK_CAPS_LOCK. Static variable in class [Link]
ww

VK_CLEAR. Static variable in class [Link]


VK_CLOSE_BRACKET. Static variable in class [Link]
VK_COMMA. Static variable in class [Link]
VK_CONTROL. Static variable in class [Link]
VK_CONVERT. Static variable in class [Link]
VK_D. Static variable in class [Link]
VK_DECIMAL. Static variable in class [Link]
VK_DELETE. Static variable in class [Link]
VK_DIVIDE. Static variable in class [Link]
VK_DOWN. Static variable in class [Link]
VK_E. Static variable in class [Link]
VK_END. Static variable in class [Link]

430
431

VK_ENTER. Static variable in class [Link]


Virtual key codes.
VK_EQUALS. Static variable in class [Link]

m
VK_ESCAPE. Static variable in class [Link]
VK_F. Static variable in class [Link]
VK_F1. Static variable in class [Link]
VK_F10. Static variable in class [Link]
VK_F11. Static variable in class [Link]
VK_F12. Static variable in class [Link]
VK_F2. Static variable in class [Link]
VK_F3. Static variable in class [Link]

o
VK_F4. Static variable in class [Link]
VK_F5. Static variable in class [Link]
VK_F6. Static variable in class [Link]
VK_F7. Static variable in class [Link]
VK_F8. Static variable in class [Link]

i.c
VK_F9. Static variable in class [Link]
VK_FINAL. Static variable in class [Link]
for Asian Keyboard
VK_G. Static variable in class [Link]
VK_H. Static variable in class [Link]
VK_HELP. Static variable in class [Link]
VK_HOME. Static variable in class [Link]
VK_I. Static variable in class [Link]
VK_INSERT. Static variable in class [Link]
VK_J. Static variable in class [Link]

dil
VK_K. Static variable in class [Link]
VK_KANA. Static variable in class [Link]
VK_KANJI. Static variable in class [Link]
VK_L. Static variable in class [Link]
VK_LEFT. Static variable in class [Link]
VK_M. Static variable in class [Link]
VK_META. Static variable in class [Link]
VK_MODECHANGE. Static variable in class [Link]
VK_MULTIPLY. Static variable in class [Link]
VK_N. Static variable in class [Link]
VK_NONCONVERT. Static variable in class [Link]
va
VK_NUM_LOCK. Static variable in class [Link]
VK_NUMPAD0. Static variable in class [Link]
VK_NUMPAD1. Static variable in class [Link]
VK_NUMPAD2. Static variable in class [Link]
VK_NUMPAD3. Static variable in class [Link]
VK_NUMPAD4. Static variable in class [Link]
VK_NUMPAD5. Static variable in class [Link]
VK_NUMPAD6. Static variable in class [Link]
VK_NUMPAD7. Static variable in class [Link]
VK_NUMPAD8. Static variable in class [Link]
ja

VK_NUMPAD9. Static variable in class [Link]


VK_O. Static variable in class [Link]
VK_OPEN_BRACKET. Static variable in class [Link]
VK_P. Static variable in class [Link]
VK_PAGE_DOWN. Static variable in class [Link]
VK_PAGE_UP. Static variable in class [Link]
VK_PAUSE. Static variable in class [Link]
w.

VK_PERIOD. Static variable in class [Link]


VK_PRINTSCREEN. Static variable in class [Link]
VK_Q. Static variable in class [Link]
VK_QUOTE. Static variable in class [Link]
VK_R. Static variable in class [Link]
VK_RIGHT. Static variable in class [Link]
VK_S. Static variable in class [Link]
VK_SCROLL_LOCK. Static variable in class [Link]
VK_SEMICOLON. Static variable in class [Link]
VK_SEPARATER. Static variable in class [Link]
ww

VK_SHIFT. Static variable in class [Link]


VK_SLASH. Static variable in class [Link]
VK_SPACE. Static variable in class [Link]
VK_SUBTRACT. Static variable in class [Link]
VK_T. Static variable in class [Link]
VK_TAB. Static variable in class [Link]
VK_U. Static variable in class [Link]
VK_UNDEFINED. Static variable in class [Link]
KEY_TYPED events do not have a defined keyCode.
VK_UP. Static variable in class [Link]
VK_V. Static variable in class [Link]
VK_W. Static variable in class [Link]

431
432

VK_X. Static variable in class [Link]


VK_Y. Static variable in class [Link]
VK_Z. Static variable in class [Link]

m
VMID(). Constructor for class [Link]
Create a new VMID.
VOLATILE. Static variable in class [Link]

o
W_RESIZE_CURSOR. Static variable in class [Link]
The west-resize cursor type.
W_RESIZE_CURSOR. Static variable in class [Link]
wait(). Method in class [Link]
Waits to be notified by another thread of a change in this object.

i.c
wait(long). Method in class [Link]
Waits to be notified by another thread of a change in this object.
wait(long, int). Method in class [Link]
Waits to be notified by another thread of a change in this object.
WAIT_CURSOR. Static variable in class [Link]
The wait cursor type.
WAIT_CURSOR. Static variable in class [Link]
waitFor(). Method in class [Link]
Waits for the subprocess to complete.
waitForAll(). Method in class [Link]

dil
Starts loading all images.
waitForAll(long). Method in class [Link]
Starts loading all images.
waitForID(int). Method in class [Link]
Starts loading all images with the specified ID and waits until they have finished loading or
receive an error.
waitForID(int, long). Method in class [Link]
Starts loading all images with the specified ID.
wasNull(). Method in interface [Link]
An OUT parameter may have the value of SQL NULL; wasNull reports whether the last value read
has this special value.
va
wasNull(). Method in interface [Link]
A column may have the value of SQL NULL; wasNull reports whether the last column read had this
special value.
WEDNESDAY. Static variable in class [Link]
Useful constant for days of week.
WEEK_OF_MONTH. Static variable in class [Link]
Useful constant for date and time.
WEEK_OF_MONTH_FIELD. Static variable in class [Link]
Useful constant for WEEK_OF_MONTH field alignment.
WEEK_OF_YEAR. Static variable in class [Link]
ja

Useful constant for date and time.


WEEK_OF_YEAR_FIELD. Static variable in class [Link]
Useful constant for WEEK_OF_YEAR field alignment.
weightx. Variable in class [Link]
weighty. Variable in class [Link]
WEST. Static variable in class [Link]
The west layout constraint.
w.

WEST. Static variable in class [Link]


when. Variable in class [Link]
The time stamp.
white. Static variable in class [Link]
The color white.
whitespaceChars(int, int). Method in class [Link]
Specifies that all characters c in the range low <= c <= high are white space characters.
width. Variable in class [Link]
The width dimension.
WIDTH. Static variable in interface [Link]
ww

The width of the base image is now available and can be taken from the width argument to the
imageUpdate callback method.
width. Variable in class [Link]
The width of the rectangle.
window. Static variable in class [Link]
The background color for windows.
WINDOW. Static variable in class [Link]
The array index for the window background color.
Window(Frame). Constructor for class [Link]
Constructs a new Window initialized to an invisible state.
WINDOW_ACTIVATED. Static variable in class [Link]
The window activated event type.

432
433

WINDOW_BORDER. Static variable in class [Link]


The array index for the window border color.
WINDOW_CLOSED. Static variable in class [Link]

m
The window closed event type.
WINDOW_CLOSING. Static variable in class [Link]
The window closing event type.
WINDOW_DEACTIVATED. Static variable in class [Link]
The window deactivated event type.
WINDOW_DEICONIFIED. Static variable in class [Link]
The window deiconified event type.
WINDOW_DEICONIFY. Static variable in class [Link]

o
The de-iconify window event.
WINDOW_DESTROY. Static variable in class [Link]
The destroy window event.
WINDOW_EVENT_MASK. Static variable in class [Link]
The event mask for selecting window events.

i.c
WINDOW_EXPOSE. Static variable in class [Link]
The expose window event.
WINDOW_FIRST. Static variable in class [Link]
Marks the first integer id for the range of window event ids.
WINDOW_ICONIFIED. Static variable in class [Link]
The window iconified event type.
WINDOW_ICONIFY. Static variable in class [Link]
The iconify window event.
WINDOW_LAST. Static variable in class [Link]
Marks the last integer id for the range of window event ids.

dil
WINDOW_MOVED. Static variable in class [Link]
The move window event.
WINDOW_OPENED. Static variable in class [Link]
The window opened event type.
WINDOW_TEXT. Static variable in class [Link]
The array index for the window text color.
windowActivated(WindowEvent). Method in class [Link]
Handles the windowActivated event by invoking the windowActivated methods on listener-a and
listener-b.
windowActivated(WindowEvent). Method in class [Link]
windowActivated(WindowEvent). Method in interface [Link]
va
Invoked when a window is activated.
WindowAdapter(). Constructor for class [Link]
windowBorder. Static variable in class [Link]
The border color for windows.
windowClosed(WindowEvent). Method in class [Link]
Handles the windowClosed event by invoking the windowClosed methods on listener-a and
listener-b.
windowClosed(WindowEvent). Method in class [Link]
windowClosed(WindowEvent). Method in interface [Link]
Invoked when a window has been closed.
ja

windowClosing(WindowEvent). Method in class [Link]


Handles the windowClosing event by invoking the windowClosing methods on listener-a and
listener-b.
windowClosing(WindowEvent). Method in class [Link]
windowClosing(WindowEvent). Method in interface [Link]
Invoked when a window is in the process of being closed.
windowDeactivated(WindowEvent). Method in class [Link]
w.

Handles the windowDeactivated event by invoking the windowDeactivated methods on listener-a


and listener-b.
windowDeactivated(WindowEvent). Method in class [Link]
windowDeactivated(WindowEvent). Method in interface [Link]
Invoked when a window is de-activated.
windowDeiconified(WindowEvent). Method in class [Link]
Handles the windowDeiconfied event by invoking the windowDeiconified methods on listener-a and
listener-b.
windowDeiconified(WindowEvent). Method in class [Link]
windowDeiconified(WindowEvent). Method in interface [Link]
ww

Invoked when a window is de-iconified.


WindowEvent(Window, int). Constructor for class [Link]
Constructs a WindowEvent object with the specified source window and type.
windowIconified(WindowEvent). Method in class [Link]
Handles the windowIconified event by invoking the windowIconified methods on listener-a and
listener-b.
windowIconified(WindowEvent). Method in class [Link]
windowIconified(WindowEvent). Method in interface [Link]
Invoked when a window is iconified.
windowOpened(WindowEvent). Method in class [Link]
Handles the windowOpened event by invoking the windowOpened methods on listener-a and
listener-b.

433
434

windowOpened(WindowEvent). Method in class [Link]


windowOpened(WindowEvent). Method in interface [Link]
Invoked when a window has been opened.

m
windowText. Static variable in class [Link]
The text color for windows.
wordChars(int, int). Method in class [Link]
Specifies that all characters c in the range low <= c <= high are word constituents.
write(byte[]). Method in interface [Link]
Writes [Link] bytes from the specified byte array to this output stream.
write(byte[]). Method in class [Link]
Writes [Link] bytes from the specified byte array to this file output stream.

o
write(byte[]). Method in class [Link]
Writes [Link] bytes to this output stream.
write(byte[]). Method in interface [Link]
Writes an array of bytes.
write(byte[]). Method in class [Link]

i.c
Writes an array of bytes.
write(byte[]). Method in class [Link]
Writes [Link] bytes from the specified byte array to this output stream.
write(byte[]). Method in class [Link]
Writes [Link] bytes from the specified byte array starting at offset off to this file.
write(byte[], int, int). Method in class [Link]
Writes len bytes from the specified byte array starting at offset off to this buffered output
stream.
write(byte[], int, int). Method in class [Link]
Writes len bytes from the specified byte array starting at offset off to this byte array

dil
output stream.
write(byte[], int, int). Method in class [Link]
Writes an array of bytes.
write(byte[], int, int). Method in interface [Link]
Writes len bytes from the specified byte array starting at offset off to this output stream.
write(byte[], int, int). Method in class [Link]
Writes len bytes from the specified byte array starting at offset off to the underlying output
stream.
write(byte[], int, int). Method in class [Link]
Writes an array of bytes to the compressed output stream.
write(byte[], int, int). Method in class [Link]
va
Updates the message digest (if the digest function is on) using the specified subarray, and in
any case writes the subarray to the output stream.
write(byte[], int, int). Method in class [Link]
Writes len bytes from the specified byte array starting at offset off to this file output
stream.
write(byte[], int, int). Method in class [Link]
Writes len bytes from the specified byte array starting at offset off to this output stream.
write(byte[], int, int). Method in class [Link]
Writes array of bytes to the compressed output stream.
write(byte[], int, int). Method in class [Link]
ja

Write a subarray of bytes.


write(byte[], int, int). Method in interface [Link]
Writes a sub array of bytes.
write(byte[], int, int). Method in class [Link]
Writes a sub array of bytes.
write(byte[], int, int). Method in class [Link]
Writes len bytes from the specified byte array starting at offset off to this output stream.
w.

write(byte[], int, int). Method in class [Link]


Writes len bytes from the specified byte array starting at offset off to this piped output
stream.
write(byte[], int, int). Method in class [Link]
Writes a portion of the specified byte array, blocking if necessary.
write(byte[], int, int). Method in class [Link]
Writes len bytes from the specified byte array starting at offset off to this file.
write(byte[], int, int). Method in class [Link]
Writes an array of bytes to the current ZIP entry data.
write(char[]). Method in class [Link]
ww

Write an array of characters.


write(char[]). Method in class [Link]
Write an array of characters.
write(char[], int, int). Method in class [Link]
Write a portion of an array of characters.
write(char[], int, int). Method in class [Link]
Writes characters to the buffer.
write(char[], int, int). Method in class [Link]
Write a portion of an array of characters.
write(char[], int, int). Method in class [Link]
Write a portion of an array of characters.
write(char[], int, int). Method in class [Link]

434
435

Write a portion of an array of characters.


write(char[], int, int). Method in class [Link]
Write a portion of an array of characters.

m
write(char[], int, int). Method in class [Link]
Write a portion of an array of characters.
write(char[], int, int). Method in class [Link]
Write a portion of an array of characters.
write(DataOutput). Method in class [Link]
Write uid to output stream.
write(int). Method in class [Link]
Writes the specified byte to this buffered output stream.

o
write(int). Method in class [Link]
Write a single character.
write(int). Method in class [Link]
Writes the specified byte to this byte array output stream.
write(int). Method in class [Link]

i.c
Writes a character to the buffer.
write(int). Method in class [Link]
Writes a byte.
write(int). Method in interface [Link]
Writes the specified byte to this data output stream.
write(int). Method in class [Link]
Writes the specified byte to the underlying output stream.
write(int). Method in class [Link]
Writes a byte to the compressed output stream.
write(int). Method in class [Link]

dil
Updates the message digest (if the digest function is on) using the specified byte, and in any
case writes the byte to the output stream.
write(int). Method in class [Link]
Writes the specified byte to this file output stream.
write(int). Method in class [Link]
Writes the specified byte to this output stream.
write(int). Method in class [Link]
Write a single character.
write(int). Method in class [Link]
Write a byte of data to the stream.
write(int). Method in interface [Link]
va
Writes a byte.
write(int). Method in class [Link]
Writes a byte.
write(int). Method in class [Link]
Writes the specified byte to this output stream.
write(int). Method in class [Link]
Write a single character.
write(int). Method in class [Link]
Writes the specified byte to the piped output stream.
write(int). Method in class [Link]
ja

Writes the specified byte to this print stream.


write(int). Method in class [Link]
Write a single character.
write(int). Method in class [Link]
Writes the specified byte to this file.
write(int). Method in class [Link]
Write a single character.
w.

write(int). Method in class [Link]


Write a single character.
write(ObjectOutput). Method in class [Link]
Marshal object id to output stream.
write(String). Method in class [Link]
Write a string.
write(String). Method in class [Link]
Write a string.
write(String). Method in class [Link]
Write a string.
ww

write(String, int, int). Method in class [Link]


Write a portion of a String.
write(String, int, int). Method in class [Link]
Write a portion of a string to the buffer.
write(String, int, int). Method in class [Link]
Write a portion of a string.
write(String, int, int). Method in class [Link]
Write a portion of a string.
write(String, int, int). Method in class [Link]
Write a portion of a string.
write(String, int, int). Method in class [Link]
Write a portion of a string.

435
436

write(String, int, int). Method in class [Link]


Write a portion of a string.
WriteAbortedException(String, Exception). Constructor for class [Link]

m
A WriteAbortedException is thrown during a read when one of the ObjectStreamExceptions was
thrown during writing.
writeBoolean(boolean). Method in interface [Link]
Writes a boolean value to this output stream.
writeBoolean(boolean). Method in class [Link]
Writes a boolean to the underlying output stream as a 1-byte value.
writeBoolean(boolean). Method in class [Link]
Writes a boolean.

o
writeBoolean(boolean). Method in class [Link]
Writes a boolean to the file as a 1-byte value.
writeByte(int). Method in interface [Link]
Writes an 8-bit value to this output stream.
writeByte(int). Method in class [Link]

i.c
Writes out a byte to the underlying output stream as a 1-byte value.
writeByte(int). Method in class [Link]
Writes an 8 bit byte.
writeByte(int). Method in class [Link]
Writes a byte to the file as a 1-byte value.
writeBytes(String). Method in interface [Link]
Writes a string to this output stream.
writeBytes(String). Method in class [Link]
Writes out the string to the underlying output stream as a sequence of bytes.
writeBytes(String). Method in class [Link]

dil
Writes a String as a sequence of bytes.
writeBytes(String). Method in class [Link]
Writes the string to the file as a sequence of bytes.
writeChar(int). Method in interface [Link]
Writes a char value to this output stream.
writeChar(int). Method in class [Link]
Writes a char to the underlying output stream as a 2-byte value, high byte first.
writeChar(int). Method in class [Link]
Writes a 16 bit char.
writeChar(int). Method in class [Link]
Writes a char to the file as a 2-byte value, high byte first.
va
writeChars(String). Method in interface [Link]
Writes a string to this output stream.
writeChars(String). Method in class [Link]
Writes a string to the underlying output stream as a sequence of characters.
writeChars(String). Method in class [Link]
Writes a String as a sequence of chars.
writeChars(String). Method in class [Link]
Writes a string to the file as a sequence of characters.
writeDouble(double). Method in interface [Link]
Writes a double value to this output stream.
ja

writeDouble(double). Method in class [Link]


Converts the double argument to a long using the doubleToLongBits method in class Double, and
then writes that long value to the underlying output stream as an 8-byte quantity, high byte
first.
writeDouble(double). Method in class [Link]
Writes a 64 bit double.
writeDouble(double). Method in class [Link]
w.

Converts the double argument to a long using the doubleToLongBits method in class Double, and
then writes that long value to the file as an 8-byte quantity, high byte first.
writeExternal(ObjectOutput). Method in interface [Link]
The object implements the writeExternal method to save its contents by calling the methods of
DataOutput for its primitive values or calling the writeObject method of ObjectOutput for
objects, strings and arrays.
writeFloat(float). Method in interface [Link]
Writes a float value to this output stream.
writeFloat(float). Method in class [Link]
Converts the float argument to an int using the floatToIntBits method in class Float, and then
ww

writes that int value to the underlying output stream as a 4-byte quantity, high byte first.
writeFloat(float). Method in class [Link]
Writes a 32 bit float.
writeFloat(float). Method in class [Link]
Converts the float argument to an int using the floatToIntBits method in class Float, and then
writes that int value to the file as a 4-byte quantity, high byte first.
writeInt(int). Method in interface [Link]
Writes an int value to this output stream.
writeInt(int). Method in class [Link]
Writes an int to the underlying output stream as four bytes, high byte first.
writeInt(int). Method in class [Link]
Writes a 32 bit int.

436
437

writeInt(int). Method in class [Link]


Writes an int to the file as four bytes, high byte first.
writeLong(long). Method in interface [Link]

m
Writes a long value to this output stream.
writeLong(long). Method in class [Link]
Writes a long to the underlying output stream as eight bytes, high byte first.
writeLong(long). Method in class [Link]
Writes a 64 bit long.
writeLong(long). Method in class [Link]
Writes a long to the file as eight bytes, high byte first.
writeObject(Object). Method in interface [Link]

o
Write an object to the underlying storage or stream.
writeObject(Object). Method in class [Link]
Write the specified object to the ObjectOutputStream.
Writer(). Constructor for class [Link]
Create a new character-stream writer whose critical sections will synchronize on the writer

i.c
itself.
Writer(Object). Constructor for class [Link]
Create a new character-stream writer whose critical sections will synchronize on the given
object.
writeShort(int). Method in interface [Link]
Writes a 16-bit value to this output stream.
writeShort(int). Method in class [Link]
Writes a short to the underlying output stream as two bytes, high byte first.
writeShort(int). Method in class [Link]
Writes a 16 bit short.

dil
writeShort(int). Method in class [Link]
Writes a short to the file as two bytes, high byte first.
writeStreamHeader(). Method in class [Link]
The writeStreamHeader method is provided so subclasses can append or prepend their own header
to the stream.
writeTo(OutputStream). Method in class [Link]
Writes the complete contents of this byte array output stream to the specified output stream
argument, as if by calling the output stream's write method using [Link](buf, 0, count).
writeTo(Writer). Method in class [Link]
Writes the contents of the buffer to another character stream.
writeUTF(String). Method in interface [Link]
va
Writes a Unicode string by encoding it using modified UTF-8 format.
writeUTF(String). Method in class [Link]
Writes a string to the underlying output stream using UTF-8 encoding in a machine-independent
manner.
writeUTF(String). Method in class [Link]
Writes a String in UTF format.
writeUTF(String). Method in class [Link]
Writes a string to the file using UTF-8 encoding in a machine-independent manner.
written. Variable in class [Link]
The number of bytes written to the data output stream.
ja

x. Variable in class [Link]


The x coordinate of the event.
w.

x. Variable in class [Link]


The x coordinate.
x. Variable in class [Link]
The x coordinate of the rectangle.
xor(BigInteger). Method in class [Link]
Returns a BigInteger whose value is (this ^ val).
xor(BitSet). Method in class [Link]
Performs a logical XOR of this bit set with the bit set argument.
xpoints. Variable in class [Link]
The array of x coordinates.
ww

y. Variable in class [Link]


The y coordinate of the event.
y. Variable in class [Link]
The y coordinate.
y. Variable in class [Link]
The y coordinate of the rectangle.
YEAR. Static variable in class [Link]

437
438

Useful constant for date and time.


YEAR_FIELD. Static variable in class [Link]
Useful constant for YEAR field alignment.

m
yellow. Static variable in class [Link]
The color yellow.
yield(). Static method in class [Link]
Causes the currently executing thread object to temporarily pause and allow other threads to
execute.
ypoints. Variable in class [Link]
The array of y coordinates.

o
i.c
dil
ja va
w.
ww

438

You might also like