Professional Documents
Culture Documents
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@mam.gov.tr
ja
w.
ww
1
2
İNDEKS
m
BÖLÜM 1 : JAVAYA GİRİŞ
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
2
3
m
5.1 Abstract sınıf
5.2 Interface
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)
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)
3
4
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
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
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.
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
http://www.java.sun.com veya
http://www.javasoft.com
internet adreslerinden bedava çekilebilir. Çekme zahmeti çekmek istemiyorsanız SUN bu
programları CD formatında da satmaktadır.
ja
Java programı isim.java seklinde editörle yazılır. Java programınız yazıldıktan sonra ilk step
java derleyici (compiler) programıyla isim.class 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 isim.java
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 isim.html dosyası açılır. En basit şekilde html dosyası şu şekilde tanımlanabilir :
6
7
<html>
<applet code="isim.class" wıdth=200 heıght=50>
m
</applet>
</html>
o
komutuyla çalıstırılabilir. Yahut herhangi bir browser programına yüklenerek görülebilir.
i.c
kolaylaştırmak amacıyla verilmiştir.
dil
5: public static void main(String args[])
6: {
7: System.out.println("Java Sinifina Hos Geldiniz!");
8: }
9: }
Şekil 1.2.1 Hoşgeldiniz.java konsol programı
va
bu programı çalıştırmak için
javac Hosgeldiniz.java
java Hosgeldiniz
Yazısını alırız.
w.
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
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.
2: import java.awt.*;
3:
dil
İlk applet programımız HosgeldinizApplet.java listesi Şekil 1.2.2 de verilmiştir
1: import java.applet.Applet;
javac HosgeldinizApplet.java
appletviewer HosgeldinizApplet.html
w.
8
9
m
Bu programında temel olarak bazı farklılıklar dışında bir önceki programa benzediğini
gözlemleyebiliriz.
import java.applet.Applet;
import java.awt.*;
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.
dil
noktasına Java sinifina hos geldiniz! Yazısını çizer. DrawString Grafik sınıfı g nesnesine ait
bir metotdur.
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:\\unicode.org 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.
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;
i.c
int ilktamsayi=32;
şeklinde de yazılabilirdi.
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;
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"
System.out.println(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
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 java.io.*; //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: System.out.println("sayi1 + sayi2 ="+toplama);
17: System.out.println("sayi1 - sayi2 ="+cikarma);
18: System.out.println("sayi1 * sayi2 ="+carpma);
19: System.out.println("sayi1 / sayi2 ="+bolme);
ja
sayi1 + sayi2 =5
sayi1 - sayi2 =-1
sayi1 * sayi2 =6
sayi1 / sayi2 =0
sayi1 % sayi2 =2
Şekil 1.4.2 Aritmetik.java 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
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 java.io.*;
public class Aritmetik1
{ public static void main(String[] args)
{
ja
int sayi1=1;
int sayi2=2;
sayi1+=sayi2;
System.out.println("sayi1+= : "+ sayi1);
sayi1-=sayi2;
w.
}
}
Şekil 1.4.3 Aritmetik1.java 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 :
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 java.io.*;
va
public class booleanvar
{ public static void main(String[] args)
{
boolean b1,b2;
b1=true;
b2=false;
ja
sayı2=2;
System.out.println("sayi 1 : "+sayi1);
System.out.println("sayi 2 : "+sayi2);
b1=(sayi1 > sayi2);
System.out.println("sayi1 > sayi2 "+ b1 );
b1=(sayi1 < sayi2);
System.out.println("sayi1 < sayi2 "+ b1 );
ww
b1=(sayi1 == sayi2);
System.out.println("sayi1 == sayi2 "+ b1 );
b1=(sayi1 >= sayi2);
System.out.println("sayi1 >= sayi2 "+ b1 );
b1=(sayi1 <= sayi2);
System.out.println("sayi1 <= sayi2 "+ b1 );
b1=(sayi1 != sayi2);
14
15
m
}
Şekil 1.5.2 Java mantıksal işlemleri örnek problemi booleanvar.java
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
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ı
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.
class ifyapisi
{
public static void main (String args[]) throws IOException
{
double not;
//
DataInputStream cin=new DataInputStream(System.in);
15
16
m
if( not >= 90)
{ System.out.println("A"); }
else if(not >=75)
{ System.out.println("B"); }
else if(not >=60)
o
{ System.out.println("C"); }
else if(not >=50)
{ System.out.println("D"); }
else if(not >=40)
i.c
{ System.out.println("E"); }
else
{ System.out.println("F"); }
}
}
Şekil 1.6.1.1 if yapısını gösteren ifyapisi.java programı
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 1.6.1.2 deki program parçası a degiskeninin degeri : true yazısını yazdıracaktır.
boolean a=true;
if(a)
ja
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 1.6.1.3 de iç
içe geçmis ve Şekil 1.6.1.4 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) { System.out.println("x ve y besten buyuktur.");}
elseif(y==5) { System.out.println("x besten buyuktur ve y bese esittir.");}
else { System.out.println("x besten buyuktur ve y besten kucuktur.");}
}
else
16
17
{
if(y>5) { System.out.println("x besten kucuktur veya esittir ve y 5 den buyuktur.");}
m
elseif(y==5) { System.out.println("x besten kucuktur veya esittir ve y bese esittir.");}
else { System.out.println("x besten kucuktur veya esıttır ve y besten kucuktur.");
}
}
Şekil 1.6.1.3 İç içe geçmiş if yapısı
o
double x = 7.0;
double y = 3.0;
if(x > 5 && y> 5) { System.out.println("x ve y besten buyuktur.");}
i.c
else if(x > 5 && y==5) { System.out.println("x besten buyuktur ve y bese esittir.");}
else if(x>5 && y<5) { System.out.println("x besten buyuktur ve y besten kucuktur.");}
else if(x< && y>5) { System.out.println("x besten kucuktur ve y 5 den buyuktur.");}
else if(x < 5 && y==5) { System.out.println("x besten kucuktur ve y bese esittir.");}
}
}
dil
Şekil 1.6.1.4 && (ve) deyimiyle bağlanmış if yapısı
örneğin :
while(true)
w.
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 1.6.2.1 de dowhile döngüsünün kullanıldığı bir dowhileApplet.java programı
görülmektedir
i.c
import java.awt.Graphics;
import java.applet.Applet;
public class dowhileApplet
{
public void paint(Graphics g)
{
dil
int saydirici=1;
int x=25;
do {
g.drawString(Integer.toString(saydırıcı),x,25);
x += 15;
} while(++saydirici <= 10);
}
va
}
Ţekil 1.6.2.1 dowhileApplet.java
for tekrarlama yapısıgenellikle sayıları belli bir düzen içinde arttırmak için kullanılır. Genel
yapısı Şekil 1.6.3.1 de gösterilmiştir.programlamadaki sayı saydırmaya dönük uygulamalarda
ww
18
19
Şekil 1.6.3.2 de 1 den yüze kadar sayıların toplamını hesaplayan bir konsol programı
m
verilmiştir.
import java.io.*;
class foryapisi
{
o
public static void main(String args[])
{
int toplam=0;
for(int sayi=1;sayi<=100;sayi++)
i.c
{ toplam+=sayi;}
System.out.println("1 den 100 e sayilarin toplami : "+toplam);
}
}
Şekil 1.6.3.2 foryapisi.java konsol proğramı
dil
foryapisi.java kompile edildiğinde
1 den 100 e sayilarin toplami : 5050
sonucunu verecektir.
int y=40;
g.drawString("Yil",25,25);
g.drawString("paraMiktari",100,25);
for(int yil=1; yil<=10 ; yil++)
{
w.
paraMiktari*=(1.0+faizOrani);
g.drawString(" "+yil,25,y);
g.drawString(" "+paraMiktari,100,y);
// not: drawString terimi daima String turu
// degiskenle baslamali veya string e donusturulmelidir.
y+=15;
ww
Şekil 1.6.3.3 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 1.6.3.4 de listelenmiştir.
19
20
o m
i.c
1.6.3.4 faizOraniApplet.html appletinin appletviewer browser programında görünümü
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 1.6.4.1 de verilmiştir.
................
default :
eğer yukarıdaki case kutularından hiçbirine girilemediyse
yapılacak işlemler
w.
break;
}
Şekil 1.6.4.1 switch - case yapısı
20
21
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.
kutugirdisi.addActionListener(this);
}
dil
g.drawString("Her harf notun toplami : ",25,40);
g.drawString("A : "+Asayisi,25,55);
g.drawString("B : "+Bsayisi,25,70);
g.drawString("C : "+Csayisi,25,85);
g.drawString("D : "+Dsayisi,25,100);
g.drawString("E : "+Esayisi,25,115);
g.drawString("F : "+Fsayisi,25,130);
va
}
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
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 1.6.4.2 switch - case yapısı örneği switchApplet.java
dil
va
JAVA PROGRAMLAMA DİLİ
ja
HAFTA 1
ALIŞTIRMALAR
1. Notdefteri programını kullanarak Hosgeldiniz.java proğramını incele. Konsole (MS Dos) ortamında aşağıdaki
komutları kullanarak calıştır :
w.
javac Hosgeldiniz.java
java Hosgeldiniz
import java.io.*;
class Hosgeldiniz { public static void main (String args[]) {
System.out.println("Java Sinifina Hos Geldiniz!");
}
ww
22
23
m
geldiniz!",25,25); }}
3. Notdefteri programını kullanarak ikisayitopla.java proğramını incele. Konsole (MS Dos) ortamında aşağıdaki
komutları kullanarak calıştır :
javac ikitamsayitopla.java
java ikitamsayitopla
o
import java.io.*; //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(System.in);
System.out.println("Bir tam sayi giriniz : ");
sayi1=Text.readInt(cin);
System.out.println("Ikinci bir tamsayi giriniz : ");
sayi2=Text.readInt(cin);
dil
toplam=sayi1+sayi2;
System.out.println("Iki tam sayinin toplami : "+toplam);
}
}
{
//sinif degiskenleri
Label kutubasligi; //Label sinifi degiskeni (nesnesi) kutubasligi
TextField kutugirdisi;//Textfield sinifi degiskeni (nesnesi)
kutugirdisi
int sayi;
w.
int toplam;
23
24
{
//sayiyi pencereden oku
m
Integer sayi1=new Integer(e.getActionCommand() );
sayi=sayi1.intValue();
// sayiyi okutma islemini asagidaki deyimle de yapabiliriz
// sayi=Integer.parseInt( e.getActionCommand() );
toplam+=sayi; // veya toplam=toplam+sayi;
repaint();//pencereyi yeniden paint metoduna göre ciz
}
o
public void paint(Graphics g)
{
g.drawString("Su ana kadarki sayilarin toplami : "+toplam,25,50);
i.c
}
}
//
DataInputStream cin=new DataInputStream(System.in);
System.out.println("Bir tam sayi giriniz : ");
sayi1=Text.readInt(cin);
System.out.println("Ikinci bir tam sayi giriniz : ");
sayi2=Text.readInt(cin);
w.
// - : 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
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
System.out.println("dogru ve yanlis : "+(mantik1 && mantik2));
System.out.println("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 );
System.out.println("sayi1 buyuktur sayi2 : "+mantik1);
System.out.println("sayi 1 kucuktur sayi2 : "+mantik2);
}
}
25
26
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;
kutugirdisi.addActionListener(this);
}
// -----------------------> x ekseni
// |
// |
// |
// V y ekseni
g.drawString("Su ana kadarki sayilarin toplami : "+toplam,25,50);
g.drawString("Su ana kadarki sayilarin aritmetik ortalamasi :
"+aritmetikOrtalama,25,65);
ww
26
27
o m
7. Notdefteri programını kullanarak bessayıtopla.java proğramını incele. Konsole (MS Dos) ortamında aşağıdaki
i.c
komutları kullanarak calıştır :
javac bessayıtopla.java
java bessayıtopla
dil
double sayi;
double toplam=0;
int saydirici=0;
//
DataInputStream cin=new DataInputStream(System.in);
while( saydirici < 5)
{
System.out.println("Bir tam sayi giriniz : ");
va
sayi=Text.readDouble(cin);
toplam+=sayi;
saydirici++;
}
System.out.println("sayilarin toplami : "+toplam);
}
}
ja
8. Notdefteri programını kullanarak StringDegisken.java programını incele. Konsole (MS Dos) ortamında
aşağıdaki komutları kullanarak calıştır :
javac StringDegisken.java
java StringDegisken
27
28
s3="49";
s4=" Elli";
m
s=s1+s2+s3+s4;
System.out.println(s);
i1=49;
s=s1+s2+i1+s4;
System.out.println(s);
}
}
o
Ali Veli 49 Elli
Ali Veli 49 Elli
i.c
9. alıstırma 7 deki bessayi topla.java programini iyice anladiktan sonra birden yüze (100) kadar sayiların
ortalamasini hesaplayan birdenyüzeOrtalama.java program ve sinifini (Konsole) yaz ve calistir.
class birdenyuzeortalama
{
public static void main (String args[])
{
double sayi=1;
double toplam=0;
while( sayi <= 100)
{
}
toplam+=sayi++;
dil
va
System.out.println("sayilarin toplami : "+toplam);
System.out.println("sayilarin ortalamasi : "+toplam/100.0);
}
}
Aritmetik.java
w.
Aritmetik1.java
booleanvar.java
ifyapisi.java
karsilastirmaApplet.java
28
29
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
girdi2.addActionListener(this);
// soru2 den sonra girdi (return) tusunu bekler
// girdi(return) tusundan sonra actionPerformed
i.c
// metoduna gider
add(girdi2); //girdi2 kutusunu applete cizer
}
dil
if(sayi1 == sayi2)
g.drawString(sayi1+" == "+sayi2,100,90);
if(sayi1 != sayi2)
g.drawString(sayi1+" != "+sayi2,100,105);
if(sayi1 < sayi2)
g.drawString(sayi1+" < "+sayi2,100,120);
if(sayi1 > sayi2)
g.drawString(sayi1+" > "+sayi2,100,135);
if(sayi1 <= sayi2)
va
g.drawString(sayi1+" <= "+sayi2,100,150);
if(sayi1 >= sayi2)
g.drawString(sayi1+" >= "+sayi2,100,165);
}
{
// sayi 1 i girdi kutusundan oku
sayi1=Integer.parseInt(girdi1.getText());
// sayi 2 i girdi kutusundan oku
sayi2=Integer.parseInt(girdi2.getText());
repaint();
w.
}
}
ww
29
30
o m
i.c
whileyapisi.java
dil
{ public static void main(String args[])
{
int sayi=2;
while(sayi<=1000)
{
sayi*=2;
System.out.println("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
dowhileApplet.java
w.
foryapisi.java
faizOraniApplet.java
switchApplet.java
Ödev problem 1
ww
30
31
m
Bu haftaki yeni java dosyaları
o
import java.awt.Graphics;import java.applet.Applet;
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)
{
g.drawString("*",x,y);
}
dil
}
}
}
ja va
31
32
o m
i.c
YILDIZ~3 JAV 404 02/05/98 23:36 yildiz2forApplet.java
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
g.drawString("*",x,x);
g.drawString("*",x,(180-x));
}
}
}
ja va
w.
import java.awt.Graphics;
import java.applet.Applet;
public class yildiz2whileApplet extends Applet
{
public void paint(Graphics g)
{
int i=1;
int x=0;
32
33
m
x += 15; // x degeri her i icin 15 artiyor
g.drawString("*",x,15); // x lineer degisken y 15
g.drawString("*",15,x); // x 15 y lineer de§isken
g.drawString("*",x,165); // x lineer degisken y 165
g.drawString("*",165,x); // x 165 y lineer de§isken
g.drawString("*",x,x); // \ ciz
g.drawString("*",x,(180-x)); // / ciz
o
}
}
}
i.c
dil
va
YILDIZ~5 JAV 366 02/05/98 23:10 yildiz1forApplet.java
ja
import java.awt.Graphics;
import java.applet.Applet;
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
{
g.drawString("*",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 kilo.java
class kilo
{
kilonuzu giriniz : 45
normal
kilonuzu giriniz : 95
sisman
w.
34
35
g.drawString("pi : "+pi,25,25);
}
m
}
o
ALIŞTIRMALAR
i.c
1. Java applet programı kullanarak aşağıdaki şekli applet de çizdiriniz :
**********
*********
********
*******
******
dil
*****
****
***
**
*
}
}
}
}
w.
ww
35
36
m
**********
* *
* *
**********
import java.awt.Graphics;
o
import java.applet.Applet;
i.c
public void paint(Graphics g)
{
int x,y;
for(x=15;x <= 150;x+=15)
{
g.drawString("*",x,15);
g.drawString("*",x,60);
}
dil
for(y=15;y <= 60;y+=15)
{
g.drawString("*",15,y);
g.drawString("*",150,y);
}
}
}
ja va
import java.io.*;
import Text;
class faktoriyel
{
public static void main(String args[]) throws IOException
{
long faktoriyel=1;
ww
36
37
m
Bir tamsayi giriniz: 4
4 faktoriyel: 24
ex = 1 + x /1! + x2 / 2! + x3 / 3! + x4 / 4! + ..
o
not : e=2.7182818
import java.io.*;
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(System.in);
System.out.println("Bir sayi giriniz:");
x=Text.readDouble(cin);
for(double sayi=1;sayi<=200;sayi++)
{
faktoriyel*=sayi;
us*=x;
exponent+=us/faktoriyel;
}
dil
va
System.out.println("exp("+x+") = "+exponent);
System.out.println("gercek exp("+x+") = "+Math.exp(x));
}
}
37
38
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 java.applet, java.awt ve java.io API paketlerini kullandık.
Java.applet paketi appletleri oluşturma, appletlere giriş çıkısları ve ses dosyalarını applet
dil
içerisinde çalıştırmayı sağlar. java.awt 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.
java.io 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) java.lang paketinde yer alır. Java.lang
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 Math.PI
va
3.14159265358979323846 (pi) sayısına eşittir. Diğeri Math.E 2.7182818284590452354 (e)
sayısına eşittir.
tanımlanmıştır.)
Sin(x) x in trigonometrik sinüsü Math.sin(1.0)=0.8414709840709
(x radyan cinsinden
tanımlanmıştır.)
Tan(x) x in trigonometrik tanjantı Math.tan(1.0)=1.557040724655
(x radyan cinsinden
tanımlanmıştır.)
ww
38
39
tanımlanmıştır.)
exp(x) e(2.7182818284590452354) nin Math.exp(1.0) =2.718281828459
m
x inci kuvveti Math.exp(2.0) =7.389056098931
Log(x) e tabanına göre logaritma Math.log(2.718281828459)=1.0
Pow(x,y) x in y inci kuvveti Math.pow(3,2)=9.0
Max(x,y) x ve y nin büyük olanı Math.max(2.3,12.7)=12.7
min(x,y) x ve y nin küçük olanı Math.min(2.3,12.7)=2.3
Random() Raslantısal sayı (0 ile 1 arasinda) Math.random() = 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.
dil
class matematik1
{
public static void main (String args[]) throws IOException
{
double x,y;
// DataInputStream sinifi cin nesnesini tanimla
DataInputStream cin=new DataInputStream(System.in);
System.out.println("Bir gercek sayi giriniz : ");
x=Text.readDouble(cin);
va
System.out.println("Bir gercek sayi giriniz : ");
y=Text.readDouble(cin);
System.out.println("Statik Matematik kutuphanesi Math de ");
System.out.println("en cok kullanilan metodlar :" );
// Math.abs(3.2)=3.2 Math.abs(-3.2)=3.2
System.out.println("Math.abs("+x+") = "+Math.abs(x));
// Math.ceil(9.2)=10 Math.ceil(-9.8)=-9
// Math.ceil(x) x den buyuk en kucuk tam say ya yuvarlar
ja
System.out.println("Math.ceil("+x+") = "+Math.ceil(x));
// Math.floor(9.2)=9 Math.floor(-9.8)=-10
// Math.floor(x) x den kucuk en buyuk tam say ya yuvarlar
System.out.println("Math.floor("+x+") = "+Math.floor(x));
// Trigonometrik fonksiyonlar sin(x) cos(x) tan(x) x:radyan
// Math.PI pi sayisi
w.
System.out.println("Math.PI = "+Math.PI);
System.out.println("Math.sin("+x+") = "+Math.cos(x));
System.out.println("Math.cos("+x+") = "+Math.sin(x));
System.out.println("Math.tan("+x+") = "+Math.tan(x));
//Trigonometrik fonksiyonlar asin(y) acos(y) atan(y)
// asin,acos,atan : radyan
System.out.println("Math.asin("+y+") = "+Math.acos(y));
ww
System.out.println("Math.acos("+y+") = "+Math.asin(y));
System.out.println("Math.atan("+y+") = "+Math.atan(y));
// Math.log(x) dogal logaritma (e) taban na gore
// Math.E e sayisi = 2.718281828...
System.out.println("Math.E = "+Math.E);
System.out.println("Math.log("+x+") = "+Math.log(x));
// Math.pow(x,y) x in y inci kuvveti
System.out.println("Math.pow("+x+","+y+" ) = "+Math.pow(x,y));
// Math.exp(x) Math.E=e=2.718281828.. in x inci kuvveti
System.out.println("Math.exp("+x+" ) = "+Math.exp(x));
39
40
m
// Maximum - minimum functions
// Math.max(x,y) Math.min(x,y)
System.out.println("Math.max("+x+","+y+" ) = "+Math.max(x,y));
System.out.println("Math.min("+x+","+y+" ) = "+Math.min(x,y));
}
}
Şekil 2.1.2 Math sınıfında(class) çalışan metotlardan bazılarını gösteren
o
Matematik1.java programı
i.c
Bir gercek sayi giriniz : 0.6
Statik Matematik kutuphanesi Math de
en cok kullanilan metodlar :
Math.abs(9.2) = 9.2
Math.ceil(9.2) = 10.0
Math.floor(9.2) = 9.0
Math.PI = 3.141592653589793
Math.sin(9.2) = -0.9748436214041636
dil
Math.cos(9.2) = 0.22288991410024764
Math.tan(9.2) = -0.22864171155902654
Math.asin(0.6) = 0.9272952180016123
Math.acos(0.6) = 0.6435011087932844
Math.atan(0.6) = 0.5404195002705842
Math.E = 2.718281828459045
Math.log(9.2) = 2.2192034840549946
Math.pow(9.2,0.6 ) = 3.7868028596424734
Math.exp(9.2 ) = 9897.129058743905
va
Math.sqrt(9.2 ) = 3.03315017762062
Math.max(9.2,0.6 ) = 9.2
Math.min(9.2,0.6 ) = 0.6
Şekil 2.1.3 mathematik1.java 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
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;
}
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);
System.out.println(“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 java.io.*;
ja
}
Şekil 2.2.2 metotornegi2.java programında kare metodunun kullanılması
41
42
m
import java.awt.*; // java pencere kullanma sinifini cagir
o
public double kare(double x)
{
return x*x;
}
i.c
public void paint(Graphics g)
{
g.drawString(sayi+"nin karesi = "+kare(sayi),25,50);
}
}
dil
va
Şekil 2.2.3 metotornegi2.java programında kare metodunun kullanılması
42
43
m
zaten geçmişti. Örneğin daha önceki programlarımızda bilgi
okutmak için kullandığımız
o
Terimi DataInputStream sınıfından(class) cin nesnesini
tanımlar. Bu tanımı yaparken System.in 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 System.in 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.. : ");
class metodornegi3a
{
// sayinin karesi dinamik metodu
public double kare(double x)
{
ww
return x*x;
}
}
43
44
{
g.drawString(sayi+"nin karesi = "+nesne1.kare(sayi),25,50);
m
}
}
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 nesne1.kare(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. Metodornegi2.java programında kare(sayı)
dogrudan kullanılmıştı. Çunku kare metodu aynı sınıfın(class)
içinde tanımlanmıştı. Metodornegi3.java 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.
class metotornegi4a
{
// sayinin karesi dinamik metodu
public static double kare(double x)
{
return x*x;
ja
}
}
44
45
m
Metodornegi3.java ve Metodornegi4.java 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 metotornegi6.java programında static kare metodunun tanımlanması
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
import java.io.*;
import Text;
class faktoriyel
{
45
46
m
long faktoriyel=1;
DataInputStream cin=new DataInputStream(System.in);
int faktoriyelsayi;
System.out.println("Bir tamsayi giriniz:");
faktoriyelsayi=Text.readInt(cin);
for(int sayi=1;sayi<=faktoriyelsayi;sayi++)
{ faktoriyel*=sayi;}
o
System.out.println(faktoriyelsayi+" faktoriyel: "+faktoriyel);
}
}
Şekil 2.3.1 Metod kullanılmadan faktoriyel hesaplayan faktoriyel.java programı
i.c
import java.io.*;
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;
}
}
Şekil 2.3.2 for döngülü faktoriyel metodunu kullarak faktoriyel hesaplayan
faktoriyel1.java programı
İkinci olarak faktoriyeli kendi kendini çağıran proğram yardımcılığı ile hesaplayalım.
w.
import java.io.*;
import Text;
class faktoriyel2
{
public static long faktoriyel(int x)
{
ww
if( x <= 1 )
return 1;
else
return x * faktoriyel( x – 1);
}
46
47
int faktoriyelsayi;
System.out.println("Bir tamsayi giriniz:");
m
faktoriyelsayi=Text.readInt(cin);
System.out.println(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 faktoriyel2.java programı
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
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.
import java.awt.Graphics;
import java.applet.Applet;
47
48
m
{
g.drawString(“ 7 nin karesi = “+kare(7),25,25);
g.drawString( 7.5 un karesi = “+kare(7.5),25,40);
}
o
// int tipi kare metodu
int kare(int x)
{
return x*x;
i.c
}
dil
Şekil 2.4.1 ayniisimliikimetod.java programı
va
Şekil 2.4.2 ayniisimliikimetod.html programıyla ayniisimliikimetod.class ın gösterilmesi
Bu programda parantez içerisinde 7 (tamsayı) verildiğinde java tamsayi metodu kare(int x),
ja
Metodların içinde kullanılan değişkenler sadece metodlara aittir. O metodun dışında tanımları
w.
import java.awt.Graphics;
import java.applet.Applet;
ww
48
49
y=6;
g.drawString("metod1 in ici : x = "+x+" y = "+y,25,40);
m
}
o
metod1(g);
g.drawString("metod1 in disi : x = "+x+" y = "+y,25,55);
}
i.c
}
Şekil 2.5.1 metodvesinifdeg.java programında metod değişkenlerinin sınıfa aktarılması
import java.awt.Graphics;
import java.applet.Applet; dil
public class metotvesinifdeg1 extends Applet
{
va
//buradaki değişkenler tüm sınıfa aittir
double x ;
int y ;
x=5.5;
y=6;
g.drawString("metod1 in ici : x = "+x+" y = "+y,25,40);
}
{
x = 2.5;
y = 3;
g.drawString("metod1 in disi : x = "+x+" y = "+y,25,25);
metod1(g);
g.drawString("metod1 in disi : x = "+x+" y = "+y,25,55);
}
ww
49
50
m
Metod1 in disi : x=2.5 y=3
Şekil 2.5.4 metodvesinifdeg1.java programının sonuçları
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.
import java.io.*;
class Point1
{ dil
// nesne olarak tanimlanmasi ve adres paylasimi
//java girdi cikti sinifini cagir
import java.awt.Point; //Point sinifini cagir
nokta1.x=200;
nokta1.y=200;
System.out.println("nokta1 in degeri degistirildi");
System.out.println("nokta 1 : "+nokta1.x+" , "+nokta1.y);
System.out.println("nokta 2 : "+nokta2.x+" , "+nokta2.y);
}
}
50
51
m
Point1.java da verilen
Point nokta1,nokta2;
nokta1=new Point(100,100);
o
nokta2=nokta1;
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.
Bu haftaki alistırmalar
ALISTIRMA 1
w.
{
return 1+(int)(Math.random()*6);
}
}
b) H4A1b sinifinda(class) java konsol ana metodu (public void main) yazarak
zar degerini yazdiriniz.
import java.io.*; // giris cikis
import H4A1a;
51
52
class H4A1b
m
{
public static void main (String args[]) throws IOException
{
System.out.println("zar degeri : "+H4A1a.zar());
}
}
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 java.io.*; // 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+=H4A1a.zar();
}
ortalama=toplam/100.0;
System.out.println("100 zarin ortalamasi = "+ortalama);
va
}
}
zar2=0;
zar3=0;
zar4=0;
zar5=0;
zar6=0;
while(zaratimsayisi<1000)
{
zardegeri=H4A1a.zar();
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
System.out.println("toplam zar 1 sayisi : "+zar1);
System.out.println("toplam zar 2 sayisi : "+zar2);
System.out.println("toplam zar 3 sayisi : "+zar3);
System.out.println("toplam zar 4 sayisi : "+zar4);
System.out.println("toplam zar 5 sayisi : "+zar5);
System.out.println("toplam zar 6 sayisi : "+zar6);
}
}
va
ALIŞTIRMA 2
import java.awt.*;
import java.applet.Applet;
import java.awt.event.*;
w.
53
54
m
add(ikincizar); // ikinci zar nesnesini pencereye ekle
salla=new Button("Zari salla ve at");
add(salla);
salla.addActionListener(this);
}
o
{
zar1=zar();
zar2=zar();
ilkzar.setText(Integer.toString(zar1));
i.c
ikincizar.setText(Integer.toString(zar2));
toplam+=(zar1+zar2);
toplamzaratisi++;
repaint();
}
dil
g.drawString("toplam = "+toplam+" Atilan zar sayisi =
"+toplamzaratisi,25,50);
}
}
import java.awt.*;
import java.applet.Applet;
import java.awt.event.*;
import H4A2b;
{
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);
salla.addActionListener(this);
54
55
m
public void actionPerformed(ActionEvent e)
{
zar1=z.zar();
zar2=z.zar();
ilkzar.setText(Integer.toString(zar1));
ikincizar.setText(Integer.toString(zar2));
toplam+=(zar1+zar2);
o
toplamzaratisi++;
repaint();
}
i.c
public void paint( Graphics g)
{
g.drawString("toplam = "+toplam+" Atilan zar sayisi =
"+toplamzaratisi,25,50);
}
}
import java.io.*;
w.
import Text;
class faktoriyel
{
public static void main(String args[]) throws IOException
{
int faktoriyel=1;
DataInputStream cin=new DataInputStream(System.in);
ww
int faktoriyelsayi;
System.out.println("Bir tamsayi giriniz:");
faktoriyelsayi=Text.readInt(cin);
for(int sayi=1;sayi<=faktoriyelsayi;sayi++)
{ faktoriyel*=sayi;}
System.out.println(faktoriyelsayi+" faktoriyel: "+faktoriyel);
}
}
55
56
m
import java.awt.Graphics;
import java.applet.Applet;
o
int y=25;
for(long i=0;i<=10;i++)
{
g.drawString(i+"! = "+faktoriyel(i),25,y);
i.c
y+=15;
}
}
dil
}
for(long i=0;i<=15;i++)
{
g.drawString("Fibonachi("+i+") = "+fibonachi(i),25,y);
y+=15;
}
}
w.
56
57
o m
i.c
FIBONA~2 JAV
import java.awt.*;
1.063
import java.applet.Applet;
import java.awt.event.*;
dil
20/05/98 0:47 fibonachitesti2.java
rakam.addActionListener(this);
sonucetiketi=new Label("Fibonachi degeri : ");
sonuc=new TextField(10);
sonuc.setEditable(false);
add(rakametiketi);
add(rakam);
w.
add(sonucetiketi);
add(sonuc);
}
sayi=Long.parseLong(rakam.getText());
showStatus("Fibonachi hesaplan yor....");
fibonachisayisi=fibonachi(sayi);
showStatus("Fibonachi hesaplandi....");
sonuc.setText(Long.toString(fibonachisayisi));
}
57
58
m
}
o
i.c
FAKTOR~3 JAV 522 20/05/98 1:12 faktoriyel2.java
import java.io.*;
import Text;
class faktoriyel2
{
{
if( x <= 1 )
return 1;
else
dil
public static long faktoriyel(int x)
System.out.println(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)*Math.PI*Math.pow(r,3);
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;
kutugirdisi.addActionListener(this);
dil
}
//=====================================================
// girdi alanindaki olan olaylari dinleme metodu
// Her yeni rakam girildiginde bu metod cagirilir
public void actionPerformed(ActionEvent e)
{
Double sayi1=new Double(e.getActionCommand() );
yaricap=sayi1.doubleValue();
hacim=kubunhacmi(yaricap);
va
kutugirdisi.setText(" ");//kutudaki rakami sil
repaint();//pencereyi yeniden paint metoduna gore ciz
}
//=====================================================
// paint (boya=pencereye ciz metodu)
public void paint(Graphics g)
{
g.drawString(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)*Math.PI*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 = Math.sqrt(dikkkenar1*dikkenar1+dikkenar2*dikkenar2);
o
import java.awt.*; // java pencere kullanma sinifini cagir
import java.awt.event.*; // 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;
kutugirdisi2.addActionListener(this);
w.
}
//=====================================================
// girdi alanindaki olan olaylari dinleme metodu
// Her yeni rakam girildiginde bu metod cagirilir
public void actionPerformed(ActionEvent e)
{
Double sayi1=new Double(kutugirdisi1.getText() );
dikkenar1=sayi1.doubleValue();
ww
60
61
m
//=====================================================
//ucgenin hipotenusunu hesaplama metodu
public double hipotenus(double dk1,double dk2)
{
return Math.sqrt(dk1*dk1+dk2*dk2);
}
}
o
i.c
dil
ja va
w.
ww
61
62
m
3.1 Sınıf yapısının genel tanımı
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
62
63
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 :
Benimkutum.en=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 java.io.*;
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;
benimkutum.en=10.0;
benimkutum.boy=20.0;
va
benimkutum.yukseklik=30.0;
hacim=benimkutum.en*benimkutum.boy*benimkutum.yukseklik;
System.out.println("Benim kutumun hacmi : "+hacim);
}
}
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 Kutu.class diğeride kututesti.class.
Ana program kututesti olduğu için bu programın işletimi
java kututesti
deyimini kullanarak yapılır. Program işletildiğinde
w.
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
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.
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 kututesti1.java programı tanımlanmıştır.
import java.io.*;
class Kutu
{
double en;
double boy;
double yukseklik;
}
class kututesti1
{
dil
va
public static void main(String args[])
{
double hacim;
Kutu benimkutum1=new Kutu();
benimkutum1.en=10.0;
benimkutum1.boy=20.0;
benimkutum1.yukseklik=30.0;
hacim=benimkutum1.en*benimkutum1.boy*benimkutum1.yukseklik;
ja
Bu programın çıktısı :
64
65
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 java.io.*;
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=benimkutum1.en*benimkutum1.boy*benimkutum1.yukseklik;
va
System.out.println("Benim kutumun hacmi : "+hacim);
Kutu benimkutum2=new Kutu(5.0,10.0,15.0);
hacim=benimkutum2.en*benimkutum2.boy*benimkutum2.yukseklik;
System.out.println("Benim kutumun hacmi : "+hacim);
}
}
Bu programın çıktısı :
Görüldüğü gibi bu program bir öncekinin aynı sonucu vermiştir. Faket burada
bir önceki programda yapılan
Tanımı yerini
ww
65
66
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
kutuornegi3.java programında hacim hesaplarını yapan hacim metodu Kutu sınıfının içinde
tanımlanmıştır.
o
import java.io.*;
class Kutu
i.c
{
double en;
double boy;
double yukseklik;
dil
en=e;
boy=b;
yukseklik=y;
}
class kututesti3
{
public static void main(String args[])
{
ja
Bir önceki bölümde metod yazımı konusunda anlattıklarımızın hepsini buraya ilave edebiliriz.
ww
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 this.değişken_ismi komutuyla çağırılabilir. Eçen bölümde sınıf ve metota ait
değişkenleri izlerken metotvesinifdeg.java ve metotvesinifdeg1.java isimlerinde iki örnek
66
67
m
import java.awt.Graphics;
import java.applet.Applet;
o
double x ;
int y ;
i.c
double x;
int y;
x=5.5;
y=6;
//tum sinifa at degiskenler this kelimesi ile birlikte kullanilabilirler
g.drawString("metod1 in dis degiskenleri this ile ulasim : x = "+this.x+"
y = "+this.y,25,25);
g.drawString("metod1 in ic degiskenleri : x = "+x+" y = "+y,25,40);
dil
}
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
this.boy=b;
this.yukseklik=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
67
68
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;
}
}
return x1-x2;
x1=y1;
x2=y2;
}
68
69
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
dortislemhesapmakinasi.java programının x1 ve x2 değişkenlerine private sözcüğü
kullandığımız için
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.
dil
h.ilksayigir(2.0);
h.ikincisayigir(3.5);
veya
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
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;
o
noktagir(a,b);
}
i.c
public double Xoku() {
return x;
}
}
public String toString()
{
}
return "["+x+","+y+"]";
dil
Şekil 3.6.1 nokta.java 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.
}
ww
70
71
{
return yaricap;
m
}
o
public String toString()
{
return "Merkez = "+"["+x+","+y+"]"+
"; Yaricap="+yaricap;
i.c
}
}
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);
}
{
merkez=new nokta(a,b);
yaricapgir(r);
{
if(r >= 0.0)
yaricap=r;
else
yaricap=0.0;
}
71
72
m
public double alan()
{
return Math.PI*yaricap*yaricap;
}
o
return "Merkez = "+"["+merkez.x+","+merkez.y+"]"+
"; Yaricap="+yaricap;
}
}
i.c
Şekil 3.7.1 daire1.java 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
import java.awt.Graphics;
import java.applet.Applet;
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
noktaref=d;
g.drawString("Daire(noktaref uzerinden) :"+noktaref.toString(),25,70);
//noktaref nesnesini daireref degiskenine aktaral m
daireref=(daire)noktaref;
g.drawString("Daire(daireref uzerinden) :"+daireref.toString(),25,85);
g.drawString("Dairenin alani(daireref uzerinden)
:"+daireref.alan(),25,100);
ww
}
}
Şekil 3.8.1 noktatesti.java sınıfında üst sınıf üzerinden adres referansı
kullanımı
72
73
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.
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.
super.finalize();
}
HAFTA 6
73
74
m
Bu haftaki alıştırmalar :
ALIŞTIRMA 1
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
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
import nokta;
74
75
n2=new nokta(nokta2.x,nokta2.y);
}
m
public void dogrugir(double x1, double y1,double x2,double y2)
{
n1.noktagir(x1,y1);
n2.noktagir(x2,y2);
}
o
public String toString()
{
return "("+n1.toString()+","+n2.toString()+")";
}
i.c
public double boy()
{
return Math.sqrt((n1.Xoku()-n2.Xoku())*(n1.Xoku()-n2.Xoku()) +
(n1.Yoku()-n2.Yoku())*(n1.Yoku()-n2.Yoku()) );
}
}
DOGRUT~2 JAV
import java.io.*;
import nokta;
307
([1.0,1.0],[2.0,2.0])
dogru boyu : 1.4142135623730951
n1=new nokta(x1,y1);
n2=new nokta(x2,y2);
}
75
76
m
public void dikdortgengir(double x1, double y1,double x2,double y2)
{
n1.noktagir(x1,y1);
n2.noktagir(x2,y2);
}
o
{
return "dikdortgen : ("+n1.toString()+","+n2.toString()+")";
}
i.c
public double alan()
{
return (n1.Xoku()-n2.Xoku())*(n1.Yoku()-n2.Yoku());
}
dil
}
}
g.drawString(cokguzelbirdikdortgen.toString(),20,20);
g.drawString("Alan : "+ cokguzelbirdikdortgen.alan(),20,35);
}
}
public nokta()
{
noktagir(0,0);
}
76
77
m
noktagir(a,b);
}
public nokta(nokta n)
{
noktagir(n.Xoku(),n.Yoku());
}
o
public void noktagir(double a, double b)
{
x = a;
i.c
y = b;
}
dil
public double Xoku()
{
return x;
}
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.
{
//kurucu (constructor) metot
x1=y1;
x2=y2;
}
public dortislemhesapmakinasi()
{
//kurucu metot (constructor)
77
78
x1=1;
x2=1;
m
}
o
public double cikar()
{
return x1-x2;
}
i.c
public double carp()
{
return x1*x2;
}
dil
return x1/x2;
}
}
w.
class dortArtiIslem1
{
public static void main (String args[]) throws IOException
{
ww
78
79
m
System.out.println("Iki tam sayinin carpimi : "+h.carp());
System.out.println("Iki tam sayinin bolumu : "+h.bol());
}
}
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
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.
return n;
}
not : sadeleştirme işlemi pay ve paydayı en büyük ortak bölene bölerek yapılır.
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 java.io.*;
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;
}
dil
imaj=nimaj;
}
{
return ger;
}
return imaj;
}
80
81
m
public void kompleksgir(double nr,double ni)
{
ger=nr;
imaj=ni;
}
o
{
//kompleks sayinin polar koordinat cap esidi
return Math.sqrt(ger*ger+imaj*imaj);
}
i.c
public double theta()
{
//kompleks sayinin polar koordinat radyan aci esidi
return Math.atan2(imaj,ger);
}
dil
{
//kompleks sayinin polar koordinat derece aci esidi
return Math.atan2(imaj,ger)*45.0/Math.atan(1.0);
}
{
// iki kompleks say n n toplam n return deyimiyle kompleks olarak
// aktar r
double r1=(sol.gercek() + sag.gercek());
double i1=(sol.imajineri() + sag.imajineri());
kompleks sonuc;
sonuc=new kompleks(r1,i1);
return sonuc;
}
81
82
m
{ // iki kompleks sayinin sonuclarini aktar
kompleks sonuc;
sonuc=new kompleks((sol.gercek() - sag.gercek()),
(sol.imajineri() - sag.imajineri()));
return sonuc;
}
o
public static kompleks carp(kompleks sol, kompleks sag)
{ // iki kompleks sayinin carpimini aktar
kompleks sonuc;
sonuc=new kompleks
i.c
((sol.gercek()*sag.gercek() - sol.imajineri()*sag.imajineri()),
(sol.gercek()*sag.imajineri() + sol.imajineri()*sag.gercek()));
return sonuc;
}
dil
double a=sag.gercek()*sag.gercek()+sag.imajineri()*sag.imajineri();
kompleks sonuc;
sonuc=new kompleks
((sol.gercek()*sag.gercek() + sol.imajineri()*sag.imajineri())/a,
(-sol.gercek()*sag.imajineri() + sol.imajineri()*sag.gercek())/a);
return sonuc;
}
82
83
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();
}
dil
if(value.imajineri() >= 0)
b=b+"("+value.gercek()+" + "+value.imajineri()+"i )";
else
b=b+"("+value.gercek()+" - "+(-value.imajineri())+"i )";
}
else
{
if(value.imajineri() >= 0)
b=b+"("+value.gercek()+" + i )";
va
else
b=b+"("+value.gercek()+" - i )";
}
return b;
}
b=b+"("+gercek()+" + i )";
else if(imajineri() < 0)
b=b+"("+gercek()+" - i )";
else
b=b+gercek()+" ";
}
return b;
}
};
83
84
m
import java.applet.Applet; // java applet sinifini cagir
import java.awt.*; // java pencere kullanma sinifini cagir
import java.awt.event.*; // java pencereyi dinleme sinifini cagir
import kompleks;
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);
kutugirdisi1.addActionListener(this);
add(kutugirdisi1);
kutugirdisi2=new TextField(5);
kutugirdisi2.addActionListener(this);
add(kutugirdisi2);
w.
}
//=====================================================
// girdi alanindaki olan olaylari dinleme metodu
// Her yeni rakam girildiginde bu metod cagirilir
public void actionPerformed(ActionEvent e)
{
Double sayi1=new Double(kutugirdisi1.getText() );
Double sayi2=new Double(kutugirdisi2.getText() );
Double sayi3=new Double(kutugirdisi3.getText() );
84
85
m
k2.kompleksgir(sayi3.doubleValue(),sayi4.doubleValue());
repaint();//pencereyi yeniden paint metoduna gore ciz
}
//=====================================================
// paint (boya=pencereye ciz metodu)
public void paint(Graphics g)
{
o
g.drawString("ilk sayi : "+k1.toString(),25,80);
g.drawString("ikinci sayi : "+k2.toString(),25,95);
i.c
"+kompleks.toString(kompleks.topla(k1,k2)),25,110);
g.drawString("iki sayinin farki :
"+kompleks.toString(kompleks.cikar(k1,k2)),25,125);
g.drawString("iki sayinin carpimi :
"+kompleks.toString(kompleks.carp(k1,k2)),25,140 );
g.drawString("iki sayinin bolumu :
"+kompleks.toString(kompleks.bol(k1,k2)),25,155 );
}
dil
} va
ja
//===========================================
// bayagikesir sinifi tanimi
// Dr. Turhan Coban
//===========================================
import java.io.*;
// 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;
}
o
payda=npayda;
}
i.c
{
pay=numer;
payda=1;
}
public bayagikesir(bayagikesir c )
{
pay=c.Pay();
dil
payda=c.Payda();
}
// giriŸ - ‡ k Ÿ metotlar
}
return n;
}
//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
{
System.out.println("Payda s f ra esittir");
}
}
o
public int Pay()
{
return pay;
}
i.c
public int Payda()
{
return payda;
}
dil
pay=r;
}
payda=ni;
}
payda=1;
}
sadelestir();
}
87
88
m
// tam sayinin bayagikesir esiti
// eh birazc k yaklas m var tabi
bayagikesir b=new bayagikesir();
b.bayagikesirGir((int)d*10000,10000);
b.sadelestir();
return b;
}
o
public void topla(bayagikesir sag)
{
i.c
//ikinci bir bayagikesirle topla
pay = pay*sag.Payda() + sag.Pay()*payda;
payda = payda*sag.Payda();
}
dil
pay = pay + sag*payda;
sadelestir();
}
payda = payda*sag.Payda();
sadelestir();
}
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= sol.Pay() * sag.Payda() + sag.Pay() * sol.Payda();
int i1= sol.Payda()* sag.Payda();
bayagikesir sonuc;
sonuc=new bayagikesir(r1,i1);
sonuc.sadelestir();
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=sol.Pay() + sag*sol.Payda();
int i1=sol.Payda();
bayagikesir sonuc;
sonuc=new bayagikesir(r1,i1);
va
sonuc.sadelestir();
return sonuc;
}
// aktar r
int r1=sag.Pay() + sol*sag.Payda();
int i1=sag.Payda();
bayagikesir sonuc;
sonuc=new bayagikesir(r1,i1);
sonuc.sadelestir();
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
89
90
{
// bir bayagikesir ve bir Pay say n n toplam n return deyimiyle
m
bayagikesir olarak
// aktar r
int r1=sol.Pay() - sag*sol.Payda();
int i1=sol.Payda();
bayagikesir sonuc;
sonuc=new bayagikesir(r1,i1);
sonuc.sadelestir();
o
return sonuc;
}
i.c
{
// bir bayagikesir ve bir Pay say n n toplam n return deyimiyle
bayagikesir olarak
// aktar r
int r1=sag.Pay() - sol*sag.Payda();
int i1=sag.Payda();
bayagikesir sonuc;
sonuc=new bayagikesir(r1,i1);
dil
sonuc.sadelestir();
return sonuc;
}
//===================================
sonuc=new bayagikesir(sol.Pay()*sag,sol.Payda());
sonuc.sadelestir();
return sonuc;
}
90
91
m
sonuc=new bayagikesir(sol.Pay(),(sol.Payda()*sag));
sonuc.sadelestir();
return sonuc;
}
o
// less then comparison of two bayagikesir numbers
return (sol.toDouble() < sag.toDouble());
}
i.c
public boolean kucuktur_esittir(bayagikesir sol,bayagikesir sag)
{
// less then and esittir comparison of two bayagikesir numbers
return (sol.toDouble() <= sag.toDouble());
}
dil
// buyuktur then comparison of two bayagikesir numbers
return sol.toDouble() > sag.toDouble();
}
{
// not esittir comparison of two bayagikesir numbers
return sol.toDouble() != sag.toDouble();
}
{
String b="";
if(Math.abs(value.Payda())!=1)
{
b=b+"( "+value.Pay()+" / "+value.Payda()+" )";
}
else
{
ww
b=b+value.Pay()+" ";
}
return b;
}
91
92
if(Math.abs(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
{
//
//=====================================================
kutugirdisi1=new TextField(5);
kutugirdisi1.addActionListener(this);
add(kutugirdisi1);
kutugirdisi2=new TextField(5);
kutugirdisi2.addActionListener(this);
add(kutugirdisi2);
kutubasligi2=new Label("Ikinci bayagikesir sayiyi giriniz : ");
add(kutubasligi2);
kutugirdisi3=new TextField(5);
kutugirdisi3.addActionListener(this);
92
93
add(kutugirdisi3);
kutugirdisi4=new TextField(5);
m
kutugirdisi4.addActionListener(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(kutugirdisi1.getText() );
Integer sayi2=new Integer(kutugirdisi2.getText() );
Integer sayi3=new Integer(kutugirdisi3.getText() );
i.c
Integer sayi4=new Integer(kutugirdisi4.getText() );
k1.bayagikesirGir(sayi1.intValue(),sayi2.intValue());
k2.bayagikesirGir(sayi3.intValue(),sayi4.intValue());
repaint();//pencereyi yeniden paint metoduna gore ciz
}
//=====================================================
// paint (boya=pencereye ciz metodu)
public void paint(Graphics g)
dil
{
g.drawString("ilk sayi : "+k1.toString(),25,80);
g.drawString("ikinci sayi : "+k2.toString(),25,95);
93
94
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[];
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];
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;
Küçük bir örnek sınıfta bu kavramı daha açık olarak vermeye çalışalım.
Class boyut
{
w.
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;
System.out.println(“Nisan ayı “+ayin_gunleri[3]+”gun ceker”);
m
}
}
Şekil 4.1.1 boyut.java 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};
System.out.println(“Nisan ayı “+ayin_gunleri[3]+”gun ceker”);
}
}
dil
Şekil 4.1.2 boyut.java 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.
}
System.out.println("Ortalama = "+toplam/sayi.length);
}
}
w.
Şimdi de bir applet örneğinde tek boyutlu değişkenleri kullanalım. Daha önce zarApplet.java
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 java.awt.*;
import java.applet.Applet;
import java.awt.event.*;
95
96
TextField ilkzar,ikincizar;
Button salla; //zar atma d gmesi
m
int zar1,zar2;
int zarfrekansi[];
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);
salla.addActionListener(this);
dil
}
}
}
ww
96
97
o m
i.c
Şekil 4.1.4 ZarfrekansiApplet.html appletinin görünümü
Ö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.
n[1]=new dogru3(2,2,2,3,3,3);
n[2]=new dogru3(3,3,3,4,4,4);
gibi.
İ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ır.Java 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 :
Iki boyutlu değişken de bir boyutlu değişkenlerde olduğu gibi degerleri direk olarak
97
98
m
Int b[][] = {{1,2},{3,4}};
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 java.awt.Graphics;
import java.applet.Applet;
dil
{
// void tipi paint metodu
public void paint( Graphics g)
{
int a1[][]={{1,2,3},{4,5,6}};
int a2[][]={{1,2},{4}};
g.drawString(" a1 : ",25,25);
ikiboyutyazdir(a1,g,40);
g.drawString(" a2 : ",25,70);
va
ikiboyutyazdir(a2,g,85);
}
for(int j=0;j<a[i].length;j++)
{
g.drawString(String.valueOf(a[i][j]),x,y);
x+=15;
}
x=25;
w.
y+=15;
}
}
}
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 a.length, 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
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 ikiboyut.html 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.
gibi.
HAFTA 8
//kurucu metodlar
public nokta3()
{
nokta3gir(0,0,0);
}
99
100
nokta3gir(a,b,c);
}
m
public nokta3(nokta3 n)
{
nokta3gir(n.Xoku(),n.Yoku(),n.Zoku());
}
o
public void nokta3gir(double a, double b,double c)
{
x = a;
y = b;
i.c
z = c;
}
dil
}
{
return y;
}
100
101
{
// 3 boyutlu dogru
m
nokta3 n1;
nokta3 n2;
public dogru3()
{
n1=new nokta3();
n2=new nokta3();
o
}
i.c
{
n1=new nokta3(n1x,n1y,n1z);
n2=new nokta3(n2x,n2y,n2z);
}
dil
n2=new nokta3(nb.Xoku(),nb.Yoku(),nb.Zoku());
}
{
n1.nokta3gir(x1,y1,z1);
}
n1.nokta3gir(in1.x,in1.y,in1.z);
}
101
102
m
{
return n2;
}
o
return (n2.Xoku()-n1.Xoku());
}
i.c
{
//dogrunun y koordinat uzunlugu
return (n2.Yoku()-n1.Yoku());
}
dil
return (n2.Zoku()-n1.Zoku());
}
{
//dogrunun n1 noktas ndan y z duzlemindeki ac s
//radyan
return Math.atan2(Z(),Y());
}
w.
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.
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<sayi.length;i++)
{
toplam.topla(sayi[i]);
}
toplam.bol((double)sayi.length);
System.out.println("Ortalama = "+toplam.toString());
}
va
}
class H8A1a
{
public static void main(String args[]) throws IOException
{
kompleks sayi[]=new kompleks[5];
double n1,n2;
w.
n2=Text.readDouble(cin);
sayi[i]=new kompleks(n1,n2);
toplam.topla(sayi[i]);
}
toplam.bol((double)sayi.length);
System.out.println("Ortalama = "+toplam.toString());
}
}
103
104
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
i.c
cinsinden yazdırın.
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<n.length;i++)
{
va
System.out.println(n[i].toString()+"boy : "+n[i].R());
System.out.println("aci xy = "+n[i].aci_n1_xy());
System.out.println("aci xz = "+n[i].aci_n1_xz());
System.out.println("aci yz = "+n[i].aci_n1_yz());
}
}
}
ja
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
m
5.1 Abstract sınıf
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 (sekil.java dosyasında yer alıyor)
va
import sekil;
noktagir(a,b);
}
y=b;
}
105
106
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);
}
106
107
m
import daire;
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;}
dil
return 2* super.alan()+
2*Math.PI*yaricap*yukseklik;
}
public double hacim(){return super.alan()*yukseklik;}
public String toString()
{return super.toString()+";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 java.awt.Graphics;
import java.applet.Applet;
private nokta n;
private daire d;
private silindir s;
private sekil a[];
{
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
107
108
int y=85;
for(int i=0;i<a.length;i++)
m
{
g.drawString(a[i].isimOku()+": "+a[i].toString(),25,y);
y+=15;
g.drawString("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
5.2 Interface
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 gerekebilir.Bu 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.
108
109
m
double alan();
double hacim();
String isimOku();
}
o
import sekil;
i.c
protected double x, y;
}
x=a;
y=b;
Şekil 5.2.2 interface sekilden implements kelimesiyle türiyen nokta sınıfı (nokta.java
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 sekiltesti.java 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 sekiltesti.java 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 java.awt 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
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
111
112
m
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.
import java.applet.Applet;
import java.awt.*;
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};
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
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
metodu mevcuttur.
import java.awt.*;
import java.applet.Applet;
}
}
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
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 stil.java programını görüyoruz.
o
import java.applet.*;
import java.awt.*;
i.c
public void paint(Graphics g)
{
String stilListesi[];
stilListesi=getToolkit().getFontList();
int y=15;
for(int i=0;i<stilListesi.length;i++)
{
g.drawString(stilListesi[i],15,y);
}
}
y+=15;
}
dil
Şekil 6.3.1 stil.java programı, java kütüphanesinde mevcut olan yazı sitillerini gösterir
ja va
Şekil 6.3.2 stil.java programı, java kütüphanesinde mevcut olan yazı sitillerini gösterir
w.
Bu yazı sitillerinden birisi asağıda verilen yazı tiplerinden birisiyle beraber ve verilen belli bir
yazı boyutunda gösterilebilir.
114
115
m
Bir appletin yazı sitili Graphics sınıfındaki setFont metoduyla değiştirilebilir.
o
g.setFont(new Font(“Serif”,Font.BOLD,12);
i.c
import java.awt.*;
import java.applet.Applet;
dil
public void init()
{
kirmizi=100;
yesil=255;
mavi=125;
}
}
ja
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
m
int y2) //ikinci noktanın y koordinatı
Bir küçük örnek problemde metodu kullanalım :
import java.applet.Applet;
import java.awt.*;
o
public class cizgiciz extends Applet
{
public void paint(Graphics g)
i.c
{
g.setColor(new Color(0,255,255));
g.setFont(new Font("SansSerif",Font.PLAIN,24));
g.drawLine(10,10,230,95);
}
}
dil
va
Şekil 6.4.1 Çizgi çizim örneği cizgiciz.java ve çizginin appletde görünümü
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.
116
117
m
import java.applet.Applet;
import java.awt.*;
o
{
g.setColor(new Color(255,0,0));
g.drawRect(10,10,100,50);
g.fillRect(129,10,100,50);
i.c
}
}
dil
Şekil 6.5.1 dikdortgenCiz.java programı ve dikdortgenCiz.html appleti
import java.applet.Applet;
import java.awt.*;
ww
117
118
}
}
o m
i.c
Şekil 6.5.2 yuvarlakKoseliDikdortgenCiz.java programı ve appleti
dil
metotların tanımları şu şekilde verilmiştir.
import java.applet.Applet;
import java.awt.*;
w.
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 ucBoyutluDikdortgenCiz.java programı ve appleti
int x1,
int y1,
dil
Oval çizimi için drawOval ve fillOval metodları kullanılır bu metodların tanımı şöyledir :
(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
import java.applet.Applet;
119
120
import java.awt.*;
m
public class daireCiz extends Applet
{
public void paint(Graphics g)
{
g.setColor(new Color(0,0,255));
g.drawOval(10,10,50,50);
g.fillOval(70,10,50,50);
o
}
}
i.c
dil
Şekil 6.6.2 daireCiz.java 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
import java.applet.Applet;
import java.awt.*;
120
121
g.setFont(new Font("SansSerif",Font.PLAIN,12));
g.drawOval(70,10,50,50);
m
g.drawArc(10,10,50,50,30,60);
g.fillArc(70,10,50,50,30,60);
}
}
o
i.c
Şekil 6.6.3 arcCiz.java programı ve apleti
dil
Açık ve kapalı polygon şekilleri çizmek için drawPolygon ve fillPolygon metotları
kullanılır. Metotların tanımı :
public Polygon(
w.
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
121
122
int y[]={100,(int)(100-100*Math.sin(Math.PI/3.0)),100,100};
int x1[]={130,(int)(130+100*Math.cos(Math.PI/3.0)),230,130};
m
int y1[];
y1=y;
g.setColor(new Color(0,0,255));
g.drawPolygon(x,y,4);
g.fillPolygon(x1,y1,4);
}
}
o
i.c
6.8 Resim gösterimi
dil
Şekil 6.7.1 ucgenCiz.java 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(),”resim.gif”);
Ve resim g.drawImage(resim,1,1,this); deyimiyle çizilir. Burada ikinci ve üçüncü noktalar
başlangıç x ve y koordinatlarıdır.Son 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 java.applet.Applet;
import java.awt.*;
w.
122
123
o m
i.c
dil
ja va
import java.applet.Applet;
import java.awt.*;
123
124
m
g.setColor(new Color(100,255,125));
g.setFont(new Font("SansSerif",Font.PLAIN,24));
g.drawString(s,100,25);
g.drawChars(c,2,3,100,50);
g.drawBytes(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 cizgiciz.java
1:57 Plot.java
//======================================================
// Numerical Analysis package in java
// Plot class to plot 2D data
// Dr. Turhan Coban
va
// =====================================================
import java.io.*;
import java.applet.*;
import java.awt.*;
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);
}
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=ifn.length;
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(lineDataFile.getAbsolutePath());
try{
ffile=new DataInputStream(new FileInputStream(lineDataFile));
125
126
} catch(IOException e)
{
m
System.err.println("Error Opening File \n"+e.toString());
System.exit(1);
}
try{
while(ffile!=null)
{
xtemp=Text.readDouble(ffile);
o
ytemp=Text.readDouble(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{
ffile.close();
dil
} catch(IOException e)
{
System.err.println("Error Closing File\n"+e.toString());
System.exit(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(lineDataFile.getAbsolutePath());
ja
for(i=0;i<nline;i++)
{
//open ffile
try{
ffile=new DataInputStream(new FileInputStream(lineDataFile));
} catch(IOException e)
w.
{
System.err.println("Error Opening File \n"+e.toString());
System.exit(1);
}
for(j=0;j<n[i];j++)
{
x[i][j]=Text.readDouble(ffile);
y[i][j]=Text.readDouble(ffile);
ww
}
//close ffile
try{
ffile.close();
} catch(IOException e)
{
System.err.println("Error Closing File\n"+e.toString());
System.exit(1);
}
126
127
}
set_plotwindow(600,500,0.15,0.1,0.8,0.6);
m
}
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
// b.dat 22 0 0 0
// a.dat 21 0 255 0
// a.dat 0 0 255 0
// b.dat 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("Plot.dat");
plotFile=new File(plotFile.getAbsolutePath());
try{
ja
label=Text.readStringLine(fin);
xlabel=Text.readStringLine(fin);
ylabel=Text.readStringLine(fin);
nline=Text.readInt(fin);
xntic=Text.readInt(fin);
yntic=Text.readInt(fin);
xgridon=Text.readInt(fin);
ygridon=Text.readInt(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]=Text.readString(fin);
plottype[i]=Text.readInt(fin);
if(plottype[i] == 10) ch[i]=Text.readChar(fin);
red[i]=Text.readInt(fin);
green[i]=Text.readInt(fin);
blue[i]=Text.readInt(fin);
o
j=0;
n[i]=0;
//open ffile
lineDataFile=new File(fn[i]);
i.c
lineDataFile=new File(lineDataFile.getAbsolutePath());
try{
ffile=new DataInputStream(new FileInputStream(lineDataFile));
} catch(IOException e)
{
System.err.println("Error Opening File \n"+e.toString());
System.exit(1);
}
dil
try{
while(ffile!=null)
{
xtemp=Text.readDouble(ffile);
ytemp=Text.readDouble(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{
ffile.close();
} catch(IOException e)
ja
{
System.err.println("Error Closing File\n"+e.toString());
System.exit(1);
}
} //End of EOFException
w.
if(i==0) nmax=n[i];
else
{
if(n[i]>nmax) nmax=n[i];
}
}
//close ffile
try{
ww
ffile.close();
} catch(IOException e)
{
System.err.println("Error Closing File\n"+e.toString());
System.exit(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(lineDataFile.getAbsolutePath());
ffile=new DataInputStream(new FileInputStream(lineDataFile));
} catch(IOException e)
{
o
System.err.println("Error Opening File \n"+e.toString());
System.exit(1);
}
for(j=0;j<n[i];j++)
i.c
{
x[i][j]=Text.readDouble(ffile);
y[i][j]=Text.readDouble(ffile);
}
//close ffile
try{
ffile.close();
dil
} catch(IOException e)
{
System.err.println("Error Closing File\n"+e.toString());
System.exit(1);
}
set_plotwindow(400,400,0.1,0.1,0.8,0.6);
va
//close fin
try{
fin.close();
} catch(IOException e)
{
System.err.println("Error Closing File\n"+e.toString());
System.exit(1);
}
ja
//======================================================
// 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 java.io.*;
import java.applet.*;
import java.awt.*;
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;
}
}
} //end of drawLine
} //end of PlotShapes.drawChar
130
131
int h=g.getFontMetrics().getHeight();
int w=h-2;
m
g.drawChars(ch,firstspace,numberofchars,
(int)((xabsmin+(x1-xmin)/(xmax-xmin)*abswidth)+5),
(int)((yabsmin+absheight-(y1-ymin)/(ymax-
ymin)*absheight)+h/2));
} //end of PlotShapes.drawChars
o
public void drawString(String s,double x1,double y1)
{
//draws a String at (x1,y1)
int h=g.getFontMetrics().getHeight();
i.c
int w=h-2;
g.drawString(s,
(int)(xabsmin+(x1-xmin)/(xmax-xmin)*abswidth),
(int)(yabsmin+absheight-(y1-ymin)/(ymax-ymin)*absheight));
} //end of PlotShapes.drawStrings
dil
{
// draw a rectangle starting at (x1,y1)
// with dimensions of (rectwidth,rectheight)
g.drawRect(
(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
(int)(yabsmin+absheight-(y1-ymin)/(ymax-ymin)*absheight-
height/2),
width,height);
}//end of drawRect
{
//draw a polygon of n sides n=3(trinagle),n=4(dimond)....
double Pi=4.0*Math.atan(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)(Math.floor(xabsmin+(x1-xmin)/
(xmax-xmin)*abswidth+radius*Math.cos(angle)));
yvalues[i]= (int)(Math.floor(yabsmin+absheight-(y1-ymin)/
(ymax-ymin)*absheight-radius*Math.sin(angle)));
if(i==0) {xvalues[side]=xvalues[i];yvalues[side]=yvalues[i];}
angle+=angle_increase;
131
132
}
g.drawPolygon(xvalues,yvalues,side+1);
m
}//end of drawPolygon
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;
}
}
}
{
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
132
133
drawLine(0,x1,ymin,x1,ymax);
x1=x1+dtic;
m
}
}
o
double y1=ymin;
for(int i=0;i<=ticNumber;i++)
{
drawLine(0,xmin,y1,xmax,y1);
i.c
y1=y1+dtic;
}
}
dil
double x1=xmin;
double y1=ymin;
String s;
s=" ";
for(int i=0;i<=ticNumber;i++)
{
s=Double.toString(Math.floor(x1*100.0)/100.00);
g.drawString(s,(int)(xabsmin+(x1-xmin)/(xmax-xmin)*abswidth),
(int)(yabsmin+absheight-(y1-ymin)/(ymax-ymin)*absheight)+20);
va
x1=x1+dtic;
}
}
// 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=Double.toString(Math.floor(y1*100)/100.0)+" ";
g.drawString(s,(int)(xabsmin+(x1-xmin)/(xmax-xmin)*abswidth-40),
(int)(yabsmin+absheight-(y1-ymin)/(ymax-ymin)*absheight));
y1=y1+dtic;
}
}
ww
133
134
m
{
// draw y labels
double x1=xmin-(xmax-xmin)/6.0;
double y1=ymax-(ymax-ymin)/3.0;
int n=yLabel.length();
char ch[]=new char[n];
yLabel.getChars(0,n,ch,0);
o
// g.DrawString(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;
}
}
dil
double x1=xmin+(xmax-xmin)/2.0;
double y1=ymax;
g.drawString(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
}
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 PlotApplet.java
//======================================================
// Numerical Analysis package in java
// PlotApplet class to plot 2D data
o
// Dr. Turhan Coban
// =====================================================
import java.io.*;
import java.applet.*;
import java.awt.*;
i.c
import java.awt.event.*;
import PlotShapes;
import Plot;
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;
//label
//xaxis
//yaxis
// 4 10 10 1 1
w.
// b.dat 22 0 0 0
// a.dat 21 0 255 0
// a.dat 0 0 255 0
// b.dat 0 0 0 255
int xnt=10;
int ynt=10;
int xgo=1;
int ygo=1;
ww
136
137
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) {System.out.println("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);
inputXmin.addActionListener(this);
inputXmax.addActionListener(this);
inputYmin.addActionListener(this);
inputYmax.addActionListener(this);
add(promptXmin);
ja
add(inputXmin);
add(promptXmax);
add(inputXmax);
add(promptYmin);
add(inputYmin);
add(promptYmax);
w.
add(inputYmax);
}
inputYmax.setText(Double.toString(p1.ymax));
PlotShapes ps=new PlotShapes(g,p1.xabsmin,p1.yabsmin,
p1.absheight,p1.abswidth,p1.xmin,p1.xmax,p1.ymin,p1.ymax);
g.drawRect(p1.xabsmin,p1.yabsmin,p1.abswidth,p1.absheight);
ps.drawXTic(p1.xntic,(p1.ymax-p1.ymin)/80.0,0);
ps.drawYTic(p1.yntic,(p1.xmax-p1.xmin)/80.0,0);
ps.drawXNumbers(p1.xntic);
ps.drawYNumbers(p1.xntic);
ps.drawLabel(p1.label);
137
138
ps.drawXLabel(p1.xlabel);
ps.drawYLabel(p1.ylabel);
m
if(p1.xgridon!=0)
ps.drawXGrid(p1.xntic);
if(p1.ygridon!=0)
ps.drawYGrid(p1.yntic);
int i,j;
for(i=0;i<p1.nline;i++)
{
o
// Select plot colors
g.setColor(new Color(p1.red[i],p1.green[i],p1.blue[i]));
ps.drawPlotLines(i,p1.plottype,p1.x,p1.y,p1.n,p1.ch);
}//end of for(i=0
i.c
}//end of method
dil
Double valYmin=new Double(inputYmin.getText());
p1.ymin=valYmin.doubleValue();
Double valYmax=new Double(inputYmax.getText());
p1.ymax=valYmax.doubleValue();
repaint();
}
}
ja va
w.
ww
138
139
m
a.dat 10 * 0 0 255 dosyaİsmi plot_türü (10 ise plot char) Kırmızı Yesil Ma
b.dat 0 255 0 0 dosyaİsmi Plot_türü Kırmızı Yesil Mavi
c.dat 0 255 100 0 dosya_ismi Plot_türü Kırmızı Yeşil Mavi
o
3 9
4 16
5 25
6 36
i.c
7 49
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
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 java.applet.Applet;
139
140
import java.awt.*;
m
public class resim extends Applet
{
private Image bebek;
o
}
i.c
g.drawImage(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 java.applet.Applet;
import java.awt.*;
{
public void paint(Graphics g)
{
dil
public class ucgenCiz extends Applet
int x[]={10,(int)(10+100*Math.cos(Math.PI/3.0)),110,10};
va
int y[]={100,(int)(100-100*Math.sin(Math.PI/3.0)),100,100};
int x1[]={130,(int)(130+100*Math.cos(Math.PI/3.0)),230,130};
int y1[];
y1=y;
g.setColor(new Color(0,255,0));
g.drawPolygon(x,y,4);
g.fillPolygon(x1,y1,4);
}
ja
}
w.
ww
ALIŞTIRMA 5
140
141
m
ALIŞTIRMA 6
o
i.c
dil
ja va
w.
ww
141
142
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ı java.awt (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
Java.applet.Applet
• ScrollPane
ja
• Window
Frame
Dialog
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ı :Label.LEFT,Label.CENTER,Label.RIGHT (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
m
public void setAlignment(int pozisyon)
Labeli pozisyonda verilen değere göre istenilen yere yerleştirir.
Yerleştirme konumları :Label.LEFT,Label.CENTER,Label.RIGHT (sol,orta,sağ)
konumlarıdır.
Örnek olarak bir bir program verelim :
o
import java.applet.Applet;
import java.awt.*;
i.c
public class LabelTesti extends Applet
{
private Label L1,L2;
public void init()
{
L1=new Label();
L1.setText("Bu etiket once bos tanimlandi");
add(L1);
L2=new Label("Bu etiket yazisi ilk tanimda tanimlandi");
add(L2);
}
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
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
m
Java.util.EventObject
• Java.awt.AWTEvent
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 :
Java.util.EventListener
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 java.applet.Applet;
import java.awt.*;
import java.awt.event.*;
ww
144
145
B2=new Button("B2");
B2.addActionListener(new B2Basilinca(this));
m
add(B2);
}
}
o
public B1Basilinca(Applet a) {applet=a;}
i.c
{
applet.showStatus(" "+e.getActionCommand()+"dugmesine basildi");
}
dil
Applet applet;
import java.applet.Applet;
w.
import java.awt.*;
import java.awt.event.*;
{
B1=new Button("B1");
B1.addActionListener(this);
add(B1);
B2=new Button("B2");
B2.addActionListener(this);
add(B2);
}
145
146
m
if(e.getSource()==B1)
{showStatus(" "+e.getActionCommand()+"dugmesine basildi");}
else if(e.getSource()==B2)
{showStatus(" "+e.paramString()+"dugmesine basildi");}
}
o
Şekil 7.3.2 ButtonTesti1.java sınıfı (sonuclar ButtonTesti1.java ile aynıdır)
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.
dil
7.4 TextField(YazımAlanı) sınıfı
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
import java.applet.Applet;
w.
import java.awt.*;
import java.awt.event.*;
{
setBackground(Color.lightGray);
//bos textField
T1=new TextField();
T1.addActionListener(this);
add(T1);
T2=new TextField("Buraya yazi yaziniz");
T2.addActionListener(this);
add(T2);
146
147
m
T2.addActionListener(this);
add(T2);
T3=new TextField("gizli yazi");
T3.setEditable(false);
add(T3);
}
o
public void actionPerformed(ActionEvent e)
{
showStatus("Yazi : "+e.getActionCommand());
}
i.c
}
dil
ja va
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.
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
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 java.applet.Applet;
import java.awt.*;
dil
Şimdi TextArea metodunu Küçük bir örnekte kullanalım :
add(T1);
}
}
git anlamına gelir Bu komutlar aslında c dilinden alınmadır ve c dilindeki tüm \ komutları
java stringlerinde de geçerlidir.
import java.applet.Applet;
148
149
import java.awt.*;
import java.awt.event.*;
m
public class TextAreaTesti1 extends Applet
implements ActionListener,TextListener
{
private TextArea T1,T2;
private Button kopye;
public void init()
{
setBackground(Color.lightGray);
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
T1.addTextListener(this);
add(T1);
kopye=new Button("Kopye >>>");
kopye.addActionListener(this);
add(kopye);
T2=new TextArea(5,20);
T2.setEditable(false);
add(T2);
}
dil
public void actionPerformed(ActionEvent e)
149
150
m
Kopye düğmesine basılınca ise sadece T1.getSelectedText() metoduyla secilmiş olan text
actionPerforned metodu üzerinden T2 Yazım Alanına (TextArea) aktarılmaktadır.
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)
import java.awt.*;
va
import java.applet.Applet;
import java.awt.event.*;
{
F=new Choice();
F.add("MonoSpaced"); // Courier
F.add("SansSerif"); // Helvetica
F.add("Serif"); // Times
T=new TextField(F.getItem(0),30);
w.
T.setEditable(false);
T.setFont(new Font(F.getItem(0),Font.PLAIN,12));
F.addItemListener(new FontIsmiKontrolu(T));
F.addItemListener(new TextFieldKontrolu(T));
add(F);
add(T);
}
}
ww
150
151
{
C.setFont(new Font(e.getItem().toString(),
m
C.getFont().getStyle(),
C.getFont().getSize()));
}
}
o
private TextField T;
public TextFieldKontrolu(TextField T)
{
this.T=T;
i.c
}
dil
Sekil 7.6.1 ChoiceTesti.java programı
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 CheckBoxTesti.java programına göz atalım :
import java.applet.Applet;
import java.awt.*;
i.c
import java.awt.event.*;
dil
{
setBackground(Color.lightGray);
//bos textField
T=new TextField("Buradaki yazinin degismesini izleyiniz");
add(T);
Kalin=new Checkbox("Kalin");
Kalin.addItemListener(this);
add(Kalin);
Italic=new Checkbox("Italik");
va
Italic.addItemListener(this);
add(Italic);
}
{KalinAyari=Font.BOLD;}
else
{KalinAyari=Font.PLAIN;}
int ItalicAyari;
if(Italic.getState())
w.
{ItalicAyari=Font.ITALIC;}
else
{ItalicAyari=Font.PLAIN;}
T.setFont(new Font("Serif",KalinAyari+ItalicAyari,14));
}
}
ww
152
153
o m
i.c
Şekil 7.7.2 CheckBoxTesti.java programının sonuçlarının appletde görülmesi
import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;
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;
Kalin=new Checkbox("Kalin",fontGurubu,true);
Kalin.addItemListener(this);
add(Kalin);
Italic=new Checkbox("Italik",fontGurubu,true);
Italic.addItemListener(this);
add(Italic);
KalinItalic=new Checkbox("Kalin Italik",fontGurubu,true);
KalinItalic.addItemListener(this);
ww
add(KalinItalic);
NormalFont=new Font("Serif",Font.PLAIN,14);
KalinFont=new Font("Serif",Font.BOLD,14);
ItalicFont=new Font("Serif",Font.ITALIC,14);
KalinItalicFont=new Font("Serif",Font.BOLD+Font.ITALIC,14);
T.setFont(NormalFont);
}
public void itemStateChanged(ItemEvent e)
{
153
154
int KalinAyari;
if(e.getSource()== Normal)
m
{T.setFont(NormalFont);}
else if(e.getSource()== Kalin)
{T.setFont(KalinFont);}
else if(e.getSource()== Italic)
{T.setFont(ItalicFont);}
else if(e.getSource()== KalinItalic)
{T.setFont(KalinItalicFont);}
o
}
}
i.c
dil
va
Şekil 7.7.3 RadioButtonTetsi.java programı ve sonuçlarının applette gösterilmesi
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.
154
155
m
import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;
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);
}
dil
g.drawString(s+"["+nx+","+ny+"]",nx,ny);
}
{ degerleriGir("Basildi",e.getX(),e.getY()); }
public void mouseReleased(MouseEvent e)
{ degerleriGir("Birakildi",e.getX(),e.getY()); }
public void mouseEntered(MouseEvent e)
{ showStatus("Fare applet alani icinde"); }
public void mouseExited(MouseEvent e)
w.
}
ww
155
156
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 java.applet.Applet;
o
import java.awt.*;
import java.awt.event.*;
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[]={Color.black,Color.blue,Color.cyan,Color.darkGray,
Color.gray,Color.green,Color.lightGray,Color.magenta,Color.orange,
Color.pink,Color.red,Color.white,Color.yellow};
dil
public void init()
{
//Ekranda 5 isim g”r lebilecel bir liste ac
//ayn ismi birden fazla tekrarlama
renkListesi=new List(5,false);
renkListesi.addActionListener(this);
renkListesi.addItemListener(this);
//listeye ekle
va
for(int i=0;i<renkIsmi.length;i++)
{
renkListesi.add(renkIsmi[i]);
}
add(renkListesi);
}
setBackground(C[renkListesi.getSelectedIndex()]);
repaint();
}
}
ww
156
157
m
Şekil 7.9.1 ListTetsi.java programı ve sonuçların appletviewer da görünümü
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 FlowLayout.RIGHT, FlowLayout.CENTER veya FlowLayout.LEFT
i.c
değerlerini alabilir.
public Flowlayout(int formatbolgesi,int yatay_bosluk,int dikey_bosluk)
formatbolgesi FlowLayout.RIGHT, FlowLayout.CENTER veya FlowLayout.LEFT
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 java.applet.Applet;
import java.awt.*;
import java.awt.event.*;
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<B.length;i++)
{
ja
B[i].addActionListener(this);
add(B[i]);
}
}
public void actionPerformed(ActionEvent e)
{
w.
int pozisyon=FlowLayout.LEFT;;
if(e.getSource()==B[0])
{
pozisyon=FlowLayout.LEFT;
}
else if(e.getSource()==B[1])
{
pozisyon=FlowLayout.CENTER;
ww
}
else if(e.getSource()==B[2])
{
pozisyon=FlowLayout.RIGHT;
}
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
import java.applet.Applet;
import java.awt.*;
ja
import java.awt.event.*;
B[i].addActionListener(this);
}
add(B[0],BorderLayout.NORTH);
add(B[1],BorderLayout.SOUTH);
add(B[2],BorderLayout.EAST);
add(B[3],BorderLayout.WEST);
add(B[4],BorderLayout.CENTER);
}
158
159
m
for(int i=0;i<B.length;i++)
{
if(e.getSource()==B[i])
B[i].setVisible(false);
else B[i].setVisible(true);
}
validate();
o
}
}
i.c
dil
ja va
w.
ww
159
160
o m
i.c
Şekil 7.11.2 BorderLayoutTesti.java programının sonuçlarının applette görulmesi
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 java.applet.Applet;
import java.awt.*;
import java.awt.event.*;
B=new Button[6];
for(int i=0;i<B.length;i++)
{
B[i]=new Button(S[i]);
add(B[i]);
}
}
}
ww
160
161
m
7.13 Panel sınıfı
o
import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;
i.c
public class Paneltesti extends Applet
{
private Panel buttonPanel;
private Button buttons[];
public void init()
{
buttonPanel=new Panel();
buttons=new Button[5];
dil
buttonPanel.setLayout(new GridLayout(1,buttons.length));
for(int i=0;i<buttons.length;i++)
{
buttons[i]=new Button("Button "+(i+1));
buttonPanel.add(buttons[i]);
}
setLayout(new BorderLayout());
add(buttonPanel,BorderLayout.SOUTH);
}
va
}
ja
import java.awt.*;
import java.applet.Applet;
ww
import java.awt.event.*;
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(Color.lightGray);
YaziPaneli=new Panel();
YaziPaneli.setFont(new Font("Serif",Font.BOLD,12));
YaziPaneli.setLayout( 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
inputa.addActionListener(this);
promptb=new Label(" b : ");
inputb =new TextField(5);
inputb.addActionListener(this);
promptc=new Label(" c : ");
inputc =new TextField(5);
inputc.addActionListener(this);
YaziPaneli.add(prompt1);
YaziPaneli.add(prompt2);
va
YaziPaneli.add(prompta);
YaziPaneli.add(inputa);
YaziPaneli.add(promptb);
YaziPaneli.add(inputb);
YaziPaneli.add(promptc);
YaziPaneli.add(inputc);
add(YaziPaneli);
}
ja
delta)/2.0/a,100,205);
}
if(delta==0)
{
g.drawString("Kok 1 :"+(-b/2.0/a),100,190 );
g.drawString("Kok 2 :"+(-b/2.0/a),100,205 );
}
if(delta>0)
{
162
163
x1=-b/2.0/a+Math.sqrt(delta)/20/a;
x2=-b/2.0/a-Math.sqrt(delta)/2.0/a;
m
g.drawString("Kok 1 :"+x1,100,190 );
g.drawString("Kok 2 :"+x2,100,205);
}
}
o
Double sayi1=new Double(inputa.getText() );
Double sayi2=new Double(inputb.getText() );
Double sayi3=new Double(inputc.getText() );
a=sayi1.doubleValue();
i.c
b=sayi2.doubleValue();
c=sayi3.doubleValue();
delta=b*b-4.0*a*c;
repaint();
}
}
dil
ja va
Bu haftaki Alıştırmalar
ALISTIRMA 1
163
164
m
fareyi kallanarak ekrana cizgi çizdiriniz (cizginin baslangic ve bitis noktaları fare tarafindan
belirlenecektir)
ALISTIRMA 2
o
FareTesti.java 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
HAFTA 12
JAVA PROGRAMLAMA DILI
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 java.applet.Applet;
import java.awt.*;
import java.awt.event.*;
164
165
T=new TextField(s[0]);
m
buttonPanel=new Panel();
buttons=new Button[10];
buttonPanel.setLayout(new GridLayout(2,buttons.length/2));
for(int i=0;i<buttons.length;i++)
{
buttons[i]=new Button("Button "+(i+1));
buttons[i].addActionListener(this);
o
buttonPanel.add(buttons[i]);
}
setLayout(new BorderLayout());
add(buttonPanel,BorderLayout.SOUTH);
i.c
add(T,BorderLayout.NORTH);
}
dil
}
}
ja va
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 :
165
166
m
Javadaki Exception türleri aşağıdaki listede verilmiştir :
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
Java.lang 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
Java.util exception listesi
EmptyStackException
MissingResourceException
NoSuchElementException
o
TooManyListenersException
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.
167
168
m
Şekil 8.2 Bizim tarafımızdan oluşturulan sifiraBolunmeException.java hata kontrolü
programı
import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;
o
import java.text.DecimalFormat;
import sifiraBolunmeException;
i.c
{
private Label L1,L2;
private TextField T1,T2;
private int sayi1,sayi2;
private double sonuc;
dil
sayi1=0;
sayi2=1;
L1=new Label("Payi gir : ");
L2=new Label("Paydayi gir : ");
T1=new TextField(10);
T2=new TextField(10);
T2.addActionListener(this);
add(L1);
add(T1);
va
add(L2);
add(T2);
}
}
catch(NumberFormatException nfe)
{showStatus("iki tam sayi girmelisiniz.");}
catch(sifiraBolunmeException sbh)
{showStatus(sbh.toString());}
}
}
168
169
o m
i.c
dil
Şekil 8.2 Bizim tarafımızdan oluşturulan sifiraBolunmeException.java hata kontrolü ve
sayı formatı hata kontrolü (NumberFormatException) yapan sifirebolmetesti.java
programı ve sonuçlarının applet ekranında izlenimi
try{
sayi1=Integer.parseInt(T1.getText());
sayi2=Integer.parseInt(T2.getText());
T1.setText("");
T2.setText("");
sonuc=bol(sayi1,sayi2);
showStatus(sayi1+" / "+sayi2+" = "+hassaslik3.format(sonuc));
ww
}
catch(NumberFormatException nfe)
{showStatus("iki tam sayi girmelisiniz.");}
catch(sifiraBolunmeException sbh)
{showStatus(sbh.toString());}
}
}
169
170
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
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.
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
try {Thread.sleep(1000);}
catch(InterruptedException e)
{System.err.println(e.toString());}
}
}
}
171
172
Date D;
DateFormat df;
m
Locale tr;
saatThread r;
o
D=new Date();
df= DateFormat.getDateInstance(DateFormat.LONG,tr);
r=new saatThread(this);
r.start();
i.c
}
dil
{
g.drawString(D.toString(),10,50);
}
catch(NullPointerException e){}
}
}
Şekil 9.1 Saat.java sınıfının thread sınıfından türemiş olarak yazılımı.
va
import java.awt.Graphics;import java.awt.Font;import java.util.Date;import
java.applet.Applet;
public class saat extends Applet implements Runnable{ Font theFont=new
Font("TimesRoman",Font.BOLD,24);
ja
Date theDate;
Thread runner;
{
runner=new Thread(this);
runner.start();
}
}
if(runner!=null)
{
runner.stop();
runner=null;
}
}
172
173
while(true)
m
{
theDate=new Date();
repaint();
try {Thread.sleep(1000);}
catch(InterruptedException e) {}
}
}
o
public void paint(Graphics g)
{
i.c
g.setFont(theFont);
try
{
g.drawString(theDate.toString(),10,50);
}
catch(NullPointerException e){}
}
}
dil
va
Şekil 9.1 Saat.java sınıfının Runnable interface’i ile yazılımı ve applet çıktısı
ja
İ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
173
174
m
public UretInteger(TutInteger h)
{
pTut=h;
}
o
for(int count=0; count<10; count++)
{
pTut.setOrtakInt(count);
System.out.println("OrtakInteger "+count+" degerini uretti");
i.c
try{
sleep( (int) (Math.random()*5000 ) );
}
catch(InterruptedException e)
{
System.err.println("Exeption "+e.toString());
}
dil
}
}
}
public KullanInteger(TutInteger h)
va
{
cTut=h;
}
catch(InterruptedException e)
{
System.err.println("Exeption "+e.toString());
}
Intdegeri=cTut.getOrtakInt(); System.out.println("Kullan
Integer"+Intdegeri+" degerini okudu"); } }}
class TutInteger{ private int OrtakInt; public void setOrtakInt(int
ww
Intdegeri)
{
OrtakInt=Intdegeri;
}
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 OrtakHucre.java programı ve çıktısı
dil
import java.util.*;import java.awt.*;import java.io.*;//runnable interfacei
kullanarakclass UretInteger implements Runnable { private TutInteger
pTut; private Thread thread; public UretInteger(TutInteger h) {
pTut=h;
thread = new Thread(this);
thread.start();
}
public void run() {
for(int count=0; count < 10; count++) {
va
pTut.setOrtakInt(count);
System.out.println("Ortak Integer " + count+" Olarak
olusturuldu");
try {
thread.sleep((int)(Math.random()*3000));
}
catch(InterruptedException exception) {
System.err.println("Exception " + exception.toString());
ja
}
}
}
}
class KullanInteger implements Runnable{
private TutInteger cTut;
w.
while(Intdegeri != 9) {
try {
thread.sleep((int)(Math.random()*3000));
}
catch(InterruptedException e) {
System.err.println("Exception " + e.toString());
}
Intdegeri = cTut.getOrtakInt();
175
176
m
}
}
}
class TutInteger {
private int OrtakInt;
public void setOrtakInt(int Intdegeri) {OrtakInt = Intdegeri;}
public int getOrtakInt() { return OrtakInt;}
o
}
i.c
TutInteger h= new TutInteger();
new UretInteger(h);
new KullanInteger(h);
}
}
Şekil 9.3 Runnable interface’i ile çalişan OrtakHucreR.java sınıfı
p.start();
c.start();
}
}
{
private Tutinteger pTut;
private TextArea cikti;
public Uretinteger(Tutinteger h)
{
pTut=h;
ww
try{
sleep( (int) (Math.random()*500 ) );
176
177
}
catch(InterruptedException e)
m
{
System.err.println("Hata : "+e.toString());
}
}
}
}
o
class Consumeinteger extends Thread
{
private Tutinteger cTut;
i.c
public Consumeinteger(Tutinteger h)
{
cTut=h;
}
}
dil
intdegeri=cTut.getOrtakint();
catch(InterruptedException e)
va
{
System.err.println("Hata "+e.toString());
}
intdegeri=cTut.getOrtakint();
}
}
}
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.
{
while (!writeable)
{
try{
177
178
{
System.err.println("Hata :"+e.toString() );
m
}
}
Ortakint[YerelYaz]=intdegeri;
okunabilir = true;
cikti.append("\n Uretilen "+intdegeri+" Yazilan "+YerelYaz);
YerelYaz = ++YerelYaz % 5;
o
cikti.append("\t yazilan hucre "+YerelYaz+"\t okunan hucre
"+YerelOku);
i.c
printBuffer(cikti, Ortakint);
if(YerelYaz==YerelOku)
{
writeable=false;
cikti.append("\nDEPOLAMA YERLER˜ DOLU ");
}
notify();
dil
}
writeable=true;
intdegeri=Ortakint[YerelOku];
printBuffer(cikti, Ortakint);
if (YerelOku==YerelYaz)
{okunabilir=false;
cikti.append("\niNTEGER DEPOSU BOS");
}
ww
notify();
return intdegeri;
}
178
179
m
out.append(" "+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ış OrtakHucreBuf.java sınıfı ve applet çıktısı
ja
p.start();
w.
c.start();
}
}
public UretInteger(TutInteger h)
{
pTut=h;
}
179
180
System.out.println("UretInteger OrtakInteger
degerini"+count+"olarak olusturdu");
m
try{
sleep( (int) (Math.random()*3000 ) );
}
catch(InterruptedException e)
{
System.err.println("Exeption "+e.toString());
o
}
}
}
}
i.c
class KullanInteger extends Thread
{
private TutInteger cTut;
public KullanInteger(TutInteger h)
{
cTut=h;
dil
}
}
}
}
class TutInteger
{
w.
try{
wait();
}
catch (InterruptedException e)
{
System.err.println("Exception:"+e.toString() );
}
}
180
181
OrtakInt=Intedegeri;
Yazilabilir=false;
m
notify();
o
{
try{
wait();
}
i.c
catch (InterruptedException e)
{
System.err.println("Exception:"+e.toString() );
}
}
Yazilabilir=true;
dil
notify();
return OrtakInt;
}
}
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.
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
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(“/”,”autoexec.bat”);
File f3=new File(f1,”autoexec.bat”);
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 isminin mutlak isim olup olmadığını kontrol eder.(Eğer dosya ismi co/java/prog/Hosgeldiniz.java
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
m
import java.io.*;
class FileTesti
{
public static void main(String args[])
{
File f1=new File("Hosgeldiniz.java");
o
System.out.println("Dosya ismi : "+f1.getName());
System.out.println("Dizin ismi : "+f1.getPath());
System.out.println("Mutlak Dizin ismi : "+f1.getAbsolutePath());
System.out.println("Ust Dizin ismi : "+f1.getParent());
i.c
System.out.println( f1.exists() ? "Mevcut " : " Mevcut degil ");
System.out.println( f1.canWrite() ? "Yazilabilir " : " Yazilamaz");
System.out.println( f1.canRead() ? "Okunabilir " : " Okunamaz");
System.out.println( f1.isDirectory() ? "Dizin " : " Dizin degil");
System.out.println( f1.isFile() ? "Dosya " : " Dosya degil");
System.out.println( f1.isAbsolute() ? "Mutlak dizin ismi " : " Mutlak dizin ismi degil");
System.out.println("Son Degisiklik : "+f1.lastModified());
System.out.println("Dosya boyutu : "+f1.length()+" Byte");
dil
}
}
Şekil 10.1.1 FileTesti.java programı
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 System.in ,
System.out, System.err 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
Bu deyim bize isim.dat 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
m
import java.io.*;
import java.awt.*;
import java.awt.event.*;
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("musteri.dat"));
} catch(IOException e)
{ System.err.println("Dosya dogru acilamadi\n"+e.toString());
System.exit(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");
enter.addActionListener(this);
add(enter);
done=new Button("Cikis");
done.addActionListener(this);
w.
add(done);
setVisible(true);
}
Double d;
if(!hesapIsmiKutusu.getText().equals(""))
{
try{
accountNumber=Integer.parseInt(hesapIsmiKutusu.getText());
if(accountNumber>0)
{
cikti.writeInt(accountNumber);
cikti.writeUTF(isimKutusu.getText());
cikti.writeUTF(soyIsimKutusu.getText());
186
187
d=new Double(hesapKutusu.getText());
cikti.writeDouble(d.doubleValue());
m
}
hesapIsmiKutusu.setText("");
isimKutusu.setText("");
soyIsimKutusu.setText("");
hesapKutusu.setText("");
}
o
catch(NumberFormatException nfe)
{
System.err.println("Hesap numarasi tamsayi degisken olamalidir");
}
catch(IOException io)
i.c
{
System.err.println("Dosyaya yazarken hata olustu\n"+io.toString());
System.exit(1);
}
}
}
public void actionPerformed(ActionEvent e)
{
dil
hesapEkle();
if(e.getSource()==done)
{
try{ cikti.close();}
catch(IOException io)
{
System.err.println("Dosya kapatilamadi\n"+io.toString());
}
System.exit(0);
va
}
}
import java.io.*;
import java.awt.*;
import java.awt.event.*;
public class ardisikDosyaOku extends Frame implements ActionListener
{
private TextField accountField,firstNameField,lastNameField,balanceField;
187
188
m
public ardisikDosyaOku()
{
super("Musteri dosyasini oku");
try{
input=new DataInputStream(new FileInputStream("musteri.dat"));
} catch(IOException e) { System.err.println("Dosya
acilamadi\n"+e.toString());
o
System.exit(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");
next.addActionListener(this);
add(next);
done=new Button("cikis");
done.addActionListener(this);
va
add(done);
setVisible(true);
}
public void readRecord()
{
int account;
String first,last;
double balance;
ja
{
try{
account=input.readInt();
first=input.readUTF();
last=input.readUTF();
balance=input.readDouble();
w.
accountField.setText(String.valueOf(account));
firstNameField.setText(first);
lastNameField.setText(last);
balanceField.setText(String.valueOf(balance));
}
catch(EOFException eof)
{
closeFile();
ww
}
catch(IOException io)
{
System.err.println("Dosyay okurken hata olustu\n"+io.toString());
System.exit(1);
}
}
}
public void actionPerformed(ActionEvent e)
188
189
{
if(e.getSource()==next)
m
readRecord();
else
closeFile();
}
o
{
try{
input.close();
System.exit(0);
}
i.c
catch(IOException e)
{
System.err.println("Dosya Kapama Hatası oluştu\n"+e.toString());
System.exit(1);
}
}
dil
{
new ardisikDosyaOku();
}
}
ja va
try{
cikti=new DataOutputStream(new FileOutputStream("musteri.dat"));
}
catch(IOException e)
{
System.err.println("Dosya dogru acilamadi\n"+e.toString());
System.exit(1);
ww
189
190
}
catch(IOException e)
m
{ System.err.println("Dosya dogru acilamadi\n"+e.toString());
System.exit(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("musteri.dat"));
}
catch(IOException e)
{
System.err.println("Dosya acilamadi\n"+e.toString());
System.exit(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.
write(byte B[] )
va
byte tipi boyutludeğişkeni açılmış olan DataOutputStream kanalına yazar.
write(int B)
writeBoolean(boolean B)
writeByte(int)
ww
writeBytes(String)
writeChar(int)
190
191
m
writeChars(String)
o
writeDouble(double)
i.c
writeFloat(float)
writeInt(int)
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)
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 b.length bytes from this data input stream into the byte array.
191
192
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)
System.exit(1);
}
}
w.
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("musteri1.dat","rw");
m
} catch(IOException e)
{
System.err.println("Dosya acma hatasi\n"+e.toString());
System.exit(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.
i.c
close()
RandomAccessFile (Raslantısal Ulaşım Dosyası) kanalını ve ilgili tüm sınıfları kapatır. Rnek
olarak :
metodu verilebilir.
getFD()
ja
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.
193
194
readBoolean()
m
boolean değişken okur
readByte()
o
readChar()
i.c
readDouble()
readFloat()
readFully(byte[] b)
dil
b.length bouyutundaki byte değerini boyutlu byte değişkenine aktarır.
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.
readShort()
readUnsignedByte()
ww
readUnsignedShort()
194
195
readUTF()
m
UTF stringi okur
seek(long)
o
skipBytes(int n)
i.c
Aşağıdaki tanımlar read tanımlarına parelel olan write terimleridir.
write(byte[])
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)
import java.io.*;
195
196
m
{
//RandomAccessFile = Raslantisal Ulasim dosyasi
hesap=dosya.readInt();
char first[]=new char[15];
for(int i=0;i<first.length;i++)
{ first[i]=dosya.readChar(); }
Isim=new String(first);
o
char last[]=new char[15];
for(int i=0;i<first.length;i++)
{ last[i]=dosya.readChar(); }
soyIsim=new String(last);
i.c
hesaptakiPara=dosya.readDouble();
}
dil
buf=new StringBuffer(Isim);
else
buf=new StringBuffer(15);
buf.setLength(15);
dosya.writeChars(buf.toString());
if(soyIsim!=null)
buf=new StringBuffer(soyIsim);
else
buf=new StringBuffer(15);
va
buf.setLength(15);
dosya.writeChars(buf.toString());
dosya.writeDouble(hesaptakiPara);
}
import java.io.*;
import java.awt.*;
import java.awt.event.*;
ww
import Kayit;
196
197
try{
girdi = new RandomAccessFile("musteri1.dat","rw");
m
for(int i=0;i<100;i++)
{ hesapDosyasi.yaz(girdi); }
} catch(IOException e)
{
System.err.println("Dosya acma hatasi\n"+e.toString());
System.exit(1);
}
o
}
i.c
RaslantisalUlasimDosyasiYarat H=
new RaslantisalUlasimDosyasiYarat();
}
}
import java.io.*;
import
import
import
java.awt.*;
java.awt.event.*;
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("musteri1.dat","rw");
} catch(IOException e)
{
System.err.println("Dosya acma hatasi\n"+e.toString());
System.exit(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
197
198
kapat=new Button("cikis");
kapat.addActionListener(this);
m
add(kapat);
setVisible(true);
}
o
Double d;
if(!hesapAlani.getText().equals(""))
{
try{
i.c
accountNumber=Integer.parseInt(hesapAlani.getText());
if(accountNumber>0 && accountNumber <=100)
{
hesapDosyasi.yazhesap(accountNumber);
hesapDosyasi.yazIsim(isimAlani.getText());
hesapDosyasi.yazsoyIsim(soyisimAlani.getText());
d=new Double(hesaptakiParaAlani.getText());
hesapDosyasi.yazhesaptakiPara(d.doubleValue());
dil
girdi.seek((long)(accountNumber-1)*Kayit.boyut());
hesapDosyasi.yaz(girdi);
}
hesapAlani.setText("");
isimAlani.setText("");
soyisimAlani.setText("");
hesaptakiParaAlani.setText("");
}
catch(NumberFormatException nfe)
va
{
System.err.println("Hesap numarasi tamsayi degisken olamalidir");
}
catch(IOException io)
{
System.err.println("Dosyaya yazarken hata olustu\n"+io.toString());
System.exit(1);
}
ja
}
}
public void actionPerformed(ActionEvent e)
{
addKayit();
if(e.getSource()==kapat)
w.
{
try{ girdi.close();}
catch(IOException io)
{
System.err.println("Dosya kapatilamadi\n"+io.toString());
}
System.exit(0);
}
ww
}
public static void main(String args[])
{
new RaslantisalUlasimDosyasiYaz();
}
}
198
199
o m
i.c
10.4.3 RaslantisalUlasimDosyasiYaz.java dosyası ve Frame çıktısı
import
import
import
import
java.io.*;
java.awt.*;
java.awt.event.*;
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("musteri1.dat","r");
} catch(IOException e)
{ System.err.println("Dosya acilamadi\n"+e.toString());
System.exit(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");
birsonraki.addActionListener(this);
199
200
add(birsonraki);
kapat=new Button("cikis");
m
kapat.addActionListener(this);
add(kapat);
setVisible(true);
}
o
int hesap;
String ilk,son;
double balance;
{
i.c
try{
do{
hesapDosyasi.oku(girdi);
} while(hesapDosyasi.okuhesap()==0);
hesapAlani.setText(String.valueOf(hesapDosyasi.okuhesap()));
isimAlani.setText(String.valueOf(hesapDosyasi.okuIsim()));
soyisimAlani.setText(String.valueOf(hesapDosyasi.okusoyIsim()));
dil
hesaptakiParaAlani.setText(String.valueOf(hesapDosyasi.okuhesaptakiPara()))
;
}
catch(EOFException eof)
{
closeFile();
}
catch(IOException io)
{
va
System.err.println("Dosyay okurken hata olustu\n"+io.toString());
System.exit(1);
}
}
}
if(e.getSource()==birsonraki)
okuKayit();
else
closeFile();
}
w.
200
201
o m
i.c
10.4.4 RaslantisalUlasimDosyasiOku.java 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
m
11.1 Vector Sınıfı
o
Örneğin double b[]=new double[3];
Deyimi bilgisayar belleğinde
i.c
1023400 b[0]
1023464 b[1]
1023528 b[2]
değiştirmektir.
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
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()
clone()
202
203
m
contains(Object)
copyInto(Object[])
o
vectorü boyutlu değişkene aktarır.
elementAt(int indeks)
i.c
Verilen indeksteki elemanı verir..
elements()
ensureCapacity(int yeni_kapasite)
dil
eğer yeni_kapasite vector kapasitesinin üstündeyse vector yeni_kapasite’ye aktarılır.
firstElement()
isEmpty()
lastElement()
ww
lastIndexOf(Object)
203
204
m
indeks ten başlayarak geriye doğru Objectin ilk tekrarlandığı yeri bulur.
removeAllElements()
o
removeElement(Object)
i.c
removeElementAt(int indeks)
setSize(int)
size()
dil
Objectin ideksini indeks olarak belirler.
va
Vectördeki toplam eleman sayısını verir.
toString()
trimToSize()
statsBtn, displayBtn;
Panel YaziPaneli;
public void init()
{
setBackground(Color.lightGray);
YaziPaneli=new Panel();
YaziPaneli.setFont(new Font("Serif",Font.BOLD,12));
YaziPaneli.setLayout( new GridLayout(5,2) );
v = new Vector(1);
204
205
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);
addBtn.addActionListener(this);
YaziPaneli.add(addBtn);
removeBtn.addActionListener(this);
YaziPaneli.add(removeBtn);
firstBtn.addActionListener(this);
YaziPaneli.add(firstBtn);
lastBtn.addActionListener(this);
dil
YaziPaneli.add(lastBtn);
emptyBtn.addActionListener(this);
YaziPaneli.add(emptyBtn);
containsBtn.addActionListener(this);
YaziPaneli.add(containsBtn);
locationBtn.addActionListener(this);
YaziPaneli.add(locationBtn);
trimBtn.addActionListener(this);
YaziPaneli.add(trimBtn);
va
statsBtn.addActionListener(this);
YaziPaneli.add(statsBtn);
displayBtn.addActionListener(this);
YaziPaneli.add(displayBtn);
add(YaziPaneli);
}
{
if(e.getSource()==addBtn)
{ v.addElement(input.getText());
showStatus("Listenin sonuna eklendi: "+input.getText()); }
else if(e.getSource()==removeBtn)
{ if(v.removeElement(input.getText()))
w.
showStatus("Silindi :"+input.getText());
else
showStatus(input.getText()+"not in vector");
}
else if(e.getSource() == firstBtn)
{
try{
showStatus("Ilk eleman : "+v.firstElement());
ww
}
catch(NoSuchElementException exception)
{
showStatus(exception.toString() );
}
}
else if(e.getSource()==lastBtn)
{ try{
showStatus("Son eleman : "+v.lastElement());
205
206
}
catch(NoSuchElementException exception)
m
{ showStatus(exception.toString() );}
}
else if(e.getSource() == emptyBtn)
{
showStatus(v.isEmpty()? "Vector bos ":"vector dolu ");
}
else if(e.getSource()==containsBtn)
o
{
String searchKey = input.getText();
if(v.contains(searchKey) )
i.c
showStatus("Vektor elemanlari " +searchKey);
else
showStatus("Aranan eleman Vektorde bulunamadi "+searchKey);
}
else if(e.getSource()==locationBtn)
{ showStatus("Eleman "+v.indexOf(input.getText() )+" pozisyonunda
bulundu");
}
dil
else if(e.getSource()==trimBtn)
{ v.trimToSize();
showStatus("Vector boyu eleman boyuna k salt ld ");
}
else if(e.getSource()== statsBtn)
{
showStatus("Boyut = "+v.size()+"; Toplam kapasite =
"+v.capacity());
}
va
else if(e.getSource()== displayBtn) {
Enumeration enum=v.elements();
StringBuffer buf = new StringBuffer();
while(enum.hasMoreElements())
{
buf.append(enum.nextElement() );
buf.append(" ");
}
ja
showStatus(buf.toString() );
}
input.setText("");
}
}
w.
ww
206
207
o m
i.c
Şekil 11.1.1 VectorTesti.java programı ve applet çıktısı
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=list1.elements();
Enumeration n2=list2.elements();
while(n1.hasMoreElements())
{
va
s1=(String)n1.nextElement();
bilesimVectoru.addElement(s1);
}
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 java.util.*;
w.
import java.awt.*;
import java.applet.Applet;
import java.awt.event.*;
class SetA
{
public Vector bilesim(Vector list1, Vector list2)
ww
{
Vector bilesimVectoru = new Vector();
String s1,s2;
Enumeration n1=list1.elements();
Enumeration n2=list2.elements();
while(n1.hasMoreElements())
{
s1=(String)n1.nextElement();
bilesimVectoru.addElement(s1);
}
207
208
while(n2.hasMoreElements())
{
m
s2=(String)n2.nextElement();
if(!bilesimVectoru.contains(s2))
bilesimVectoru.addElement(s2);
}
return bilesimVectoru;
}
o
public Vector kesisim(Vector list1,Vector list2)
{
Vector kesisimVectoru = new Vector();
String s;
i.c
Enumeration n = list1.elements();
while(n.hasMoreElements())
{
s=(String)n.nextElement();
if(list2.contains(s))
kesisimVectoru.addElement(s);
}
return kesisimVectoru;
dil
}
}
Vector ansUn;
Vector ansInt;
add(T1);
T1.addActionListener(this);
add(P2);
add(T2);
T2.addActionListener(this);
add(cikti);
}
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(tokens.hasMoreTokens()) {
String test = tokens.nextToken();
list.addElement(test);
}
o
}
i.c
Enumeration enum = v.elements();
while(enum.hasMoreElements())
{
String ans = (String)enum.nextElement();
cikti.append(ans + "\n");
}
}
dil
public void actionPerformed(ActionEvent e)
{
if(e.getSource()==T1)
{
String stringToTokenize = T1.getText();
girdiA(stringToTokenize,list1);
}
else if(e.getSource()==T2)
{
va
String stringToTokenize = T2.getText();
girdiA(stringToTokenize,list2);
// Iki listenin bilesim ve kesisim k melerini hesapla.
ansUn = set.bilesim(list1,list2);
ansInt = set.kesisim(list1,list2);
// sonuclari cikti alanina gonder
cikti.append("\nIki listenin bilesim kumesi : \n");
ciktiA(ansUn);
ja
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 SetTest.java programı ve applet çıktısı
va
JAVA PROGRAMLAMA DİLİ
HAFTA 14
Hafta 13 dosyaları :
Bu haftaki dosyalar
w.
ALISTIRMA 1
ww
Hafta 13 dosyaları ve saat.java programını inceleyiniz. Saat.java 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
SetTest.java 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
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
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[])
//
//
dil
//=============================================================
Numerical Analysis Packages in Java
Matrix calculations class Matrix
va
// Author : Dr. Turhan Coban
//=============================================================
//Turhan Coban
import java.io.*;
import complex;
n=s.length();
}
return s;
}
212
213
String b;
b="";
m
n=left.length;
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
}
dil
n=left.length;
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;
}
int n,m;
String b;
b="";
n=left.length;
for(int i=0;i<n;i++)
{
w.
b=b+left[i].toString()+"\n";
}
return b;
}
// a complex vector
int n,m;
String b;
b="";
n=left.length;
for(int i=0;i<n;i++)
{
b=b+left[i].toString()+" ";
}
213
214
b=b+"\n";
return b;
m
}
o
String b;
b="";
n=left.length;
for(int i=0;i<n;i++)
i.c
{
b=b+toString(left[i])+"\n";
}
return b;
}
dil
// returns a horizontal string representation
// of a double vector
int n,m;
String b;
b="";
n=left.length;
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=left.length;
for(int i=0;i<n;i++)
{
w.
b=b+left[i]+"\t";
}
b=b+"\n";
return b;
}
214
215
m
public static double[][] inv(double[][] a)
{
// INVERSION OF A MATRIX
// inversion by using gaussian elimination
// with full pivoting
int n=a.length;
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)
{
System.out.println("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(Math.abs(b[j][k]) >= big)
w.
{
big=Math.abs(b[j][k]);
irow=j;
icol=k;
}
}
else if(ipiv[k] > 1 )
{
ww
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)
{
System.out.println("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;
}
{
//inverse of a matrix
//this method enable usage of inv or inverse as
//name of mtrix inversion method
return Matrix.inv(a);
}
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(Math.abs(a[i-1][j-1])>big) big=Math.abs(a[i-1][j-1]);
}
if(big==0) {System.out.println("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]*Math.abs(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=a.length;
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;
}
218
219
int d[]={1};
int indx[]=new int[n];
m
double e[][]=new double[n][n];
e=Matrix.LU(a,indx,d);
c=Matrix.LUaxb(e,b,indx);
return c;
} //end of AXB
o
{
//inverse of a matrix by using LU decomposition method
//this method is more efficient than inv (or inverse)
int n=a.length;
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=Matrix.LU(a,indx,d);
for(int i=0;i<n;i++)
{
dil
c[i]=Matrix.LUaxb(e,b[i],indx);
}
return Matrix.T(c);
} //end of LUinv
return e;
} //end of det
return Matrix.det(a);
}
219
220
int n2=right.length;
double[][] b;
m
b=new double[m1][n2];
if(n1 != m2)
{
System.out.println("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
}
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
220
221
double[] b;
b=new double[m1];
m
if(n2 != m1)
{
System.out.println("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=right.length;
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
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
221
222
b=new double[n];
for(i=0;i<n;i++)
m
{
b[i]=left*right[i];
}
return b;
}
o
{
//multiplying a vector with a constant
int i;
int n=left.length;
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=right.length;
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]=Math.pow(right[i][j],left);
}
}
w.
}
return b;
//end of power of a matrix
}
int i;
int n=right.length;
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]=Math.pow(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=left.length;
int m1=left[0].length;
int n2=right.length;
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.
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
}
o
{
//addition of two matrices
int n1=left.length;
int m1=left[0].length;
i.c
int n2=right.length;
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
int n1=left.length;
int n2=right.length;
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
m
//============== division of the matrices
public static double[][] divide(double[][] left,double[][] right)
{
//division of two matrices
int n=right.length;
int m=right[0].length;
o
double b[][];
b=new double[n][m];
b=Matrix.multiply(Matrix.inv(right),left);
return b;
i.c
}
dil
b=new double[n][m];
b=Matrix.multiply(Matrix.LUinv(right),left);
return b;
}
int n=left.length;
int m=left[0].length;
double b=0;
for(i=0;i<n;i++)
for(j=0;j<m;j++)
{
b=b+Math.abs(left[i][j]);
}
return b;
225
226
m
public static double abs(double[] left)
{
// absolute value of a vector
int i;
int n=left.length;
double b=0;
for(i=0;i<n;i++)
o
{
b=b+Math.abs(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=left.length;
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;
}
int n=left.length;
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
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;
}
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=c.length-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;
}
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+=Math.abs(a[j-1][i-1]);
r+=Math.abs(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;
}
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(Math.abs(a[j-1][m-2]) > Math.abs(x))
{
x=a[j-1][m-2];
i=j;
i.c
} //end of if(Math.abs(..
}//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;
}
229
230
{
//calculates eigenvalues of a Hessenberg matrix
m
int n=b.length;
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=Math.abs(a[1][1]);
i.c
for (i=2;i<=n;i++)
for (j=(i-1);j<=n;j++)
anorm += Math.abs(a[i][j]);
nn=n;
t=0.0;
while (nn >= 1) {
its=0;
do {
dil
for (l=nn;l>=2;l--) {
s=Math.abs(a[l-1][l-1])+Math.abs(a[l][l]);
if (s == 0.0) s=anorm;
if ((double)(Math.abs(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=Math.sqrt(Math.abs(q));
ja
x += t;
if (q >= 0.0) {
z=p+Matrix.SIGN(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
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=Math.abs(p)+Math.abs(q)+Math.abs(r);
o
p /= s;
q /= s;
r /= s;
if (m == l) break;
i.c
u=Math.abs(a[m][m-1])*(Math.abs(q)+Math.abs(r));
v=Math.abs(p)*(Math.abs(a[m-1][m-1])+
Math.abs(z)+Math.abs(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=Math.abs(p)+Math.abs(q)+Math.abs(r)) != 0.0) {
p /= x;
va
q /= x;
r /= x;
}
}
if ((s=Matrix.SIGN(Math.sqrt(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
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=b.length;
double d[][]=new double[2][n];
d=Matrix.QR(Matrix.Hessenberg(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=b.length;
double d[][]=new double[2][n];
d=Matrix.QR(Matrix.Hessenberg(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
232
233
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=c.length-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;
}
dil
// method balance is used to balance the matrix previous to
// actual calculations
int n=b.length;
double d[][]=new double[2][n];
d=Matrix.QR(Matrix.Hessenberg(Matrix.balance(b)));
return d;
}
h=scale=0.0;
if (l > 1) {
for (k=1;k<=l;k++)
scale += Math.abs(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 ? -Math.sqrt(h) : Math.sqrt(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.
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=Math.abs(d[m-1])+Math.abs(d[m]);
i.c
if ((double)(Math.abs(e[m-1])+dd) == dd) break;
}
if (m != l) {
if (iter++ == 30) System.out.println("Too many iterations in
QL");
g=(d[l]-d[l-1])/(2.0*e[l-1]);
r=Matrix.pythag(g,1.0);
g=d[m-1]-d[l-1]+e[l-1]/(g+Matrix.SIGN(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=Matrix.pythag(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.
235
236
m
int n=a.length;
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;
}
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;
System.out.println("Original Matrix : ");
System.out.println(Matrix.toString(a));
System.out.println("Inverse Matrix : (Method inv) ");
System.out.println(Matrix.toString(Matrix.inv(a)));
System.out.println("Matrix * Inverse Matrix : (Method multiply) ");
System.out.println(Matrix.toString(Matrix.multiply(a,Matrix.inv(a))));
dil
System.out.println("Solution of system of equation : ");
System.out.println("with second side : ");
System.out.println(Matrix.toStringT(b));
System.out.println(Matrix.toString(Matrix.divide(b,a)));
int indx[]=new int[5];
d[0]=0;
c=Matrix.LU(a,indx,d);
System.out.println("LU decomposed matrix : (Method LU) ");
System.out.println(Matrix.toString(c));
va
System.out.println("Matrix inversion by LU decomposition : (Method
LUinv)");
System.out.println(Matrix.toString(Matrix.LUinv(a)));
System.out.println("Matrix * Inverse Matrix (LU Decomposition) :");
System.out.println(Matrix.toString(Matrix.multiply(a,Matrix.LUinv(a))));
}
}
ja
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
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
import java.io.*;
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
238
239
m
System.out.println(Matrix.toString(Matrix.T(Matrix.balancedEigenValue(a))))
;
complex c[]=new complex[5];
c=Matrix.eigenValueC(a);
System.out.println("eigen values (Method eigenValueC)");
System.out.println(Matrix.toStringT(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
System.out.println("roots of polynomial (Method poly_roots)");
System.out.println(Matrix.toString(Matrix.T(Matrix.poly_roots(e))));
i.c
System.out.println("roots of polynomial (Method poly_roots)");
System.out.println(Matrix.toStringT(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
0.9999999999999991
3. Determinant
import java.io.*;
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;
System.out.println("Matrix : ");
System.out.println(Matrix.toString(a));
i.c
System.out.println("Inverse Matrix : ");
System.out.println(Matrix.toString(Matrix.inv(a)));
System.out.println("Matrix * Inverse Matrix :");
System.out.println(Matrix.toString(Matrix.multiply(a,Matrix.inv(a))));
System.out.println("Determinant = "+Matrix.det(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 java.io.*;
import Numeric;
class Matrix6
{
w.
System.out.println(Matrix.toString(Matrix.eigenQL(a)));
}
}
çözümü :
Original Matrix :
3.0 -1.0 0.0
-1.0 2.0 -1.0
240
241
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)
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
// f[1][0]=x[0]*x[0]-x[1] f[1][1]=Math.exp(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.
241
242
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
//
//
// dil
//=============================================================
Numerical Analysis Package in Java
Numerical analysis calculation class Numeric
Author : Dr. Turhan Coban
//=============================================================
import java.io.*;
import Matrix;
va
abstract class f_x
{
//single function single independent variable
// example f=x*x
abstract double func(double x);
}
ja
242
243
m
{
// multifunction multi independent variable
// for n independent variable n*n matrix of
// dependent variables are returned
// example f[0][0]=x[0]+Math.sin(x[1]) f[0][1]=x[0]-x[1]
// f[1][0]=x[0]*x[0]-x[1] f[1][1]=Math.exp(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
i.c
}
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*Math.pow(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
}
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[x.length];
double x2[];
x2=new double[x.length];
for(i=0;i<x.length;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*Math.pow(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
}
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[x.length];
double f2[];
f2=new double[x.length];
double x1[];
x1=new double[x.length];
dil
double x2[];
x2=new double[x.length];
for(i=0;i<x.length;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*Math.pow(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;
}
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+=ff.func(a+h*(2*p-1)); }
R[j][0]=R[j-1][0]/2.0+h*sum;
}
w.
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*(ff.func(a)+ff.func(b));
do
{
j++;
247
248
h/=2.0;
Numeric.trap(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])/(Math.pow(4,k)-1.0);
close=Math.abs(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
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=y.func(x);
dfx=dy.func(x);
va
x-=fx/dfx;
if(Math.abs(fx)<tolerance)
{
return x;
}
}
return x;
}
ja
int nmax=500;
double tolerance=1.0e-15;
double fx,dfx;
for(int i=0;i<nmax;i++)
{
fx=y.func(x);
ww
dfx=Numeric.derivative(y,x);
x-=fx/dfx;
if(Math.abs(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=y.func(x);
fxm=y.func(x-dx);
dfx=dy.func(x);
dfxm=dy.func(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(Math.abs(fx)<tolerance)
dil
{
return x;
}
}
return x;
}
double fx,fxm,dfx,dfxm,d2fx;
for(int i=0;i<nmax;i++)
{
fx=y.func(x);
fxm=y.func(x-dx);
dfx=Numeric.derivative(y,x);
w.
dfxm=Numeric.derivative(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(Math.abs(fx)<tolerance)
{
return x;
}
}
ww
return x;
}
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=y.func(x);
fxm=y.func(x-dx);
o
fxm1=y.func(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(Math.abs(fx)<tolerance)
{
return x;
}
}
return x;
}
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=Math.abs((xu-xl)/(xl+xu))*100;}
fxl= y.func(xl);
fxr= y.func(xr);
test= fxl*fxr;
if(test==0.0) ea=0;
ww
250
251
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=x.length;
i.c
double b[];
b=new double[n];
for(i=0;i<n;i++)
{
b[i]=1.0;
}
i=0;
while( i++ < nmax && Matrix.abs(b) > tolerance )
dil
{
b=Matrix.multiply(Matrix.divide(y.func(x),dy.func(x)),-ti);
x=Matrix.add(x,b);
}
if(i >= nmax) System.out.println("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=x.length;
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 && Matrix.abs(b) > tolerance )
{
ww
for(ii=0;ii<n;ii++)
{
for(jj=0;jj<n;jj++)
{
dy[ii][jj]=Numeric.derivative(y,ii,x,jj);
}
}
b=Matrix.multiply(Matrix.divide(y.func(x),dy),-ti);
x=Matrix.add(x,b);
251
252
}
if(i >= nmax) System.out.println("warning maximum number of iterations"+
m
" results may not be valid" );
return x;
}
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=xi.length;
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] += Math.pow(xi[k],(i+j));
ja
}
for(k=0;k<l;k++)
{
if(i==0)
B[i]+= yi[k];
else
w.
B[i] += Math.pow(xi[k],i)*yi[k];
}
}
X=Matrix.divide(B,A);
//X=B/A;
double max=0;
for(i=0;i<n+1;i++)
ww
252
253
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=x.length;
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=Math.sqrt(total);
return total;
}
int n=xi.length;
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;
}
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=ff.func(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*Math.abs(y[ihi-1]-y[ilo-1])
/(Math.abs(y[ihi-1])+Math.abs(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) System.out.println("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]=ff.func(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;
}
}
256
257
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*fp.func(xi,0);
xi[0]=x+h/2.0;
xi[1]=fi[i]+k[0]/2;
i.c
k[1]=h*fp.func(xi,0);
xi[1]=fi[i]+k[1]/2.0;
k[2]=h*fp.func(xi,0);
xi[0]=x+h;
xi[1]=fi[i]+k[2];
k[3]=h*fp.func(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;
}
{
for(j=1;j<=M;j++)
{
xi[0]=x;
xi[1]=fi[j-1][i];
k[0]=h*fp.func(xi,j-1);
xi[0]=x+h/2.0;
xi[1]=fi[j-1][i]+k[0]/2;
ww
k[1]=h*fp.func(xi,j-1);
xi[1]=fi[j-1][i]+k[1]/2.0;
k[2]=h*fp.func(xi,j-1);
xi[0]=x+h;
xi[1]=fi[j-1][i]+k[2];
k[3]=h*fp.func(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*fp.func(xi,0);
xi[0]=fi[0][j]+h/4.0;
xi[1]=fi[1][j]+k[0]/4.0;
k[1]=h*fp.func(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*fp.func(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*fp.func(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*fp.func(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*fp.func(xi,0);
ww
Err=Math.abs(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*(Math.pow(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;
}
dil
Numeric sınıfı örnek problemleri :
import java.io.*;
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;
}
}
return b;
}
}
259
260
}
}
m
class df2 extends f_x
{
double func(double x)
{
return Math.cos(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
System.out.println("Roots of equations : ");
System.out.println("Newtons method y=f(x)=0 f(x) and df(x)/dx is
given");
System.out.println("Newton y,dy x= "+Numeric.newton(xx,b2,db2));
System.out.println("");
System.out.println("Newtons method y=f(x)=0 f(x) is given");
System.out.println("Newton y, x= "+Numeric.newton(xx,b2));
System.out.println("");
ja
System.out.println("");
System.out.println("Newtons method for system of equations");
System.out.println("yi=fi(xi)=0,i=0,n ");
System.out.println("fi(xi) and dfi(xi)/dxj,i=1,n,j=1,n is given");
System.out.println(" "+Matrix.toStringT(Numeric.newton(x,b1,db1)));
System.out.println("");
System.out.println("Newtons method for system of equations");
System.out.println("yi=fi(xi)=0,i=0,n ");
260
261
m
System.out.println(" "+Matrix.toStringT(Numeric.newton(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
x= 1.895494267033981
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
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 java.io.*;
import Numeric;
import complex;
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 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;
System.out.println("integral of class f1 : "+
Numeric.integral(b1,0.0,1.0));
System.out.println("romberg integral of class f1 : "+
Numeric.integral_romberg(b1,0.0,1.0));
262
263
m
System.out.println("Derivative of class f1 : "+
Numeric.derivative(b1,1.0));
System.out.println("Derivative of class f2 : "+
Numeric.derivative(b2,1.0));
o
System.out.println("Derivative of fm2,0 : "+
Numeric.derivative(b4,1,x,0));
System.out.println("Derivative of fm1,0 : "+
Numeric.derivative(b3,1,x,0));
i.c
System.out.println("Derivative of fm2,0 : "+
Numeric.derivative(b4,1,x,0));
System.in.read();
}
}
çö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
//===========================================
// Polynomial least square curve fitting
// Dr. Turhan Coban
//===========================================
ja
import java.io.*;
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(System.in);
System.out.println("name of input file : ");
String in_name=Text.readString(cin);
System.out.println(" ");
DataInputStream fin=new DataInputStream(new FileInputStream(in_name));
PrintStream fout=new PrintStream(new FileOutputStream("out.dat"));
263
264
int i=-1;
try {
m
while(fin != null)
{
i++;
xi[i]=Text.readDouble(fin);
yi[i]=Text.readDouble(fin);
System.out.println(" "+xi[i]+" "+yi[i]);
}
o
} catch(EOFException e_eof) {System.out.println("end of file"); }
System.out.println("degree of curve fitting : ");
int n=Text.readInt(cin);
e=Numeric.poly_least_square(xi,yi,n);
i.c
System.out.println(Matrix.toString(e));
fout.println(Matrix.toString(e));
System.out.println("least square error : "+Numeric.error(xi,yi,e));
System.out.println("would you like to send curve fitted data to a data
file (y/n) ");
char answer=Text.readChar(cin);
if(answer=='y')
{
dil
System.out.println("name of output file : ");
String out_name=Text.readString(cin);
PrintStream fout1=new PrintStream(new FileOutputStream(out_name));
double xmin,xmax;
System.out.println("minimum x : ");
xmin=Text.readDouble(cin);
System.out.println("maximum x : ");
xmax=Text.readDouble(cin);
System.out.println("number of data points : ");
va
int n_data=Text.readInt(cin);
double x;
for(i=0;i<n_data;i++)
{
x=xmin+(xmax-xmin)/(n_data-1.0)*i;
System.out.println(" "+x+" "+Numeric.f_least_square(e,x));
fout1.println(" "+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 java.io.*;
import Numeric;
import complex;
import Matrix;
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
{
dil
//boundary condition x=0 y=1 is given
//final value x=1 to be calculated by the method
System.out.println(Matrix.toStringT(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 java.io.*;
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.
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 java.io.*;
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
{
Çö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 java.io.*;
import java.util.*;
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(system.in);
double number;
number=Text.readDouble(cin);
------ reading data from a file "datafile.dat"------
DataInputStream fin=new DataInputStream
(new FileInputStream("datafile.dat"));
double number;
number=Text.readDouble(fin);
ja
*/
public Text () {} ;
private static StringTokenizer T;
private static String S;
271
272
{
try {
m
String item = T.nextToken();
return Integer.valueOf(item.trim()).intValue();
}
catch (NoSuchElementException e1) { refresh (in);
} catch(NumberFormatException e2)
{ System.out.println("Error in number, try again.");}
}
o
}
i.c
IOException
{
if (T==null) refresh(in);
while (true)
{
try {
return T.nextToken().charAt(0);
}
dil
catch(NoSuchElementException e1) {refresh (in);}
}
}
again.");
}
}
}
IOException
{
if(T==null) refresh (in);
while (true) {
try {return T.nextToken();}
catch (NoSuchElementException e1) {
refresh (in);
}
ww
}
}
272
273
m
{ try
{ ch = in.read();
if (ch < 0 || (char)ch == '\n' || (char)ch == '\0')
done = true;
else
r = r + (char) ch;
}
o
catch(java.io.IOException e)
{ done = true;
}
}
i.c
return r.substring(0,(r.length()-1));
}
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
/**
* 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 = s.length();
int parse_state = 0;
ww
while (parse_state == 0)
{ if (i >= length) parse_state = 5;
else if (s.charAt(i) == '%')
{ if (i < length - 1)
{ if (s.charAt(i + 1) == '%')
274
275
m
}
else
parse_state = 1;
}
else throw new java.lang.IllegalArgumentException();
}
else
o
pre = pre + s.charAt(i);
i++;
}
while (parse_state == 1)
i.c
{ if (i >= length) parse_state = 5;
else if (s.charAt(i) == ' ') show_space = true;
else if (s.charAt(i) == '-') left_align = true;
else if (s.charAt(i) == '+') show_plus = true;
else if (s.charAt(i) == '0') leading_zeroes = true;
else if (s.charAt(i) == '#') alternate = true;
else { parse_state = 2; i--; }
i++;
dil
}
while (parse_state == 2)
{ if (i >= length) parse_state = 5;
else if ('0' <= s.charAt(i) && s.charAt(i) <= '9')
{ width = width * 10 + s.charAt(i) - '0';
i++;
}
else if (s.charAt(i) == '.')
{ parse_state = 3;
va
precision = 0;
i++;
}
else
parse_state = 4;
}
while (parse_state == 3)
{ if (i >= length) parse_state = 5;
ja
}
if (parse_state == 4)
{ if (i >= length) parse_state = 5;
else fmt = s.charAt(i);
i++;
}
if (i < length)
post = s.substring(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
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(java.io.PrintStream s, String fmt, long x)
{ s.print(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(java.io.PrintStream s, String fmt, char x)
{ s.print(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(java.io.PrintStream s, String fmt, String x)
{ s.print(new Text(fmt).form(x));
}
/**
* Converts a string of digits (decimal, octal or hex) to an integer
* @param s a string
ja
/**
* 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
276
277
m
else return parseLong(s, 10);
}
o
while (i < s.length() && Character.isSpace(s.charAt(i))) i++;
if (i < s.length() && s.charAt(i) == '-') { sign = -1; i++; }
else if (i < s.length() && s.charAt(i) == '+') { i++; }
i.c
while (i < s.length())
{ char ch = s.charAt(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
*/
}
}
else if (ch == '.')
{ if (state == 0) state = 1;
else return sign * r;
}
else if (ch == 'e' || ch == 'E')
{ long e = (int)parseLong(s.substring(i + 1), 10);
return sign * r * Math.pow(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 java.lang.IllegalArgumentException();
/**
* Formats a long integer into a string (like sprintf in C)
va
* @param x the number to format
* @return the formatted string
*/
{ s = 1;
if (x < 0) { x = -x; s = -1; }
r = "" + x;
}
else if (fmt == 'o')
r = convert(x, 3, 7, "01234567");
w.
/**
* Formats a character into a string (like sprintf in C)
* @param x the value to format
* @return the formatted string
*/
278
279
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
*/
i.c
{ if (fmt != 's')
throw new java.lang.IllegalArgumentException();
if (precision >= 0) s = s.substring(0, precision);
return pad(s);
}
/**
dil
* a test stub for the format class
*/
279
280
m
Text.print(System.out, "d = |%020d|\n", d);
Text.print(System.out, "d = |%+20d|\n", d);
Text.print(System.out, "d = |% 020d|\n", d);
Text.print(System.out, "d = |%-20d|\n", d);
Text.print(System.out, "d = |%20.8d|\n", d);
Text.print(System.out, "d = |%x|\n", d);
Text.print(System.out, "d = |%20X|\n", d);
o
Text.print(System.out, "d = |%#20x|\n", d);
Text.print(System.out, "d = |%020X|\n", d);
Text.print(System.out, "d = |%20.8x|\n", d);
Text.print(System.out, "d = |%o|\n", d);
i.c
Text.print(System.out, "d = |%020o|\n", d);
Text.print(System.out, "d = |%#20o|\n", d);
Text.print(System.out, "d = |%#020o|\n", d);
Text.print(System.out, "d = |%20.12o|\n", d);
}
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++) s.append(c);
return s.toString();
va
private static String convert(long x, int n, int m, String d)
{ if (x == 0) return "0";
String r = "";
while (x != 0)
{ r = d.charAt((int)(x & m)) + r;
x = x >>> n;
}
return r;
ja
}
else
{ if (fmt == 'o' && alternate && r.length() > 0 && r.charAt(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;
o
private String fixed_Text(double d)
{ String f = "";
i.c
long l = (long)(precision == 0 ? d + 0.5 : d);
f = f + l;
return f + frac_part(fr);
dil
}
z = leading_zeroes + l;
z = z.substring(z.length() - precision, z.length());
ja
{ int t = z.length() - 1;
while (t >= 0 && z.charAt(t) == '0') t--;
if (t >= 0 && z.charAt(t) == '.') t--;
z = z.substring(0, t + 1);
}
return z;
}
ww
281
282
d = d * factor;
m
f = f + fixed_Text(d);
o
String p = "000";
if (e >= 0)
{ f = f + "+";
p = p + e;
i.c
}
else
{ f = f + "-";
p = p + (-e);
}
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 java.lang.Object
class java.awt.AWTEventMulticaster (implements java.awt.event.ComponentListener,
java.awt.event.ContainerListener, java.awt.event.FocusListener, java.awt.event.KeyListener,
java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.WindowListener,
java.awt.event.ActionListener, java.awt.event.ItemListener, java.awt.event.AdjustmentListener,
o
java.awt.event.TextListener)
interface java.security.acl.Acl (extends java.security.acl.Owner)
interface java.security.acl.AclEntry (extends java.lang.Cloneable)
interface java.awt.event.ActionListener (extends java.util.EventListener)
interface java.awt.Adjustable
i.c
interface java.awt.event.AdjustmentListener (extends java.util.EventListener)
class java.util.zip.Adler32 (implements java.util.zip.Checksum)
interface java.applet.AppletContext
interface java.applet.AppletStub
class java.lang.reflect.Array
interface java.applet.AudioClip
interface java.beans.BeanInfo
class java.beans.Beans
class java.util.BitSet (implements java.lang.Cloneable, java.io.Serializable)
dil
class java.lang.Boolean (implements java.io.Serializable)
class java.awt.BorderLayout (implements java.awt.LayoutManager2, java.io.Serializable)
class java.text.BreakIterator (implements java.lang.Cloneable, java.io.Serializable)
interface java.awt.peer.ButtonPeer (extends java.awt.peer.ComponentPeer)
class java.util.zip.CRC32 (implements java.util.zip.Checksum)
class java.util.Calendar (implements java.io.Serializable, java.lang.Cloneable)
class java.util.GregorianCalendar
interface java.sql.CallableStatement (extends java.sql.PreparedStatement)
interface java.awt.peer.CanvasPeer (extends java.awt.peer.ComponentPeer)
class java.awt.CardLayout (implements java.awt.LayoutManager2, java.io.Serializable)
va
interface java.security.Certificate
class java.lang.Character (implements java.io.Serializable)
interface java.text.CharacterIterator (extends java.lang.Cloneable)
class java.awt.CheckboxGroup (implements java.io.Serializable)
interface java.awt.peer.CheckboxMenuItemPeer (extends java.awt.peer.MenuItemPeer)
interface java.awt.peer.CheckboxPeer (extends java.awt.peer.ComponentPeer)
interface java.util.zip.Checksum
interface java.awt.peer.ChoicePeer (extends java.awt.peer.ComponentPeer)
ja
java.io.Serializable)
class java.awt.Button
class java.awt.Canvas
class java.awt.Checkbox (implements java.awt.ItemSelectable)
class java.awt.Choice (implements java.awt.ItemSelectable)
class java.awt.Container
class java.awt.Panel
class java.applet.Applet
class java.awt.ScrollPane
class java.awt.Window
283
284
class java.awt.Dialog
class java.awt.FileDialog
m
class java.awt.Frame (implements java.awt.MenuContainer)
class java.awt.Label
class java.awt.List (implements java.awt.ItemSelectable)
class java.awt.Scrollbar (implements java.awt.Adjustable)
class java.awt.TextComponent
class java.awt.TextArea
class java.awt.TextField
class java.awt.event.ComponentAdapter (implements java.awt.event.ComponentListener)
o
interface java.awt.event.ComponentListener (extends java.util.EventListener)
interface java.awt.peer.ComponentPeer
interface java.sql.Connection
class java.lang.reflect.Constructor (implements java.lang.reflect.Member)
class java.awt.event.ContainerAdapter (implements java.awt.event.ContainerListener)
i.c
interface java.awt.event.ContainerListener (extends java.util.EventListener)
interface java.awt.peer.ContainerPeer (extends java.awt.peer.ComponentPeer)
class java.net.ContentHandler
interface java.net.ContentHandlerFactory
class java.awt.Cursor (implements java.io.Serializable)
interface java.beans.Customizer
interface java.rmi.dgc.DGC (extends java.rmi.Remote)
interface java.security.interfaces.DSAKey
dil
interface java.security.interfaces.DSAKeyPairGenerator
interface java.security.interfaces.DSAParams
interface java.security.interfaces.DSAPrivateKey (extends java.security.interfaces.DSAKey, java.security.PrivateKey)
interface java.security.interfaces.DSAPublicKey (extends java.security.interfaces.DSAKey, java.security.PublicKey)
class java.awt.datatransfer.DataFlavor
interface java.io.DataInput
interface java.io.DataOutput
interface java.sql.DatabaseMetaData
class java.net.DatagramPacket
class java.net.DatagramSocket
va
class java.net.MulticastSocket
class java.net.DatagramSocketImpl (implements java.net.SocketOptions)
class java.util.Date (implements java.io.Serializable, java.lang.Cloneable)
class java.sql.Date
class java.sql.Time
class java.sql.Timestamp
class java.text.DateFormatSymbols (implements java.io.Serializable, java.lang.Cloneable)
interface sun.tools.debug.DebuggerCallback
class java.text.DecimalFormatSymbols (implements java.lang.Cloneable, java.io.Serializable)
ja
class java.util.zip.Deflater
interface java.awt.peer.DialogPeer (extends java.awt.peer.WindowPeer)
class java.util.Dictionary
class java.util.Hashtable (implements java.lang.Cloneable, java.io.Serializable)
class java.util.Properties
class java.security.Provider
w.
class java.awt.AWTEvent
class java.awt.event.ActionEvent
class java.awt.event.AdjustmentEvent
class java.awt.event.ComponentEvent
class java.awt.event.ContainerEvent
class java.awt.event.FocusEvent
class java.awt.event.InputEvent
class java.awt.event.KeyEvent
class java.awt.event.MouseEvent
class java.awt.event.PaintEvent
284
285
class java.awt.event.WindowEvent
class java.awt.event.ItemEvent
m
class java.awt.event.TextEvent
class sunw.util.EventObject
class java.beans.PropertyChangeEvent
class java.awt.EventQueue
interface java.io.Externalizable (extends java.io.Serializable)
class java.beans.FeatureDescriptor
class java.beans.BeanDescriptor
class java.beans.EventSetDescriptor
o
class java.beans.MethodDescriptor
class java.beans.ParameterDescriptor
class java.beans.PropertyDescriptor
class java.beans.IndexedPropertyDescriptor
class java.lang.reflect.Field (implements java.lang.reflect.Member)
i.c
class sun.tools.debug.Field
class sun.tools.debug.RemoteField (implements sun.tools.debug.AgentConstants)
class java.text.FieldPosition
class java.io.File (implements java.io.Serializable)
class java.io.FileDescriptor
interface java.awt.peer.FileDialogPeer (extends java.awt.peer.DialogPeer)
interface java.net.FileNameMap
interface java.io.FilenameFilter
dil
class java.awt.image.FilteredImageSource (implements java.awt.image.ImageProducer)
class java.awt.FlowLayout (implements java.awt.LayoutManager, java.io.Serializable)
class java.awt.event.FocusAdapter (implements java.awt.event.FocusListener)
interface java.awt.event.FocusListener (extends java.util.EventListener)
class java.awt.Font (implements java.io.Serializable)
class java.awt.FontMetrics (implements java.io.Serializable)
interface java.awt.peer.FontPeer
class java.text.Format (implements java.io.Serializable, java.lang.Cloneable)
class java.text.DateFormat (implements java.lang.Cloneable)
class java.text.SimpleDateFormat
va
class java.text.MessageFormat
class java.text.NumberFormat (implements java.lang.Cloneable)
class java.text.ChoiceFormat
class java.text.DecimalFormat
interface java.awt.peer.FramePeer (extends java.awt.peer.WindowPeer)
class java.awt.Graphics
class java.awt.GridBagConstraints (implements java.lang.Cloneable, java.io.Serializable)
class java.awt.GridBagLayout (implements java.awt.LayoutManager2, java.io.Serializable)
class java.awt.GridLayout (implements java.awt.LayoutManager, java.io.Serializable)
ja
class java.io.InputStream
class java.io.ByteArrayInputStream
class java.io.FileInputStream
class java.io.FilterInputStream
class java.io.BufferedInputStream
class java.util.zip.CheckedInputStream
class java.io.DataInputStream (implements java.io.DataInput)
class java.security.DigestInputStream
class java.util.zip.InflaterInputStream
class java.util.zip.GZIPInputStream
285
286
m
class java.io.PushbackInputStream
class java.io.ObjectInputStream (implements java.io.ObjectInput, java.io.ObjectStreamConstants)
class java.io.PipedInputStream
class java.io.SequenceInputStream
class java.io.StringBufferInputStream
class java.awt.Insets (implements java.lang.Cloneable, java.io.Serializable)
class java.beans.Introspector
interface java.awt.event.ItemListener (extends java.util.EventListener)
o
interface java.awt.ItemSelectable
interface java.security.Key (extends java.io.Serializable)
class java.awt.event.KeyAdapter (implements java.awt.event.KeyListener)
interface java.awt.event.KeyListener (extends java.util.EventListener)
class java.security.KeyPair
i.c
class java.security.KeyPairGenerator
interface java.awt.peer.LabelPeer (extends java.awt.peer.ComponentPeer)
interface java.awt.LayoutManager
interface java.awt.LayoutManager2 (extends java.awt.LayoutManager)
class java.rmi.dgc.Lease (implements java.io.Serializable)
interface java.awt.peer.LightweightPeer (extends java.awt.peer.ComponentPeer)
interface java.awt.peer.ListPeer (extends java.awt.peer.ComponentPeer)
interface java.rmi.server.LoaderHandler
dil
class sun.tools.debug.LocalVariable
class sun.tools.debug.RemoteStackVariable (implements sun.tools.debug.AgentConstants)
class java.util.Locale (implements java.lang.Cloneable, java.io.Serializable)
class java.rmi.registry.LocateRegistry
class java.lang.Math
class java.awt.MediaTracker (implements java.io.Serializable)
interface java.lang.reflect.Member
class java.awt.image.MemoryImageSource (implements java.awt.image.ImageProducer)
interface java.awt.peer.MenuBarPeer (extends java.awt.peer.MenuComponentPeer)
class java.awt.MenuComponent (implements java.io.Serializable)
va
class java.awt.MenuBar (implements java.awt.MenuContainer)
class java.awt.MenuItem
class java.awt.CheckboxMenuItem (implements java.awt.ItemSelectable)
class java.awt.Menu (implements java.awt.MenuContainer)
class java.awt.PopupMenu
interface java.awt.peer.MenuComponentPeer
interface java.awt.MenuContainer
interface java.awt.peer.MenuItemPeer (extends java.awt.peer.MenuComponentPeer)
interface java.awt.peer.MenuPeer (extends java.awt.peer.MenuItemPeer)
ja
class java.lang.Integer
class java.lang.Long
class java.lang.Short
class java.rmi.server.ObjID (implements java.io.Serializable)
interface java.io.ObjectInput (extends java.io.DataInput)
interface java.io.ObjectInputValidation
interface java.io.ObjectOutput (extends java.io.DataOutput)
class java.io.ObjectStreamClass (implements java.io.Serializable)
class java.util.Observable
interface java.util.Observer
286
287
class java.rmi.server.Operation
class java.io.OutputStream
m
class java.io.ByteArrayOutputStream
class java.io.FileOutputStream
class java.io.FilterOutputStream
class java.io.BufferedOutputStream
class java.util.zip.CheckedOutputStream
class java.io.DataOutputStream (implements java.io.DataOutput)
class java.util.zip.DeflaterOutputStream
class java.util.zip.GZIPOutputStream
o
class java.util.zip.ZipOutputStream (implements java.util.zip.ZipConstants)
class java.security.DigestOutputStream
class java.io.PrintStream
class java.rmi.server.LogStream
class java.io.ObjectOutputStream (implements java.io.ObjectOutput, java.io.ObjectStreamConstants)
i.c
class java.io.PipedOutputStream
interface java.security.acl.Owner
interface java.awt.peer.PanelPeer (extends java.awt.peer.ContainerPeer)
class java.text.ParsePosition
interface java.security.acl.Permission
class java.awt.image.PixelGrabber (implements java.awt.image.ImageConsumer)
class java.awt.Point (implements java.io.Serializable)
class java.awt.Polygon (implements java.awt.Shape, java.io.Serializable)
dil
interface java.awt.peer.PopupMenuPeer (extends java.awt.peer.MenuPeer)
interface java.sql.PreparedStatement (extends java.sql.Statement)
interface java.security.Principal
interface java.awt.PrintGraphics
class java.awt.PrintJob
interface java.security.PrivateKey (extends java.security.Key)
class java.lang.Process
interface java.beans.PropertyChangeListener (extends java.util.EventListener)
class java.beans.PropertyChangeSupport (implements java.io.Serializable)
interface java.beans.PropertyEditor
va
class java.beans.PropertyEditorManager
class java.beans.PropertyEditorSupport (implements java.beans.PropertyEditor)
interface java.security.PublicKey (extends java.security.Key)
class java.rmi.server.RMIClassLoader
interface java.rmi.server.RMIFailureHandler
class java.rmi.server.RMISocketFactory
class java.util.Random (implements java.io.Serializable)
class java.security.SecureRandom
class java.io.RandomAccessFile (implements java.io.DataOutput, java.io.DataInput)
ja
class java.io.Reader
class java.io.BufferedReader
class java.io.LineNumberReader
class java.io.CharArrayReader
class java.io.FilterReader
class java.io.PushbackReader
w.
class java.io.InputStreamReader
class java.io.FileReader
class java.io.PipedReader
class java.io.StringReader
class java.awt.Rectangle (implements java.awt.Shape, java.io.Serializable)
interface java.rmi.registry.Registry (extends java.rmi.Remote)
interface java.rmi.registry.RegistryHandler
interface java.rmi.Remote
interface java.rmi.server.RemoteCall
ww
class sun.tools.debug.RemoteDebugger
class java.rmi.server.RemoteObject (implements java.rmi.Remote, java.io.Serializable)
class java.rmi.server.RemoteServer
class java.rmi.server.UnicastRemoteObject
class java.rmi.server.RemoteStub
interface java.rmi.server.RemoteRef (extends java.io.Externalizable)
class sun.tools.debug.RemoteValue (implements sun.tools.debug.AgentConstants)
class sun.tools.debug.RemoteBoolean
class sun.tools.debug.RemoteByte
class sun.tools.debug.RemoteChar
287
288
class sun.tools.debug.RemoteDouble
class sun.tools.debug.RemoteFloat
m
class sun.tools.debug.RemoteInt
class sun.tools.debug.RemoteLong
class sun.tools.debug.RemoteObject
class sun.tools.debug.RemoteArray
class sun.tools.debug.RemoteClass
class sun.tools.debug.RemoteString
class sun.tools.debug.RemoteThread
class sun.tools.debug.RemoteThreadGroup
o
class sun.tools.debug.RemoteShort
class java.util.ResourceBundle
class java.util.ListResourceBundle
class java.util.PropertyResourceBundle
interface java.sql.ResultSet
i.c
interface java.sql.ResultSetMetaData
interface java.lang.Runnable
class java.lang.Runtime
interface java.awt.peer.ScrollPanePeer (extends java.awt.peer.ContainerPeer)
interface java.awt.peer.ScrollbarPeer (extends java.awt.peer.ComponentPeer)
class java.security.Security
class java.lang.SecurityManager
class java.rmi.RMISecurityManager
dil
interface java.io.Serializable
interface sunw.io.Serializable (extends java.io.Serializable)
interface java.rmi.server.ServerRef (extends java.rmi.server.RemoteRef)
class java.net.ServerSocket
interface java.awt.Shape
class java.security.Signature
class java.beans.SimpleBeanInfo (implements java.beans.BeanInfo)
interface java.rmi.server.Skeleton
class java.net.Socket
class java.net.SocketImpl (implements java.net.SocketOptions)
va
interface java.net.SocketImplFactory
class sun.tools.debug.StackFrame
class sun.tools.debug.RemoteStackFrame
interface java.sql.Statement
class java.io.StreamTokenizer
class java.lang.String (implements java.io.Serializable)
class java.lang.StringBuffer (implements java.io.Serializable)
class java.text.StringCharacterIterator (implements java.text.CharacterIterator)
class java.awt.datatransfer.StringSelection (implements java.awt.datatransfer.Transferable,
ja
java.awt.datatransfer.ClipboardOwner)
class java.util.StringTokenizer (implements java.util.Enumeration)
class java.lang.System
interface java.awt.peer.TextAreaPeer (extends java.awt.peer.TextComponentPeer)
interface java.awt.peer.TextComponentPeer (extends java.awt.peer.ComponentPeer)
interface java.awt.peer.TextFieldPeer (extends java.awt.peer.TextComponentPeer)
w.
class java.lang.ExceptionInInitializerError
class java.lang.IncompatibleClassChangeError
class java.lang.AbstractMethodError
class java.lang.IllegalAccessError
class java.lang.InstantiationError
class java.lang.NoSuchFieldError
class java.lang.NoSuchMethodError
class java.lang.NoClassDefFoundError
class java.lang.UnsatisfiedLinkError
class java.lang.VerifyError
288
289
class java.lang.ThreadDeath
class java.lang.VirtualMachineError
m
class java.lang.InternalError
class java.lang.OutOfMemoryError
class java.lang.StackOverflowError
class java.lang.UnknownError
class java.lang.Exception
class java.awt.AWTException
class java.security.acl.AclNotFoundException
class java.rmi.AlreadyBoundException
o
class java.lang.ClassNotFoundException
class java.lang.CloneNotSupportedException
class java.rmi.server.ServerCloneException
class java.util.zip.DataFormatException
class java.security.DigestException
i.c
class java.io.IOException
class java.io.CharConversionException
class java.io.EOFException
class java.io.FileNotFoundException
class java.io.InterruptedIOException
class java.net.MalformedURLException
class java.io.ObjectStreamException
class java.io.InvalidClassException
dil
class java.io.InvalidObjectException
class java.io.NotActiveException
class java.io.NotSerializableException
class java.io.OptionalDataException
class java.io.StreamCorruptedException
class java.io.WriteAbortedException
class java.net.ProtocolException
class java.rmi.RemoteException
class java.rmi.AccessException
class java.rmi.ConnectException
va
class java.rmi.ConnectIOException
class java.rmi.server.ExportException
class java.rmi.server.SocketSecurityException
class java.rmi.MarshalException
class java.rmi.NoSuchObjectException
class java.rmi.ServerError
class java.rmi.ServerException
class java.rmi.ServerRuntimeException
class java.rmi.server.SkeletonMismatchException
ja
class java.rmi.server.SkeletonNotFoundException
class java.rmi.StubNotFoundException
class java.rmi.UnexpectedException
class java.rmi.UnknownHostException
class java.rmi.UnmarshalException
class java.net.SocketException
w.
class java.net.BindException
class java.net.ConnectException
class java.net.NoRouteToHostException
class java.io.SyncFailedException
class java.io.UTFDataFormatException
class java.net.UnknownHostException
class java.net.UnknownServiceException
class java.io.UnsupportedEncodingException
class java.util.zip.ZipException
ww
class java.lang.IllegalAccessException
class java.lang.InstantiationException
class java.lang.InterruptedException
class java.beans.IntrospectionException
class java.lang.reflect.InvocationTargetException
class java.security.KeyException
class java.security.InvalidKeyException
class java.security.KeyManagementException
class java.security.acl.LastOwnerException
class sun.tools.debug.NoSessionException
289
290
class java.security.NoSuchAlgorithmException
class java.lang.NoSuchFieldException
m
class sun.tools.debug.NoSuchLineNumberException
class java.lang.NoSuchMethodException
class java.security.NoSuchProviderException
class java.rmi.NotBoundException
class java.security.acl.NotOwnerException
class java.text.ParseException
class java.beans.PropertyVetoException
class java.lang.RuntimeException
o
class java.lang.ArithmeticException
class java.lang.ArrayStoreException
class java.lang.ClassCastException
class java.util.EmptyStackException
class java.lang.IllegalArgumentException
i.c
class java.text.FormatException
class java.lang.IllegalThreadStateException
class java.security.InvalidParameterException
class java.lang.NumberFormatException
class java.lang.IllegalMonitorStateException
class java.lang.IllegalStateException
class java.awt.IllegalComponentStateException
class java.lang.IndexOutOfBoundsException
dil
class java.lang.ArrayIndexOutOfBoundsException
class java.lang.StringIndexOutOfBoundsException
class java.util.MissingResourceException
class java.lang.NegativeArraySizeException
class java.util.NoSuchElementException
class java.lang.NullPointerException
class java.security.ProviderException
class java.lang.SecurityException
class java.rmi.RMISecurityException
class java.sql.SQLException
va
class java.sql.SQLWarning
class java.sql.DataTruncation
class java.rmi.server.ServerNotActiveException
class java.security.SignatureException
class java.util.TooManyListenersException
class java.awt.datatransfer.UnsupportedFlavorException
class java.util.TimeZone (implements java.io.Serializable, java.lang.Cloneable)
class java.util.SimpleTimeZone
class java.awt.Toolkit
ja
interface java.awt.datatransfer.Transferable
class java.sql.Types
class java.rmi.server.UID (implements java.io.Serializable)
class java.net.URL (implements java.io.Serializable)
class java.net.URLConnection
class java.net.HttpURLConnection
w.
class java.net.URLEncoder
class java.net.URLStreamHandler
interface java.net.URLStreamHandlerFactory
interface java.rmi.server.Unreferenced
class java.rmi.dgc.VMID (implements java.io.Serializable)
class java.util.Vector (implements java.lang.Cloneable, java.io.Serializable)
class java.util.Stack
interface java.beans.VetoableChangeListener (extends java.util.EventListener)
class java.beans.VetoableChangeSupport (implements java.io.Serializable)
ww
interface java.beans.Visibility
class java.lang.Void
class java.awt.event.WindowAdapter (implements java.awt.event.WindowListener)
interface java.awt.event.WindowListener (extends java.util.EventListener)
interface java.awt.peer.WindowPeer (extends java.awt.peer.ContainerPeer)
class java.io.Writer
class java.io.BufferedWriter
class java.io.CharArrayWriter
class java.io.FilterWriter
class java.io.OutputStreamWriter
290
291
m
Not : Bu liste ingilizce açıklamalarıyla verilmiştir. Listenin Türkçesi hazırlanacaktır.
o
An image which was being tracked asynchronously was aborted before production was complete.
ABORTED. Static variable in class java.awt.MediaTracker
Flag indicating the download of some media was aborted.
abortGrabbing(). Method in class java.awt.image.PixelGrabber
Request the PixelGrabber to abort the image fetch.
abs(). Method in class java.math.BigDecimal
i.c
Returns a BigDecimal whose value is the absolute value of this number, and whose scale is this.scale().
abs(). Method in class java.math.BigInteger
Returns a BigInteger whose value is the absolute value of this number.
abs(double). Static method in class java.lang.Math
Returns the absolute value of a double value.
abs(float). Static method in class java.lang.Math
Returns the absolute value of a float value.
abs(int). Static method in class java.lang.Math
Returns the absolute value of an int value.
abs(long). Static method in class java.lang.Math
dil
Returns the absolute value of a long value.
ABSTRACT. Static variable in class java.lang.reflect.Modifier
AbstractMethodError(). Constructor for class java.lang.AbstractMethodError
Constructs an AbstractMethodError with no detail message.
AbstractMethodError(String). Constructor for class java.lang.AbstractMethodError
Constructs an AbstractMethodError with the specified detail message.
accept(). Method in class java.net.ServerSocket
Listens for a connection to be made to this socket and accepts it.
accept(File, String). Method in interface java.io.FilenameFilter
Tests if a specified file should be included in a file list.
va
accept(SocketImpl). Method in class java.net.SocketImpl
Accepts a connection.
acceptsURL(String). Method in interface java.sql.Driver
Returns true if the driver thinks that it can open a connection to the given URL.
AccessException(String). Constructor for class java.rmi.AccessException
Create a new AccessException with a description.
AccessException(String, Exception). Constructor for class java.rmi.AccessException
Create a new AccessException with a description and detail exception.
AclNotFoundException(). Constructor for class java.security.acl.AclNotFoundException
Constructs an AclNotFoundException.
ja
Marks the first integer id for the range of action event ids.
ACTION_LAST. Static variable in class java.awt.event.ActionEvent
Marks the last integer id for the range of action event ids.
ACTION_PERFORMED. Static variable in class java.awt.event.ActionEvent
An action performed event type.
ActionEvent(Object, int, String). Constructor for class java.awt.event.ActionEvent
Constructs an ActionEvent object with the specified source object.
ActionEvent(Object, int, String, int). Constructor for class java.awt.event.ActionEvent
Constructs an ActionEvent object with the specified source object.
ww
291
292
m
The text color for captions in window borders.
activeCount(). Static method in class java.lang.Thread
Returns the current number of active threads in this thread group.
activeCount(). Method in class java.lang.ThreadGroup
Returns an estimate of the number of active threads in this thread group.
activeGroupCount(). Method in class java.lang.ThreadGroup
Returns an estimate of the number of active groups in this thread group.
AD. Static variable in class java.util.GregorianCalendar
o
Useful constant for GregorianCalendar.
add(ActionListener, ActionListener). Static method in class java.awt.AWTEventMulticaster
Adds action-listener-a with action-listener-b and returns the resulting multicast listener.
add(AdjustmentListener, AdjustmentListener). Static method in class java.awt.AWTEventMulticaster
Adds adjustment-listener-a with adjustment-listener-b and returns the resulting multicast listener.
i.c
add(BigDecimal). Method in class java.math.BigDecimal
Returns a BigDecimal whose value is (this + val), and whose scale is MAX(this.scale(), val.scale).
add(BigInteger). Method in class java.math.BigInteger
Returns a BigInteger whose value is (this + val).
add(Component). Method in class java.awt.Container
Adds the specified component to this container.
add(Component, int). Method in class java.awt.Container
Adds the specified component to this container at the given position in the container's component list.
add(Component, Object). Method in class java.awt.Container
Adds the specified component to this container at the specified index.
dil
add(Component, Object, int). Method in class java.awt.Container
Adds the specified component to this container with the specified constraints at the specified index.
add(ComponentListener, ComponentListener). Static method in class java.awt.AWTEventMulticaster
Adds component-listener-a with component-listener-b and returns the resulting multicast listener.
add(ContainerListener, ContainerListener). Static method in class java.awt.AWTEventMulticaster
Adds container-listener-a with container-listener-b and returns the resulting multicast listener.
add(FocusListener, FocusListener). Static method in class java.awt.AWTEventMulticaster
Adds focus-listener-a with focus-listener-b and returns the resulting multicast listener.
add(int, int). Method in class java.util.Calendar
Date Arithmetic function.
add(int, int). Method in class java.util.GregorianCalendar
va
Overrides Calendar Date Arithmetic function.
add(int, int). Method in class java.awt.Rectangle
Adds a point to a rectangle.
add(ItemListener, ItemListener). Static method in class java.awt.AWTEventMulticaster
Adds item-listener-a with item-listener-b and returns the resulting multicast listener.
add(KeyListener, KeyListener). Static method in class java.awt.AWTEventMulticaster
Adds key-listener-a with key-listener-b and returns the resulting multicast listener.
add(Menu). Method in class java.awt.MenuBar
Adds the specified menu to the menu bar.
add(MenuItem). Method in class java.awt.Menu
ja
292
293
Adds the specified action listener to receive action events from this list.
addActionListener(ActionListener). Method in class java.awt.MenuItem
Adds the specified action listener to receive action events from this menu item.
m
addActionListener(ActionListener). Method in class java.awt.TextField
Adds the specified action listener to recieve action events from this textfield.
addAdjustmentListener(AdjustmentListener). Method in interface java.awt.Adjustable
Add a listener to recieve adjustment events when the value of the adjustable object changes.
addAdjustmentListener(AdjustmentListener). Method in class java.awt.Scrollbar
Adds the specified adjustment listener to recieve adjustment events from this scrollbar.
addCertificate(Certificate). Method in class java.security.Identity
Adds a certificate for this identity.
o
addComponentListener(ComponentListener). Method in class java.awt.Component
Adds the specified component listener to receive component events from this component.
addConsumer(ImageConsumer). Method in class java.awt.image.FilteredImageSource
Adds an ImageConsumer to the list of consumers interested in data for this image.
addConsumer(ImageConsumer). Method in interface java.awt.image.ImageProducer
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 java.awt.image.MemoryImageSource
Adds an ImageConsumer to the list of consumers interested in data for this image.
addContainerListener(ContainerListener). Method in class java.awt.Container
Adds the specified container listener to receive container events from this container.
addElement(Object). Method in class java.util.Vector
Adds the specified component to the end of this vector, increasing its size by one.
addEntry(Principal, AclEntry). Method in interface java.security.acl.Acl
Adds an ACL entry to this ACL.
dil
addFocusListener(FocusListener). Method in class java.awt.Component
Adds the specified focus listener to receive focus events from this component.
addHelpMenu(Menu). Method in interface java.awt.peer.MenuBarPeer
addIdentity(Identity). Method in class java.security.IdentityScope
Adds an identity to this identity scope.
addImage(Image, int). Method in class java.awt.MediaTracker
Adds an image to the list of images being tracked.
addImage(Image, int, int, int). Method in class java.awt.MediaTracker
Adds a scaled image to the list of images being tracked.
addImpl(Component, Object, int). Method in class java.awt.Container
Adds the specified component to this container at the specified index.
va
addImpl(Component, Object, int). Method in class java.awt.ScrollPane
Adds the specified component to this scroll pane container.
addInternal(EventListener, EventListener). Static method in class java.awt.AWTEventMulticaster
Returns the resulting multicast listener from adding listener-a and listener-b together.
addItem(MenuItem). Method in interface java.awt.peer.MenuPeer
addItem(String). Method in class java.awt.Choice
Adds an item to this Choice.
addItem(String). Method in class java.awt.List
Adds the specified item to the end of scrolling list.
addItem(String, int). Method in interface java.awt.peer.ChoicePeer
ja
Adds the specified item listener to recieve item events from this checkbox menu item.
addItemListener(ItemListener). Method in class java.awt.Choice
Adds the specified item listener to recieve item events from this choice.
addItemListener(ItemListener). Method in interface java.awt.ItemSelectable
Add a listener to recieve item events when the state of an item changes.
addItemListener(ItemListener). Method in class java.awt.List
Adds the specified item listener to recieve item events from this list.
addKeyListener(KeyListener). Method in class java.awt.Component
Adds the specified key listener to receive key events from this component.
addLayoutComponent(Component, Object). Method in class java.awt.BorderLayout
ww
Adds the specified component to the layout, using the specified constraint object.
addLayoutComponent(Component, Object). Method in class java.awt.CardLayout
Adds the specified component to the layout, using the specified constraint object.
addLayoutComponent(Component, Object). Method in class java.awt.GridBagLayout
Adds the specified component to the layout, using the specified constraint object.
addLayoutComponent(Component, Object). Method in interface java.awt.LayoutManager2
Adds the specified component to the layout, using the specified constraint object.
addLayoutComponent(String, Component). Method in class java.awt.BorderLayout
Replaced by addLayoutComponent(Component, Object).
addLayoutComponent(String, Component). Method in class java.awt.CardLayout
Replaced by addLayoutComponent(Component, Object).
addLayoutComponent(String, Component). Method in class java.awt.FlowLayout
293
294
m
addLayoutComponent(String, Component). Method in class java.awt.GridLayout
Adds the specified component with the specified name to the layout.
addLayoutComponent(String, Component). Method in interface java.awt.LayoutManager
Adds the specified component with the specified name to the layout.
addMember(Principal). Method in interface java.security.acl.Group
Adds the specified member to the group.
addMenu(Menu). Method in interface java.awt.peer.MenuBarPeer
addMouseListener(MouseListener). Method in class java.awt.Component
o
Adds the specified mouse listener to receive mouse events from this component.
addMouseMotionListener(MouseMotionListener). Method in class java.awt.Component
Adds the specified mouse motion listener to receive mouse motion events from this component.
addNotify(). Method in class java.awt.Button
Creates the peer of the button.
i.c
addNotify(). Method in class java.awt.Canvas
Creates the peer of the canvas.
addNotify(). Method in class java.awt.Checkbox
Creates the peer of the Checkbox.
addNotify(). Method in class java.awt.CheckboxMenuItem
Creates the peer of the checkbox item.
addNotify(). Method in class java.awt.Choice
Creates the Choice's peer.
addNotify(). Method in class java.awt.Component
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 java.awt.Container
Notifies the container to create a peer.
addNotify(). Method in class java.awt.Dialog
Creates the frame's peer.
addNotify(). Method in class java.awt.FileDialog
Creates the file dialog's peer.
addNotify(). Method in class java.awt.Frame
Creates the Frame's peer.
addNotify(). Method in class java.awt.Label
Creates the peer for this label.
addNotify(). Method in class java.awt.List
va
Creates the peer for the list.
addNotify(). Method in class java.awt.Menu
Creates the menu's peer.
addNotify(). Method in class java.awt.MenuBar
Creates the menu bar's peer.
addNotify(). Method in class java.awt.MenuItem
Creates the menu item's peer.
addNotify(). Method in class java.awt.Panel
Creates the Panel's peer.
addNotify(). Method in class java.awt.PopupMenu
ja
294
295
m
Adds a separator line, or a hypen, to the menu at the current position.
addSeparator(). Method in interface java.awt.peer.MenuPeer
addSystemThread(). Method in class sun.tools.debug.RemoteDebugger
Add the calling thread to the list of threads which aren't suspended by the RemoteDebugger.
addSystemThread(Thread). Method in class sun.tools.debug.RemoteDebugger
Add the specified thread to the list of threads which aren't suspended by the RemoteDebugger.
addTextListener(TextListener). Method in class java.awt.TextComponent
Adds the specified text event listener to recieve text events from this textcomponent.
o
addVetoableChangeListener(VetoableChangeListener). Method in class java.beans.VetoableChangeSupport
Add a VetoableListener to the listener list.
addWindowListener(WindowListener). Method in class java.awt.Window
Adds the specified window listener to receive window events from this window.
AdjustForGravity(GridBagConstraints, Rectangle). Method in class java.awt.GridBagLayout
i.c
ADJUSTMENT_EVENT_MASK. Static variable in class java.awt.AWTEvent
The event mask for selecting adjustment events.
ADJUSTMENT_FIRST. Static variable in class java.awt.event.AdjustmentEvent
Marks the first integer id for the range of adjustment event ids.
ADJUSTMENT_LAST. Static variable in class java.awt.event.AdjustmentEvent
Marks the last integer id for the range of adjustment event ids.
ADJUSTMENT_VALUE_CHANGED. Static variable in class java.awt.event.AdjustmentEvent
The adjustment value changed event.
AdjustmentEvent(Adjustable, int, int, int). Constructor for class java.awt.event.AdjustmentEvent
Constructs a AdjustmentEvent object with the specified Adjustable source, type, and value.
dil
adjustmentValueChanged(AdjustmentEvent). Method in interface java.awt.event.AdjustmentListener
Invoked when the value of the adjustable has changed.
adjustmentValueChanged(AdjustmentEvent). Method in class java.awt.AWTEventMulticaster
Handles the adjustmentValueChanged event by invoking the adjustmentValueChanged methods on listener-a and listener-b.
Adler32(). Constructor for class java.util.zip.Adler32
after(Date). Method in class java.util.Date
Tests if this date is after the specified date.
after(Object). Method in class java.util.Calendar
Compares the time field records.
after(Object). Method in class java.util.GregorianCalendar
Overrides Calendar Compares the time field records.
va
after(Timestamp). Method in class java.sql.Timestamp
Is this timestamp later than the timestamp argument?
ALLBITS. Static variable in interface java.awt.image.ImageObserver
A static image which was previously drawn is now complete and can be drawn again in its final form.
allowsMultipleSelections(). Method in class java.awt.List
allowThreadSuspension(boolean). Method in class java.lang.ThreadGroup
Used by VM to control lowmem implicit suspension.
allowUserInteraction. Variable in class java.net.URLConnection
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
295
296
m
Appends the string representation of the char array argument to this string buffer.
append(char[], int, int). Method in class java.lang.StringBuffer
Appends the string representation of a subarray of the char array argument to this string buffer.
append(double). Method in class java.lang.StringBuffer
Appends the string representation of the double argument to this string buffer.
append(float). Method in class java.lang.StringBuffer
Appends the string representation of the float argument to this string buffer.
append(int). Method in class java.lang.StringBuffer
o
Appends the string representation of the int argument to this string buffer.
append(long). Method in class java.lang.StringBuffer
Appends the string representation of the long argument to this string buffer.
append(Object). Method in class java.lang.StringBuffer
Appends the string representation of the Object argument to this string buffer.
i.c
append(String). Method in class java.lang.StringBuffer
Appends the string to this string buffer.
append(String). Method in class java.awt.TextArea
Appends the given text to the end.
appendText(String). Method in class java.awt.TextArea
Applet(). Constructor for class java.applet.Applet
appletResize(int, int). Method in interface java.applet.AppletStub
Called when the applet wants to be resized.
applyLocalizedPattern(String). Method in class java.text.DecimalFormat
Apply the given pattern to this Format object.
dil
applyLocalizedPattern(String). Method in class java.text.SimpleDateFormat
Apply the given localized pattern string to this date format.
applyPattern(String). Method in class java.text.ChoiceFormat
Sets the pattern.
applyPattern(String). Method in class java.text.DecimalFormat
Apply the given pattern to this Format object.
applyPattern(String). Method in class java.text.MessageFormat
Sets the pattern.
applyPattern(String). Method in class java.text.SimpleDateFormat
Apply the given unlocalized pattern string to this date format.
APRIL. Static variable in class java.util.Calendar
va
Useful constant for month.
AreaAveragingScaleFilter(int, int). Constructor for class java.awt.image.AreaAveragingScaleFilter
Constructs an AreaAveragingScaleFilter that scales the pixels from its source Image as specified by the width and height
parameters.
areFieldsSet. Variable in class java.util.Calendar
The flag which tells if the time fields are set for the calendar.
arg. Variable in class java.awt.Event
An arbitrary argument.
ArithmeticException(). Constructor for class java.lang.ArithmeticException
Constructs an ArithmeticException with no detail message.
ja
296
297
m
Returns the number of bytes that can be read from this file input stream without blocking.
available(). Method in class java.io.FilterInputStream
Returns the number of bytes that can be read from this input stream without blocking.
available(). Method in class java.io.InputStream
Returns the number of bytes that can be read from this input stream without blocking.
available(). Method in class java.io.LineNumberInputStream
Returns the number of bytes that can be read from this input stream without blocking.
available(). Method in interface java.io.ObjectInput
o
Returns the number of bytes that can be read without blocking.
available(). Method in class java.io.ObjectInputStream
Returns the number of bytes that can be read without blocking.
available(). Method in class java.io.PipedInputStream
Returns the number of bytes that can be read from this input stream without blocking.
i.c
available(). Method in class java.io.PushbackInputStream
Returns the number of bytes that can be read from this input stream without blocking.
available(). Method in class java.io.SequenceInputStream
Returns the number of bytes available on the current stream.
available(). Method in class java.net.SocketImpl
Returns the number of bytes that can be read from this socket without blocking.
available(). Method in class java.io.StringBufferInputStream
Returns the number of bytes that can be read from the input stream without blocking.
avoidingGui(). Method in interface java.beans.Visibility
AWTError(String). Constructor for class java.awt.AWTError
dil
AWTEvent(Event). Constructor for class java.awt.AWTEvent
Constructs an AWTEvent object from the parameters of a 1.0-style event.
AWTEvent(Object, int). Constructor for class java.awt.AWTEvent
Constructs an AWTEvent object with the specified source object and type.
AWTEventMulticaster(EventListener, EventListener). Constructor for class java.awt.AWTEventMulticaster
Creates an event multicaster instance which chains listener-a with listener-b.
AWTException(String). Constructor for class java.awt.AWTException
Constructs an AWTException with the specified detail message.
va
B
297
298
m
Translates a BigInteger and a scale into a BigDecimal.
BigDecimal(double). Constructor for class java.math.BigDecimal
Translates a double into a BigDecimal.
BigDecimal(String). Constructor for class java.math.BigDecimal
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 java.sql.Types
BigInteger(byte[]). Constructor for class java.math.BigInteger
o
Translates a byte array containing the two's-complement representation of a (signed) integer into a BigInteger.
BigInteger(int, byte[]). Constructor for class java.math.BigInteger
Translates the sign-magnitude representation of an integer into a BigInteger.
BigInteger(int, int, Random). Constructor for class java.math.BigInteger
Returns a randomly selected BigInteger with the specified bitLength that is probably prime.
i.c
BigInteger(int, Random). Constructor for class java.math.BigInteger
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 java.math.BigInteger
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 java.math.BigInteger
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 java.sql.Types
bind(InetAddress, int). Method in class java.net.SocketImpl
dil
Binds this socket to the specified port number on the specified host.
bind(int, InetAddress). Method in class java.net.DatagramSocketImpl
Binds a datagram socket to a local port and address.
bind(String, Remote). Static method in class java.rmi.Naming
Binds the name to the specified remote object.
bind(String, Remote). Method in interface java.rmi.registry.Registry
Binds the name to the specified remote object.
BindException(). Constructor for class java.net.BindException
Construct a new BindException with no detailed message.
BindException(String). Constructor for class java.net.BindException
Constructs a new BindException with the specified detail message as to why the bind error occurred.
va
BIT. Static variable in class java.sql.Types
bitCount(). Method in class java.math.BigInteger
Returns the number of bits in the two's complement representation of this number that differ from its sign bit.
bitLength(). Method in class java.math.BigInteger
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 java.util.BitSet
Creates a new bit set.
BitSet(int). Constructor for class java.util.BitSet
Creates a bit set whose initial size is the specified number of bits.
ja
298
299
Constructor.
breakpointEvent(RemoteThread). Method in interface sun.tools.debug.DebuggerCallback
A breakpoint has been hit in the specified thread.
m
BRIEF. Static variable in class java.rmi.server.LogStream
brighter(). Method in class java.awt.Color
Returns a brighter version of this color.
buf. Variable in class java.io.BufferedInputStream
The buffer where data is stored.
buf. Variable in class java.io.BufferedOutputStream
The buffer where data is stored.
buf. Variable in class java.io.ByteArrayInputStream
o
The byte array containing the data.
buf. Variable in class java.io.ByteArrayOutputStream
The buffer where data is stored.
buf. Variable in class java.io.CharArrayReader
Character buffer
i.c
buf. Variable in class java.io.CharArrayWriter
The buffer where data is stored.
buf. Variable in class java.util.zip.DeflaterOutputStream
Output buffer for writing compressed data.
buf. Variable in class java.util.zip.InflaterInputStream
Input buffer for decompression.
buf. Variable in class java.io.PushbackInputStream
The push back buffer.
buffer. Variable in class java.io.PipedInputStream
The circular buffer into which incoming data is placed.
dil
buffer. Variable in class java.io.StringBufferInputStream
The string from which bytes are read.
BufferedInputStream(InputStream). Constructor for class java.io.BufferedInputStream
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 java.io.BufferedInputStream
Creates a new buffered input stream to read data from the specified input stream with the specified buffer size.
BufferedOutputStream(OutputStream). Constructor for class java.io.BufferedOutputStream
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 java.io.BufferedOutputStream
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 java.io.BufferedReader
Create a buffering character-input stream that uses a default-sized input buffer.
BufferedReader(Reader, int). Constructor for class java.io.BufferedReader
Create a buffering character-input stream that uses an input buffer of the specified size.
BufferedWriter(Writer). Constructor for class java.io.BufferedWriter
Create a buffered character-output stream that uses a default-sized output buffer.
BufferedWriter(Writer, int). Constructor for class java.io.BufferedWriter
Create a new buffered character-output stream that uses an output buffer of the given size.
Button(). Constructor for class java.awt.Button
Constructs a Button with no label.
ja
299
300
m
byteValue(). Method in class java.lang.Long
Returns the value of this Long as a byte.
byteValue(). Method in class java.lang.Number
Returns the value of the specified number as a byte.
byteValue(). Method in class java.lang.Short
Returns the value of this Short as a byte.
o
C
i.c
Calendar(). Constructor for class java.util.Calendar
Constructs a Calendar with the default time zone as returned by TimeZone.getDefault(), and the default locale.
Calendar(TimeZone, Locale). Constructor for class java.util.Calendar
Constructs a Calendar with the given time zone and locale.
CANADA. Static variable in class java.util.Locale
Useful constant for country.
CANADA_FRENCH. Static variable in class java.util.Locale
Useful constant for country.
cancel(). Method in interface java.sql.Statement
Cancel can be used by one thread to cancel a statement that is being executed by another thread.
dil
canFilterIndexColorModel. Variable in class java.awt.image.RGBImageFilter
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 java.text.Collator
Decomposition mode value.
canRead(). Method in class java.io.File
Tests if the application can read from the specified file.
Canvas(). Constructor for class java.awt.Canvas
Constructs a new Canvas.
canWrite(). Method in class java.io.File
Tests if the application can write to this file.
va
capacity(). Method in class java.lang.StringBuffer
Returns the current capacity of the String buffer.
capacity(). Method in class java.util.Vector
Returns the current capacity of this vector.
capacityIncrement. Variable in class java.util.Vector
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 java.awt.Event
The CapsLock action-key.
CardLayout(). Constructor for class java.awt.CardLayout
Creates a new card layout with gaps of size zero.
ja
300
301
m
charAt(int). Method in class java.lang.String
Returns the character at the specified index.
charAt(int). Method in class java.lang.StringBuffer
Returns the character at a specific index in this string buffer.
CharConversionException(). Constructor for class java.io.CharConversionException
provides no detailed message
CharConversionException(String). Constructor for class java.io.CharConversionException
provides a detailed message
o
charsWidth(char[], int, int). Method in class java.awt.FontMetrics
Returns the total advance width for showing the specified array of characters in this Font.
charValue(). Method in class java.lang.Character
Returns the value of this Character object.
charWidth(char). Method in class java.awt.FontMetrics
i.c
Returns the advance width of the specified character in this Font.
charWidth(int). Method in class java.awt.FontMetrics
Returns the advance width of the specified character in this Font.
checkAccept(String, int). Method in class java.rmi.RMISecurityManager
For now stubs can't accept connections on any port.
checkAccept(String, int). Method in class java.lang.SecurityManager
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 java.lang.Thread
Determines if the currently running thread has permission to modify this thread.
dil
checkAccess(). Method in class java.lang.ThreadGroup
Determines if the currently running thread has permission to modify this thread group.
checkAccess(Thread). Method in class java.rmi.RMISecurityManager
Stubs are not allowed to manipulate threads.
checkAccess(Thread). Method in class java.lang.SecurityManager
Throws a SecurityException if the calling thread is not allowed to modify the thread argument.
checkAccess(ThreadGroup). Method in class java.rmi.RMISecurityManager
Stubs are not allowed to manipulate thread groups.
checkAccess(ThreadGroup). Method in class java.lang.SecurityManager
Throws a SecurityException if the calling thread is not allowed to modify the thread group argument.
checkAll(). Method in class java.awt.MediaTracker
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 java.awt.MediaTracker
Checks to see if all images have finished loading.
checkAwtEventQueueAccess(). Method in class java.rmi.RMISecurityManager
Checks to see if an client can get access to the AWT event queue (disallowed from stubs).
checkAwtEventQueueAccess(). Method in class java.lang.SecurityManager
Tests if a client can get access to the AWT event queue.
Checkbox(). Constructor for class java.awt.Checkbox
Constructs a Checkbox with an empty label.
Checkbox(String). Constructor for class java.awt.Checkbox
ja
301
302
m
Throws a SecurityException if the calling thread is not allowed to delete the specified file.
CheckedInputStream(InputStream, Checksum). Constructor for class java.util.zip.CheckedInputStream
Creates an input stream using the specified Checksum.
CheckedOutputStream(OutputStream, Checksum). Constructor for class java.util.zip.CheckedOutputStream
Creates an output stream with the specified Checksum.
checkError(). Method in class java.io.PrintStream
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 java.io.PrintWriter
o
Flush the stream and check its error state.
checkExec(String). Method in class java.rmi.RMISecurityManager
Stubs are not allowed to fork processes.
checkExec(String). Method in class java.lang.SecurityManager
Throws a SecurityException if the calling thread is not allowed to create a subprocss.
i.c
checkExit(int). Method in class java.rmi.RMISecurityManager
Stubs are not allowed to exit the VM.
checkExit(int). Method in class java.lang.SecurityManager
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 java.awt.MediaTracker
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 java.awt.MediaTracker
Checks to see if all images tagged with the indicated ID have finished loading.
dil
checkImage(Image, ImageObserver). Method in class java.awt.Component
Returns the status of the construction of a screen representation of the specified image.
checkImage(Image, int, int, ImageObserver). Method in class java.awt.Component
Returns the status of the construction of a scaled screen representation of the specified image.
checkImage(Image, int, int, ImageObserver). Method in interface java.awt.peer.ComponentPeer
checkImage(Image, int, int, ImageObserver). Method in class java.awt.Toolkit
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 java.rmi.RMISecurityManager
Stubs are not allowed to link dynamic libraries.
checkLink(String). Method in class java.lang.SecurityManager
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 java.rmi.RMISecurityManager
For now stubs can't listen on any port.
checkListen(int). Method in class java.lang.SecurityManager
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 java.rmi.RMISecurityManager
Checks to see if client code can access class members.
checkMemberAccess(Class, int). Method in class java.lang.SecurityManager
Tests if a client is allowed to access members.
ja
Checks if the specified permission is part of the permission set in this entry.
checkPermission(Principal, Permission). Method in interface java.security.acl.Acl
Checks whether or not the specified principal has the specified permission.
checkPrintJobAccess(). Method in class java.rmi.RMISecurityManager
Disallow printing from stubs.
checkPrintJobAccess(). Method in class java.lang.SecurityManager
Tests if a client can initiate a print job request.
checkPropertiesAccess(). Method in class java.rmi.RMISecurityManager
Stubs are not allowed to access the entire system properties list, only properties explicitly labeled as accessible to stubs.
checkPropertiesAccess(). Method in class java.lang.SecurityManager
Throws a SecurityException if the calling thread is not allowed to access or modify the system properties.
checkPropertyAccess(String). Method in class java.rmi.RMISecurityManager
302
303
Stubs can access the system property named by key only if its twin key.stub property is set to true.
checkPropertyAccess(String). Method in class java.lang.SecurityManager
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 java.rmi.RMISecurityManager
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 java.lang.SecurityManager
Throws a SecurityException if the calling thread is not allowed to read from the specified file descriptor.
checkRead(String). Method in class java.rmi.RMISecurityManager
Check if a stub can read a particular file.
o
checkRead(String). Method in class java.lang.SecurityManager
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 java.rmi.RMISecurityManager
No file reads are valid from a stub.
checkRead(String, Object). Method in class java.lang.SecurityManager
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 java.rmi.RMISecurityManager
Stubs cannot perform security provider operations.
checkSecurityAccess(String). Method in class java.lang.SecurityManager
Tests access to certain operations for a security API action.
checkSetFactory(). Method in class java.rmi.RMISecurityManager
Check if a stub can set a networking-related object factory.
checkSetFactory(). Method in class java.lang.SecurityManager
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 java.rmi.RMISecurityManager
Checks to see if an client can get access to the System Clipboard (disallowed from stubs).
checkSystemClipboardAccess(). Method in class java.lang.SecurityManager
Tests if a client can get access to the system clipboard.
checkTopLevelWindow(Object). Method in class java.rmi.RMISecurityManager
Allow caller to create top-level windows.
checkTopLevelWindow(Object). Method in class java.lang.SecurityManager
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 java.rmi.RMISecurityManager
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 java.lang.SecurityManager
Throws a SecurityException if the calling thread is not allowed to write to the specified file descriptor.
checkWrite(String). Method in class java.rmi.RMISecurityManager
Check if a Stub can write a particular file.
checkWrite(String). Method in class java.lang.SecurityManager
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 java.awt.peer.ScrollPanePeer
CHINA. Static variable in class java.util.Locale
Useful constant for country.
ja
303
304
m
Constructs a ClassNotFoundException with the specified detail message.
clean(ObjID[], long, VMID, boolean). Method in interface java.rmi.dgc.DGC
The clean call removes the 'vmid' from the reference list of each remote object indicated in 'id's.
clear(). Method in class java.util.Calendar
Clears the values of all the time fields.
clear(). Method in class java.util.Hashtable
Clears this hashtable so that it contains no keys.
clear(). Method in class java.awt.List
o
clear(). Method in interface java.awt.peer.ListPeer
DEPRECATED: Replaced by removeAll().
clear(int). Method in class java.util.BitSet
Sets the bit specified by the index to false.
clear(int). Method in class java.util.Calendar
i.c
Clears the value in the given time field.
clearBit(int). Method in class java.math.BigInteger
Returns a BigInteger whose value is equivalent to this number with the designated bit cleared.
clearBreakpoint(int). Method in class sun.tools.debug.RemoteClass
Clear a breakpoint at a specific address in a class.
clearBreakpointLine(int). Method in class sun.tools.debug.RemoteClass
Clear a breakpoint at a specified line.
clearBreakpointMethod(RemoteField). Method in class sun.tools.debug.RemoteClass
Clear a breakpoint at the start of a specified method.
clearChanged(). Method in class java.util.Observable
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 java.sql.PreparedStatement
304
305
m
Overrides Cloneable
clone(). Method in class java.security.MessageDigest
Returns a clone if the implementation is cloneable.
clone(). Method in class java.text.MessageFormat
Overrides Cloneable
clone(). Method in class java.text.NumberFormat
Overrides Cloneable
clone(). Method in class java.lang.Object
o
Creates a new object of the same class as this object.
clone(). Method in class java.text.RuleBasedCollator
Standard override; no change in semantics.
clone(). Method in class java.security.Signature
Returns a clone if the implementation is cloneable.
i.c
clone(). Method in class java.text.SimpleDateFormat
Overrides Cloneable
clone(). Method in class java.util.SimpleTimeZone
Overrides Cloneable
clone(). Method in class java.text.StringCharacterIterator
Create a copy of this boundary
clone(). Method in class java.util.TimeZone
Overrides Cloneable
clone(). Method in class java.rmi.server.UnicastRemoteObject
Returns a clone of the remote object that is distinct from the original.
dil
clone(). Method in class java.util.Vector
Returns a clone of this vector.
CloneNotSupportedException(). Constructor for class java.lang.CloneNotSupportedException
Constructs a CloneNotSupportedException with no detail message.
CloneNotSupportedException(String). Constructor for class java.lang.CloneNotSupportedException
Constructs a CloneNotSupportedException with the specified detail message.
close(). Method in class java.io.BufferedReader
Close the stream.
close(). Method in class java.io.BufferedWriter
Close the stream.
close(). Method in class java.io.CharArrayReader
va
Close the stream.
close(). Method in class java.io.CharArrayWriter
Close the stream.
close(). Method in interface java.sql.Connection
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 java.net.DatagramSocket
Closes this datagram socket.
close(). Method in class java.net.DatagramSocketImpl
Close the socket.
ja
Closes this input stream and releases any system resources associated with the stream.
close(). Method in class java.io.FilterOutputStream
Closes this output stream and releases any system resources associated with the stream.
close(). Method in class java.io.FilterReader
Close the stream.
close(). Method in class java.io.FilterWriter
Close the stream.
close(). Method in class java.util.zip.GZIPInputStream
Closes the input stream.
close(). Method in class java.util.zip.GZIPOutputStream
ww
Writes remaining compressed data to the output stream and closes the underlying stream.
close(). Method in class java.io.InputStream
Closes this input stream and releases any system resources associated with the stream.
close(). Method in class java.io.InputStreamReader
Close the stream.
close(). Method in interface java.io.ObjectInput
Closes the input stream.
close(). Method in class java.io.ObjectInputStream
Closes the input stream.
close(). Method in interface java.io.ObjectOutput
Closes the stream.
close(). Method in class java.io.ObjectOutputStream
305
306
m
close(). Method in class java.io.OutputStreamWriter
Close the stream.
close(). Method in class java.io.PipedInputStream
Closes this piped input stream and releases any system resources associated with the stream.
close(). Method in class java.io.PipedOutputStream
Closes this piped output stream and releases any system resources associated with this stream.
close(). Method in class java.io.PipedReader
Close the stream.
o
close(). Method in class java.io.PipedWriter
Close the stream.
close(). Method in class java.io.PrintStream
Closes this print stream and releases any resources associated with the underlying output stream.
close(). Method in class java.io.PrintWriter
i.c
Close the stream.
close(). Method in class java.io.PushbackReader
Close the stream.
close(). Method in class java.io.RandomAccessFile
Closes this random access file stream and releases any system resources associated with the stream.
close(). Method in class java.io.Reader
Close the stream.
close(). Method in class sun.tools.debug.RemoteDebugger
Close the connection to the remote debugging agent.
close(). Method in interface java.sql.ResultSet
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 java.io.SequenceInputStream
Closes this input stream and releases any system resources associated with the stream.
close(). Method in class java.net.ServerSocket
Closes this socket.
close(). Method in class java.net.Socket
Closes this socket.
close(). Method in class java.net.SocketImpl
Closes this socket.
close(). Method in interface java.sql.Statement
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 java.io.StringReader
Close the stream.
close(). Method in class java.io.StringWriter
Close the stream.
close(). Method in class java.io.Writer
Close the stream, flushing it first.
close(). Method in class java.util.zip.ZipFile
Closes the ZIP file.
ja
Closes the current ZIP entry and positions the stream for writing the next entry.
Collator(). Constructor for class java.text.Collator
Default constructor.
Color(float, float, float). Constructor for class java.awt.Color
Creates a color with the specified red, green, and blue values in the range (0.0 - 1.0).
Color(int). Constructor for class java.awt.Color
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 java.awt.Color
Creates a color with the specified red, green, and blue values in the range (0 - 255).
ww
306
307
m
columnWidths. Variable in class java.awt.GridBagLayout
COMBINING_SPACING_MARK. Static variable in class java.lang.Character
command(Object). Static method in class java.lang.Compiler
Examines the argument type and its fields and perform some documented operation.
commentChar(int). Method in class java.io.StreamTokenizer
Specified that the character argument starts a single-line comment.
commit(). Method in interface java.sql.Connection
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 java.text.Collator
Compares the source string to the target string according to the collation rules for this Collator.
compare(String, String). Method in class java.text.RuleBasedCollator
Compares the character data stored in two different strings based on the collation rules.
i.c
compareTo(BigDecimal). Method in class java.math.BigDecimal
Returns -1, 0 or 1 as this number is less than, equal to, or greater than val.
compareTo(BigInteger). Method in class java.math.BigInteger
Returns -1, 0 or 1 as this number is less than, equal to, or greater than val.
compareTo(CollationKey). Method in class java.text.CollationKey
Compare this CollationKey to the target CollationKey.
compareTo(String). Method in class java.lang.String
Compares two strings lexicographically.
compileClass(Class). Static method in class java.lang.Compiler
Compiles the specified class.
dil
compileClasses(String). Static method in class java.lang.Compiler
Compiles all classes whose name matches the specified string.
COMPLETE. Static variable in class java.awt.MediaTracker
Flag indicating the download of media completed successfully.
complete(). Method in class java.util.Calendar
Fills in any unset fields in the time field list.
COMPLETESCANLINES. Static variable in interface java.awt.image.ImageConsumer
The pixels will be delivered in (multiples of) complete scanlines at a time.
Component(). Constructor for class java.awt.Component
Constructs a new Component.
COMPONENT_ADDED. Static variable in class java.awt.event.ContainerEvent
va
The component moved event type.
COMPONENT_EVENT_MASK. Static variable in class java.awt.AWTEvent
The event mask for selecting component events.
COMPONENT_FIRST. Static variable in class java.awt.event.ComponentEvent
Marks the first integer id for the range of component event ids.
COMPONENT_HIDDEN. Static variable in class java.awt.event.ComponentEvent
The component hidden event type.
COMPONENT_LAST. Static variable in class java.awt.event.ComponentEvent
Marks the last integer id for the range of component event ids.
COMPONENT_MOVED. Static variable in class java.awt.event.ComponentEvent
ja
307
308
m
componentResized(ComponentEvent). Method in class java.awt.event.ComponentAdapter
componentResized(ComponentEvent). Method in interface java.awt.event.ComponentListener
Invoked when component has been resized.
componentShown(ComponentEvent). Method in class java.awt.AWTEventMulticaster
Handles the componentShown event by invoking the componentShown methods on listener-a and listener-b.
componentShown(ComponentEvent). Method in class java.awt.event.ComponentAdapter
componentShown(ComponentEvent). Method in interface java.awt.event.ComponentListener
Invoked when component has been shown.
o
comptable. Variable in class java.awt.GridBagLayout
computeFields(). Method in class java.util.Calendar
Converts UTC as milliseconds to time field values.
computeFields(). Method in class java.util.GregorianCalendar
Overrides Calendar Converts UTC as milliseconds to time field values.
i.c
computeTime(). Method in class java.util.Calendar
Converts Calendar's time field values to UTC as milliseconds.
computeTime(). Method in class java.util.GregorianCalendar
Overrides Calendar Converts time field values to UTC as milliseconds.
concat(String). Method in class java.lang.String
Concatenates the specified string to the end of this string.
connect(). Method in class java.net.URLConnection
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 java.net.SocketImpl
Connects this socket to the specified port number on the specified host.
dil
connect(PipedInputStream). Method in class java.io.PipedOutputStream
Connects this piped output stream to a receiver.
connect(PipedOutputStream). Method in class java.io.PipedInputStream
Connects this piped input stream to a sender.
connect(PipedReader). Method in class java.io.PipedWriter
Connect the specified piped reader to this writer.
connect(PipedWriter). Method in class java.io.PipedReader
Connect the specified piped writer to this reader.
connect(String, int). Method in class java.net.SocketImpl
Connects this socket to the specified port on the named host.
connect(String, Properties). Method in interface java.sql.Driver
va
Try to make a database connection to the given URL.
connected. Variable in class java.net.URLConnection
If false, this connection object has not created a communications link to the specified URL.
ConnectException(). Constructor for class java.net.ConnectException
Construct a new ConnectException with no detailed message.
ConnectException(String). Constructor for class java.net.ConnectException
Constructs a new ConnectException with the specified detail message as to why the connect error occurred.
ConnectException(String). Constructor for class java.rmi.ConnectException
Create A remote exception with the specified string
ConnectException(String, Exception). Constructor for class java.rmi.ConnectException
ja
Create A remote exception with the specified string, and the exception specified.
ConnectIOException(String). Constructor for class java.rmi.ConnectIOException
Create A remote exception with the specified string
ConnectIOException(String, Exception). Constructor for class java.rmi.ConnectIOException
Create A remote exception with the specified string, and the exception specified.
CONNECTOR_PUNCTUATION. Static variable in class java.lang.Character
consume(). Method in class java.awt.AWTEvent
w.
308
309
m
contains(Object). Method in class java.util.Hashtable
Tests if some key maps into the specified value in this hashtable.
contains(Object). Method in class java.util.Vector
Tests if the specified object is a component in this vector.
contains(Point). Method in class java.awt.Component
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 java.awt.Polygon
o
Determines whether the specified point is inside the Polygon.
contains(Point). Method in class java.awt.Rectangle
Checks whether this rectangle contains the specified point.
containsKey(Object). Method in class java.util.Hashtable
Tests if the specified object is a key in this hashtable.
i.c
ContentHandler(). Constructor for class java.net.ContentHandler
contents. Variable in class java.awt.datatransfer.Clipboard
CONTROL. Static variable in class java.lang.Character
control. Static variable in class java.awt.SystemColor
The background color for control objects.
CONTROL. Static variable in class java.awt.SystemColor
The array index for the control background color.
CONTROL_DK_SHADOW. Static variable in class java.awt.SystemColor
The array index for the control dark shadow color.
CONTROL_HIGHLIGHT. Static variable in class java.awt.SystemColor
dil
The array index for the control highlight color.
CONTROL_LT_HIGHLIGHT. Static variable in class java.awt.SystemColor
The array index for the control light highlight color.
CONTROL_SHADOW. Static variable in class java.awt.SystemColor
The array index for the control shadow color.
CONTROL_TEXT. Static variable in class java.awt.SystemColor
The array index for the control text color.
controlDkShadow. Static variable in class java.awt.SystemColor
The dark shadow color for control objects.
controlDown(). Method in class java.awt.Event
Checks if the control key is down.
va
controlHighlight. Static variable in class java.awt.SystemColor
The light highlight color for control objects.
controlLtHighlight. Static variable in class java.awt.SystemColor
The regular highlight color for control objects.
controlShadow. Static variable in class java.awt.SystemColor
The regular shadow color for control objects.
controlText. Static variable in class java.awt.SystemColor
The text color for control objects.
copyArea(int, int, int, int, int, int). Method in class java.awt.Graphics
Copies an area of the Component by a distance specified by dx and dy to the right and down.
ja
309
310
m
Calculates the number of times that this tokenizer's nextToken method can be called before it generates an exception.
crc. Variable in class java.util.zip.GZIPInputStream
CRC-32 for uncompressed data.
crc. Variable in class java.util.zip.GZIPOutputStream
CRC-32 of uncompressed data.
CRC32(). Constructor for class java.util.zip.CRC32
create(). Method in class java.net.DatagramSocketImpl
Creates a datagram socket
o
create(). Method in class java.awt.Graphics
Creates a new Graphics object that is a copy of this Graphics object.
create(boolean). Method in class java.net.SocketImpl
Creates either a stream or a datagram socket.
create(int, int, int, int). Method in class java.awt.Graphics
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 java.awt.Toolkit
Uses the specified Peer interface to create a new Button.
createCanvas(Canvas). Method in class java.awt.Toolkit
Uses the specified Peer interface to create a new Canvas.
createCheckbox(Checkbox). Method in class java.awt.Toolkit
Uses the specified Peer interface to create a new Checkbox.
createCheckboxMenuItem(CheckboxMenuItem). Method in class java.awt.Toolkit
Uses the specified Peer interface to create a new CheckboxMenuItem.
createChoice(Choice). Method in class java.awt.Toolkit
dil
Uses the specified Peer interface to create a new Choice.
createComponent(Component). Method in class java.awt.Toolkit
Creates a peer for a component or container.
createContentHandler(String). Method in interface java.net.ContentHandlerFactory
Creates a new ContentHandler to read an object from a URLStreamHandler.
createDialog(Dialog). Method in class java.awt.Toolkit
Uses the specified Peer interface to create a new Dialog.
createFileDialog(FileDialog). Method in class java.awt.Toolkit
Uses the specified Peer interface to create a new FileDialog.
createFrame(Frame). Method in class java.awt.Toolkit
Uses the specified Peer interface to create a new Frame.
va
createImage(byte[]). Method in class java.awt.Toolkit
Creates an image which decodes the image stored in the specified byte array.
createImage(byte[], int, int). Method in class java.awt.Toolkit
Creates an image which decodes the image stored in the specified byte array at the specified offset and length.
createImage(ImageProducer). Method in class java.awt.Component
Creates an image from the specified image producer.
createImage(ImageProducer). Method in interface java.awt.peer.ComponentPeer
createImage(ImageProducer). Method in class java.awt.Toolkit
Creates an image with the specified image producer.
createImage(int, int). Method in class java.awt.Component
ja
310
311
SQL statements without parameters are normally executed using Statement objects.
createTextArea(TextArea). Method in class java.awt.Toolkit
Uses the specified Peer interface to create a new TextArea.
m
createTextField(TextField). Method in class java.awt.Toolkit
Uses the specified Peer interface to create a new TextField.
createURLStreamHandler(String). Method in interface java.net.URLStreamHandlerFactory
Creates a new URLStreamHandler instance with the specified protocol.
createWindow(Window). Method in class java.awt.Toolkit
Uses the specified Peer interface to create a new Window.
CropImageFilter(int, int, int, int). Constructor for class java.awt.image.CropImageFilter
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 java.awt.Cursor
The crosshair cursor type.
CROSSHAIR_CURSOR. Static variable in class java.awt.Frame
CTRL_MASK. Static variable in class java.awt.event.ActionEvent
i.c
The control modifier constant.
CTRL_MASK. Static variable in class java.awt.Event
The control modifier constant.
CTRL_MASK. Static variable in class java.awt.event.InputEvent
The control key modifier constant.
CURRENCY_SYMBOL. Static variable in class java.lang.Character
current(). Method in class java.text.BreakIterator
Return character index of the text boundary that was most recently returned by next(), previous(), first(), or last()
current(). Method in interface java.text.CharacterIterator
Get the character at the current position (as returned by getIndex()).
dil
current(). Method in class java.text.StringCharacterIterator
Get the character at the current position (as returned by getIndex()).
currentClassLoader(). Method in class java.lang.SecurityManager
Returns an object describing the most recent class loader executing on the stack.
currentLoadedClass(). Method in class java.lang.SecurityManager
Returns the current Class with a ClassLoader on the execution stack.
currentThread(). Static method in class java.lang.Thread
Returns a reference to the currently executing thread object.
currentTimeMillis(). Static method in class java.lang.System
Returns the current time in milliseconds.
Cursor(int). Constructor for class java.awt.Cursor
va
Creates a new cursor object with the specified type.
cyan. Static variable in class java.awt.Color
The color cyan.
representationClass = representationClass
mimeType = application/x-javaserializedobject
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
311
312
m
DatagramPacket(byte[], int). Constructor for class java.net.DatagramPacket
Constructs a DatagramPacket for receiving packets of length ilength.
DatagramPacket(byte[], int, InetAddress, int). Constructor for class java.net.DatagramPacket
Constructs a datagram packet for sending packets of length ilength to the specified port number on the specified host.
DatagramSocket(). Constructor for class java.net.DatagramSocket
Constructs a datagram socket and binds it to any available port on the local host machine.
DatagramSocket(int). Constructor for class java.net.DatagramSocket
Constructs a datagram socket and binds it to the specified port on the local host machine.
o
DatagramSocket(int, InetAddress). Constructor for class java.net.DatagramSocket
Creates a datagram socket, bound to the specified local address.
DatagramSocketImpl(). Constructor for class java.net.DatagramSocketImpl
DataInputStream(InputStream). Constructor for class java.io.DataInputStream
Creates a new data input stream to read data from the specified input stream.
i.c
DataOutputStream(OutputStream). Constructor for class java.io.DataOutputStream
Creates a new data output stream to write data to the specified underlying output stream.
DataTruncation(int, boolean, boolean, int, int). Constructor for class java.sql.DataTruncation
dil
millisecond.
Date(int, int, int). Constructor for class java.sql.Date
Construct a Date
Date(int, int, int). Constructor for class java.util.Date
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 java.util.Date
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 java.util.Date
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 java.sql.Date
Construct a Date using a milliseconds time value
Date(long). Constructor for class java.util.Date
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 java.util.Date
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 java.text.DateFormat
ja
312
313
Create a DecimalFormat from the given pattern and the symbols for the default locale.
DecimalFormat(String, DecimalFormatSymbols). Constructor for class java.text.DecimalFormat
Create a DecimalFormat from the given pattern and symbols.
m
DecimalFormatSymbols(). Constructor for class java.text.DecimalFormatSymbols
Create a DecimalFormatSymbols object for the default locale.
DecimalFormatSymbols(Locale). Constructor for class java.text.DecimalFormatSymbols
Create a DecimalFormatSymbols object for the given locale.
DECLARED. Static variable in interface java.lang.reflect.Member
Identifies the set of declared members of a class or interface.
decode(InputStream). Method in interface java.security.Certificate
Decodes a certificate from an input stream.
o
decode(String). Static method in class java.lang.Byte
Decodes a String into a Byte.
decode(String). Static method in class java.awt.Color
Gets the specified Color.
decode(String). Static method in class java.awt.Font
i.c
Gets the specified font using the name passed in.
decode(String). Static method in class java.lang.Integer
Decodes a string into an Integer.
decode(String). Static method in class java.lang.Short
Decodes a String into a Short.
def. Variable in class java.util.zip.DeflaterOutputStream
Compressor for this stream.
DEFAULT. Static variable in class java.text.DateFormat
Constant for default style pattern.
DEFAULT_COMPRESSION. Static variable in class java.util.zip.Deflater
dil
Default compression level.
DEFAULT_CURSOR. Static variable in class java.awt.Cursor
The default cursor type (gets set if no cursor is defined).
DEFAULT_CURSOR. Static variable in class java.awt.Frame
DEFAULT_STRATEGY. Static variable in class java.util.zip.Deflater
Default compression strategy.
defaultConstraints. Variable in class java.awt.GridBagLayout
defaultReadObject(). Method in class java.io.ObjectInputStream
Read the non-static and non-transient fields of the current class from this stream.
defaults. Variable in class java.util.Properties
A property list that contains default values for any keys not found in this property list.
va
defaultWriteObject(). Method in class java.io.ObjectOutputStream
Write the non-static and non-transient fields of the current class to this stream.
defineClass(byte[], int, int). Method in class java.lang.ClassLoader
Converts an array of bytes into an instance of class Class.
defineClass(String, byte[], int, int). Method in class java.lang.ClassLoader
Converts an array of bytes to an instance of class Class.
deflate(). Method in class java.util.zip.DeflaterOutputStream
Writes next block of compressed data to the output stream.
deflate(byte[]). Method in class java.util.zip.Deflater
Fills specified buffer with compressed data.
ja
Creates a new output stream with the specified compressor and a default buffer size.
DeflaterOutputStream(OutputStream, Deflater, int). Constructor for class java.util.zip.DeflaterOutputStream
Creates a new output stream with the specified compressor and buffer size.
DELETE. Static variable in class java.awt.Event
The Delete key.
delete(). Method in class java.io.File
Deletes the file specified by this object.
deleteObserver(Observer). Method in class java.util.Observable
Deletes an observer from the set of observers of this object.
deleteObservers(). Method in class java.util.Observable
Clears the observer list so that this object no longer has any observers.
deleteOwner(Principal, Principal). Method in interface java.security.acl.Owner
313
314
Deletes an owner.
deleteShortcut(). Method in class java.awt.MenuItem
Delete any MenuShortcut associated with this MenuItem.
m
deleteShortcut(MenuShortcut). Method in class java.awt.MenuBar
Delete the specified MenuShortcut.
delItem(int). Method in class java.awt.List
Removes an item from the list.
delItem(int). Method in interface java.awt.peer.MenuPeer
delItems(int, int). Method in class java.awt.List
delItems(int, int). Method in interface java.awt.peer.ListPeer
deliverEvent(Event). Method in class java.awt.Component
o
deliverEvent(Event). Method in class java.awt.Container
delMenu(int). Method in interface java.awt.peer.MenuBarPeer
deregisterDriver(Driver). Static method in class java.sql.DriverManager
Drop a Driver from the DriverManager's list.
description. Variable in class java.sql.DriverPropertyInfo
i.c
A brief description of the property.
description(). Method in class sun.tools.debug.RemoteArray
Return a description of the array.
description(). Method in class sun.tools.debug.RemoteClass
Return a (somewhat verbose) description.
description(). Method in class sun.tools.debug.RemoteObject
Return a description of the object.
description(). Method in class sun.tools.debug.RemoteString
Return the string value, or "null"
description(). Method in class sun.tools.debug.RemoteValue
dil
Return a description of the RemoteValue.
deselect(int). Method in class java.awt.List
Deselects the item at the specified index.
deselect(int). Method in interface java.awt.peer.ListPeer
DESELECTED. Static variable in class java.awt.event.ItemEvent
The item de-selected state change type.
DESKTOP. Static variable in class java.awt.SystemColor
The array index for the desktop background color.
desktop. Static variable in class java.awt.SystemColor
The color of the desktop background.
destHeight. Variable in class java.awt.image.ReplicateScaleFilter
va
destroy(). Method in class java.applet.Applet
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 java.lang.Process
Kills the subprocess.
destroy(). Method in class java.lang.Thread
Destroys this thread, without any cleanup.
destroy(). Method in class java.lang.ThreadGroup
Destroys this thread group and all of its subgroups.
destWidth. Variable in class java.awt.image.ReplicateScaleFilter
ja
314
315
Creates a digest output stream, using the specified output stream and message digest.
digit(char, int). Static method in class java.lang.Character
Returns the numeric value of the character ch in the specified radix.
m
Dimension(). Constructor for class java.awt.Dimension
Constructs a Dimension object with 0 width and 0 height.
Dimension(Dimension). Constructor for class java.awt.Dimension
Constructs a Dimension and initializes it to the specified value.
Dimension(int, int). Constructor for class java.awt.Dimension
Constructs a Dimension and initializes it to the specified width and specified height.
DirectColorModel(int, int, int, int). Constructor for class java.awt.image.DirectColorModel
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 java.awt.image.DirectColorModel
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 java.rmi.dgc.DGC
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 java.lang.Compiler
Cause the Compiler to cease operation.
disable(). Method in class java.awt.Component
disable(). Method in interface java.awt.peer.ComponentPeer
DEPRECATED: Replaced by setEnabled(boolean).
disable(). Method in class java.awt.MenuItem
disable(). Method in interface java.awt.peer.MenuItemPeer
DEPRECATED: Replaced by setEnabled(boolean).
disableEvents(long). Method in class java.awt.Component
dil
Disables the events defined by the specified event mask parameter from being delivered to this component.
disableEvents(long). Method in class java.awt.MenuItem
Disables the events defined by the specified event mask parameter from being delivered to this menu item.
disconnect(). Method in class java.net.HttpURLConnection
Close the connection to the server.
dispatch(Remote, RemoteCall, int, long). Method in interface java.rmi.server.Skeleton
Unmarshals arguments, calls the actual remote object implementation, and marshals the return value or any exception.
dispatchEvent(AWTEvent). Method in class java.awt.Component
Dispatches an event to this component or one of its sub components.
dispatchEvent(AWTEvent). Method in class java.awt.MenuComponent
dispose(). Method in interface java.awt.peer.ComponentPeer
va
dispose(). Method in class java.awt.Frame
Disposes of the Frame.
dispose(). Method in class java.awt.Graphics
Dispose of the system resources used by this graphics context.
dispose(). Method in interface java.awt.peer.MenuComponentPeer
dispose(). Method in class java.awt.Window
Disposes of the Window.
divide(BigDecimal, int). Method in class java.math.BigDecimal
Returns a BigDecimal whose value is (this / val), and whose scale is this.scale().
divide(BigDecimal, int, int). Method in class java.math.BigDecimal
ja
Returns a BigDecimal whose value is (this / val), and whose scale is as specified.
divide(BigInteger). Method in class java.math.BigInteger
Returns a BigInteger whose value is (this / val).
divideAndRemainder(BigInteger). Method in class java.math.BigInteger
Returns an array of two BigIntegers.
doesMaxRowSizeIncludeBlobs(). Method in interface java.sql.DatabaseMetaData
Did getMaxRowSize() include LONGVARCHAR and LONGVARBINARY blobs?
w.
315
316
Constructs a newly allocated Double object that represents the primitive double argument.
Double(String). Constructor for class java.lang.Double
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 java.lang.Double
Returns a representation of the specified floating-point value according to the IEEE 754 floating-point "double format" bit
layout.
doubleValue(). Method in class java.math.BigDecimal
Converts the number to a double.
doubleValue(). Method in class java.math.BigInteger
Converts the number to a double.
o
doubleValue(). Method in class java.lang.Byte
Returns the value of this Byte as a double.
doubleValue(). Method in class java.lang.Double
Returns the double value of this Double.
doubleValue(). Method in class java.lang.Float
i.c
Returns the double value of this Float.
doubleValue(). Method in class java.lang.Integer
Returns the value of this Integer as a double.
doubleValue(). Method in class java.lang.Long
Returns the value of this Long as a double.
doubleValue(). Method in class java.lang.Number
Returns the value of the specified number as a double.
doubleValue(). Method in class java.lang.Short
Returns the value of this Short as a double.
DOWN. Static variable in class java.awt.Event
dil
The down arrow action-key.
down(int). Method in class sun.tools.debug.RemoteThread
Change the current stackframe to be one or more frames lower (as in, toward the current program counter).
drain(). Method in class java.io.ObjectOutputStream
Drain any buffered data in ObjectOutputStream.
draw3DRect(int, int, int, int, boolean). Method in class java.awt.Graphics
Draws a 3-D highlighted outline of the specified rectangle.
drawArc(int, int, int, int, int, int). Method in class java.awt.Graphics
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 java.awt.Graphics
va
Draws the specified bytes using the current font and color.
drawChars(char[], int, int, int, int). Method in class java.awt.Graphics
Draws the specified characters using the current font and color.
drawImage(Image, int, int, Color, ImageObserver). Method in class java.awt.Graphics
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 java.awt.Graphics
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 java.awt.Graphics
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 java.awt.Graphics
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 java.awt.Graphics
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 java.awt.Graphics
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 java.awt.Graphics
Draws a line between the coordinates (x1,y1) and (x2,y2) using the current color.
drawOval(int, int, int, int). Method in class java.awt.Graphics
Draws the outline of an oval covering the specified rectangle using the current color.
drawPolygon(int[], int[], int). Method in class java.awt.Graphics
Draws the outline of a polygon defined by arrays of x coordinates and y coordinates using the current color.
drawPolygon(Polygon). Method in class java.awt.Graphics
Draws the outline of a polygon defined by the specified Polygon object using the current color.
ww
316
317
m
Prints a stack trace of the current thread.
o
E_RESIZE_CURSOR. Static variable in class java.awt.Cursor
The east-resize cursor type.
E_RESIZE_CURSOR. Static variable in class java.awt.Frame
EAST. Static variable in class java.awt.BorderLayout
The east layout constraint.
i.c
EAST. Static variable in class java.awt.GridBagConstraints
echoCharIsSet(). Method in class java.awt.TextField
Returns true if this TextField has a character set for echoing.
elementAt(int). Method in class java.util.Vector
Returns the component at the specified index.
elementCount. Variable in class java.util.Vector
The number of valid components in the vector.
elementData. Variable in class java.util.Vector
The array buffer into which the components of the vector are stored.
elements(). Method in class java.util.Dictionary
dil
Returns an enumeration of the values in this dictionary.
elements(). Method in class java.util.Hashtable
Returns an enumeration of the values in this hashtable.
elements(). Method in class java.util.Vector
Returns an enumeration of the components of this vector.
empty(). Method in class java.util.Stack
Tests if this stack is empty.
EmptyStackException(). Constructor for class java.util.EmptyStackException
Constructs a new EmptyStackException with no detail message.
enable(). Static method in class java.lang.Compiler
Cause the Compiler to resume operation.
va
enable(). Method in class java.awt.Component
enable(). Method in interface java.awt.peer.ComponentPeer
DEPRECATED: Replaced by setEnabled(boolean).
enable(). Method in class java.awt.MenuItem
enable(). Method in interface java.awt.peer.MenuItemPeer
DEPRECATED: Replaced by setEnabled(boolean).
enable(boolean). Method in class java.awt.Component
enable(boolean). Method in class java.awt.MenuItem
enableEvents(long). Method in class java.awt.Component
Enables the events defined by the specified event mask parameter to be delivered to this component.
ja
317
318
m
SPI: Resets the digest for further use.
engineSetParameter(String, Object). Method in class java.security.Signature
SPI: Sets the specified algorithm parameter to the specified value.
engineSign(). Method in class java.security.Signature
SPI: Returns the signature bytes of all the data updated so far.
engineUpdate(byte). Method in class java.security.MessageDigest
SPI: Updates the digest using the specified byte.
engineUpdate(byte). Method in class java.security.Signature
o
SPI: Updates the data to be signed or verified using the specified byte.
engineUpdate(byte[], int, int). Method in class java.security.MessageDigest
SPI: Updates the digest using the specified array of bytes, starting at the specified offset.
engineUpdate(byte[], int, int). Method in class java.security.Signature
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 java.security.Signature
SPI: Verifies the passed-in signature.
ENGLISH. Static variable in class java.util.Locale
Useful constant for language.
ensureCapacity(int). Method in class java.lang.StringBuffer
Ensures that the capacity of the buffer is at least equal to the specified minimum.
ensureCapacity(int). Method in class java.util.Vector
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 java.awt.Event
dil
The Enter key.
entries(). Method in interface java.security.acl.Acl
Returns an enumeration of the entries in this ACL.
entries(). Method in class java.util.zip.ZipFile
Returns an enumeration of the ZIP file entries.
enumerate(Thread[]). Static method in class java.lang.Thread
Copies into the specified array every active thread in this thread group and its subgroups.
enumerate(Thread[]). Method in class java.lang.ThreadGroup
Copies into the specified array every active thread in this thread group and its subgroups.
enumerate(Thread[], boolean). Method in class java.lang.ThreadGroup
Copies into the specified array every active thread in this thread group.
va
enumerate(ThreadGroup[]). Method in class java.lang.ThreadGroup
Copies into the specified array references to every active subgroup in this thread group.
enumerate(ThreadGroup[], boolean). Method in class java.lang.ThreadGroup
Copies into the specified array references to every active subgroup in this thread group.
eof. Variable in class java.io.OptionalDataException
True if there is not more data in the buffered part of the stream.
EOFException(). Constructor for class java.io.EOFException
Constructs an EOFException with no detail message.
EOFException(String). Constructor for class java.io.EOFException
Constructs an EOFException with the specified detail message.
ja
key and both either use or don't use the SHIFT key.
equals(Object). Method in class java.math.BigDecimal
Returns true iff x is a BigDecimal whose value is equal to this number.
equals(Object). Method in class java.math.BigInteger
Returns true iff x is a BigInteger whose value is equal to this number.
equals(Object). Method in class java.util.BitSet
Compares this object against the specified object.
equals(Object). Method in class java.lang.Boolean
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
318
319
m
Compares this Constructor against the specified object.
equals(Object). Method in class java.util.Date
Compares two dates.
equals(Object). Method in class java.text.DateFormat
Overrides equals
equals(Object). Method in class java.text.DateFormatSymbols
Override equals
equals(Object). Method in class java.text.DecimalFormat
o
Overrides equals
equals(Object). Method in class java.text.DecimalFormatSymbols
Override equals
equals(Object). Method in class java.awt.Dimension
Checks whether two dimension objects have equal values.
i.c
equals(Object). Method in class java.lang.Double
Compares this object against the specified object.
equals(Object). Method in class java.lang.reflect.Field
Compares this Field against the specified object.
equals(Object). Method in class java.io.File
Compares this object against the specified object.
equals(Object). Method in class java.lang.Float
Compares this object against some other object.
equals(Object). Method in class java.awt.Font
Compares this object to the specifed object.
dil
equals(Object). Method in class java.util.GregorianCalendar
Overrides Calendar Compares the time field records.
equals(Object). Method in class java.security.Identity
Tests for equality between the specified object and this identity.
equals(Object). Method in class java.net.InetAddress
Compares this object against the specified object.
equals(Object). Method in class java.awt.Insets
Checks whether two insets objects are equal.
equals(Object). Method in class java.lang.Integer
Compares this object to the specified object.
equals(Object). Method in class java.util.Locale
va
Compares two Objects for equality.
equals(Object). Method in class java.lang.Long
Compares this object against the specified object.
equals(Object). Method in class java.text.MessageFormat
Equality comparision between two message format objects
equals(Object). Method in class java.lang.reflect.Method
Compares this Method against the specified object.
equals(Object). Method in class java.text.NumberFormat
Overrides equals
equals(Object). Method in class java.lang.Object
ja
319
320
m
Convenience method for comparing the equality of two strings based on this Collator's collation rules.
equals(Timestamp). Method in class java.sql.Timestamp
Test Timestamp values for equality
equalsIgnoreCase(String). Method in class java.lang.String
Compares this String to another object.
ERA. Static variable in class java.util.Calendar
Useful constant for date and time.
ERA_FIELD. Static variable in class java.text.DateFormat
o
Useful constant for ERA field alignment.
err. Static variable in class java.io.FileDescriptor
A handle to the standard error stream.
err. Static variable in class java.lang.System
The "standard" error output stream.
i.c
ERROR. Static variable in interface java.awt.image.ImageObserver
An image which was being tracked asynchronously has encountered an error.
Error(). Constructor for class java.lang.Error
Constructs an Error with no specified detail message.
Error(String). Constructor for class java.lang.Error
Constructs an Error with the specified detail message.
ERRORED. Static variable in class java.awt.MediaTracker
Flag indicating the download of some media encountered an error.
ESCAPE. Static variable in class java.awt.Event
The Escape key.
dil
Event(Object, int, Object). Constructor for class java.awt.Event
Constructs an event with the specified target component, event type, and argument.
Event(Object, long, int, int, int, int, int). Constructor for class java.awt.Event
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 java.awt.Event
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 java.util.EventObject
EventObject(Object). Constructor for class sunw.util.EventObject
EventQueue(). Constructor for class java.awt.EventQueue
va
EventSetDescriptor(Class, String, Class, String). Constructor for class java.beans.EventSetDescriptor
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 java.beans.EventSetDescriptor
This constructor creates an EventSetDescriptor from scratch using string names.
EventSetDescriptor(String, Class, Method[], Method, Method). Constructor for class java.beans.EventSetDescriptor
This constructor creates an EventSetDescriptor from scratch using java.lang.reflect.Method and java.lang.Class objects.
EventSetDescriptor(String, Class, MethodDescriptor[], Method, Method). Constructor for class java.beans.EventSetDescriptor
ja
This constructor creates an EventSetDescriptor from scratch using java.lang.reflect.MethodDescriptor and java.lang.Class
objects.
evt. Variable in class java.awt.Event
The next event.
Exception(). Constructor for class java.lang.Exception
Constructs an Exception with no specified detail message.
Exception(String). Constructor for class java.lang.Exception
w.
320
321
m
A prepared SQL query is executed and its ResultSet is returned.
executeQuery(String). Method in interface java.sql.Statement
Execute a SQL statement that returns a single ResultSet.
executeUpdate(). Method in interface java.sql.PreparedStatement
Execute a SQL INSERT, UPDATE or DELETE statement.
executeUpdate(String). Method in interface java.sql.Statement
Execute a SQL INSERT, UPDATE or DELETE statement.
exists(). Method in class java.io.File
o
Tests if this File exists.
exit(int). Method in class java.lang.Runtime
Terminates the currently running Java Virtual Machine.
exit(int). Static method in class java.lang.System
Terminates the currently running Java Virtual Machine.
i.c
exitValue(). Method in class java.lang.Process
Returns the exit value for the subprocess.
exp(double). Static method in class java.lang.Math
Returns the exponential number e (i.e., 2.718...) raised to the power of a double value.
ExportException(String). Constructor for class java.rmi.server.ExportException
Create A remote exception with the specified string
ExportException(String, Exception). Constructor for class java.rmi.server.ExportException
Create A remote exception with the specified string, and the exception specified.
exportObject(Remote). Static method in class java.rmi.server.UnicastRemoteObject
Export the remote object to make it available to receive incoming calls.
dil
exportObject(Remote, Object). Method in interface java.rmi.server.ServerRef
Find or create a client stub object for the supplied Remote.
321
322
Creates a File instance that represents the file with the specified name in the specified directory.
File(String). Constructor for class java.io.File
Creates a File instance that represents the file whose pathname is the given path argument.
m
File(String, String). Constructor for class java.io.File
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 java.io.FileDescriptor
FileDialog(Frame). Constructor for class java.awt.FileDialog
Creates a file dialog for loading a file.
FileDialog(Frame, String). Constructor for class java.awt.FileDialog
Creates a file dialog for loading a file.
o
FileDialog(Frame, String, int). Constructor for class java.awt.FileDialog
Creates a file dialog with the specified title and mode.
FileInputStream(File). Constructor for class java.io.FileInputStream
Creates an input file stream to read from the specified File object.
FileInputStream(FileDescriptor). Constructor for class java.io.FileInputStream
i.c
Creates an input file stream to read from the specified file descriptor.
FileInputStream(String). Constructor for class java.io.FileInputStream
Creates an input file stream to read from a file with the specified name.
fileNameMap. Static variable in class java.net.URLConnection
FileNotFoundException(). Constructor for class java.io.FileNotFoundException
Constructs a FileNotFoundException with no detail message.
FileNotFoundException(String). Constructor for class java.io.FileNotFoundException
Constructs a FileNotFoundException with the specified detail message.
FileOutputStream(File). Constructor for class java.io.FileOutputStream
Creates a file output stream to write to the specified File object.
dil
FileOutputStream(FileDescriptor). Constructor for class java.io.FileOutputStream
Creates an output file stream to write to the specified file descriptor.
FileOutputStream(String). Constructor for class java.io.FileOutputStream
Creates an output file stream to write to the file with the specified name.
FileOutputStream(String, boolean). Constructor for class java.io.FileOutputStream
Creates an output file with the specified system dependent file name.
FileReader(File). Constructor for class java.io.FileReader
FileReader(FileDescriptor). Constructor for class java.io.FileReader
FileReader(String). Constructor for class java.io.FileReader
FileWriter(File). Constructor for class java.io.FileWriter
FileWriter(FileDescriptor). Constructor for class java.io.FileWriter
va
FileWriter(String). Constructor for class java.io.FileWriter
FileWriter(String, boolean). Constructor for class java.io.FileWriter
fill. Variable in class java.awt.GridBagConstraints
fill(). Method in class java.util.zip.InflaterInputStream
Fills input buffer with more data to decompress.
fill3DRect(int, int, int, int, boolean). Method in class java.awt.Graphics
Paints a 3-D highlighted rectangle filled with the current color.
fillArc(int, int, int, int, int, int). Method in class java.awt.Graphics
Fills an arc bounded by the specified rectangle, starting at startAngle and extending for arcAngle degrees, with the current
color.
ja
322
323
filterRGBPixels(int, int, int, int, int[], int, int). Method in class java.awt.image.RGBImageFilter
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 java.io.FilterWriter
m
Create a new filtered writer.
FINAL. Static variable in class java.lang.reflect.Modifier
finalize(). Method in class java.awt.image.ColorModel
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 java.util.zip.Deflater
Frees the compressor when garbage is collected.
finalize(). Method in class java.io.FileInputStream
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 java.io.FileOutputStream
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 java.awt.Graphics
Disposes of this graphics context once it is no longer referenced.
i.c
finalize(). Method in class java.util.zip.Inflater
Frees the decompressor when garbage is collected.
finalize(). Method in class java.lang.Object
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 java.awt.PrintJob
Ends this print job once it is no longer referenced.
finalize(). Method in class sun.tools.debug.RemoteObject
findClass(String). Method in class sun.tools.debug.RemoteDebugger
Find a specified class.
dil
findColumn(String). Method in interface java.sql.ResultSet
Map a Resultset column name to a ResultSet column index.
findEditor(Class). Static method in class java.beans.PropertyEditorManager
Locate a value editor for a given target type.
findLoadedClass(String). Method in class java.lang.ClassLoader
findSystemClass(String). Method in class java.lang.ClassLoader
Finds the system class with the specified name, loading it in if necessary.
finish(). Method in class java.util.zip.Deflater
When called, indicates that compression should end with the current contents of the input buffer.
finish(). Method in class java.util.zip.DeflaterOutputStream
Finishes writing compressed data to the output stream without closing the underlying stream.
va
finish(). Method in class java.util.zip.GZIPOutputStream
Finishes writing compressed data to the output stream without closing the underlying stream.
finish(). Method in class java.util.zip.ZipOutputStream
Finishes writing the contents of the ZIP output stream without closing the underlying stream.
finished(). Method in class java.util.zip.Deflater
Returns true if the end of the compressed data output stream has been reached.
finished(). Method in class java.util.zip.Inflater
Return true if the end of the compressed data stream has been reached.
firePropertyChange(). Method in class java.beans.PropertyEditorSupport
Report that we have been modified to any interested listeners.
ja
Set the position to getBeginIndex() and return the character at that position.
first(). Method in class java.text.StringCharacterIterator
Set the position to getBeginIndex() and return the character at that position.
first(Container). Method in class java.awt.CardLayout
Flip to the first card.
firstElement(). Method in class java.util.Vector
Returns the first component of this vector.
flipBit(int). Method in class java.math.BigInteger
Returns a BigInteger whose value is equivalent to this number with the designated bit flipped.
FLOAT. Static variable in class java.sql.Types
ww
323
324
m
Returns the float value of this Double.
floatValue(). Method in class java.lang.Float
Returns the float value of this Float object.
floatValue(). Method in class java.lang.Integer
Returns the value of this Integer as a float.
floatValue(). Method in class java.lang.Long
Returns the value of this Long as a float.
floatValue(). Method in class java.lang.Number
o
Returns the value of the specified number as a float.
floatValue(). Method in class java.lang.Short
Returns the value of this Short as a float.
floor(double). Static method in class java.lang.Math
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 java.awt.FlowLayout
Constructs a new Flow Layout with a centered alignment and a default 5-unit horizontal and vertical gap.
FlowLayout(int). Constructor for class java.awt.FlowLayout
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 java.awt.FlowLayout
Constructs a new Flow Layout with the specified alignment and gap values.
flush(). Method in class java.io.BufferedOutputStream
Flushes this buffered output stream.
flush(). Method in class java.io.BufferedWriter
dil
Flush the stream.
flush(). Method in class java.io.CharArrayWriter
Flush the stream.
flush(). Method in class java.io.DataOutputStream
Flushes this data output stream.
flush(). Method in class java.io.FilterOutputStream
Flushes this output stream and forces any buffered output bytes to be written out to the stream.
flush(). Method in class java.io.FilterWriter
Flush the stream.
flush(). Method in class java.awt.Image
Flushes all resources being used by this Image object.
va
flush(). Method in interface java.io.ObjectOutput
Flushes the stream.
flush(). Method in class java.io.ObjectOutputStream
Flushes the stream.
flush(). Method in class java.io.OutputStream
Flushes this output stream and forces any buffered output bytes to be written out.
flush(). Method in class java.io.OutputStreamWriter
Flush the stream.
flush(). Method in class java.io.PipedOutputStream
Flushes this output stream and forces any buffered output bytes to be written out.
ja
Marks the last integer id for the range of focus event ids.
FOCUS_LOST. Static variable in class java.awt.event.FocusEvent
The focus lost event type.
FocusAdapter(). Constructor for class java.awt.event.FocusAdapter
FocusEvent(Component, int). Constructor for class java.awt.event.FocusEvent
Constructs a permanent-level FocusEvent object with the specified source component and type.
FocusEvent(Component, int, boolean). Constructor for class java.awt.event.FocusEvent
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 java.awt.AWTEventMulticaster
Handles the focusGained event by invoking the focusGained methods on listener-a and listener-b.
focusGained(FocusEvent). Method in class java.awt.event.FocusAdapter
324
325
m
Handles the focusLost event by invoking the focusLost methods on listener-a and listener-b.
focusLost(FocusEvent). Method in class java.awt.event.FocusAdapter
focusLost(FocusEvent). Method in interface java.awt.event.FocusListener
Invoked when a component loses the keyboard focus.
following(int). Method in class java.text.BreakIterator
Return the first boundary following the specified offset.
font. Variable in class java.awt.FontMetrics
The actual font.
o
Font(String, int, int). Constructor for class java.awt.Font
Creates a new font with the specified name, style and point size.
FontMetrics(Font). Constructor for class java.awt.FontMetrics
Creates a new FontMetrics object with the specified font.
forClass(). Method in class java.io.ObjectStreamClass
i.c
Return the class in the local VM that this version is mapped to.
forDigit(int, int). Static method in class java.lang.Character
Determines the character representation for a specific digit in the specified radix.
FORMAT. Static variable in class java.lang.Character
Format(). Constructor for class java.text.Format
format(Date). Method in class java.text.DateFormat
Formats a Date into a date/time string.
format(Date, StringBuffer, FieldPosition). Method in class java.text.DateFormat
Formats a Date into a date/time string.
format(Date, StringBuffer, FieldPosition). Method in class java.text.SimpleDateFormat
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 java.text.NumberFormat
Specialization of format.
format(double, StringBuffer, FieldPosition). Method in class java.text.ChoiceFormat
Specialization of format.
format(double, StringBuffer, FieldPosition). Method in class java.text.DecimalFormat
Specialization of format.
format(double, StringBuffer, FieldPosition). Method in class java.text.NumberFormat
Specialization of format.
va
format(long). Method in class java.text.NumberFormat
Specialization of format.
format(long, StringBuffer, FieldPosition). Method in class java.text.ChoiceFormat
Specialization of format.
format(long, StringBuffer, FieldPosition). Method in class java.text.DecimalFormat
Specialization of format.
format(long, StringBuffer, FieldPosition). Method in class java.text.NumberFormat
Specialization of format.
format(Object). Method in class java.text.Format
Formats an object to produce a string.
ja
325
326
m
FRIDAY. Static variable in class java.util.Calendar
Useful constant for days of week.
fromHex(String). Static method in class sun.tools.debug.RemoteValue
Convert hexadecimal strings to ints.
FULL. Static variable in class java.text.DateFormat
Constant for full style pattern.
FULL_DECOMPOSITION. Static variable in class java.text.Collator
Decomposition mode value.
o
G
i.c
gc(). Method in class java.lang.Runtime
Runs the garbage collector.
gc(). Static method in class java.lang.System
Runs the garbage collector.
gc(RemoteObject[]). Method in class sun.tools.debug.RemoteDebugger
Free all objects referenced by the debugger.
gcd(BigInteger). Method in class java.math.BigInteger
Returns a BigInteger whose value is the greatest common denominator of abs(this) and abs(val).
generateKeyPair(). Method in class java.security.KeyPairGenerator
Generates a key pair.
dil
GERMAN. Static variable in class java.util.Locale
Useful constant for language.
GERMANY. Static variable in class java.util.Locale
Useful constant for country.
get(). Method in class sun.tools.debug.RemoteBoolean
Return the boolean's value.
get(). Method in class sun.tools.debug.RemoteByte
Return the byte's value.
get(). Method in class sun.tools.debug.RemoteChar
Return the char's value.
get(). Method in class sun.tools.debug.RemoteDouble
va
Return the double's value.
get(). Method in class sun.tools.debug.RemoteFloat
Return the float's value.
get(). Method in class sun.tools.debug.RemoteInt
Return the int's value.
get(). Method in class sun.tools.debug.RemoteLong
Return the long's value.
get(). Method in class sun.tools.debug.RemoteShort
Return the short's value.
get(int). Method in class java.util.BitSet
ja
326
327
m
Returns the Adjustable object where this event originated.
getAdjustmentType(). Method in class java.awt.event.AdjustmentEvent
Returns the type of adjustment which caused the value changed event.
getAdler(). Method in class java.util.zip.Deflater
Returns the ADLER-32 value of the uncompressed data.
getAdler(). Method in class java.util.zip.Inflater
Returns the ADLER-32 value of the uncompressed data.
getAlgorithm(). Method in interface java.security.Key
o
Returns the standard algorithm name this key is for.
getAlgorithm(). Method in class java.security.KeyPairGenerator
Returns the standard name of the algorithm for this key generator.
getAlgorithm(). Method in class java.security.MessageDigest
Returns a string that identifies the algorithm, independent of implementation details.
i.c
getAlgorithm(). Method in class java.security.Signature
Returns the name of the algorithm for this signature object.
getAlgorithmProperty(String, String). Static method in class java.security.Security
Gets a specified property for an algorithm.
getAlignment(). Method in class java.awt.FlowLayout
Returns the alignment value for this layout, one of LEFT, CENTER, or RIGHT.
getAlignment(). Method in class java.awt.Label
Gets the current alignment of this label.
getAlignmentX(). Method in class java.awt.Component
Returns the alignment along the x axis.
dil
getAlignmentX(). Method in class java.awt.Container
Returns the alignment along the x axis.
getAlignmentY(). Method in class java.awt.Component
Returns the alignment along the y axis.
getAlignmentY(). Method in class java.awt.Container
Returns the alignment along the y axis.
getAllByName(String). Static method in class java.net.InetAddress
Determines all the IP addresses of a host, given the host's name.
getAllowUserInteraction(). Method in class java.net.URLConnection
Returns the value of the allowUserInteraction field for this object.
getAlpha(int). Method in class java.awt.image.ColorModel
va
The subclass must provide a function which provides the alpha color compoment for the specified pixel.
getAlpha(int). Method in class java.awt.image.DirectColorModel
Return the alpha transparency value for the specified pixel in the range 0-255.
getAlpha(int). Method in class java.awt.image.IndexColorModel
Returns the alpha transparency value for the specified pixel in the range 0-255.
getAlphaMask(). Method in class java.awt.image.DirectColorModel
Returns the mask indicating which bits in a pixel contain the alpha transparency component.
getAlphas(byte[]). Method in class java.awt.image.IndexColorModel
Copies the array of alpha transparency values into the given array.
getAmPmStrings(). Method in class java.text.DateFormatSymbols
ja
327
328
m
Get the set of Locales for which TextBoundaries are installed
getAvailableLocales(). Static method in class java.util.Calendar
Gets the set of locales for which Calendars are installed.
getAvailableLocales(). Static method in class java.text.Collator
Get the set of Locales for which Collators are installed.
getAvailableLocales(). Static method in class java.text.DateFormat
Gets the set of locales for which DateFormats are installed.
getAvailableLocales(). Static method in class java.text.NumberFormat
o
Get the set of Locales for which NumberFormats are installed
getBackground(). Method in class java.awt.Component
Gets the background color.
getBeanClass(). Method in class java.beans.BeanDescriptor
getBeanDescriptor(). Method in interface java.beans.BeanInfo
i.c
getBeanDescriptor(). Method in class java.beans.SimpleBeanInfo
Deny knowledge about the class and customizer of the bean.
getBeanInfo(Class). Static method in class java.beans.Introspector
Introspect on a Java bean and learn about all its properties, exposed methods, and events.
getBeanInfo(Class, Class). Static method in class java.beans.Introspector
Introspect on a Java bean and learn all about its properties, exposed methods, below a given "stop" point.
getBeanInfoSearchPath(). Static method in class java.beans.Introspector
getBeginIndex(). Method in interface java.text.CharacterIterator
Return the start index of the text.
getBeginIndex(). Method in class java.text.FieldPosition
dil
Retrieve the index of the first character in the requested field.
getBeginIndex(). Method in class java.text.StringCharacterIterator
Return the start index of the text.
getBestRowIdentifier(String, String, String, int, boolean). Method in interface java.sql.DatabaseMetaData
Get a description of a table's optimal set of columns that uniquely identifies a row.
getBigDecimal(int, int). Method in interface java.sql.CallableStatement
Get the value of a NUMERIC parameter as a java.math.BigDecimal object.
getBigDecimal(int, int). Method in interface java.sql.ResultSet
Get the value of a column in the current row as a java.lang.BigDecimal object.
getBigDecimal(String, int). Method in interface java.sql.ResultSet
Get the value of a column in the current row as a java.lang.BigDecimal object.
va
getBinaryStream(int). Method in interface java.sql.ResultSet
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 java.sql.ResultSet
A column value can be retrieved as a stream of uninterpreted bytes and then read in chunks from the stream.
getBlockIncrement(). Method in interface java.awt.Adjustable
Gets the block value increment for the adjustable object.
getBlockIncrement(). Method in class java.awt.Scrollbar
Gets the block increment for this scrollbar.
getBlue(). Method in class java.awt.Color
Gets the blue component.
ja
Returns the mask indicating which bits in a pixel contain the blue color component.
getBlues(byte[]). Method in class java.awt.image.IndexColorModel
Copies the array of blue color components into the given array.
getBoolean(int). Method in interface java.sql.CallableStatement
Get the value of a BIT parameter as a Java boolean.
getBoolean(int). Method in interface java.sql.ResultSet
Get the value of a column in the current row as a Java boolean.
getBoolean(Object). Method in class java.lang.reflect.Field
Get the value of a field as a boolean on specified object.
getBoolean(Object, int). Static method in class java.lang.reflect.Array
ww
Returns the value of the indexed component in the specified array object, as a boolean.
getBoolean(String). Static method in class java.lang.Boolean
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 java.sql.ResultSet
Get the value of a column in the current row as a Java boolean.
getBoundingBox(). Method in class java.awt.Polygon
getBounds(). Method in class java.awt.Component
Returns the current bounds of this component.
getBounds(). Method in class java.awt.Polygon
Returns the bounding box of the shape.
getBounds(). Method in class java.awt.Rectangle
Returns the bounds of this rectangle.
328
329
m
Return the string buffer itself.
getBundle(String). Static method in class java.util.ResourceBundle
Get the appropriate ResourceBundle subclass.
getBundle(String, Locale). Static method in class java.util.ResourceBundle
Get the appropriate ResourceBundle subclass.
getByName(String). Static method in class java.net.InetAddress
Determines the IP address of a host, given the host's name.
getByte(int). Method in interface java.sql.CallableStatement
o
Get the value of a TINYINT parameter as a Java byte.
getByte(int). Method in interface java.sql.ResultSet
Get the value of a column in the current row as a Java byte.
getByte(Object). Method in class java.lang.reflect.Field
Get the value of a field as a byte on specified object.
i.c
getByte(Object, int). Static method in class java.lang.reflect.Array
Returns the value of the indexed component in the specified array object, as a byte.
getByte(String). Method in interface java.sql.ResultSet
Get the value of a column in the current row as a Java byte.
getBytes(). Method in class java.lang.String
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 java.sql.CallableStatement
Get the value of a SQL BINARY or VARBINARY parameter as a Java byte[]
getBytes(int). Method in interface java.sql.ResultSet
Get the value of a column in the current row as a Java byte array.
dil
getBytes(int, int, byte[], int). Method in class java.lang.String
Copies characters from this string into the destination byte array.
getBytes(String). Method in interface java.sql.ResultSet
Get the value of a column in the current row as a Java byte array.
getBytes(String). Method in class java.lang.String
Convert this String into bytes according to the specified character encoding, storing the result into a new byte array.
getCalendar(). Method in class java.text.DateFormat
Gets the calendar associated with this date/time formatter.
getCanonicalPath(). Method in class java.io.File
Gets the official, canonical path of the File.
getCaretPosition(). Method in class java.awt.TextComponent
va
Returns the position of the text insertion caret for the text component.
getCaretPosition(). Method in interface java.awt.peer.TextComponentPeer
getCatalog(). Method in interface java.sql.Connection
Return the Connection's current catalog name.
getCatalogName(int). Method in interface java.sql.ResultSetMetaData
What's a column's table's catalog name?
getCatalogs(). Method in interface java.sql.DatabaseMetaData
Get the catalog names available in this database.
getCatalogSeparator(). Method in interface java.sql.DatabaseMetaData
What's the separator between catalog and table name?
ja
Create BreakIterator for character-breaks using default locale Returns an instance of a BreakIterator implementing character
breaks.
getCharacterInstance(Locale). Static method in class java.text.BreakIterator
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 java.lang.String
Copies characters from this string into the destination character array.
getChars(int, int, char[], int). Method in class java.lang.StringBuffer
Characters are copied from this string buffer into the destination character array dst.
getCheckboxGroup(). Method in class java.awt.Checkbox
ww
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 java.lang.Class
m
Determines the class loader for the class.
getClassLoader(). Method in class sun.tools.debug.RemoteClass
Return the classloader for this class.
getClassName(). Method in class java.util.MissingResourceException
Gets parameter passed by constructor.
getClazz(). Method in class sun.tools.debug.RemoteObject
Returns the object's class.
getClickCount(). Method in class java.awt.event.MouseEvent
o
Return the number of mouse clicks associated with this event.
getClientHost(). Static method in class java.rmi.server.RemoteServer
Return the hostname of the current client.
getClientHost(). Method in interface java.rmi.server.ServerRef
Return the hostname of the current client.
i.c
getClip(). Method in class java.awt.Graphics
Return a Shape object representing the current clipping area.
getClipBounds(). Method in class java.awt.Graphics
Returns the bounding rectangle of the current clipping area.
getClipRect(). Method in class java.awt.Graphics
getCodeBase(). Method in class java.applet.Applet
Gets the base URL.
getCodeBase(). Method in interface java.applet.AppletStub
Gets the base URL.
getCollationElementIterator(String). Method in class java.text.RuleBasedCollator
dil
Return a CollationElementIterator for the given String.
getCollationKey(String). Method in class java.text.Collator
Transforms the String into a series of bits that can be compared bitwise to other CollationKeys.
getCollationKey(String). Method in class java.text.RuleBasedCollator
Transforms the string into a series of characters that can be compared with CollationKey.compareTo.
getColor(). Method in class java.awt.Graphics
Gets the current color.
getColor(String). Static method in class java.awt.Color
Gets the specified Color property.
getColor(String, Color). Static method in class java.awt.Color
Gets the specified Color property of the specified Color.
va
getColor(String, int). Static method in class java.awt.Color
Gets the specified Color property of the color value.
getColorModel(). Method in class java.awt.Component
Gets the ColorModel used to display the component on the output device.
getColorModel(). Method in interface java.awt.peer.ComponentPeer
getColorModel(). Method in class java.awt.image.PixelGrabber
Get the ColorModel for the pixels stored in the array.
getColorModel(). Method in class java.awt.Toolkit
Returns the ColorModel of the screen.
getColumnCount(). Method in interface java.sql.ResultSetMetaData
ja
330
331
m
Returns the component or subcomponent that contains the specified point.
getComponentAt(Point). Method in class java.awt.Container
Locates the component that contains the specified point.
getComponentCount(). Method in class java.awt.Container
Returns the number of components in this panel.
getComponents(). Method in class java.awt.Container
Gets all the components in this container.
getComponentType(). Method in class java.lang.Class
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 java.util.zip.ZipEntry
Returns the compressed size of the entry data, or -1 if not known.
getConnection(String). Static method in class java.sql.DriverManager
i.c
Attempt to establish a connection to the given database URL.
getConnection(String, Properties). Static method in class java.sql.DriverManager
Attempt to establish a connection to the given database URL.
getConnection(String, String, String). Static method in class java.sql.DriverManager
Attempt to establish a connection to the given database URL.
getConstraints(Component). Method in class java.awt.GridBagLayout
Retrieves the constraints for the specified component.
getConstructor(Class[]). Method in class java.lang.Class
Returns a Constructor object that reflects the specified public constructor of the class represented by this Class object.
getConstructors(). Method in class java.lang.Class
dil
Returns an array containing Constructor objects reflecting all the public constructors of the class represented by this Class
object.
getContainer(). Method in class java.awt.event.ContainerEvent
Returns the container where this event originated.
getContent(). Method in class java.net.URL
Returns the contents of this URL.
getContent(). Method in class java.net.URLConnection
Retrieves the contents of this URL connection.
getContent(URLConnection). Method in class java.net.ContentHandler
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 java.net.URLConnection
Returns the value of the content-encoding header field.
getContentLength(). Method in class java.net.URLConnection
Returns the value of the content-length header field.
getContents(). Method in class java.util.ListResourceBundle
See class description.
getContents(Object). Method in class java.awt.datatransfer.Clipboard
Returns a transferable object representing the current contents of the clipboard.
getContentType(). Method in class java.net.URLConnection
Returns the value of the content-type header field.
ja
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 java.text.NumberFormat
Returns a currency format for the current default locale.
getCurrencyInstance(Locale). Static method in class java.text.NumberFormat
Returns a currency format for the specified locale.
getCurrent(). Method in class java.awt.CheckboxGroup
getCurrentFrame(). Method in class sun.tools.debug.RemoteThread
Get the current stack frame.
ww
331
332
m
What's the name of this database product?
getDatabaseProductVersion(). Method in interface java.sql.DatabaseMetaData
What's the version of this database product?
getDataSize(). Method in class java.sql.DataTruncation
Get the number of bytes of data that should have been transferred.
getDate(). Method in class java.util.Date
Returns the day of the month represented by this date.
getDate(). Method in class java.sql.Time
o
Returns the day of the month represented by this date.
getDate(). Method in class java.net.URLConnection
Returns the value of the date header field.
getDate(int). Method in interface java.sql.CallableStatement
Get the value of a SQL DATE parameter as a java.sql.Date object
i.c
getDate(int). Method in interface java.sql.ResultSet
Get the value of a column in the current row as a java.sql.Date object.
getDate(String). Method in interface java.sql.ResultSet
Get the value of a column in the current row as a java.sql.Date object.
getDateFormatSymbols(). Method in class java.text.SimpleDateFormat
Gets the date/time formatting data.
getDateInstance(). Static method in class java.text.DateFormat
Gets the date formatter with the default formatting style for the default locale.
getDateInstance(int). Static method in class java.text.DateFormat
Gets the date formatter with the given formatting style for the default locale.
dil
getDateInstance(int, Locale). Static method in class java.text.DateFormat
Gets the date formatter with the given formatting style for the given locale.
getDateTimeInstance(). Static method in class java.text.DateFormat
Gets the date/time formatter with the default formatting style for the default locale.
getDateTimeInstance(int, int). Static method in class java.text.DateFormat
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 java.text.DateFormat
Gets the date/time formatter with the given formatting styles for the given locale.
getDay(). Method in class java.util.Date
Returns the day of the week represented by this date.
getDay(). Method in class java.sql.Time
va
Returns the day of the week represented by this date.
getDecimalFormatSymbols(). Method in class java.text.DecimalFormat
Returns the decimal format symbols, which is generally not changed by the programmer or user.
getDecimalSeparator(). Method in class java.text.DecimalFormatSymbols
character used for decimal sign.
getDeclaredClasses(). Method in class java.lang.Class
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 java.lang.Class
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 java.lang.Class
Returns an array of Constructor objects reflecting all the constructors declared by the class represented by this Class object.
getDeclaredField(String). Method in class java.lang.Class
Returns a Field object that reflects the specified declared field of the class or interface represented by this Class object.
getDeclaredFields(). Method in class java.lang.Class
Returns an array of Field objects reflecting all the fields declared by the class or interface represented by this Class object.
w.
332
333
m
getDefaultCursor(). Static method in class java.awt.Cursor
Return the system default cursor.
getDefaultEventIndex(). Method in interface java.beans.BeanInfo
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 java.beans.SimpleBeanInfo
Deny knowledge of a default event.
getDefaultPropertyIndex(). Method in interface java.beans.BeanInfo
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 java.beans.SimpleBeanInfo
Deny knowledge of a default property.
getDefaultRequestProperty(String). Static method in class java.net.URLConnection
Returns the value of the default request property.
i.c
getDefaultStream(). Static method in class java.rmi.server.LogStream
Return the current default stream for new logs.
getDefaultToolkit(). Static method in class java.awt.Toolkit
Returns the default toolkit.
getDefaultTransactionIsolation(). Method in interface java.sql.DatabaseMetaData
What's the database's default transaction isolation level? The values are defined in java.sql.Connection.
getDefaultUseCaches(). Method in class java.net.URLConnection
Returns the default value of a URLConnection's useCaches flag.
getDescent(). Method in class java.awt.FontMetrics
Gets the font descent.
dil
getDigit(). Method in class java.text.DecimalFormatSymbols
character used for a digit in a pattern.
getDirectory(). Method in class java.awt.FileDialog
Gets the directory of the Dialog.
getDisplayCountry(). Method in class java.util.Locale
Getter for display of field to user.
getDisplayCountry(Locale). Method in class java.util.Locale
Getter for display of field to user.
getDisplayLanguage(). Method in class java.util.Locale
Getter for display of field to user.
getDisplayLanguage(Locale). Method in class java.util.Locale
va
Getter for display of field to user.
getDisplayName(). Method in class java.beans.FeatureDescriptor
getDisplayName(). Method in class java.util.Locale
Getter for display of the entire locale to user.
getDisplayName(Locale). Method in class java.util.Locale
Getter for display of the entire locale to user.
getDisplayVariant(). Method in class java.util.Locale
Getter for display of field to user.
getDisplayVariant(Locale). Method in class java.util.Locale
Getter for display of field to user If the localized name is not found, returns the variant code.
ja
333
334
m
getEditorSearchPath(). Static method in class java.beans.PropertyEditorManager
getElement(int). Method in class sun.tools.debug.RemoteArray
Return an array element.
getElements(). Method in class sun.tools.debug.RemoteArray
Returns a copy of the array as instances of RemoteValue.
getElements(int, int). Method in class sun.tools.debug.RemoteArray
Returns a copy of a portion of the array as instances of RemoteValue.
getElementType(). Method in class sun.tools.debug.RemoteArray
o
Return the element type as a "TC_" constant, such as "TC_CHAR".
getEncoded(). Method in interface java.security.Key
Returns the encoded key.
getEncoding(). Method in class java.io.InputStreamReader
Return the name of the encoding being used by this stream.
i.c
getEncoding(). Method in class java.io.OutputStreamWriter
Return the name of the encoding being used by this stream.
getEndIndex(). Method in interface java.text.CharacterIterator
Return the end index of the text.
getEndIndex(). Method in class java.text.FieldPosition
Retrieve the index of the character following the last character in the requested field.
getEndIndex(). Method in class java.text.StringCharacterIterator
Return the end index of the text.
getEntry(String). Method in class java.util.zip.ZipFile
Returns the ZIP file entry for the given path name.
dil
getenv(String). Static method in class java.lang.System
Gets an environment variable.
getEras(). Method in class java.text.DateFormatSymbols
Gets era strings.
getErrorCode(). Method in class java.sql.SQLException
Get the vendor specific exception code
getErrorOffset(). Method in class java.text.FormatException
Returns the position where the error was found.
getErrorOffset(). Method in class java.text.ParseException
Returns the position where the error was found.
getErrorsAny(). Method in class java.awt.MediaTracker
va
Returns a list of all media that have encountered an error.
getErrorsID(int). Method in class java.awt.MediaTracker
Returns a list of media with the specified ID that have encountered an error.
getErrorStream(). Method in class java.lang.Process
Gets the error stream of the subprocess.
getEventSetDescriptors(). Method in interface java.beans.BeanInfo
getEventSetDescriptors(). Method in class java.beans.SimpleBeanInfo
Deny knowledge of event sets.
getException(). Method in class java.lang.ExceptionInInitializerError
Returns the exception that occurred during a static initialization that caused this Error to be created.
ja
334
335
m
Return an instance variable, specified by slot number.
getField(String). Method in class java.lang.Class
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 sun.tools.debug.RemoteClass
Return the static field, specified by name.
getField(String). Method in class sun.tools.debug.RemoteObject
Return an instance variable, specified by name.
getFields(). Method in class java.lang.Class
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 sun.tools.debug.RemoteClass
Return all the static fields for this class.
getFields(). Method in class sun.tools.debug.RemoteObject
i.c
Return the instance (non-static) fields of an object.
getFieldValue(int). Method in class sun.tools.debug.RemoteClass
Return the value of a static field, specified by its index.
getFieldValue(int). Method in class sun.tools.debug.RemoteObject
Returns the value of an object's instance variable.
getFieldValue(String). Method in class sun.tools.debug.RemoteClass
Return the value of a static field, specified by name.
getFieldValue(String). Method in class sun.tools.debug.RemoteObject
Returns the value of an object's instance variable.
getFile(). Method in class java.awt.FileDialog
dil
Gets the file of the Dialog.
getFile(). Method in class java.net.URL
Returns the file name of this URL.
getFileDescriptor(). Method in class java.net.DatagramSocketImpl
Get the datagram socket file descriptor
getFileDescriptor(). Method in class java.net.SocketImpl
Returns the value of this socket's fd field.
getFilenameFilter(). Method in class java.awt.FileDialog
Gets the filter.
getFilePointer(). Method in class java.io.RandomAccessFile
Returns the current offset in this file.
va
getFilterInstance(ImageConsumer). Method in class java.awt.image.ImageFilter
Returns a unique instance of an ImageFilter object which will actually perform the filtering for the specified ImageConsumer.
getFirstDayOfWeek(). Method in class java.util.Calendar
Gets what the first day of the week is; e.g., Sunday in US, Monday in France.
getFloat(int). Method in interface java.sql.CallableStatement
Get the value of a FLOAT parameter as a Java float.
getFloat(int). Method in interface java.sql.ResultSet
Get the value of a column in the current row as a Java float.
getFloat(Object). Method in class java.lang.reflect.Field
Get the value of a field as a float on specified object.
ja
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
m
Gets the font metrics for this component.
getFontMetrics(Font). Method in interface java.awt.peer.ComponentPeer
getFontMetrics(Font). Method in class java.awt.Graphics
Gets the font metrics for the specified font.
getFontMetrics(Font). Method in class java.awt.Toolkit
Returns the screen metrics of the font.
getFontPeer(String, int). Method in class java.awt.Toolkit
Uses the specified Peer interface to create a new Font.
o
getForeground(). Method in class java.awt.Component
Gets the foreground color.
getFormat(). Method in interface java.security.Certificate
Returns the name of the coding format.
getFormat(). Method in interface java.security.Key
i.c
Returns the format used to encode the key or null if the key does not support encoding.
getFormats(). Method in class java.text.ChoiceFormat
Get the formats passed in the constructor.
getFormats(). Method in class java.text.MessageFormat
Gets formats that were set with setFormats.
getG(). Method in interface java.security.interfaces.DSAParams
Returns the base, g.
getGraphics(). Method in class java.awt.Component
Gets a Graphics context for this component.
getGraphics(). Method in interface java.awt.peer.ComponentPeer
dil
getGraphics(). Method in class java.awt.Image
Gets a graphics object to draw into this image.
getGraphics(). Method in class java.awt.PrintJob
Gets a Graphics object that will draw to the next page.
getGreatestMinimum(int). Method in class java.util.Calendar
Gets the highest minimum value for the given field if varies.
getGreatestMinimum(int). Method in class java.util.GregorianCalendar
Returns highest minimum value for the given field if varies.
getGreen(). Method in class java.awt.Color
Gets the green component.
getGreen(int). Method in class java.awt.image.ColorModel
va
The subclass must provide a function which provides the green color compoment for the specified pixel.
getGreen(int). Method in class java.awt.image.DirectColorModel
Returns the green color compoment for the specified pixel in the range 0-255.
getGreen(int). Method in class java.awt.image.IndexColorModel
Returns the green color compoment for the specified pixel in the range 0-255.
getGreenMask(). Method in class java.awt.image.DirectColorModel
Returns the mask indicating which bits in a pixel contain the green color component.
getGreens(byte[]). Method in class java.awt.image.IndexColorModel
Copies the array of green color components into the given array.
getGregorianChange(). Method in class java.util.GregorianCalendar
ja
336
337
m
getHgap(). Method in class java.awt.FlowLayout
Returns the horizontal gap between components.
getHgap(). Method in class java.awt.GridLayout
Returns the horizontal gap between components.
getHost(). Method in class java.net.URL
Returns the host name of this URL, if applicable.
getHostAddress(). Method in class java.net.InetAddress
Returns the IP address string "%d.%d.%d.%d"
o
getHostName(). Method in class java.net.InetAddress
Returns the hostname for this address.
getHours(). Method in class java.sql.Date
Returns the hour represented by this date.
getHours(). Method in class java.util.Date
i.c
Returns the hour represented by this date.
getHSBColor(float, float, float). Static method in class java.awt.Color
A static Color factory for generating a Color object from HSB values.
getHScrollbarHeight(). Method in class java.awt.ScrollPane
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 java.awt.peer.ScrollPanePeer
getHumanPresentableName(). Method in class java.awt.datatransfer.DataFlavor
Returns the human presentable name for the data foramt that this DataFlavor represents.
getIcon(int). Method in interface java.beans.BeanInfo
dil
This method returns an image object that can be used to represent the bean in toolboxes, toolbars, etc.
getIcon(int). Method in class java.beans.SimpleBeanInfo
Claim there are no icons available.
getIconImage(). Method in class java.awt.Frame
Returns the icon image for this Frame.
getID(). Method in class java.awt.AWTEvent
Returns the event type.
getId(). Method in class sun.tools.debug.RemoteObject
Returns the id of the object.
getID(). Method in class java.util.TimeZone
Gets the ID of this time zone.
va
getIdentifierQuoteString(). Method in interface java.sql.DatabaseMetaData
What's the string used to quote SQL identifiers? This returns a space " " if identifier quoting isn't supported.
getIdentity(Principal). Method in class java.security.IdentityScope
Retrieves the identity whose name is the same as that of the specified principal.
getIdentity(PublicKey). Method in class java.security.IdentityScope
Retrieves the identity with the specified public key.
getIdentity(String). Method in class java.security.IdentityScope
Returns the identity in this scope with the specified name (if any).
getIfModifiedSince(). Method in class java.net.URLConnection
Returns the value of this object's ifModifiedSince field.
ja
Returns an image which gets pixel data from the specified URL.
getImage(URL, String). Method in class java.applet.Applet
Returns an Image object that can then be painted on the screen.
getImportedKeys(String, String, String). Method in interface java.sql.DatabaseMetaData
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 java.lang.SecurityManager
Tests if there is a security check in progress.
getIndex(). Method in interface java.text.CharacterIterator
Return the current index.
ww
337
338
m
getInetAddress(). Method in class java.net.SocketImpl
Returns the value of this socket's address field.
getInfinity(). Method in class java.text.DecimalFormatSymbols
character used to represent infinity.
getInfo(). Method in class java.security.Identity
Returns general information previously specified for this identity.
getInfo(). Method in class java.security.Provider
Returns a human-readable description of the provider and its services.
o
getInputStream(). Method in class java.lang.Process
Gets the input stream of the subprocess.
getInputStream(). Method in interface java.rmi.server.RemoteCall
Get the InputStream that the stub/skeleton should get results/arguments from.
getInputStream(). Method in class java.net.Socket
i.c
Returns an input stream for this socket.
getInputStream(). Method in class java.net.SocketImpl
Returns an input stream for this socket.
getInputStream(). Method in class java.net.URLConnection
Returns an input stream that reads from this open connection.
getInputStream(ZipEntry). Method in class java.util.zip.ZipFile
Returns an input stream for reading the contents of the specified ZIP file entry.
getInsets(). Method in class java.awt.Container
Returns the insets of the container.
getInsets(). Method in interface java.awt.peer.ContainerPeer
dil
getInstance(). Static method in class java.util.Calendar
Gets a Calendar using the default timezone and locale.
getInstance(). Static method in class java.text.Collator
Gets the Collator for the current default locale.
getInstance(). Static method in class java.text.DateFormat
Get a default date/time formatter that uses the SHORT style for both the date and the time.
getInstance(). Static method in class java.text.NumberFormat
Returns the default number format for the current default locale.
getInstance(Locale). Static method in class java.util.Calendar
Gets a Calendar using the default timezone and given locale.
getInstance(Locale). Static method in class java.text.Collator
va
Gets the Collator for the desired locale.
getInstance(Locale). Static method in class java.text.NumberFormat
Returns the default number format for the specified locale.
getInstance(String). Static method in class java.security.KeyPairGenerator
Generates a KeyPairGenerator object that implements the algorithm requested, as available in the environment.
getInstance(String). Static method in class java.security.MessageDigest
Generates a MessageDigest object that implements the specified digest algorithm.
getInstance(String). Static method in class java.security.Signature
Generates a Signature object that implements the specified algorithm.
getInstance(String, String). Static method in class java.security.KeyPairGenerator
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 java.security.MessageDigest
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 java.security.Signature
Generates a Signature object implementing the specified algorithm, as supplied from the specified provider, if such an
w.
From a given bean, obtain an object representing a specified type view of that source object.
getInt(int). Method in interface java.sql.CallableStatement
Get the value of an INTEGER parameter as a Java int.
getInt(int). Method in interface java.sql.ResultSet
Get the value of a column in the current row as a Java int.
getInt(Object). Method in class java.lang.reflect.Field
Get the value of a field as a int on specified object.
getInt(Object, int). Static method in class java.lang.reflect.Array
Returns the value of the indexed component in the specified array object, as an int.
getInt(String). Method in interface java.sql.ResultSet
Get the value of a column in the current row as a Java int.
getInteger(String). Static method in class java.lang.Integer
338
339
Determines the integer value of the system property with the specified name.
getInteger(String, int). Static method in class java.lang.Integer
Determines the integer value of the system property with the specified name.
m
getInteger(String, Integer). Static method in class java.lang.Integer
Determines the integer value of the system property with the specified name.
getInterface(). Method in class java.net.MulticastSocket
Retrieve the address of the network interface used for multicast packets.
getInterfaces(). Method in class java.lang.Class
Determines the interfaces implemented by the class or interface represented by this object.
getInterfaces(). Method in class sun.tools.debug.RemoteClass
Return the interfaces for this class.
o
getISO3Country(). Method in class java.util.Locale
Getter for the three-letter ISO country abbreviation of the locale.
getISO3Language(). Method in class java.util.Locale
Getter for the three-letter ISO language abbreviation of the locale.
getItem(). Method in class java.awt.event.ItemEvent
i.c
Returns the item where the event occurred.
getItem(int). Method in class java.awt.Choice
Returns the String at the specified index in the Choice.
getItem(int). Method in class java.awt.List
Gets the item associated with the specified index.
getItem(int). Method in class java.awt.Menu
Returns the item located at the specified index of this menu.
getItemCount(). Method in class java.awt.Choice
Returns the number of items in this Choice.
getItemCount(). Method in class java.awt.List
dil
Returns the number of items in the list.
getItemCount(). Method in class java.awt.Menu
Returns the number of elements in this menu.
getItems(). Method in class java.awt.List
Returns the items in the list.
getItemSelectable(). Method in class java.awt.event.ItemEvent
Returns the ItemSelectable object where this event originated.
getJavaInitializationString(). Method in interface java.beans.PropertyEditor
This method is intended for use when generating Java code to set the value of the property.
getJavaInitializationString(). Method in class java.beans.PropertyEditorSupport
This method is intended for use when generating Java code to set the value of the property.
va
getKey(). Method in class java.awt.MenuShortcut
Return the raw keycode of this MenuShortcut.
getKey(). Method in class java.util.MissingResourceException
Gets parameter passed by constructor.
getKeyChar(). Method in class java.awt.event.KeyEvent
Returns the character associated with the key in this event.
getKeyCode(). Method in class java.awt.event.KeyEvent
Returns the integer key-code associated with the key in this event.
getKeyModifiersText(int). Static method in class java.awt.event.KeyEvent
Returns a String describing the modifier key(s), such as "Shift", or "Ctrl+Shift".
ja
339
340
m
getLayoutAlignmentY(Container). Method in class java.awt.GridBagLayout
Returns the alignment along the y axis.
getLayoutAlignmentY(Container). Method in interface java.awt.LayoutManager2
Returns the alignment along the y axis.
getLayoutDimensions(). Method in class java.awt.GridBagLayout
GetLayoutInfo(Container, int). Method in class java.awt.GridBagLayout
Print the layout constraints.
getLayoutOrigin(). Method in class java.awt.GridBagLayout
o
getLayoutWeights(). Method in class java.awt.GridBagLayout
getLeading(). Method in class java.awt.FontMetrics
Gets the standard leading, or line spacing, for the font.
getLeastMaximum(int). Method in class java.util.Calendar
Gets the lowest maximum value for the given field if varies.
i.c
getLeastMaximum(int). Method in class java.util.GregorianCalendar
Returns lowest maximum value for the given field if varies.
getLength(). Method in class java.net.DatagramPacket
Returns the length of the data to be sent or the length of the data received.
getLength(Object). Static method in class java.lang.reflect.Array
Returns the length of the specified array object, as an int.
getLimits(). Method in class java.text.ChoiceFormat
Get the limits passed in the constructor.
getLineIncrement(). Method in class java.awt.Scrollbar
getLineInstance(). Static method in class java.text.BreakIterator
dil
Create BreakIterator for line-breaks using default locale.
getLineInstance(Locale). Static method in class java.text.BreakIterator
Create BreakIterator for line-breaks using default locale.
getLineNumber(). Method in class java.io.LineNumberInputStream
Returns the current line number.
getLineNumber(). Method in class java.io.LineNumberReader
Get the current line number.
getLineNumber(). Method in class sun.tools.debug.RemoteStackFrame
Return the source file line number.
getLineNumbers(). Method in class sun.tools.debug.RemoteClass
Return an array of all the class's source file line numbers which have code associated with them.
va
getListenerMethodDescriptors(). Method in class java.beans.EventSetDescriptor
getListenerMethods(). Method in class java.beans.EventSetDescriptor
getListenerType(). Method in class java.beans.EventSetDescriptor
getLocalAddress(). Method in class java.net.DatagramSocket
Gets the local address to which the socket is bound.
getLocalAddress(). Method in class java.net.Socket
Gets the local address to which the socket is bound.
getLocale(). Method in class java.applet.Applet
Gets the Locale for the applet, if it has been set.
getLocale(). Method in class java.awt.Component
ja
340
341
m
Returns the location of this point.
getLocation(). Method in class java.awt.Rectangle
Returns the location of this rectangle.
getLocationOnScreen(). Method in class java.awt.Component
Returns the current location of this component in the screen's coordinate space.
getLocationOnScreen(). Method in interface java.awt.peer.ComponentPeer
getLog(). Static method in class java.rmi.server.RemoteServer
Returns stream for the RMI call log.
o
getLoginTimeout(). Static method in class java.sql.DriverManager
Get the maximum time in seconds that all drivers can wait when attempting to log in to a database.
getLogStream(). Static method in class java.sql.DriverManager
Get the logging/tracing PrintStream that is used by the DriverManager and all drivers.
getLong(int). Method in interface java.sql.CallableStatement
i.c
Get the value of a BIGINT parameter as a Java long.
getLong(int). Method in interface java.sql.ResultSet
Get the value of a column in the current row as a Java long.
getLong(Object). Method in class java.lang.reflect.Field
Get the value of a field as a long on specified object.
getLong(Object, int). Static method in class java.lang.reflect.Array
Returns the value of the indexed component in the specified array object, as a long.
getLong(String). Static method in class java.lang.Long
Determines the long value of the system property with the specified name.
getLong(String). Method in interface java.sql.ResultSet
dil
Get the value of a column in the current row as a Java long.
getLong(String, Long). Static method in class java.lang.Long
Determines the long value of the system property with the specified name.
getLong(String, long). Static method in class java.lang.Long
Determines the long value of the system property with the specified name.
getLowestSetBit(). Method in class java.math.BigInteger
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 java.sql.Driver
Get the driver's major version number.
getMapSize(). Method in class java.awt.image.IndexColorModel
va
Returns the size of the color component arrays in this IndexColorModel.
getMaxAdvance(). Method in class java.awt.FontMetrics
Gets the maximum advance width of any character in this Font.
getMaxAscent(). Method in class java.awt.FontMetrics
Gets the maximum ascent of all characters in this Font.
getMaxBinaryLiteralLength(). Method in interface java.sql.DatabaseMetaData
How many hex characters can you have in an inline binary literal?
getMaxCatalogNameLength(). Method in interface java.sql.DatabaseMetaData
What's the maximum length of a catalog name?
getMaxCharLiteralLength(). Method in interface java.sql.DatabaseMetaData
ja
341
342
m
getMaximumFractionDigits(). Method in class java.text.NumberFormat
Returns the maximum number of digits allowed in the fraction portion of a number.
getMaximumIntegerDigits(). Method in class java.text.NumberFormat
Returns the maximum number of digits allowed in the integer portion of a number.
getMaximumSize(). Method in class java.awt.Component
Returns the maximum size of this component.
getMaximumSize(). Method in class java.awt.Container
Returns the maximum size of this container.
o
getMaxIndexLength(). Method in interface java.sql.DatabaseMetaData
What's the maximum length of an index (in bytes)?
getMaxPriority(). Method in class java.lang.ThreadGroup
Returns the maximum priority of this thread group.
getMaxProcedureNameLength(). Method in interface java.sql.DatabaseMetaData
i.c
What's the maximum length of a procedure name?
getMaxRows(). Method in interface java.sql.Statement
The maxRows limit is the maximum number of rows that a ResultSet can contain.
getMaxRowSize(). Method in interface java.sql.DatabaseMetaData
What's the maximum length of a single row?
getMaxSchemaNameLength(). Method in interface java.sql.DatabaseMetaData
What's the maximum length allowed for a schema name?
getMaxStatementLength(). Method in interface java.sql.DatabaseMetaData
What's the maximum length of a SQL statement?
getMaxStatements(). Method in interface java.sql.DatabaseMetaData
dil
How many active statements can we have open at one time to this database?
getMaxTableNameLength(). Method in interface java.sql.DatabaseMetaData
What's the maximum length of a table name?
getMaxTablesInSelect(). Method in interface java.sql.DatabaseMetaData
What's the maximum number of tables in a SELECT?
getMaxUserNameLength(). Method in interface java.sql.DatabaseMetaData
What's the maximum length of a user name?
getMenu(int). Method in class java.awt.MenuBar
Gets the specified menu.
getMenu(String). Method in class java.util.ResourceBundle
Get an object from a ResourceBundle.
va
getMenuBar(). Method in class java.awt.Frame
Gets the menu bar for this Frame.
getMenuBar(String). Method in class java.util.ResourceBundle
Get an object from a ResourceBundle.
getMenuCount(). Method in class java.awt.MenuBar
Counts the number of menus on the menu bar.
getMenuShortcutKeyMask(). Method in class java.awt.Toolkit
Return the Event modifier mask appropriate for shortcuts.
getMessage(). Method in class java.io.InvalidClassException
Produce the message, include the classname if present.
ja
Produce the message, include the message from the nested exception if there is one.
getMessageDigest(). Method in class java.security.DigestInputStream
Returns the message digest associated with this stream.
getMessageDigest(). Method in class java.security.DigestOutputStream
Returns the message digest associated with this stream.
getMetaData(). Method in interface java.sql.Connection
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 java.sql.ResultSet
The number, types and properties of a ResultSet's columns are provided by the getMetaData method.
ww
342
343
Return the first line number of the specified method, or throws NoSuchLineNumber exception.
getMethodLineNumber(String). Method in class sun.tools.debug.RemoteClass
Return the first line number of the specified method, or throws NoSuchLineNumber exception.
m
getMethodName(). Method in class sun.tools.debug.RemoteStackFrame
Get the method name referenced by this stackframe.
getMethodNames(). Method in class sun.tools.debug.RemoteClass
Return the names of all methods supported by this class.
getMethods(). Method in class java.lang.Class
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 sun.tools.debug.RemoteClass
Return the class's methods.
getMimeType(). Method in class java.awt.datatransfer.DataFlavor
Returns the MIME type string for this DataFlavor
getMinimalDaysInFirstWeek(). Method in class java.util.Calendar
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 java.awt.Adjustable
Gets the minimum value of the adjustable object.
getMinimum(). Method in class java.awt.Scrollbar
Returns the minimum value of this Scrollbar.
getMinimum(int). Method in class java.util.Calendar
Gets the minimum value for the given time field.
getMinimum(int). Method in class java.util.GregorianCalendar
Returns minimum value for the given field.
dil
getMinimumFractionDigits(). Method in class java.text.NumberFormat
Returns the minimum number of digits allowed in the fraction portion of a number.
getMinimumIntegerDigits(). Method in class java.text.NumberFormat
Returns the minimum number of digits allowed in the integer portion of a number.
getMinimumSize(). Method in class java.awt.Component
Returns the mininimum size of this component.
getMinimumSize(). Method in interface java.awt.peer.ComponentPeer
getMinimumSize(). Method in class java.awt.Container
Returns the minimum size of this container.
getMinimumSize(). Method in class java.awt.List
Returns the minimum dimensions needed for the list.
va
getMinimumSize(). Method in class java.awt.TextArea
Returns the minimum size Dimensions of the TextArea.
getMinimumSize(). Method in class java.awt.TextField
Returns the minimum size Dimensions needed for this TextField.
getMinimumSize(int). Method in class java.awt.List
Returns the minimum dimensions needed for the amount of rows in the list.
getMinimumSize(int). Method in interface java.awt.peer.ListPeer
getMinimumSize(int). Method in class java.awt.TextField
Returns the minimum size Dimensions needed for this TextField with the specified amount of columns.
getMinimumSize(int). Method in interface java.awt.peer.TextFieldPeer
ja
Returns the Java language modifiers for this class or interface, encoded in an integer.
getModifiers(). Method in class java.lang.reflect.Constructor
Returns the Java language modifiers for the constructor represented by this Constructor object, as an integer.
getModifiers(). Method in class java.lang.reflect.Field
Returns the Java language modifiers for the field represented by this Field object, as an integer.
getModifiers(). Method in class java.awt.event.InputEvent
Returns the modifiers flag for this event.
getModifiers(). Method in interface java.lang.reflect.Member
Returns the Java language modifiers for the member or constructor represented by this Member, as an integer.
getModifiers(). Method in class java.lang.reflect.Method
Returns the Java language modifiers for the method represented by this Method object, as an integer.
getModifiers(). Method in class sun.tools.debug.RemoteField
343
344
Returns a string with the field's modifiers, such as "public", "static", "final", etc.
getMonth(). Method in class java.util.Date
Returns the month represented by this date.
m
getMonth(). Method in class java.sql.Time
Returns the month represented by this date.
getMonths(). Method in class java.text.DateFormatSymbols
Gets month strings.
getMoreResults(). Method in interface java.sql.Statement
getMoreResults moves to a Statement's next result.
getMultiplier(). Method in class java.text.DecimalFormat
Get the multiplier for use in percent, permill, etc.
o
getName(). Method in interface java.security.acl.Acl
Returns the name of this ACL.
getName(). Method in class java.lang.Class
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 java.awt.datatransfer.Clipboard
i.c
Returns the name of this clipboard object.
getName(). Method in class java.awt.Component
Gets the name of the component.
getName(). Method in class java.lang.reflect.Constructor
Returns the name of this constructor, as a string.
getName(). Method in class java.beans.FeatureDescriptor
getName(). Method in class java.lang.reflect.Field
Returns the name of the field represented by this Field object.
getName(). Method in class java.io.File
Returns the name of the file represented by this object.
dil
getName(). Method in class java.awt.Font
Gets the logical name of the font.
getName(). Method in class java.security.Identity
Returns this identity's name.
getName(). Method in interface java.lang.reflect.Member
Returns the simple name of the underlying member or constructor represented by this Member.
getName(). Method in class java.awt.MenuComponent
Gets the name of the menu component.
getName(). Method in class java.lang.reflect.Method
Returns the name of the method represented by this Method object, as a String.
getName(). Method in class java.io.ObjectStreamClass
va
The name of the class described by this descriptor.
getName(). Method in interface java.security.Principal
Returns the name of this principal.
getName(). Method in class java.security.Provider
Returns the name of this provider.
getName(). Method in class sun.tools.debug.RemoteClass
Returns the name of the class.
getName(). Method in class sun.tools.debug.RemoteField
Returns the name of the field.
getName(). Method in class sun.tools.debug.RemoteStackVariable
ja
344
345
m
getNumberInstance(). Method in class java.text.DateFormat
Gets the number formatter which this date/time formatter uses to format and parse a time.
getNumberInstance(). Static method in class java.text.NumberFormat
Returns a general-purpose number format for the current default locale.
getNumberInstance(Locale). Static method in class java.text.NumberFormat
Returns a general-purpose number format for the specified locale.
getNumericFunctions(). Method in interface java.sql.DatabaseMetaData
Get a comma separated list of math functions.
o
getNumericValue(char). Static method in class java.lang.Character
Returns the Unicode numeric value of the character as a nonnegative integer.
getObject(int). Method in interface java.sql.CallableStatement
Get the value of a parameter as a Java object.
getObject(int). Method in interface java.sql.ResultSet
i.c
Get the value of a column in the current row as a Java object.
getObject(String). Method in class java.util.ResourceBundle
Get an object from a ResourceBundle.
getObject(String). Method in interface java.sql.ResultSet
dil
Gets the time zone offset, for current date, modified in case of daylight savings.
getOldValue(). Method in class java.beans.PropertyChangeEvent
getOperation(). Method in class java.rmi.server.Operation
Returns the name of the method.
getOperations(). Method in interface java.rmi.server.Skeleton
getOrientation(). Method in interface java.awt.Adjustable
Gets the orientation of the adjustable object.
getOrientation(). Method in class java.awt.Scrollbar
Returns the orientation for this Scrollbar.
getOutputStream(). Method in class java.rmi.server.LogStream
Return the current stream to which output from this log is sent.
va
getOutputStream(). Method in class java.lang.Process
Gets the output stream of the subprocess.
getOutputStream(). Method in interface java.rmi.server.RemoteCall
Return the output stream the stub/skeleton should put arguments/results into.
getOutputStream(). Method in class java.net.Socket
Returns an output stream for this socket.
getOutputStream(). Method in class java.net.SocketImpl
Returns an output stream for this socket.
getOutputStream(). Method in class java.net.URLConnection
Returns an output stream that writes to this connection.
ja
Returns information about the parameters than are understood by this applet.
getParameterTypes(). Method in class java.lang.reflect.Constructor
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 java.lang.reflect.Method
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 java.security.interfaces.DSAKey
Returns the DSA-specific key parameters.
getParent(). Method in class java.awt.Component
Gets the parent of the component.
getParent(). Method in class java.io.File
345
346
m
getParent(). Method in class java.lang.ThreadGroup
Returns the parent of this thread group.
getPath(). Method in class java.io.File
Returns the pathname of the file represented by this object.
getPatternSeparator(). Method in class java.text.DecimalFormatSymbols
character used to separate positive and negative subpatterns in a pattern.
getPC(). Method in class sun.tools.debug.RemoteStackFrame
Get the program counter referenced by this stackframe.
o
getPeer(). Method in class java.awt.Component
getPeer(). Method in class java.awt.Font
Gets the peer of the font.
getPeer(). Method in class java.awt.MenuComponent
getPercent(). Method in class java.text.DecimalFormatSymbols
i.c
character used for percent sign.
getPercentInstance(). Static method in class java.text.NumberFormat
Returns a percentage format for the current default locale.
getPercentInstance(Locale). Static method in class java.text.NumberFormat
Returns a percentage format for the specified locale.
getPerMill(). Method in class java.text.DecimalFormatSymbols
character used for mille percent sign.
getPermissions(Principal). Method in interface java.security.acl.Acl
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 java.awt.image.PixelGrabber
Get the pixel buffer.
getPixelSize(). Method in class java.awt.image.ColorModel
Returns the number of bits per pixel described by this ColorModel.
getPoint(). Method in class java.awt.event.MouseEvent
Returns the x,y position of the event relative to the source component.
getPort(). Method in class java.net.DatagramPacket
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 java.net.Socket
Returns the remote port to which this socket is connected.
getPort(). Method in class java.net.SocketImpl
va
Returns the value of this socket's port field.
getPort(). Method in class java.net.URL
Returns the port number of this URL.
getPositivePrefix(). Method in class java.text.DecimalFormat
Get the positive prefix.
getPositiveSuffix(). Method in class java.text.DecimalFormat
Get the positive suffix.
getPrecision(int). Method in interface java.sql.ResultSetMetaData
What's a column's number of decimal digits?
getPredefinedCursor(int). Static method in class java.awt.Cursor
ja
346
347
m
Returns this thread's priority.
getPrivate(). Method in class java.security.KeyPair
Returns the private key from this key pair.
getPrivateKey(). Method in class java.security.Signer
Returns this signer's private key.
getProcedureColumns(String, String, String, String). Method in interface java.sql.DatabaseMetaData
Get a description of a catalog's stored procedure parameters and result columns.
getProcedures(String, String, String). Method in interface java.sql.DatabaseMetaData
o
Get a description of stored procedures available in a catalog.
getProcedureTerm(). Method in interface java.sql.DatabaseMetaData
What's the database vendor's preferred term for "procedure"?
getPropagationId(). Method in class java.beans.PropertyChangeEvent
The "propagationId" field is reserved for future use.
i.c
getProperties(). Static method in class java.lang.System
Determines the current system properties.
getProperty(String). Method in class java.util.Properties
Searches for the property with the specified key in this property list.
getProperty(String). Static method in class java.security.Security
Gets a security property.
getProperty(String). Static method in class java.lang.System
Gets the system property indicated by the specified key.
getProperty(String, ImageObserver). Method in class java.awt.Image
Gets a property of the image by name.
dil
getProperty(String, String). Method in class java.util.Properties
Searches for the property with the specified key in this property list.
getProperty(String, String). Static method in class java.lang.System
Gets the system property indicated by the specified key.
getProperty(String, String). Static method in class java.awt.Toolkit
Gets a property with the specified key and default.
getPropertyChangeEvent(). Method in class java.beans.PropertyVetoException
getPropertyDescriptors(). Method in interface java.beans.BeanInfo
getPropertyDescriptors(). Method in class java.beans.SimpleBeanInfo
Deny knowledge of properties.
getPropertyEditorClass(). Method in class java.beans.PropertyDescriptor
va
getPropertyInfo(String, Properties). Method in interface java.sql.Driver
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 java.beans.PropertyChangeEvent
getPropertyType(). Method in class java.beans.PropertyDescriptor
getProtocol(). Method in class java.net.URL
Returns the protocol name this URL.
getProvider(String). Static method in class java.security.Security
Returns the provider installed with the specified name, if any.
ja
347
348
m
Returns the anchor (also known as the "reference") of this URL.
getRefClass(ObjectOutput). Method in interface java.rmi.server.RemoteRef
Returns the class name of the ref type to be serialized onto the stream 'out'.
getRegistry(). Static method in class java.rmi.registry.LocateRegistry
Returns the remote object Registry for the local host.
getRegistry(int). Static method in class java.rmi.registry.LocateRegistry
Returns the remote object Registry on the current host at the specified port.
getRegistry(String). Static method in class java.rmi.registry.LocateRegistry
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 java.rmi.registry.LocateRegistry
Returns the remote object Registry on the specified host at the specified port.
getRemaining(). Method in class java.util.zip.Inflater
Returns the total number of bytes remaining in the input buffer.
i.c
getRemoteClass(). Method in class sun.tools.debug.RemoteStackFrame
Get the class this stackframe references.
getRemoveListenerMethod(). Method in class java.beans.EventSetDescriptor
getRepresentationClass(). Method in class java.awt.datatransfer.DataFlavor
Returns the Class which objects supporting this DataFlavor will return when this DataFlavor is requested.
getRequestMethod(). Method in class java.net.HttpURLConnection
Get the request method.
getRequestProperty(String). Method in class java.net.URLConnection
Returns the value of the named general request property for this connection.
getResource(String). Method in class java.lang.Class
dil
getResource(String). Method in class java.lang.ClassLoader
Find a resource with a given name.
getResourceAsStream(String). Method in class java.lang.Class
Find a resource with a given name.
getResourceAsStream(String). Method in class java.lang.ClassLoader
Get an InputStream on a given resource.
getResponseCode(). Method in class java.net.HttpURLConnection
Gets HTTP response status.
getResponseMessage(). Method in class java.net.HttpURLConnection
Gets the HTTP response message, if any, returned along with the response code from a server.
getResultSet(). Method in interface java.sql.Statement
va
getResultSet returns the current result as a ResultSet.
getResultStream(boolean). Method in interface java.rmi.server.RemoteCall
Returns an output stream (may put out header information relating to the success of the call).
getReturnType(). Method in class java.lang.reflect.Method
Returns a Class object that represents the formal return type of the method represented by this Method object.
getRGB(). Method in class java.awt.Color
Gets the RGB value representing the color in the default RGB ColorModel.
getRGB(). Method in class java.awt.SystemColor
Gets the "current" RGB value representing the symbolic color.
getRGB(int). Method in class java.awt.image.ColorModel
ja
Returns the color of the pixel in the default RGB color model.
getRGB(int). Method in class java.awt.image.DirectColorModel
Returns the color of the pixel in the default RGB color model.
getRGB(int). Method in class java.awt.image.IndexColorModel
Returns the color of the pixel in the default RGB color model.
getRGBdefault(). Static method in class java.awt.image.ColorModel
Return a ColorModel which describes the default format for integer RGB values used throughout the AWT image interfaces.
w.
348
349
m
Gets the size of the screen.
getScrollbarDisplayPolicy(). Method in class java.awt.ScrollPane
Returns the display policy for the scrollbars.
getScrollbarVisibility(). Method in class java.awt.TextArea
Returns the enumerated value describing which scrollbars the text area has.
getScrollPosition(). Method in class java.awt.ScrollPane
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 java.sql.DatabaseMetaData
o
This is the string that can be used to escape '_' or '%' in the string pattern style catalog search parameters.
getSeconds(). Method in class java.sql.Date
Returns the number of seconds past the minute represented by this date.
getSeconds(). Method in class java.util.Date
Returns the number of seconds past the minute represented by this date.
i.c
getSecurityContext(). Method in class java.rmi.RMISecurityManager
Returns the security context (e.g., a URL).
getSecurityContext(). Method in class java.lang.SecurityManager
Creates an object that encapsulates the current execution environment.
getSecurityContext(ClassLoader). Method in interface java.rmi.server.LoaderHandler
Returns the security context of the given class loader (e.g., a URL)
getSecurityContext(ClassLoader). Static method in class java.rmi.server.RMIClassLoader
Returns the security context of the given class loader
getSecurityManager(). Static method in class java.lang.System
Gets the system security interface.
dil
getSeed(int). Static method in class java.security.SecureRandom
Returns the given number of seed bytes, computed using the seed generation algorithm that this class uses to seed itself.
getSelectedCheckbox(). Method in class java.awt.CheckboxGroup
Gets the current choice.
getSelectedIndex(). Method in class java.awt.Choice
Returns the index of the currently selected item.
getSelectedIndex(). Method in class java.awt.List
Get the selected item on the list or -1 if no item is selected.
getSelectedIndexes(). Method in class java.awt.List
Returns the selected indexes on the list.
getSelectedIndexes(). Method in interface java.awt.peer.ListPeer
va
getSelectedItem(). Method in class java.awt.Choice
Returns a String representation of the current choice.
getSelectedItem(). Method in class java.awt.List
Returns the selected item on the list or null if no item is selected.
getSelectedItems(). Method in class java.awt.List
Returns the selected items on the list in an array of Strings.
getSelectedObjects(). Method in class java.awt.Checkbox
Returns the an array (length 1) containing the checkbox label or null if the checkbox is not selected.
getSelectedObjects(). Method in class java.awt.CheckboxMenuItem
Returns the an array (length 1) containing the checkbox menu item label or null if the checkbox is not selected.
ja
349
350
Returns the value of the indexed component in the specified array object, as a short.
getShort(String). Method in interface java.sql.ResultSet
Get the value of a column in the current row as a Java short.
m
getShortcut(). Method in class java.awt.MenuItem
Return the MenuShortcut associated with this MenuItem, or null if none has been specified.
getShortcutMenuItem(MenuShortcut). Method in class java.awt.MenuBar
Return the MenuItem associated with a MenuShortcut, or null if none has been specified.
getShortDescription(). Method in class java.beans.FeatureDescriptor
getShortMonths(). Method in class java.text.DateFormatSymbols
Gets short month strings.
getShortWeekdays(). Method in class java.text.DateFormatSymbols
o
Gets short weekday strings.
getSigners(). Method in class java.lang.Class
Get the signers of this class.
getSize(). Method in class java.awt.Component
Returns the current size of this component.
i.c
getSize(). Method in class java.awt.Dimension
Returns the size of this Dimension object.
getSize(). Method in class java.awt.Font
Gets the point size of the font.
getSize(). Method in class java.awt.Rectangle
Returns the size (width by height) of this rectangle.
getSize(). Method in class sun.tools.debug.RemoteArray
Return the number of elements in the array.
getSize(). Method in class java.util.zip.ZipEntry
Returns the uncompressed size of the entry data, or -1 if not known.
dil
getSocketFactory(). Static method in class java.rmi.server.RMISocketFactory
Returns the socket factory used by RMI.
getSoLinger(). Method in class java.net.Socket
Returns setting for SO_LINGER.
getSoTimeout(). Method in class java.net.DatagramSocket
Retrive setting for SO_TIMEOUT.
getSoTimeout(). Method in class java.net.ServerSocket
Retrive setting for SO_TIMEOUT.
getSoTimeout(). Method in class java.net.Socket
Returns setting for SO_TIMEOUT.
getSource(). Method in class java.util.EventObject
va
getSource(). Method in class java.awt.Image
Gets the object that produces the pixels for the image.
getSourceFile(). Method in class sun.tools.debug.RemoteClass
Get the source file referenced by this stackframe.
getSourceFileName(). Method in class sun.tools.debug.RemoteClass
Get the name of the source file referenced by this stackframe.
getSourcePath(). Method in class sun.tools.debug.RemoteDebugger
Return the source file path the Agent is currently using.
getSourceString(). Method in class java.text.CollationKey
Returns the String that this CollationKey represents.
ja
Return the arguments and local variable from the current stackframe.
getState(). Method in class java.awt.Checkbox
Returns the boolean state of the Checkbox.
getState(). Method in class java.awt.CheckboxMenuItem
Returns the state of this MenuItem.
getStateChange(). Method in class java.awt.event.ItemEvent
Returns the state change type which generated the event.
getStaticFields(). Method in class sun.tools.debug.RemoteClass
Return all the static fields for this class.
getStatus(). Method in class java.awt.image.PixelGrabber
ww
350
351
m
getStringFunctions(). Method in interface java.sql.DatabaseMetaData
Get a comma separated list of string functions.
getStyle(). Method in class java.awt.Font
Gets the style of the font.
getSuperclass(). Method in class java.lang.Class
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 sun.tools.debug.RemoteClass
o
Return the superclass for this class.
getSystemClipboard(). Method in class java.awt.Toolkit
Returns an instance of the "system" clipboard which interfaces with the clipboard facilities on the native platform.
getSystemEventQueue(). Method in class java.awt.Toolkit
Get the application's or applet's EventQueue instance.
i.c
getSystemEventQueueImpl(). Method in class java.awt.Toolkit
getSystemFunctions(). Method in interface java.sql.DatabaseMetaData
Get a comma separated list of system functions.
getSystemResource(String). Static method in class java.lang.ClassLoader
Find a resource with a given name.
getSystemResourceAsStream(String). Static method in class java.lang.ClassLoader
Get an InputStream on a given resource..
getSystemScope(). Static method in class java.security.IdentityScope
Returns the system's identity scope.
getTableName(int). Method in interface java.sql.ResultSetMetaData
dil
What's a column's table name?
getTablePrivileges(String, String, String). Method in interface java.sql.DatabaseMetaData
Get a description of the access rights for each table available in a catalog.
getTables(String, String, String, String[]). Method in interface java.sql.DatabaseMetaData
Get a description of tables available in a catalog.
getTableTypes(). Method in interface java.sql.DatabaseMetaData
Get the table types available in this database.
getTags(). Method in interface java.beans.PropertyEditor
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 java.beans.PropertyEditorSupport
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 java.lang.reflect.InvocationTargetException
Get the thrown target exception.
getTcpNoDelay(). Method in class java.net.Socket
Tests if TCP_NODELAY is enabled.
getText(). Method in class java.text.BreakIterator
Get the text being scanned
getText(). Method in class java.awt.Label
Gets the text of this label.
getText(). Method in class java.awt.TextComponent
Returns the text contained in this TextComponent.
ja
351
352
m
Get the value of a column in the current row as a java.sql.Timestamp object.
getTimeZone(). Method in class java.util.Calendar
Gets the time zone.
getTimeZone(). Method in class java.text.DateFormat
Gets the time zone.
getTimeZone(String). Static method in class java.util.TimeZone
Gets the TimeZone for the given ID.
getTimezoneOffset(). Method in class java.util.Date
o
Returns the local time-zone offset.
getTitle(). Method in class java.awt.Dialog
Gets the title of the Dialog.
getTitle(). Method in class java.awt.Frame
Gets the title of the Frame.
i.c
getToolkit(). Method in class java.awt.Component
Gets the toolkit of the component.
getToolkit(). Method in interface java.awt.peer.ComponentPeer
getToolkit(). Method in class java.awt.Window
Returns the toolkit of this frame.
getTotalIn(). Method in class java.util.zip.Deflater
Returns the total number of bytes input so far.
getTotalIn(). Method in class java.util.zip.Inflater
Returns the total number of bytes input so far.
getTotalOut(). Method in class java.util.zip.Deflater
dil
Returns the total number of bytes output so far.
getTotalOut(). Method in class java.util.zip.Inflater
Returns the total number of bytes output so far.
getTransactionIsolation(). Method in interface java.sql.Connection
Get this Connection's current transaction isolation mode.
getTransferData(DataFlavor). Method in class java.awt.datatransfer.StringSelection
If the data was requested in the "java.lang.String" flavor, return the String representing the selection.
getTransferData(DataFlavor). Method in interface java.awt.datatransfer.Transferable
Returns an object which represents the data to be transferred.
getTransferDataFlavors(). Method in class java.awt.datatransfer.StringSelection
Returns the array of flavors in which it can provide the data.
va
getTransferDataFlavors(). Method in interface java.awt.datatransfer.Transferable
Returns an array of DataFlavor objects indicating the flavors the data can be provided in.
getTransferSize(). Method in class java.sql.DataTruncation
Get the number of bytes of data actually transferred.
getTransparentPixel(). Method in class java.awt.image.IndexColorModel
Returns the index of the transparent pixel in this IndexColorModel or -1 if there is no transparent pixel.
getTreeLock(). Method in class java.awt.Component
Gets the locking object for AWT component-tree and layout operations.
getTTL(). Method in class java.net.DatagramSocketImpl
Retrieve the TTL (time-to-live) option.
ja
Get a description of all the standard SQL types supported by this database.
getUnicodeStream(int). Method in interface java.sql.ResultSet
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 java.sql.ResultSet
A column value can be retrieved as a stream of Unicode characters and then read in chunks from the stream.
getUnitIncrement(). Method in interface java.awt.Adjustable
Gets the unit value increment for the adjustable object.
getUnitIncrement(). Method in class java.awt.Scrollbar
Gets the unit increment for this scrollbar.
getUpdateCount(). Method in interface java.sql.Statement
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
m
What's the url for this database?
getURL(). Method in class java.net.URLConnection
Returns the value of this URLConnection's URL field.
getUseCaches(). Method in class java.net.URLConnection
Returns the value of this URLConnection's useCaches field.
getUserName(). Method in interface java.sql.DatabaseMetaData
What's our user name as known to the database?
getVAdjustable(). Method in class java.awt.ScrollPane
o
Returns the Adjustable object which represents the state of the vertical scrollbar.
getValue(). Method in interface java.awt.Adjustable
Gets the current value of the adjustable object.
getValue(). Method in class java.awt.event.AdjustmentEvent
Returns the current value in the adjustment event.
i.c
getValue(). Method in class java.util.zip.Adler32
Returns checksum value.
getValue(). Method in interface java.util.zip.Checksum
Returns the current checksum value.
getValue(). Method in class java.util.zip.CRC32
Returns CRC-32 value.
getValue(). Method in class java.rmi.dgc.Lease
Returns the lease duration.
getValue(). Method in interface java.beans.PropertyEditor
getValue(). Method in class java.beans.PropertyEditorSupport
dil
getValue(). Method in class sun.tools.debug.RemoteStackVariable
Return the value of a stack variable or argument.
getValue(). Method in class java.awt.Scrollbar
Returns the current value of this Scrollbar.
getValue(String). Method in class java.beans.FeatureDescriptor
Retrieve a named attribute with this feature.
getVariant(). Method in class java.util.Locale
Getter for programmatic name of field.
getVersion(). Method in class java.security.Provider
Returns the version number for this provider.
getVersionColumns(String, String, String). Method in interface java.sql.DatabaseMetaData
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 java.awt.BorderLayout
Returns the vertical gap between components.
getVgap(). Method in class java.awt.CardLayout
Returns the vertical gap between components.
getVgap(). Method in class java.awt.FlowLayout
Returns the vertical gap between components.
getVgap(). Method in class java.awt.GridLayout
Returns the vertical gap between components.
getViewportSize(). Method in class java.awt.ScrollPane
ja
Gets the index of the item that was last made visible by the method makeVisible.
getVMID(). Method in class java.rmi.dgc.Lease
Returns the client VMID associated with the lease.
getVScrollbarWidth(). Method in class java.awt.ScrollPane
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 java.awt.peer.ScrollPanePeer
getWarnings(). Method in interface java.sql.Connection
The first warning reported by calls on this Connection is returned.
getWarnings(). Method in interface java.sql.ResultSet
ww
353
354
m
Gets the advance widths of the first 256 characters in the Font.
getWindow(). Method in class java.awt.event.WindowEvent
Returns the window where this event originated.
getWordInstance(). Static method in class java.text.BreakIterator
Create BreakIterator for word-breaks using default locale.
getWordInstance(Locale). Static method in class java.text.BreakIterator
Create BreakIterator for word-breaks using default locale.
getWriteMethod(). Method in class java.beans.PropertyDescriptor
o
getX(). Method in interface java.security.interfaces.DSAPrivateKey
Returns the value of the private key, x.
getX(). Method in class java.awt.event.MouseEvent
Returns the x position of the event relative to the source component.
getY(). Method in interface java.security.interfaces.DSAPublicKey
i.c
Returns the value of the public key, y.
getY(). Method in class java.awt.event.MouseEvent
Returns the y position of the event relative to the source component.
getYear(). Method in class java.util.Date
Returns the year represented by this date, minus 1900.
getYear(). Method in class java.sql.Time
Returns the year represented by this date, minus 1900.
getZeroDigit(). Method in class java.text.DecimalFormatSymbols
character used for zero.
getZoneStrings(). Method in class java.text.DateFormatSymbols
dil
Gets timezone strings.
GOT_FOCUS. Static variable in class java.awt.Event
A component gained the focus.
gotFocus(Event, Object). Method in class java.awt.Component
grabPixels(). Method in class java.awt.image.PixelGrabber
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 java.awt.image.PixelGrabber
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 java.awt.Graphics
va
Constructs a new Graphics object.
gray. Static variable in class java.awt.Color
The color gray.
green. Static variable in class java.awt.Color
The color green.
GregorianCalendar(). Constructor for class java.util.GregorianCalendar
Constructs a default GregorianCalendar using the current time in the default time zone with the default locale.
GregorianCalendar(int, int, int). Constructor for class java.util.GregorianCalendar
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 java.util.GregorianCalendar
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 java.util.GregorianCalendar
Constructs a GregorianCalendar with the given date and time set for the default time zone with the default locale.
GregorianCalendar(Locale). Constructor for class java.util.GregorianCalendar
Constructs a GregorianCalendar based on the current time in the default time zone with the given locale.
GregorianCalendar(TimeZone). Constructor for class java.util.GregorianCalendar
Constructs a GregorianCalendar based on the current time in the given time zone with the default locale.
w.
354
355
m
GZIPInputStream(InputStream, int). Constructor for class java.util.zip.GZIPInputStream
Creates a new input stream with the specified buffer size.
GZIPOutputStream(OutputStream). Constructor for class java.util.zip.GZIPOutputStream
Creates a new output stream with a default buffer size.
GZIPOutputStream(OutputStream, int). Constructor for class java.util.zip.GZIPOutputStream
Creates a new output stream with the specified buffer size.
o
H
i.c
HAND_CURSOR. Static variable in class java.awt.Frame
handleEvent(AWTEvent). Method in interface java.awt.peer.ComponentPeer
handleEvent(Event). Method in class java.awt.Component
handleGetObject(String). Method in class java.util.ListResourceBundle
Override of ResourceBundle, same semantics
handleGetObject(String). Method in class java.util.PropertyResourceBundle
Override of ResourceBundle, same semantics
handleGetObject(String). Method in class java.util.ResourceBundle
Get an object from a ResourceBundle.
hasChanged(). Method in class java.util.Observable
dil
Tests if this object has changed.
hashCode(). Method in class java.math.BigDecimal
Computes a hash code for this object.
hashCode(). Method in class java.math.BigInteger
Computes a hash code for this object.
hashCode(). Method in class java.util.BitSet
Returns a hash code value for this bit set.
hashCode(). Method in class java.lang.Boolean
Returns a hash code for this Boolean.
hashCode(). Method in class java.lang.Byte
Returns a hashcode for this Byte.
va
hashCode(). Method in class java.lang.Character
Returns a hash code for this Character.
hashCode(). Method in class java.text.ChoiceFormat
Generates a hash code for the message format object.
hashCode(). Method in class java.text.CollationKey
Creates a hash code for this CollationKey.
hashCode(). Method in class java.text.Collator
Generates the hash code for this Collator.
hashCode(). Method in class java.awt.Color
Computes the hash code.
ja
Override hashCode.
hashCode(). Method in class java.text.DecimalFormat
Overrides hashCode
hashCode(). Method in class java.text.DecimalFormatSymbols
Override hashCode
hashCode(). Method in class java.lang.Double
Returns a hashcode for this Double.
hashCode(). Method in class java.lang.reflect.Field
Returns a hashcode for this Field.
hashCode(). Method in class java.io.File
ww
355
356
m
hashCode(). Method in class java.lang.Long
Computes a hashcode for this Long.
hashCode(). Method in class java.text.MessageFormat
Generates a hash code for the message format object.
hashCode(). Method in class java.lang.reflect.Method
Returns a hashcode for this Method.
hashCode(). Method in class java.text.NumberFormat
Overrides hashCode
o
hashCode(). Method in class java.lang.Object
Returns a hash code value for the object.
hashCode(). Method in class java.rmi.server.ObjID
The hashcode is the object number.
hashCode(). Method in class java.awt.Point
i.c
Returns the hashcode for this Point.
hashCode(). Method in interface java.security.Principal
Returns a hashcode for this principal.
hashCode(). Method in class java.awt.Rectangle
Returns the hashcode for this Rectangle.
hashCode(). Method in class java.rmi.server.RemoteObject
Returns a hashcode for a remote object.
hashCode(). Method in class java.text.RuleBasedCollator
Generates the hash code for the table-based collation object
hashCode(). Method in class java.lang.Short
dil
Returns a hashcode for this Short.
hashCode(). Method in class java.text.SimpleDateFormat
Override hashCode.
hashCode(). Method in class java.util.SimpleTimeZone
Override hashCode.
hashCode(). Method in class java.lang.String
Returns a hashcode for this string.
hashCode(). Method in class java.text.StringCharacterIterator
Compute a hashcode for this enumeration
hashCode(). Method in class java.rmi.server.UID
Returns a hash code value for the object.
va
hashCode(). Method in class java.net.URL
Creates an integer suitable for hash table indexing.
hashCode(). Method in class java.rmi.dgc.VMID
Compute hash code for this VMID.
Hashtable(). Constructor for class java.util.Hashtable
Constructs a new, empty hashtable with a default capacity and load factor.
Hashtable(int). Constructor for class java.util.Hashtable
Constructs a new, empty hashtable with the specified initial capacity and default load factor.
Hashtable(int, float). Constructor for class java.util.Hashtable
Constructs a new, empty hashtable with the specified initial capacity and the specified load factor.
ja
356
357
m
Useful constant for zero-based HOUR_OF_DAY field alignment.
HOUR_OF_DAY1_FIELD. Static variable in class java.text.DateFormat
Useful constant for one-based HOUR_OF_DAY field alignment.
HSBtoRGB(float, float, float). Static method in class java.awt.Color
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 java.net.HttpURLConnection
HTTP_BAD_GATEWAY. Static variable in class java.net.HttpURLConnection
o
HTTP_BAD_METHOD. Static variable in class java.net.HttpURLConnection
HTTP_BAD_REQUEST. Static variable in class java.net.HttpURLConnection
4XX: client error
HTTP_CLIENT_TIMEOUT. Static variable in class java.net.HttpURLConnection
HTTP_CONFLICT. Static variable in class java.net.HttpURLConnection
i.c
HTTP_CREATED. Static variable in class java.net.HttpURLConnection
HTTP_ENTITY_TOO_LARGE. Static variable in class java.net.HttpURLConnection
HTTP_FORBIDDEN. Static variable in class java.net.HttpURLConnection
HTTP_GATEWAY_TIMEOUT. Static variable in class java.net.HttpURLConnection
HTTP_GONE. Static variable in class java.net.HttpURLConnection
HTTP_INTERNAL_ERROR. Static variable in class java.net.HttpURLConnection
HTTP_LENGTH_REQUIRED. Static variable in class java.net.HttpURLConnection
HTTP_MOVED_PERM. Static variable in class java.net.HttpURLConnection
HTTP_MOVED_TEMP. Static variable in class java.net.HttpURLConnection
HTTP_MULT_CHOICE. Static variable in class java.net.HttpURLConnection
dil
3XX: relocation/redirect
HTTP_NO_CONTENT. Static variable in class java.net.HttpURLConnection
HTTP_NOT_ACCEPTABLE. Static variable in class java.net.HttpURLConnection
HTTP_NOT_AUTHORITATIVE. Static variable in class java.net.HttpURLConnection
HTTP_NOT_FOUND. Static variable in class java.net.HttpURLConnection
HTTP_NOT_MODIFIED. Static variable in class java.net.HttpURLConnection
HTTP_OK. Static variable in class java.net.HttpURLConnection
2XX: generally "OK"
HTTP_PARTIAL. Static variable in class java.net.HttpURLConnection
HTTP_PAYMENT_REQUIRED. Static variable in class java.net.HttpURLConnection
HTTP_PRECON_FAILED. Static variable in class java.net.HttpURLConnection
va
HTTP_PROXY_AUTH. Static variable in class java.net.HttpURLConnection
HTTP_REQ_TOO_LONG. Static variable in class java.net.HttpURLConnection
HTTP_RESET. Static variable in class java.net.HttpURLConnection
HTTP_SEE_OTHER. Static variable in class java.net.HttpURLConnection
HTTP_SERVER_ERROR. Static variable in class java.net.HttpURLConnection
5XX: server error
HTTP_UNAUTHORIZED. Static variable in class java.net.HttpURLConnection
HTTP_UNAVAILABLE. Static variable in class java.net.HttpURLConnection
HTTP_UNSUPPORTED_TYPE. Static variable in class java.net.HttpURLConnection
HTTP_USE_PROXY. Static variable in class java.net.HttpURLConnection
ja
357
358
m
Tests for equality between the specified identity and this identity.
identityHashCode(Object). Static method in class java.lang.System
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 java.security.IdentityScope
This constructor is used for serialization only and should not be used by subclasses.
IdentityScope(String). Constructor for class java.security.IdentityScope
Constructs a new identity scope with the specified name.
o
IdentityScope(String, IdentityScope). Constructor for class java.security.IdentityScope
Constructs a new identity scope with the specified name and scope.
IEEEremainder(double, double). Static method in class java.lang.Math
Computes the remainder operation on two arguments as prescribed by the IEEE 754 standard.
ifModifiedSince. Variable in class java.net.URLConnection
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 sun.tools.debug.RemoteClass
Don't enter the debugger when an instance of this class is thrown.
IllegalAccessError(). Constructor for class java.lang.IllegalAccessError
Constructs an IllegalAccessError with no detail message.
IllegalAccessError(String). Constructor for class java.lang.IllegalAccessError
Constructs an IllegalAccessError with the specified detail message.
IllegalAccessException(). Constructor for class java.lang.IllegalAccessException
Constructs an IllegalAccessException without a detail message.
dil
IllegalAccessException(String). Constructor for class java.lang.IllegalAccessException
Constructs an IllegalAccessException with a detail message.
IllegalArgumentException(). Constructor for class java.lang.IllegalArgumentException
Constructs an IllegalArgumentException with no detail message.
IllegalArgumentException(String). Constructor for class java.lang.IllegalArgumentException
Constructs an IllegalArgumentException with the specified detail message.
IllegalComponentStateException(). Constructor for class java.awt.IllegalComponentStateException
Constructs an IllegalComponentStateException with no detail message.
IllegalComponentStateException(String). Constructor for class java.awt.IllegalComponentStateException
Constructs an IllegalComponentStateException with the specified detail message.
IllegalMonitorStateException(). Constructor for class java.lang.IllegalMonitorStateException
va
Constructs an IllegalMonitorStateException with no detail message.
IllegalMonitorStateException(String). Constructor for class java.lang.IllegalMonitorStateException
Constructs an IllegalMonitorStateException with the specified detail message.
IllegalStateException(). Constructor for class java.lang.IllegalStateException
Constructs an IllegalStateException with no detail message.
IllegalStateException(String). Constructor for class java.lang.IllegalStateException
Constructs an IllegalStateException with the specified detail message.
IllegalThreadStateException(). Constructor for class java.lang.IllegalThreadStateException
Constructs an IllegalThreadStateException with no detail message.
IllegalThreadStateException(String). Constructor for class java.lang.IllegalThreadStateException
ja
358
359
m
importedKeyNotDeferrable. Static variable in interface java.sql.DatabaseMetaData
IMPORT KEY DEFERRABILITY - see SQL92 for definition
importedKeyRestrict. Static variable in interface java.sql.DatabaseMetaData
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 java.sql.DatabaseMetaData
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 java.sql.DatabaseMetaData
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 java.io.FileDescriptor
A handle to the standard input stream.
i.c
in. Variable in class java.io.FilterInputStream
The underlying input stream.
in. Variable in class java.io.FilterReader
The underlying character-input stream, or null if the stream has been closed
in. Variable in class java.io.PipedInputStream
in. Static variable in class java.lang.System
The "standard" input stream.
INACTIVE_CAPTION. Static variable in class java.awt.SystemColor
The array index for the inactive caption background color.
INACTIVE_CAPTION_BORDER. Static variable in class java.awt.SystemColor
dil
The array index for the inactive caption border color.
INACTIVE_CAPTION_TEXT. Static variable in class java.awt.SystemColor
The array index for the inactive caption text color.
inactiveCaption. Static variable in class java.awt.SystemColor
The background color for inactive captions in window borders.
inactiveCaptionBorder. Static variable in class java.awt.SystemColor
The border color for inactive captios in window borders.
inactiveCaptionText. Static variable in class java.awt.SystemColor
The text color for inactive captions in window borders.
inCheck. Variable in class java.lang.SecurityManager
This field is true if there is a security check in progress; false otherwise.
va
inClass(String). Method in class java.lang.SecurityManager
Tests if the specified String is in this Class.
inClassLoader(). Method in class java.lang.SecurityManager
Tests if the current ClassLoader is equal to null.
IncompatibleClassChangeError(). Constructor for class java.lang.IncompatibleClassChangeError
Constructs an IncompatibleClassChangeError with no detail message.
IncompatibleClassChangeError(String). Constructor for class java.lang.IncompatibleClassChangeError
Constructs an IncompatibleClassChangeError with the specified detail message.
inDaylightTime(Date). Method in class java.util.SimpleTimeZone
Overrides TimeZone Queries if the given date is in Daylight Savings Time.
ja
Constructs an IndexColorModel from the given arrays of red, green, and blue components.
IndexColorModel(int, int, byte[], int, boolean). Constructor for class java.awt.image.IndexColorModel
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 java.awt.image.IndexColorModel
Constructs an IndexColorModel from a single arrays of packed red, green, blue and optional alpha components.
IndexedPropertyDescriptor(String, Class). Constructor for class java.beans.IndexedPropertyDescriptor
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
java.beans.IndexedPropertyDescriptor
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
java.beans.IndexedPropertyDescriptor
This constructor takes the name of a simple property, and Method objects for reading and writing the property.
indexOf(int). Method in class java.lang.String
Returns the index within this string of the first occurrence of the specified character.
indexOf(int, int). Method in class java.lang.String
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 java.util.Vector
Searches for the first occurence of the given argument, testing for equality using the equals method.
indexOf(Object, int). Method in class java.util.Vector
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 java.lang.String
m
Returns the index within this string of the first occurrence of the specified substring.
indexOf(String, int). Method in class java.lang.String
Returns the index within this string of the first occurrence of the specified substring, starting at the specified index.
IndexOutOfBoundsException(). Constructor for class java.lang.IndexOutOfBoundsException
Constructs an IndexOutOfBoundsException with no detail message.
IndexOutOfBoundsException(String). Constructor for class java.lang.IndexOutOfBoundsException
Constructs an IndexOutOfBoundsException with the specified detail message.
inf. Variable in class java.util.zip.InflaterInputStream
o
Decompressor for this stream.
inflate(byte[]). Method in class java.util.zip.Inflater
Uncompresses bytes into specified buffer.
inflate(byte[], int, int). Method in class java.util.zip.Inflater
Uncompresses bytes into specified buffer.
i.c
Inflater(). Constructor for class java.util.zip.Inflater
Creates a new decompressor.
Inflater(boolean). Constructor for class java.util.zip.Inflater
Creates a new decompressor.
InflaterInputStream(InputStream). Constructor for class java.util.zip.InflaterInputStream
Creates a new input stream with a default decompressor and buffer size.
InflaterInputStream(InputStream, Inflater). Constructor for class java.util.zip.InflaterInputStream
Creates a new input stream with the specified decompressor and a default buffer size.
InflaterInputStream(InputStream, Inflater, int). Constructor for class java.util.zip.InflaterInputStream
Creates a new input stream with the specified decompressor and buffer size.
dil
info. Static variable in class java.awt.SystemColor
The background color for info(help) text.
INFO. Static variable in class java.awt.SystemColor
The array index for the info background color.
INFO_TEXT. Static variable in class java.awt.SystemColor
The array index for the info text color.
infoText. Static variable in class java.awt.SystemColor
The text color for info(help) text.
init(). Method in class java.applet.Applet
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 java.security.interfaces.DSAKeyPairGenerator
va
Initializes the key pair generator using p, q and g, the DSA family parameters.
initialize(int). Method in class java.security.KeyPairGenerator
Initializes the key pair generator for a certain strength using a system-provided source of randomness.
initialize(int, boolean, SecureRandom). Method in interface java.security.interfaces.DSAKeyPairGenerator
Initializes the key pair generator for a given modulus length, without parameters.
initialize(int, SecureRandom). Method in class java.security.KeyPairGenerator
Initializes the key pair generator for a certain strength.
initSign(PrivateKey). Method in class java.security.Signature
Initialize this object for signing.
initVerify(PublicKey). Method in class java.security.Signature
ja
Inserts the string representation of the double argument into this string buffer.
insert(int, float). Method in class java.lang.StringBuffer
Inserts the string representation of the float argument into this string buffer.
insert(int, int). Method in class java.lang.StringBuffer
Inserts the string representation of the second int argument into this string buffer.
insert(int, long). Method in class java.lang.StringBuffer
Inserts the string representation of the long argument into this string buffer.
insert(int, Object). Method in class java.lang.StringBuffer
Inserts the string representation of the Object argument into this string buffer.
insert(int, String). Method in class java.lang.StringBuffer
Inserts the string into this string buffer.
insert(MenuItem, int). Method in class java.awt.Menu
360
361
m
insert(String, int). Method in class java.awt.Menu
Inserts an item with the specified label to this menu at the specified position.
insert(String, int). Method in class java.awt.TextArea
Inserts the specified text at the specified position.
insert(String, int). Method in interface java.awt.peer.TextAreaPeer
insertElementAt(Object, int). Method in class java.util.Vector
Inserts the specified object as a component in this vector at the specified index.
insertProviderAt(Provider, int). Static method in class java.security.Security
o
Adds a new provider, at a specified position.
insertSeparator(int). Method in class java.awt.Menu
Inserts a separator at the specified position
insertText(String, int). Method in class java.awt.TextArea
insertText(String, int). Method in interface java.awt.peer.TextAreaPeer
i.c
DEPRECATED: Replaced by insert(String, int).
insets. Variable in class java.awt.GridBagConstraints
insets(). Method in class java.awt.Container
insets(). Method in interface java.awt.peer.ContainerPeer
DEPRECATED: Replaced by getInsets().
Insets(int, int, int, int). Constructor for class java.awt.Insets
Constructs and initializes a new Inset with the specified top, left, bottom, and right insets.
inside(int, int). Method in class java.awt.Component
inside(int, int). Method in class java.awt.Polygon
inside(int, int). Method in class java.awt.Rectangle
dil
instantiate(ClassLoader, String). Static method in class java.beans.Beans
Instantiate a bean.
InstantiationError(). Constructor for class java.lang.InstantiationError
Constructs an InstantiationError with no detail message.
InstantiationError(String). Constructor for class java.lang.InstantiationError
Constructs an InstantiationError with the specified detail message.
InstantiationException(). Constructor for class java.lang.InstantiationException
Constructs an InstantiationException with no detail message.
InstantiationException(String). Constructor for class java.lang.InstantiationException
Constructs an InstantiationException with the specified detail message.
intBitsToFloat(int). Static method in class java.lang.Float
va
Returns the single-float corresponding to a given bit represention.
INTEGER. Static variable in class java.sql.Types
Integer(int). Constructor for class java.lang.Integer
Constructs a newly allocated Integer object that represents the primitive int argument.
Integer(String). Constructor for class java.lang.Integer
Constructs a newly allocated Integer object that represents the value represented by the string.
INTEGER_FIELD. Static variable in class java.text.NumberFormat
Field constant used to construct a FieldPosition object.
INTERFACE. Static variable in class java.lang.reflect.Modifier
intern(). Method in class java.lang.String
ja
361
362
m
intValue(). Method in class java.lang.Float
Returns the integer value of this Float (by casting to an int).
intValue(). Method in class java.lang.Integer
Returns the value of this Integer as an int.
intValue(). Method in class java.lang.Long
Returns the value of this Long as an int.
intValue(). Method in class java.lang.Number
Returns the value of the specified number as an int.
o
intValue(). Method in class java.lang.Short
Returns the value of this Short as an int.
invalidate(). Method in class java.awt.Component
Invalidates the component.
invalidate(). Method in class java.awt.Container
i.c
Invalidates the container.
invalidateLayout(Container). Method in class java.awt.BorderLayout
Invalidates the layout, indicating that if the layout manager has cached information it should be discarded.
invalidateLayout(Container). Method in class java.awt.CardLayout
Invalidates the layout, indicating that if the layout manager has cached information it should be discarded.
invalidateLayout(Container). Method in class java.awt.GridBagLayout
Invalidates the layout, indicating that if the layout manager has cached information it should be discarded.
invalidateLayout(Container). Method in interface java.awt.LayoutManager2
Invalidates the layout, indicating that if the layout manager has cached information it should be discarded.
InvalidClassException(String). Constructor for class java.io.InvalidClassException
dil
Report a InvalidClassException for the specified reason.
InvalidClassException(String, String). Constructor for class java.io.InvalidClassException
InvalidKeyException(). Constructor for class java.security.InvalidKeyException
Constructs an InvalidKeyException with no detail message.
InvalidKeyException(String). Constructor for class java.security.InvalidKeyException
Constructs an InvalidKeyException with the specified detail message.
InvalidObjectException(String). Constructor for class java.io.InvalidObjectException
Raised by a class when it is explicitly disallowing itself to be serialized.
InvalidParameterException(). Constructor for class java.security.InvalidParameterException
Constructs an InvalidParameterException with no detail message.
InvalidParameterException(String). Constructor for class java.security.InvalidParameterException
va
Constructs an InvalidParameterException with the specified detail message.
InvocationTargetException(). Constructor for class java.lang.reflect.InvocationTargetException
InvocationTargetException(Throwable). Constructor for class java.lang.reflect.InvocationTargetException
Constructs a InvocationTargetException with a target exception.
InvocationTargetException(Throwable, String). Constructor for class java.lang.reflect.InvocationTargetException
Constructs a InvocationTargetException with a target exception and a detail message.
invoke(Object, Object[]). Method in class java.lang.reflect.Method
Invokes the underlying method represented by this Method object, on the specified object with the specified parameters.
invoke(RemoteCall). Method in interface java.rmi.server.RemoteRef
Executes the remote call.
ja
362
363
m
Updates to "bound" properties will cause a "PropertyChange" event to get fired when the property is changed.
isCaseSensitive(int). Method in interface java.sql.ResultSetMetaData
Does a column's case matter?
isCatalogAtStart(). Method in interface java.sql.DatabaseMetaData
Does a catalog appear at the start of a qualified table name? (Otherwise it appears at the end)
isClosed(). Method in interface java.sql.Connection
Tests to see if a Connection is closed.
isConstrained(). Method in class java.beans.PropertyDescriptor
o
Attempted updates to "Constrained" properties will cause a "VetoableChange" event to get fired when the property is
changed.
isConsumed(). Method in class java.awt.AWTEvent
isConsumed(). Method in class java.awt.event.InputEvent
Returns whether or not this event has been consumed.
i.c
isConsumer(ImageConsumer). Method in class java.awt.image.FilteredImageSource
Determines whether an ImageConsumer is on the list of consumers currently interested in data for this image.
isConsumer(ImageConsumer). Method in interface java.awt.image.ImageProducer
This method determines if a given ImageConsumer object is currently registered with this ImageProducer as one of its
consumers.
isConsumer(ImageConsumer). Method in class java.awt.image.MemoryImageSource
Determine if an ImageConsumer is on the list of consumers currently interested in data for this image.
isControlDown(). Method in class java.awt.event.InputEvent
Returns whether or not the Control modifier is down on this event.
isCurrency(int). Method in interface java.sql.ResultSetMetaData
dil
Is the column a cash value?
isDaemon(). Method in class java.lang.Thread
Tests if this thread is a daemon thread.
isDaemon(). Method in class java.lang.ThreadGroup
Tests if this thread group is a daemon thread group.
isDataFlavorSupported(DataFlavor). Method in class java.awt.datatransfer.StringSelection
Returns whether the requested flavor is supported by this object.
isDataFlavorSupported(DataFlavor). Method in interface java.awt.datatransfer.Transferable
Returns whether or not the specified data flavor is supported for this object.
isDecimalSeparatorAlwaysShown(). Method in class java.text.DecimalFormat
Allows you to get the behavior of the decimal separator with integers.
va
isDefined(char). Static method in class java.lang.Character
Determines if a character has a defined meaning in Unicode.
isDefinitelyWritable(int). Method in interface java.sql.ResultSetMetaData
Will a write on the column definitely succeed?
isDesignTime(). Static method in class java.beans.Beans
Test if we are in design-mode.
isDestroyed(). Method in class java.lang.ThreadGroup
Tests if this thread group has not been destroyed.
isDigit(char). Static method in class java.lang.Character
Determines if the specified character is a digit.
ja
363
364
m
Returns whether this component can be traversed using Tab or Shift-Tab keyboard focus traversal.
isFocusTraversable(). Method in interface java.awt.peer.ComponentPeer
isGroupingUsed(). Method in class java.text.NumberFormat
Returns true if grouping is used in this format.
isGuiAvailable(). Static method in class java.beans.Beans
isHidden(). Method in class java.beans.FeatureDescriptor
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 java.lang.Character
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 java.beans.EventSetDescriptor
Report if an event set is in the "default set".
isIndexSelected(int). Method in class java.awt.List
Returns true if the item at the specified index has been selected; false otherwise.
i.c
isInfinite(). Method in class java.lang.Double
Returns true if this Double value is infinitely large in magnitude.
isInfinite(). Method in class java.lang.Float
Returns true if this Float value is infinitely large in magnitude.
isInfinite(double). Static method in class java.lang.Double
Returns true if the specified number is infinitely large in magnitude.
isInfinite(float). Static method in class java.lang.Float
Returns true if the specified number is infinitely large in magnitude.
isInstance(Object). Method in class java.lang.Class
This method is the dynamic equivalent of the Java language instanceof operator.
dil
isInstanceOf(Object, Class). Static method in class java.beans.Beans
Check if a bean can be viewed as a given target type.
isInterface(). Method in class java.lang.Class
Determines if the specified Class object represents an interface type.
isInterface(). Method in class sun.tools.debug.RemoteClass
Is this RemoteClass an interface?
isInterface(int). Static method in class java.lang.reflect.Modifier
Return true if the specifier integer includes the interface modifier.
isInterrupted(). Method in class java.lang.Thread
Tests if the current thread has been interrupted.
isISOControl(char). Static method in class java.lang.Character
va
Determines if the specified character is an ISO control character.
isItalic(). Method in class java.awt.Font
Returns true if the font is italic.
isJavaIdentifierPart(char). Static method in class java.lang.Character
Determines if the specified character may be part of a Java identifier as other than the first character.
isJavaIdentifierStart(char). Static method in class java.lang.Character
Determines if the specified character is permissible as the first character in a Java identifier.
isJavaLetter(char). Static method in class java.lang.Character
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
364
365
m
Returns true if this Float value is Not-a-Number (NaN).
isNaN(double). Static method in class java.lang.Double
Returns true if the specified number is the special Not-a-Number (NaN) value.
isNaN(float). Static method in class java.lang.Float
Returns true if the specified number is the special Not-a-Number (NaN) value.
isNative(int). Static method in class java.lang.reflect.Modifier
Return true if the specifier integer includes the native modifier.
isNegative(). Method in interface java.security.acl.AclEntry
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 java.sql.ResultSetMetaData
Can you put a NULL in this column?
isObject(). Method in class sun.tools.debug.RemoteValue
i.c
Returns whether the RemoteValue is an Object (as opposed to a primitive type, such as int).
isOwner(Principal). Method in interface java.security.acl.Owner
Returns true if the given principal is an owner of the ACL.
isPaintable(). Method in interface java.beans.PropertyEditor
isPaintable(). Method in class java.beans.PropertyEditorSupport
isParseIntegerOnly(). Method in class java.text.NumberFormat
Returns true if this format will parse numbers as integers only.
isPlain(). Method in class java.awt.Font
Returns true if the font is plain.
isPopupTrigger(). Method in class java.awt.event.MouseEvent
dil
Returns whether or not this mouse event is the popup-menu trigger event for the platform.
isPrimitive(). Method in class java.lang.Class
Determines if the specified Class object represents a primitive Java type.
isPrivate(int). Static method in class java.lang.reflect.Modifier
Return true if the specifier integer includes the private modifier.
isProbablePrime(int). Method in class java.math.BigInteger
Returns true if this BigInteger is probably prime, false if it's definitely composite.
isProtected(int). Static method in class java.lang.reflect.Modifier
Return true if the specifier integer includes the protected modifier.
isPublic(int). Static method in class java.lang.reflect.Modifier
Return true if the specified integer includes the public modifier.
va
isReadOnly(). Method in interface java.sql.Connection
Tests to see if the connection is in read-only mode.
isReadOnly(). Method in interface java.sql.DatabaseMetaData
Is the database in read-only mode?
isReadOnly(int). Method in interface java.sql.ResultSetMetaData
Is a column definitely not writable?
isResizable(). Method in class java.awt.Dialog
Returns true if the user can resize the dialog.
isResizable(). Method in class java.awt.Frame
Returns true if the user can resize the Frame.
ja
365
366
m
Returns whether or not this focus change event is a temporary change.
isTimeSet. Variable in class java.util.Calendar
The flag which indicates if the current time is set for the calendar.
isTitleCase(char). Static method in class java.lang.Character
Determines if the specified character is a titlecase character.
isTransient(int). Static method in class java.lang.reflect.Modifier
Return true if the specifier integer includes the transient modifier.
isUnicast(). Method in class java.beans.EventSetDescriptor
o
Normally event sources are multicast.
isUnicodeIdentifierPart(char). Static method in class java.lang.Character
Determines if the specified character may be part of a Unicode identifier as other than the first character.
isUnicodeIdentifierStart(char). Static method in class java.lang.Character
Determines if the specified character is permissible as the first character in a Unicode identifier.
i.c
isUnique(). Static method in class java.rmi.dgc.VMID
Return true if an accurate address can be determined for this host.
isUpperCase(char). Static method in class java.lang.Character
Determines if the specified character is an uppercase character.
isValid(). Method in class java.awt.Component
Checks if this Component is valid.
isVisible(). Method in class java.awt.Component
Checks if this Component is visible.
isVolatile(int). Static method in class java.lang.reflect.Modifier
Return true if the specifier integer includes the volatile modifier.
dil
isWhitespace(char). Static method in class java.lang.Character
Determines if the specified character is white space according to Java.
isWritable(int). Method in interface java.sql.ResultSetMetaData
Is it possible for a write on the column to succeed?
ITALIAN. Static variable in class java.util.Locale
Useful constant for language.
ITALIC. Static variable in class java.awt.Font
The italicized style constant.
ITALY. Static variable in class java.util.Locale
Useful constant for country.
ITEM_EVENT_MASK. Static variable in class java.awt.AWTEvent
va
The event mask for selecting item events.
ITEM_FIRST. Static variable in class java.awt.event.ItemEvent
Marks the first integer id for the range of item event ids.
ITEM_LAST. Static variable in class java.awt.event.ItemEvent
Marks the last integer id for the range of item event ids.
ITEM_STATE_CHANGED. Static variable in class java.awt.event.ItemEvent
The item state changed event type.
ItemEvent(ItemSelectable, int, Object, int). Constructor for class java.awt.event.ItemEvent
Constructs a ItemSelectEvent object with the specified ItemSelectable source, type, item, and item select state.
itemStateChanged(ItemEvent). Method in class java.awt.AWTEventMulticaster
ja
Handles the itemStateChanged event by invoking the itemStateChanged methods on listener-a and listener-b.
itemStateChanged(ItemEvent). Method in interface java.awt.event.ItemListener
Invoked when an item's state has been changed.
itrace(boolean). Method in class sun.tools.debug.RemoteDebugger
Turn on/off instruction tracing.
w.
366
367
m
K
o
The action-key press keyboard event.
KEY_ACTION_RELEASE. Static variable in class java.awt.Event
The action-key release keyboard event.
KEY_EVENT_MASK. Static variable in class java.awt.AWTEvent
The event mask for selecting key events.
i.c
KEY_FIRST. Static variable in class java.awt.event.KeyEvent
Marks the first integer id for the range of key event ids.
KEY_LAST. Static variable in class java.awt.event.KeyEvent
Marks the last integer id for the range of key event ids.
KEY_PRESS. Static variable in class java.awt.Event
The key press keyboard event.
KEY_PRESSED. Static variable in class java.awt.event.KeyEvent
The key pressed event type.
KEY_RELEASE. Static variable in class java.awt.Event
The key release keyboard event.
dil
KEY_RELEASED. Static variable in class java.awt.event.KeyEvent
The key released event type.
KEY_TYPED. Static variable in class java.awt.event.KeyEvent
The key typed event type.
KeyAdapter(). Constructor for class java.awt.event.KeyAdapter
keyDown(Event, int). Method in class java.awt.Component
KeyEvent(Component, int, long, int, int). Constructor for class java.awt.event.KeyEvent
KeyEvent(Component, int, long, int, int, char). Constructor for class java.awt.event.KeyEvent
Constructs a KeyEvent object with the specified source component, type, modifiers, and key.
KeyException(). Constructor for class java.security.KeyException
Constructs a KeyException with no detail message.
va
KeyException(String). Constructor for class java.security.KeyException
Constructs a KeyException with the specified detail message.
KeyManagementException(). Constructor for class java.security.KeyManagementException
Constructs a KeyManagementException with no detail message.
KeyManagementException(String). Constructor for class java.security.KeyManagementException
Constructs a KeyManagementException with the specified detail message.
KeyPair(PublicKey, PrivateKey). Constructor for class java.security.KeyPair
Constructs a key with the specified public key and private key.
KeyPairGenerator(String). Constructor for class java.security.KeyPairGenerator
Creates a KeyPairGenerator object for the specified algorithm.
ja
367
368
m
Constructs a new label with the specified String of text.
Label(String, int). Constructor for class java.awt.Label
Constructs a new label with the specified String of text and the specified alignment.
last(). Method in class java.text.BreakIterator
Return the last boundary.
last(). Method in interface java.text.CharacterIterator
Set the position to getEndIndex()-1, return the character at that position.
last(). Method in class java.text.StringCharacterIterator
o
Set the position to getEndIndex() and return the character at that position.
last(Container). Method in class java.awt.CardLayout
Flips to the last card of the specified container.
lastElement(). Method in class java.util.Vector
Returns the last component of the vector.
i.c
lastIndexOf(int). Method in class java.lang.String
Returns the index within this string of the last occurrence of the specified character.
lastIndexOf(int, int). Method in class java.lang.String
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 java.util.Vector
Returns the index of the last occurrence of the specified object in this vector.
lastIndexOf(Object, int). Method in class java.util.Vector
Searches backwards for the specified object, starting from the specified index, and returns an index to it.
lastIndexOf(String). Method in class java.lang.String
dil
Returns the index within this string of the rightmost occurrence of the specified substring.
lastIndexOf(String, int). Method in class java.lang.String
Returns the index within this string of the last occurrence of the specified substring.
lastModified(). Method in class java.io.File
Returns the time that the file represented by this File object was last modified.
LastOwnerException(). Constructor for class java.security.acl.LastOwnerException
Constructs a LastOwnerException.
lastPageFirst(). Method in class java.awt.PrintJob
Returns true if the last page will be printed first.
layout(). Method in class java.awt.Component
layout(). Method in class java.awt.Container
va
layout(). Method in class java.awt.ScrollPane
layoutContainer(Container). Method in class java.awt.BorderLayout
Lays out the specified container.
layoutContainer(Container). Method in class java.awt.CardLayout
Performs a layout in the specified panel.
layoutContainer(Container). Method in class java.awt.FlowLayout
Lays out the container.
layoutContainer(Container). Method in class java.awt.GridBagLayout
Lays out the container in the specified panel.
layoutContainer(Container). Method in class java.awt.GridLayout
ja
368
369
m
LETTER_NUMBER. Static variable in class java.lang.Character
lightGray. Static variable in class java.awt.Color
The color light gray.
LINE_SEPARATOR. Static variable in class java.lang.Character
lineno(). Method in class java.io.StreamTokenizer
Return the current line number.
LineNumberInputStream(InputStream). Constructor for class java.io.LineNumberInputStream
Constructs a newline number input stream that reads its input from the specified input stream.
o
LineNumberReader(Reader). Constructor for class java.io.LineNumberReader
Create a new line-numbering reader, using the default input-buffer size.
LineNumberReader(Reader, int). Constructor for class java.io.LineNumberReader
Create a new line-numbering reader, reading characters into a buffer of the given size.
LinkageError(). Constructor for class java.lang.LinkageError
i.c
Constructs a LinkageError with no detail message.
LinkageError(String). Constructor for class java.lang.LinkageError
Constructs a LinkageError with the specified detail message.
list(). Method in class java.awt.Component
Prints a listing to System.out.
list(). Method in class java.io.File
Returns a list of the files in the directory specified by this File object.
List(). Constructor for class java.awt.List
Creates a new scrolling list initialized with no visible Lines or multiple selections.
list(). Method in interface java.rmi.registry.Registry
dil
Returns an array of the names in the registry.
list(). Method in class java.lang.ThreadGroup
Prints information about this thread group to the standard output.
list(FilenameFilter). Method in class java.io.File
Returns a list of the files in the directory specified by this File that satisfy the specified filter.
List(int). Constructor for class java.awt.List
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 java.awt.List
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 java.awt.Component
Prints a listing to the specified print stream.
list(PrintStream). Method in class java.util.Properties
Prints this property list out to the specified output stream.
list(PrintStream, int). Method in class java.awt.Component
Prints out a list, starting at the specified indention, to the specified print stream.
list(PrintStream, int). Method in class java.awt.Container
Prints out a list, starting at the specified indention, to the specified out stream.
list(PrintWriter). Method in class java.awt.Component
Prints a listing to the specified print writer.
ja
369
370
m
Requests the class loader to load a class with the specified name.
loadClass(String). Method in interface java.rmi.server.LoaderHandler
Load class using java.rmi.server.codebase property.
loadClass(String). Static method in class java.rmi.server.RMIClassLoader
Load a class from the URL specified in the java.rmi.server.codebase property.
loadClass(String, boolean). Method in class java.lang.ClassLoader
Resolves the specified name to a Class.
loadClass(URL, String). Method in interface java.rmi.server.LoaderHandler
o
Load class from codebase URL specified.
loadClass(URL, String). Static method in class java.rmi.server.RMIClassLoader
Load a class from a URL.
loadImage(String). Method in class java.beans.SimpleBeanInfo
This is a utility method to help in loading icon images.
i.c
LOADING. Static variable in class java.awt.MediaTracker
Flag indicating some media is currently being loaded.
loadLibrary(String). Method in class java.lang.Runtime
Loads the dynamic library with the specified library name.
loadLibrary(String). Static method in class java.lang.System
Loads the system library specified by the libname argument.
loadSystemColors(int[]). Method in class java.awt.Toolkit
Fills in the provided int array with the current system color values
locale. Variable in class java.awt.Component
The locale for the component.
dil
Locale(String, String). Constructor for class java.util.Locale
Construct a locale from language, country.
Locale(String, String, String). Constructor for class java.util.Locale
Construct a locale from language, country, variant.
localPort. Variable in class java.net.DatagramSocketImpl
localport. Variable in class java.net.SocketImpl
The local port number to which this socket is connected.
locate(int, int). Method in class java.awt.Component
locate(int, int). Method in class java.awt.Container
location(). Method in class java.awt.Component
location(int, int). Method in class java.awt.GridBagLayout
va
lock. Variable in class java.io.Reader
The object used to synchronize operations on this stream.
lock. Variable in class java.io.Writer
The object used to synchronize operations on this stream.
log(double). Static method in class java.lang.Math
Returns the natural logarithm (base e) of a double value.
log(String). Static method in class java.rmi.server.LogStream
Return the LogStream identified by the given name.
LONG. Static variable in class java.text.DateFormat
Constant for long style pattern.
ja
370
371
m
lookupConstraints(Component). Method in class java.awt.GridBagLayout
Retrieves the constraints for the specified component.
loop(). Method in interface java.applet.AudioClip
Starts playing this audio clip in a loop.
LOST_FOCUS. Static variable in class java.awt.Event
A component lost the focus.
lostFocus(Event, Object). Method in class java.awt.Component
lostOwnership(Clipboard, Transferable). Method in interface java.awt.datatransfer.ClipboardOwner
o
Notifies this object that it is no longer the owner of the contents of the clipboard.
lostOwnership(Clipboard, Transferable). Method in class java.awt.datatransfer.StringSelection
LOWERCASE_LETTER. Static variable in class java.lang.Character
lowerCaseMode(boolean). Method in class java.io.StreamTokenizer
Determines whether or not word token are automatically lowercased.
i.c
M
dil
MalformedURLException(). Constructor for class java.net.MalformedURLException
Constructs a MalformedURLException with no detail message.
MalformedURLException(String). Constructor for class java.net.MalformedURLException
Constructs a MalformedURLException with the specified detail message.
MARCH. Static variable in class java.util.Calendar
Useful constant for month.
mark. Variable in class java.io.ByteArrayInputStream
The currently marked position in the stream.
mark(int). Method in class java.io.BufferedInputStream
Marks the current position in this input stream.
mark(int). Method in class java.io.BufferedReader
va
Mark the present position in the stream.
mark(int). Method in class java.io.ByteArrayInputStream
Set the current marked position in the stream.
mark(int). Method in class java.io.CharArrayReader
Mark the present position in the stream.
mark(int). Method in class java.io.FilterInputStream
Marks the current position in this input stream.
mark(int). Method in class java.io.FilterReader
Mark the present position in the stream.
mark(int). Method in class java.io.InputStream
ja
371
372
m
Tell whether this stream supports the mark() operation, which it does not.
markSupported(). Method in class java.io.Reader
Tell whether this stream supports the mark() operation.
markSupported(). Method in class java.io.StringReader
Tell whether this stream supports the mark() operation, which it does.
MarshalException(String). Constructor for class java.rmi.MarshalException
Create a new marshal exception with a descriptive string.
MarshalException(String, Exception). Constructor for class java.rmi.MarshalException
o
Create a new marshal exception with a descriptive string and an exception.
MATH_SYMBOL. Static variable in class java.lang.Character
max(BigDecimal). Method in class java.math.BigDecimal
Returns the BigDecimal whose value is the greater of this and val.
max(BigInteger). Method in class java.math.BigInteger
i.c
Returns the BigInteger whose value is the greater of this and val.
max(double, double). Static method in class java.lang.Math
Returns the greater of two double values.
max(float, float). Static method in class java.lang.Math
Returns the greater of two float values.
max(int, int). Static method in class java.lang.Math
Returns the greater of two int values.
max(long, long). Static method in class java.lang.Math
Returns the greater of two long values.
MAX_PRIORITY. Static variable in class java.lang.Thread
dil
The maximum priority that a thread can have.
MAX_RADIX. Static variable in class java.lang.Character
The maximum radix available for conversion to and from Strings.
MAX_VALUE. Static variable in class java.lang.Byte
The maximum value a Byte can have.
MAX_VALUE. Static variable in class java.lang.Character
The constant value of this field is the largest value of type char.
MAX_VALUE. Static variable in class java.lang.Double
The largest positive value of type double.
MAX_VALUE. Static variable in class java.lang.Float
The largest positive value of type float.
va
MAX_VALUE. Static variable in class java.lang.Integer
The largest value of type int.
MAX_VALUE. Static variable in class java.lang.Long
The largest value of type long.
MAX_VALUE. Static variable in class java.lang.Short
The maximum value a Short can have.
MAXGRIDSIZE. Static variable in class java.awt.GridBagLayout
maximumLayoutSize(Container). Method in class java.awt.BorderLayout
Returns the maximum dimensions for this layout given the components in the specified target container.
maximumLayoutSize(Container). Method in class java.awt.CardLayout
ja
Returns the maximum dimensions for this layout given the components in the specified target container.
maximumLayoutSize(Container). Method in class java.awt.GridBagLayout
Returns the maximum dimensions for this layout given the components in the specified target container.
maximumLayoutSize(Container). Method in interface java.awt.LayoutManager2
Returns the maximum size of this component.
MAY. Static variable in class java.util.Calendar
Useful constant for month.
w.
MemoryImageSource(int, int, ColorModel, int[], int, int). Constructor for class java.awt.image.MemoryImageSource
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 java.awt.image.MemoryImageSource
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 java.awt.image.MemoryImageSource
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 java.awt.image.MemoryImageSource
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 java.awt.SystemColor
The array index for the menu background color.
372
373
m
Constructs a new Menu with an empty label.
Menu(String). Constructor for class java.awt.Menu
Constructs a new Menu with the specified label.
Menu(String, boolean). Constructor for class java.awt.Menu
Constructs a new Menu with the specified label.
MENU_TEXT. Static variable in class java.awt.SystemColor
The array index for the menu text color.
MenuBar(). Constructor for class java.awt.MenuBar
o
Creates a new menu bar.
MenuComponent(). Constructor for class java.awt.MenuComponent
MenuItem(). Constructor for class java.awt.MenuItem
Constructs a new MenuItem with an empty label and no keyboard shortcut.
MenuItem(String). Constructor for class java.awt.MenuItem
i.c
Constructs a new MenuItem with the specified label and no keyboard shortcut.
MenuItem(String, MenuShortcut). Constructor for class java.awt.MenuItem
Create a MenuItem with an associated keyboard shortcut.
MenuShortcut(int). Constructor for class java.awt.MenuShortcut
Constructs a new MenuShortcut for the specified key.
MenuShortcut(int, boolean). Constructor for class java.awt.MenuShortcut
Constructs a new MenuShortcut for the specified key.
menuText. Static variable in class java.awt.SystemColor
The text color for menus.
MessageDigest(String). Constructor for class java.security.MessageDigest
dil
Creates a message digest with the specified algorithm name.
MessageFormat(String). Constructor for class java.text.MessageFormat
Constructs with the specified pattern.
META_MASK. Static variable in class java.awt.event.ActionEvent
The meta modifier constant.
META_MASK. Static variable in class java.awt.Event
The meta modifier constant.
META_MASK. Static variable in class java.awt.event.InputEvent
The meta key modifier constant.
metaDown(). Method in class java.awt.Event
Checks if the meta key is down.
va
method. Variable in class java.net.HttpURLConnection
methodArgument(). Method in class sun.tools.debug.RemoteStackVariable
Return whether variable is a method argument.
MethodDescriptor(Method). Constructor for class java.beans.MethodDescriptor
MethodDescriptor(Method, ParameterDescriptor[]). Constructor for class java.beans.MethodDescriptor
MILLISECOND. Static variable in class java.util.Calendar
Useful constant for date and time.
MILLISECOND_FIELD. Static variable in class java.text.DateFormat
Useful constant for MILLISECOND field alignment.
min(BigDecimal). Method in class java.math.BigDecimal
ja
Returns the BigDecimal whose value is the lesser of this and val.
min(BigInteger). Method in class java.math.BigInteger
Returns the BigInteger whose value is the lesser of this and val.
min(double, double). Static method in class java.lang.Math
Returns the smaller of two double values.
min(float, float). Static method in class java.lang.Math
Returns the smaller of two float values.
w.
373
374
m
Calculates the minimum size for the specified panel.
minimumLayoutSize(Container). Method in class java.awt.FlowLayout
Returns the minimum dimensions needed to layout the components contained in the specified target container.
minimumLayoutSize(Container). Method in class java.awt.GridBagLayout
Returns the minimum dimensions needed to layout the components contained in the specified panel.
minimumLayoutSize(Container). Method in class java.awt.GridLayout
Returns the minimum dimensions needed to layout the components contained in the specified panel.
minimumLayoutSize(Container). Method in interface java.awt.LayoutManager
o
Calculates the minimum size dimensions for the specified panel given the components in the specified parent container.
minimumSize(). Method in class java.awt.Component
minimumSize(). Method in interface java.awt.peer.ComponentPeer
DEPRECATED: Replaced by getMinimumSize().
minimumSize(). Method in class java.awt.Container
i.c
minimumSize(). Method in class java.awt.List
minimumSize(). Method in class java.awt.TextArea
minimumSize(). Method in class java.awt.TextField
minimumSize(int). Method in class java.awt.List
minimumSize(int). Method in interface java.awt.peer.ListPeer
DEPRECATED: Replaced by getMinimumSize(int).
minimumSize(int). Method in class java.awt.TextField
minimumSize(int). Method in interface java.awt.peer.TextFieldPeer
DEPRECATED: Replaced by getMinimumSize(int).
minimumSize(int, int). Method in class java.awt.TextArea
dil
minimumSize(int, int). Method in interface java.awt.peer.TextAreaPeer
DEPRECATED: Replaced by getMinimumSize(int, int).
MINSIZE. Static variable in class java.awt.GridBagLayout
MINUTE. Static variable in class java.util.Calendar
Useful constant for date and time.
MINUTE_FIELD. Static variable in class java.text.DateFormat
Useful constant for MINUTE field alignment.
MissingResourceException(String, String, String). Constructor for class java.util.MissingResourceException
Constructs a MissingResourceException with the specified information.
mkdir(). Method in class java.io.File
Creates a directory whose pathname is specified by this File object.
va
mkdirs(). Method in class java.io.File
Creates a directory whose pathname is specified by this File object, including any necessary parent directories.
mod(BigInteger). Method in class java.math.BigInteger
Returns a BigInteger whose value is this mod m.
Modifier(). Constructor for class java.lang.reflect.Modifier
MODIFIER_LETTER. Static variable in class java.lang.Character
MODIFIER_SYMBOL. Static variable in class java.lang.Character
modifiers. Variable in class java.awt.Event
The state of the modifier keys.
modInverse(BigInteger). Method in class java.math.BigInteger
ja
374
375
m
The event mask for selecting mouse motion events.
MOUSE_MOVE. Static variable in class java.awt.Event
The mouse move event.
MOUSE_MOVED. Static variable in class java.awt.event.MouseEvent
The mouse moved event type.
MOUSE_PRESSED. Static variable in class java.awt.event.MouseEvent
The mouse pressed event type.
MOUSE_RELEASED. Static variable in class java.awt.event.MouseEvent
o
The mouse released event type.
MOUSE_UP. Static variable in class java.awt.Event
The mouse up event.
MouseAdapter(). Constructor for class java.awt.event.MouseAdapter
mouseClicked(MouseEvent). Method in class java.awt.AWTEventMulticaster
i.c
Handles the mouseClicked event by invoking the mouseClicked methods on listener-a and listener-b.
mouseClicked(MouseEvent). Method in class java.awt.event.MouseAdapter
mouseClicked(MouseEvent). Method in interface java.awt.event.MouseListener
Invoked when the mouse has been clicked on a component.
mouseDown(Event, int, int). Method in class java.awt.Component
mouseDrag(Event, int, int). Method in class java.awt.Component
mouseDragged(MouseEvent). Method in class java.awt.AWTEventMulticaster
Handles the mouseDragged event by invoking the mouseDragged methods on listener-a and listener-b.
mouseDragged(MouseEvent). Method in class java.awt.event.MouseMotionAdapter
mouseDragged(MouseEvent). Method in interface java.awt.event.MouseMotionListener
dil
Invoked when a mouse button is pressed on a component and then dragged.
mouseEnter(Event, int, int). Method in class java.awt.Component
mouseEntered(MouseEvent). Method in class java.awt.AWTEventMulticaster
Handles the mouseEntered event by invoking the mouseEntered methods on listener-a and listener-b.
mouseEntered(MouseEvent). Method in class java.awt.event.MouseAdapter
mouseEntered(MouseEvent). Method in interface java.awt.event.MouseListener
Invoked when the mouse enters a component.
MouseEvent(Component, int, long, int, int, int, int, boolean). Constructor for class java.awt.event.MouseEvent
Constructs a MouseEvent object with the specified source component, type, modifiers, coordinates, and click count.
mouseExit(Event, int, int). Method in class java.awt.Component
mouseExited(MouseEvent). Method in class java.awt.AWTEventMulticaster
va
Handles the mouseExited event by invoking the mouseExited methods on listener-a and listener-b.
mouseExited(MouseEvent). Method in class java.awt.event.MouseAdapter
mouseExited(MouseEvent). Method in interface java.awt.event.MouseListener
Invoked when the mouse exits a component.
MouseMotionAdapter(). Constructor for class java.awt.event.MouseMotionAdapter
mouseMove(Event, int, int). Method in class java.awt.Component
mouseMoved(MouseEvent). Method in class java.awt.AWTEventMulticaster
Handles the mouseMoved event by invoking the mouseMoved methods on listener-a and listener-b.
mouseMoved(MouseEvent). Method in class java.awt.event.MouseMotionAdapter
mouseMoved(MouseEvent). Method in interface java.awt.event.MouseMotionListener
ja
Invoked when the mouse button has been moved on a component (with no buttons no down).
mousePressed(MouseEvent). Method in class java.awt.AWTEventMulticaster
Handles the mousePressed event by invoking the mousePressed methods on listener-a and listener-b.
mousePressed(MouseEvent). Method in class java.awt.event.MouseAdapter
mousePressed(MouseEvent). Method in interface java.awt.event.MouseListener
Invoked when a mouse button has been pressed on a component.
mouseReleased(MouseEvent). Method in class java.awt.AWTEventMulticaster
w.
Handles the mouseReleased event by invoking the mouseReleased methods on listener-a and listener-b.
mouseReleased(MouseEvent). Method in class java.awt.event.MouseAdapter
mouseReleased(MouseEvent). Method in interface java.awt.event.MouseListener
Invoked when a mouse button has been released on a component.
mouseUp(Event, int, int). Method in class java.awt.Component
move(int, int). Method in class java.awt.Component
move(int, int). Method in class java.awt.Point
Changes the point to have the specified location.
move(int, int). Method in class java.awt.Rectangle
MOVE_CURSOR. Static variable in class java.awt.Cursor
ww
375
376
m
N
o
The name of the property.
name. Variable in class java.awt.Font
The logical name of this font.
NaN. Static variable in class java.lang.Double
A NaN value of type double.
i.c
NaN. Static variable in class java.lang.Float
The NaN value of type float.
NATIVE. Static variable in class java.lang.reflect.Modifier
nativeSQL(String). Method in interface java.sql.Connection
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 java.awt.Cursor
The north-east-resize cursor type.
NE_RESIZE_CURSOR. Static variable in class java.awt.Frame
needsDictionary(). Method in class java.util.zip.Inflater
dil
Returns true if a preset dictionary is needed for decompression.
needsGui(). Method in interface java.beans.Visibility
needsInput(). Method in class java.util.zip.Deflater
Returns true if the input data buffer is empty and setInput() should be called in order to provide more input.
needsInput(). Method in class java.util.zip.Inflater
Returns true if no data remains in the input buffer.
negate(). Method in class java.math.BigDecimal
Returns a BigDecimal whose value is -1 * this, and whose scale is this.scale().
negate(). Method in class java.math.BigInteger
Returns a BigInteger whose value is (-1 * this).
NEGATIVE_INFINITY. Static variable in class java.lang.Double
va
The negative infinity of type double.
NEGATIVE_INFINITY. Static variable in class java.lang.Float
The negative infinity of type float.
NegativeArraySizeException(). Constructor for class java.lang.NegativeArraySizeException
Constructs a NegativeArraySizeException with no detail message.
NegativeArraySizeException(String). Constructor for class java.lang.NegativeArraySizeException
Constructs a NegativeArraySizeException with the specified detail message.
newCall(RemoteObject, Operation[], int, long). Method in interface java.rmi.server.RemoteRef
Creates an appropriate call object for a new remote method invocation on this object.
newInstance(). Method in class java.lang.Class
ja
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 java.awt.image.MemoryImageSource
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 java.awt.image.MemoryImageSource
Change to a new int array to hold the pixels for this image.
next(). Method in class java.text.BreakIterator
Return the boundary following the current boundary.
next(). Method in interface java.text.CharacterIterator
Increment the iterator's index by one and return the character at the new index.
next(). Method in class java.text.CollationElementIterator
Get the ordering priority of the next character in the string.
376
377
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 java.text.StringCharacterIterator
Increment the iterator's index by one and return the character at the new index.
next(Container). Method in class java.awt.CardLayout
Flips to the next card of the specified container.
next(int). Method in class java.text.BreakIterator
Return the nth boundary from the current boundary
o
next(int). Method in class java.util.Random
Generates the next pseudorandom number.
next(int). Method in class java.security.SecureRandom
Generates an integer containing the user-specified number of pseudo-random bits (right justified, with leading zeros).
nextBytes(byte[]). Method in class java.util.Random
i.c
Generates a user specified number of random bytes.
nextBytes(byte[]). Method in class java.security.SecureRandom
Generates a user-specified number of random bytes.
nextDouble(). Method in class java.util.Random
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 java.text.ChoiceFormat
Finds the least double greater than d.
nextDouble(double, boolean). Static method in class java.text.ChoiceFormat
nextElement(). Method in interface java.util.Enumeration
dil
Returns the next element of this enumeration.
nextElement(). Method in class java.util.StringTokenizer
Returns the same value as the nextToken method, except that its declared return value is Object rather than String.
nextFloat(). Method in class java.util.Random
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 java.awt.Component
nextGaussian(). Method in class java.util.Random
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 java.util.Random
va
Returns the next pseudorandom, uniformly distributed int value from this random number generator's sequence.
nextLong(). Method in class java.util.Random
Returns the next pseudorandom, uniformly distributed long value from this random number generator's sequence.
nextToken(). Method in class java.io.StreamTokenizer
Parses the next token from the input stream of this tokenizer.
nextToken(). Method in class java.util.StringTokenizer
Returns the next token from this string tokenizer.
nextToken(String). Method in class java.util.StringTokenizer
Returns the next token in this string tokenizer's string.
NO_COMPRESSION. Static variable in class java.util.zip.Deflater
ja
377
378
m
NoSuchAlgorithmException(String). Constructor for class java.security.NoSuchAlgorithmException
Constructs a NoSuchAlgorithmException with the specified detail message.
NoSuchElementException(). Constructor for class java.util.NoSuchElementException
Constructs a NoSuchElementException with no detail message.
NoSuchElementException(String). Constructor for class java.util.NoSuchElementException
Constructs a NoSuchElementException with the specified detail message.
NoSuchFieldError(). Constructor for class java.lang.NoSuchFieldError
Constructs a NoSuchFieldException with no detail message.
o
NoSuchFieldError(String). Constructor for class java.lang.NoSuchFieldError
Constructs a NoSuchFieldException with the specified detail message.
NoSuchFieldException(). Constructor for class java.lang.NoSuchFieldException
Constructor.
NoSuchFieldException(String). Constructor for class java.lang.NoSuchFieldException
i.c
Constructor with a detail message.
NoSuchLineNumberException(). Constructor for class sun.tools.debug.NoSuchLineNumberException
Constructor.
NoSuchLineNumberException(String). Constructor for class sun.tools.debug.NoSuchLineNumberException
Constructor with a detail message.
NoSuchMethodError(). Constructor for class java.lang.NoSuchMethodError
NoSuchMethodError(String). Constructor for class java.lang.NoSuchMethodError
Constructs a NoSuchMethodException with the specified detail message.
NoSuchMethodException(). Constructor for class java.lang.NoSuchMethodException
Constructs a NoSuchMethodException without a detail message.
dil
NoSuchMethodException(String). Constructor for class java.lang.NoSuchMethodException
Constructs a NoSuchMethodException with a detail message.
NoSuchObjectException(String). Constructor for class java.rmi.NoSuchObjectException
Create a new NoSuchObjectException with a description.
NoSuchProviderException(). Constructor for class java.security.NoSuchProviderException
Constructs a NoSuchProviderException with no detail message.
NoSuchProviderException(String). Constructor for class java.security.NoSuchProviderException
Constructs a NoSuchProviderException with the specified detail message.
not(). Method in class java.math.BigInteger
Returns a BigInteger whose value is (~this).
NotActiveException(). Constructor for class java.io.NotActiveException
va
Constructor to create a new NotActiveException with no reason.
NotActiveException(String). Constructor for class java.io.NotActiveException
Constructor to create a new NotActiveException with the reason given.
NotBoundException(). Constructor for class java.rmi.NotBoundException
NotBoundException(String). Constructor for class java.rmi.NotBoundException
notify(). Method in class java.lang.Object
Wakes up a single thread that is waiting on this object's monitor.
notifyAll(). Method in class java.lang.Object
Wakes up all threads that are waiting on this object's monitor.
notifyObservers(). Method in class java.util.Observable
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 java.util.Observable
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 java.security.acl.NotOwnerException
Constructs a NotOwnerException.
w.
Are concatenations between NULL and non-NULL values NULL? A JDBC-Compliant driver always returns true.
NullPointerException(). Constructor for class java.lang.NullPointerException
Constructs a NullPointerException with no detail message.
NullPointerException(String). Constructor for class java.lang.NullPointerException
Constructs a NullPointerException with the specified detail message.
nullsAreSortedAtEnd(). Method in interface java.sql.DatabaseMetaData
Are NULL values sorted at the end regardless of sort order?
nullsAreSortedAtStart(). Method in interface java.sql.DatabaseMetaData
Are NULL values sorted at the start regardless of sort order?
nullsAreSortedHigh(). Method in interface java.sql.DatabaseMetaData
Are NULL values sorted high?
nullsAreSortedLow(). Method in interface java.sql.DatabaseMetaData
378
379
m
NUM_LOCK. Static variable in class java.awt.Event
The NumLock action-key.
Number(). Constructor for class java.lang.Number
numberFormat. Variable in class java.text.DateFormat
The number formatter that DateFormat uses to format numbers in dates and times.
NumberFormat(). Constructor for class java.text.NumberFormat
NumberFormatException(). Constructor for class java.lang.NumberFormatException
Constructs a NumberFormatException with no detail message.
o
NumberFormatException(String). Constructor for class java.lang.NumberFormatException
Constructs a NumberFormatException with the specified detail message.
NUMERIC. Static variable in class java.sql.Types
nval. Variable in class java.io.StreamTokenizer
If the current token is a number, this field contains the value of that number.
i.c
NW_RESIZE_CURSOR. Static variable in class java.awt.Cursor
The north-west-resize cursor type.
NW_RESIZE_CURSOR. Static variable in class java.awt.Frame
dil
Create an ObjectInputStream that reads from the specified InputStream.
ObjectOutputStream(OutputStream). Constructor for class java.io.ObjectOutputStream
Creates an ObjectOutputStream that writes to the specified OutputStream.
ObjectStreamException(). Constructor for class java.io.ObjectStreamException
Create an ObjectStreamException.
ObjectStreamException(String). Constructor for class java.io.ObjectStreamException
Create an ObjectStreamException with the specified argument.
ObjID(). Constructor for class java.rmi.server.ObjID
Generate unique object identifier.
ObjID(int). Constructor for class java.rmi.server.ObjID
Generate a "well-known" object ID.
va
Observable(). Constructor for class java.util.Observable
Creates an observable object with no observers.
OCTOBER. Static variable in class java.util.Calendar
Useful constant for month.
okToUseGui(). Method in interface java.beans.Visibility
This method instructs the bean that it is OK to use the Gui.
on(boolean). Method in class java.security.DigestInputStream
Turns the digest function on or off.
on(boolean). Method in class java.security.DigestOutputStream
Turns the digest function on or off.
ja
Specifies that all characters c in the range low <= c <= high are "ordinary" in this tokenizer.
origmodel. Variable in class java.awt.image.RGBImageFilter
OTHER. Static variable in class java.sql.Types
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 java.lang.Character
OTHER_NUMBER. Static variable in class java.lang.Character
OTHER_PUNCTUATION. Static variable in class java.lang.Character
OTHER_SYMBOL. Static variable in class java.lang.Character
out. Static variable in class java.io.FileDescriptor
A handle to the standard output stream.
out. Variable in class java.io.FilterOutputStream
379
380
m
out. Variable in class java.io.PipedInputStream
out. Static variable in class java.lang.System
The "standard" output stream.
OutOfMemoryError(). Constructor for class java.lang.OutOfMemoryError
Constructs an OutOfMemoryError with no detail message.
OutOfMemoryError(String). Constructor for class java.lang.OutOfMemoryError
Constructs an OutOfMemoryError with the specified detail message.
outpixbuf. Variable in class java.awt.image.ReplicateScaleFilter
o
OutputStream(). Constructor for class java.io.OutputStream
OutputStreamWriter(OutputStream). Constructor for class java.io.OutputStreamWriter
Create an OutputStreamWriter that uses the default character encoding.
OutputStreamWriter(OutputStream, String). Constructor for class java.io.OutputStreamWriter
Create an OutputStreamWriter that uses the named character encoding.
i.c
owner. Variable in class java.awt.datatransfer.Clipboard
dil
defined by the prefix.
packagePrefix. Static variable in interface java.rmi.server.RemoteRef
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 java.awt.event.PaintEvent
The paint event type.
paint(Graphics). Method in class java.awt.Canvas
Paints the canvas in the default background color.
paint(Graphics). Method in class java.awt.Component
Paints the component.
paint(Graphics). Method in interface java.awt.peer.ComponentPeer
va
paint(Graphics). Method in class java.awt.Container
Paints the container.
PAINT_FIRST. Static variable in class java.awt.event.PaintEvent
Marks the first integer id for the range of paint event ids.
PAINT_LAST. Static variable in class java.awt.event.PaintEvent
Marks the last integer id for the range of paint event ids.
paintAll(Graphics). Method in class java.awt.Component
Paints the component and its subcomponents.
paintComponents(Graphics). Method in class java.awt.Container
Paints the components in this container.
ja
380
381
m
Returns the parameter String of this Event.
paramString(). Method in class java.awt.FileDialog
Returns the parameter String of this file dialog.
paramString(). Method in class java.awt.event.FocusEvent
paramString(). Method in class java.awt.Frame
Returns the parameter String of this Frame.
paramString(). Method in class java.awt.event.ItemEvent
paramString(). Method in class java.awt.event.KeyEvent
o
paramString(). Method in class java.awt.Label
Returns the parameter String of this label.
paramString(). Method in class java.awt.List
Returns the parameter String of this list.
paramString(). Method in class java.awt.Menu
i.c
Returns the String parameter of the menu.
paramString(). Method in class java.awt.MenuComponent
Returns the String parameter of this MenuComponent.
paramString(). Method in class java.awt.MenuItem
Returns the String parameter of the menu item.
paramString(). Method in class java.awt.MenuShortcut
paramString(). Method in class java.awt.event.MouseEvent
paramString(). Method in class java.awt.event.PaintEvent
paramString(). Method in class java.awt.Scrollbar
Returns the String parameters for this Scrollbar.
dil
paramString(). Method in class java.awt.ScrollPane
Returns the parameter String of this Container.
paramString(). Method in class java.awt.TextArea
Returns the String of parameters for this TextArea.
paramString(). Method in class java.awt.TextComponent
Returns the String of parameters for this TextComponent.
paramString(). Method in class java.awt.event.TextEvent
paramString(). Method in class java.awt.TextField
Returns the String of parameters for this TextField.
paramString(). Method in class java.awt.event.WindowEvent
parent. Variable in class java.util.ResourceBundle
va
The parent bundle is consulted by getObject when this bundle does not contain a particular resource.
parentOf(ThreadGroup). Method in class java.lang.ThreadGroup
Tests if this thread group is either the thread group argument or one of its ancestor thread groups.
parse(String). Static method in class java.util.Date
Given a string representing a time, parse it and return the time value.
parse(String). Method in class java.text.DateFormat
Parse a date/time string.
parse(String). Method in class java.text.MessageFormat
Parses the string.
parse(String). Method in class java.text.NumberFormat
ja
Convenience method.
parse(String, ParsePosition). Method in class java.text.ChoiceFormat
Returns a Long if possible (e.g.
parse(String, ParsePosition). Method in class java.text.DateFormat
Parse a date/time string according to the given parse position.
parse(String, ParsePosition). Method in class java.text.DecimalFormat
Returns a Long if possible (e.g.
w.
381
382
m
Parses a string to produce an object.
parseObject(String, ParsePosition). Method in class java.text.DateFormat
Parse a date/time string into an Object.
parseObject(String, ParsePosition). Method in class java.text.Format
Parses a string to produce an object.
parseObject(String, ParsePosition). Method in class java.text.MessageFormat
Parses the string.
parseObject(String, ParsePosition). Method in class java.text.NumberFormat
o
Parses a string to produce an object.
ParsePosition(int). Constructor for class java.text.ParsePosition
Create a new ParsePosition with the given initial index.
parseShort(String). Static method in class java.lang.Short
Assuming the specified String represents a short, returns that short's value.
i.c
parseShort(String, int). Static method in class java.lang.Short
Assuming the specified String represents a short, returns that short's value.
parseURL(URL, String, int, int). Method in class java.net.URLStreamHandler
Parses the string representation of a URL into a URL object.
pathSeparator. Static variable in class java.io.File
The system-dependent path separator string.
pathSeparatorChar. Static variable in class java.io.File
The system-dependent path separator character.
PAUSE. Static variable in class java.awt.Event
The Pause action-key.
dil
peek(). Method in class java.util.Stack
Looks at the object at the top of this stack without removing it from the stack.
peek(InetAddress). Method in class java.net.DatagramSocketImpl
Peek at the packet to see who it is from.
peekEvent(). Method in class java.awt.EventQueue
Return the first event without removing it.
peekEvent(int). Method in class java.awt.EventQueue
permissions(). Method in interface java.security.acl.AclEntry
Returns an enumeration of the permissions in this ACL entry.
PGDN. Static variable in class java.awt.Event
The page down action-key.
va
PGUP. Static variable in class java.awt.Event
The page up action-key.
PI. Static variable in class java.lang.Math
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 java.awt.Color
The color pink.
PIPE_SIZE. Static variable in class java.io.PipedInputStream
PipedInputStream(). Constructor for class java.io.PipedInputStream
Creates a piped input stream that is not yet connected to a piped output stream.
PipedInputStream(PipedOutputStream). Constructor for class java.io.PipedInputStream
ja
Creates a piped input stream connected to the specified piped output stream.
PipedOutputStream(). Constructor for class java.io.PipedOutputStream
Creates a piped output stream that is not yet connected to a piped input stream.
PipedOutputStream(PipedInputStream). Constructor for class java.io.PipedOutputStream
Creates a piped output stream connected to the specified piped input stream.
PipedReader(). Constructor for class java.io.PipedReader
Create a reader that is not yet connected to a piped writer.
w.
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 java.awt.image.PixelGrabber
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 java.awt.Font
The plain style constant.
plainTextFlavor. Static variable in class java.awt.datatransfer.DataFlavor
The DataFlavor representing plain text with unicode encoding, where:
representationClass = InputStream
mimeType = "text/plain; charset=unicode"
382
383
m
play(URL). Method in class java.applet.Applet
Plays the audio clip at the specified absolute URL.
play(URL, String). Method in class java.applet.Applet
Plays the audio clip given the URL and a specifier that is relative to it.
PM. Static variable in class java.util.Calendar
Useful constant for hour in 12-hour clock.
Point(). Constructor for class java.awt.Point
Constructs and initializes a Point initialized with (0, 0).
o
Point(int, int). Constructor for class java.awt.Point
Constructs and initializes a Point from the specified x and y coordinates.
Point(Point). Constructor for class java.awt.Point
Constructs and initializes a Point with the same location as the specified Point.
Polygon(). Constructor for class java.awt.Polygon
i.c
Creates an empty polygon.
Polygon(int[], int[], int). Constructor for class java.awt.Polygon
Constructs and initializes a Polygon from the specified parameters.
pop(). Method in class java.util.Stack
Removes the object at the top of this stack and returns that object as the value of this function.
PopupMenu(). Constructor for class java.awt.PopupMenu
Creates a new popup menu.
PopupMenu(String). Constructor for class java.awt.PopupMenu
Creates a new popup menu with the specified name.
port. Variable in class java.net.SocketImpl
dil
The port number on the remote host to which this socket is connected.
pos. Variable in class java.io.BufferedInputStream
The current position in the buffer.
pos. Variable in class java.io.ByteArrayInputStream
The index of the next character to read from the input stream buffer.
pos. Variable in class java.io.CharArrayReader
Current buffer position
pos. Variable in class java.io.PushbackInputStream
The current position within the buffer.
pos. Variable in class java.io.StringBufferInputStream
The index of the next character to read from the input stream buffer.
va
POSITIVE_INFINITY. Static variable in class java.lang.Double
The positive infinity of type double.
POSITIVE_INFINITY. Static variable in class java.lang.Float
The positive infinity of type float.
postEvent(AWTEvent). Method in class java.awt.EventQueue
Post a 1.1-style event to the EventQueue.
postEvent(Event). Method in class java.awt.Component
postEvent(Event). Method in class java.awt.MenuComponent
Posts the specified event to the menu.
postEvent(Event). Method in interface java.awt.MenuContainer
ja
Returns the preferred dimensions for this layout given the components int the specified panel.
preferredLayoutSize(Container). Method in interface java.awt.LayoutManager
Calculates the preferred size dimensions for the specified panel given the components in the specified parent container.
PREFERREDSIZE. Static variable in class java.awt.GridBagLayout
preferredSize(). Method in class java.awt.Component
preferredSize(). Method in interface java.awt.peer.ComponentPeer
DEPRECATED: Replaced by getPreferredSize().
preferredSize(). Method in class java.awt.Container
preferredSize(). Method in class java.awt.List
preferredSize(). Method in class java.awt.TextArea
preferredSize(). Method in class java.awt.TextField
preferredSize(int). Method in class java.awt.List
383
384
m
preferredSize(int). Method in interface java.awt.peer.TextFieldPeer
DEPRECATED: Replaced by getPreferredSize(int).
preferredSize(int, int). Method in class java.awt.TextArea
preferredSize(int, int). Method in interface java.awt.peer.TextAreaPeer
DEPRECATED: Replaced by getPreferredSize(int, int).
prepareCall(String). Method in interface java.sql.Connection
A SQL stored procedure call statement is handled by creating a CallableStatement for it.
prepareImage(Image, ImageObserver). Method in class java.awt.Component
o
Prepares an image for rendering on this Component.
prepareImage(Image, int, int, ImageObserver). Method in class java.awt.Component
Prepares an image for rendering on this Component at the specified width and height.
prepareImage(Image, int, int, ImageObserver). Method in interface java.awt.peer.ComponentPeer
prepareImage(Image, int, int, ImageObserver). Method in class java.awt.Toolkit
i.c
Prepares an image for rendering on the default screen at the specified width and height.
prepareStatement(String). Method in interface java.sql.Connection
A SQL statement with or without IN parameters can be pre-compiled and stored in a PreparedStatement object.
previous(). Method in class java.text.BreakIterator
Return the boundary preceding the current boundary.
previous(). Method in interface java.text.CharacterIterator
Decrement the iterator's index by one and return the character at the new index.
previous(). Method in class java.text.StringCharacterIterator
Decrement the iterator's index by one and return the character at the new index.
previous(Container). Method in class java.awt.CardLayout
dil
Flips to the previous card of the specified container.
previousDouble(double). Static method in class java.text.ChoiceFormat
Finds the greatest double less than d.
PRIMARY. Static variable in class java.text.Collator
Collator strength value.
primaryOrder(int). Static method in class java.text.CollationElementIterator
Get the primary order of a collation order.
print(boolean). Method in class java.io.PrintStream
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 java.io.PrintWriter
va
Print a boolean.
print(char). Method in class java.io.PrintStream
Prints the low eight bits of the character argument to this print stream's underlying output stream.
print(char). Method in class java.io.PrintWriter
Print a character.
print(char[]). Method in class java.io.PrintStream
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 java.io.PrintWriter
Print an array of chracters.
print(double). Method in class java.io.PrintStream
ja
Prints the string representation of the double to this print stream's underlying output stream.
print(double). Method in class java.io.PrintWriter
Print a double.
print(float). Method in class java.io.PrintStream
Prints the string representation of the float to this print stream's underlying output stream.
print(float). Method in class java.io.PrintWriter
Print a float.
w.
Prints the string representation of the long to this print stream's underlying output stream.
print(long). Method in class java.io.PrintWriter
Print a long.
print(Object). Method in class java.io.PrintStream
Prints the string representation of the Object to this print stream's underlying output stream.
print(Object). Method in class java.io.PrintWriter
Print an object.
print(String). Method in class java.io.PrintStream
If the string argument is null, the string "null" is printed to this print stream's underlying output stream.
print(String). Method in class java.io.PrintWriter
Print a String.
PRINT_SCREEN. Static variable in class java.awt.Event
384
385
m
printComponents(Graphics). Method in class java.awt.Container
Prints the components in this container.
printComponents(Graphics). Method in class java.awt.ScrollPane
Prints the component in this scroll pane.
PrintJob(). Constructor for class java.awt.PrintJob
println(). Method in class java.io.PrintStream
Prints a newline character to this print stream's underlying output stream.
println(). Method in class java.io.PrintWriter
o
Finish the line.
println(boolean). Method in class java.io.PrintStream
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 java.io.PrintWriter
Print a boolean, and then finish the line.
println(char). Method in class java.io.PrintStream
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 java.io.PrintWriter
Print a character, and then finish the line.
println(char[]). Method in class java.io.PrintStream
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 java.io.PrintWriter
Print an array of characters, and then finish the line.
println(double). Method in class java.io.PrintStream
Prints the string representation of the double followed by a newline to this print stream's underlying output stream.
println(double). Method in class java.io.PrintWriter
Print a double, and then finish the line.
println(float). Method in class java.io.PrintStream
Prints the string representation of the float followed by a newline to this print stream's underlying output stream.
println(float). Method in class java.io.PrintWriter
Print a float, and then finish the line.
println(int). Method in class java.io.PrintStream
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 java.io.PrintWriter
Print an integer, and then finish the line.
println(long). Method in class java.io.PrintStream
Prints the string representation of the long followed by a newline to this print stream's underlying output stream.
println(long). Method in class java.io.PrintWriter
Print a long, and then finish the line.
println(Object). Method in class java.io.PrintStream
Prints the string representation of the Object followed by a newline to this print stream's underlying output stream.
println(Object). Method in class java.io.PrintWriter
ja
Constructs a new print stream that writes its output to the specified underlying output stream.
printToConsole(String). Method in interface sun.tools.debug.DebuggerCallback
Print text to the debugger's console window.
PrintWriter(OutputStream). Constructor for class java.io.PrintWriter
Create a new PrintWriter, without automatic line flushing, from an existing OutputStream.
PrintWriter(OutputStream, boolean). Constructor for class java.io.PrintWriter
Create a new PrintWriter from an existing OutputStream.
PrintWriter(Writer). Constructor for class java.io.PrintWriter
Create a new PrintWriter, without automatic line flushing.
PrintWriter(Writer, boolean). Constructor for class java.io.PrintWriter
Create a new PrintWriter.
PRIVATE. Static variable in class java.lang.reflect.Modifier
385
386
m
procedureColumnInOut. Static variable in interface java.sql.DatabaseMetaData
COLUMN_TYPE - INOUT parameter.
procedureColumnOut. Static variable in interface java.sql.DatabaseMetaData
COLUMN_TYPE - OUT parameter.
procedureColumnResult. Static variable in interface java.sql.DatabaseMetaData
COLUMN_TYPE - result column in ResultSet.
procedureColumnReturn. Static variable in interface java.sql.DatabaseMetaData
COLUMN_TYPE - procedure return value.
o
procedureColumnUnknown. Static variable in interface java.sql.DatabaseMetaData
COLUMN_TYPE - nobody knows.
procedureNoNulls. Static variable in interface java.sql.DatabaseMetaData
TYPE NULLABLE - does not allow NULL values.
procedureNoResult. Static variable in interface java.sql.DatabaseMetaData
i.c
PROCEDURE_TYPE - Does not return a result.
procedureNullable. Static variable in interface java.sql.DatabaseMetaData
TYPE NULLABLE - allows NULL values.
procedureNullableUnknown. Static variable in interface java.sql.DatabaseMetaData
TYPE NULLABLE - nullability unknown.
procedureResultUnknown. Static variable in interface java.sql.DatabaseMetaData
PROCEDURE_TYPE - May return a result.
procedureReturnsResult. Static variable in interface java.sql.DatabaseMetaData
PROCEDURE_TYPE - Returns a result.
Process(). Constructor for class java.lang.Process
dil
processActionEvent(ActionEvent). Method in class java.awt.Button
Processes action events occurring on this button by dispatching them to any registered ActionListener objects.
processActionEvent(ActionEvent). Method in class java.awt.List
Processes action events occurring on this component by dispatching them to any registered ActionListener objects.
processActionEvent(ActionEvent). Method in class java.awt.MenuItem
Processes action events occurring on this menu item by dispatching them to any registered ActionListener objects.
processActionEvent(ActionEvent). Method in class java.awt.TextField
Processes action events occurring on this textfield by dispatching them to any registered ActionListener objects.
processAdjustmentEvent(AdjustmentEvent). Method in class java.awt.Scrollbar
Processes adjustment events occurring on this scrollbar by dispatching them to any registered AdjustmentListener objects.
processComponentEvent(ComponentEvent). Method in class java.awt.Component
va
Processes component events occurring on this component by dispatching them to any registered ComponentListener objects.
processContainerEvent(ContainerEvent). Method in class java.awt.Container
Processes container events occurring on this container by dispatching them to any registered ContainerListener objects.
processEvent(AWTEvent). Method in class java.awt.Button
Processes events on this button.
processEvent(AWTEvent). Method in class java.awt.Checkbox
Processes events on this checkbox.
processEvent(AWTEvent). Method in class java.awt.CheckboxMenuItem
Processes events on this checkbox menu item.
processEvent(AWTEvent). Method in class java.awt.Choice
ja
386
387
m
Processes mouse events occurring on this component by dispatching them to any registered MouseListener objects.
processMouseMotionEvent(MouseEvent). Method in class java.awt.Component
Processes mouse motion events occurring on this component by dispatching them to any registered MouseMotionListener
objects.
processTextEvent(TextEvent). Method in class java.awt.TextComponent
Processes text events occurring on this text component by dispatching them to any registered TextListener objects.
processWindowEvent(WindowEvent). Method in class java.awt.Window
Processes window events occurring on this window by dispatching them to any registered WindowListener objects.
o
PROPERTIES. Static variable in interface java.awt.image.ImageObserver
The properties of the image are now available.
Properties(). Constructor for class java.util.Properties
Creates an empty property list with no default values.
Properties(Properties). Constructor for class java.util.Properties
i.c
Creates an empty property list with the specified defaults.
propertyChange(PropertyChangeEvent). Method in interface java.beans.PropertyChangeListener
This method gets called when a bound property is changed.
PropertyChangeEvent(Object, String, Object, Object). Constructor for class java.beans.PropertyChangeEvent
PropertyChangeSupport(Object). Constructor for class java.beans.PropertyChangeSupport
PropertyDescriptor(String, Class). Constructor for class java.beans.PropertyDescriptor
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 java.beans.PropertyDescriptor
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 java.beans.PropertyDescriptor
This constructor takes the name of a simple property, and Method objects for reading and writing the property.
PropertyEditorManager(). Constructor for class java.beans.PropertyEditorManager
PropertyEditorSupport(). Constructor for class java.beans.PropertyEditorSupport
Constructor for use by derived PropertyEditor classes.
PropertyEditorSupport(Object). Constructor for class java.beans.PropertyEditorSupport
Constructor for use when a PropertyEditor is delegating to us.
propertyNames(). Method in class java.util.Properties
Returns an enumeration of all the keys in this property list, including the keys in the default property list.
PropertyResourceBundle(InputStream). Constructor for class java.util.PropertyResourceBundle
Creates a property resource
va
PropertyVetoException(String, PropertyChangeEvent). Constructor for class java.beans.PropertyVetoException
PROTECTED. Static variable in class java.lang.reflect.Modifier
ProtocolException(). Constructor for class java.net.ProtocolException
Constructs a new ProtocolException with no detail message.
ProtocolException(String). Constructor for class java.net.ProtocolException
Constructs a new ProtocolException with the specified detail message.
Provider(String, double, String). Constructor for class java.security.Provider
Constructs a provider with the specified name, version number, and information.
ProviderException(). Constructor for class java.security.ProviderException
Constructs a ProviderException with no detail message.
ja
Create a new pushback reader with a pushback buffer of the given size.
put(Object, Object). Method in class java.util.Dictionary
Maps the specified key to the specified value in this dictionary.
put(Object, Object). Method in class java.util.Hashtable
Maps the specified key to the specified value in this hashtable.
putNextEntry(ZipEntry). Method in class java.util.zip.ZipOutputStream
Begins writing a new ZIP file entry and positions the stream to the start of the entry data.
387
388
m
Specifies that matching pairs of this character delimit string constants in this tokenizer.
o
Random(). Constructor for class java.util.Random
Creates a new random number generator.
Random(long). Constructor for class java.util.Random
Creates a new random number generator using a single long seed.
RandomAccessFile(File, String). Constructor for class java.io.RandomAccessFile
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 java.io.RandomAccessFile
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 java.awt.image.ImageConsumer
The pixels will be delivered in a random order.
read(). Method in class java.io.BufferedInputStream
Reads the next byte of data from this buffered input stream.
read(). Method in class java.io.BufferedReader
Read a single character.
read(). Method in class java.io.ByteArrayInputStream
dil
Reads the next byte of data from this input stream.
read(). Method in class java.io.CharArrayReader
Read a single character.
read(). Method in class java.util.zip.CheckedInputStream
Reads a byte.
read(). Method in class java.security.DigestInputStream
Reads a byte, and updates the message digest (if the digest function is on).
read(). Method in class java.io.FileInputStream
Reads a byte of data from this input stream.
read(). Method in class java.io.FilterInputStream
Reads the next byte of data from this input stream.
va
read(). Method in class java.io.FilterReader
Read a single character.
read(). Method in class java.util.zip.InflaterInputStream
Reads a byte of uncompressed data.
read(). Method in class java.io.InputStream
Reads the next byte of data from this input stream.
read(). Method in class java.io.InputStreamReader
Read a single character.
read(). Method in class java.io.LineNumberInputStream
Reads the next byte of data from this input stream.
ja
Reads the next byte of data from this piped input stream.
read(). Method in class java.io.PushbackInputStream
Reads the next byte of data from this input stream.
read(). Method in class java.io.PushbackReader
Read a single character.
read(). Method in class java.io.RandomAccessFile
Reads a byte of data from this file.
read(). Method in class java.io.Reader
Read a single character.
read(). Method in class java.io.SequenceInputStream
ww
388
389
Reads up to b.length bytes of data from this input stream into an array of bytes.
read(byte[]). Method in interface java.io.ObjectInput
Reads into an array of bytes.
m
read(byte[]). Method in class java.io.RandomAccessFile
Reads up to b.length bytes of data from this file into an array of bytes.
read(byte[], int, int). Method in class java.io.BufferedInputStream
Reads up to len bytes of data from this buffered input stream into an array of bytes.
read(byte[], int, int). Method in class java.io.ByteArrayInputStream
Reads up to len bytes of data into an array of bytes from this input stream.
read(byte[], int, int). Method in class java.util.zip.CheckedInputStream
Reads into an array of bytes.
o
read(byte[], int, int). Method in class java.io.DataInputStream
Reads up to len bytes of data from this data input stream into an array of bytes.
read(byte[], int, int). Method in class java.security.DigestInputStream
Reads into a byte array, and updates the message digest (if the digest function is on).
read(byte[], int, int). Method in class java.io.FileInputStream
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 java.io.FilterInputStream
Reads up to len bytes of data from this input stream into an array of bytes.
read(byte[], int, int). Method in class java.util.zip.GZIPInputStream
Reads uncompressed data into an array of bytes.
read(byte[], int, int). Method in class java.util.zip.InflaterInputStream
Reads uncompressed data into an array of bytes.
read(byte[], int, int). Method in class java.io.InputStream
Reads up to len bytes of data from this input stream into an array of bytes.
read(byte[], int, int). Method in class java.io.LineNumberInputStream
dil
Reads up to len bytes of data from this input stream into an array of bytes.
read(byte[], int, int). Method in interface java.io.ObjectInput
Reads into an array of bytes.
read(byte[], int, int). Method in class java.io.ObjectInputStream
Reads into an array of bytes.
read(byte[], int, int). Method in class java.io.PipedInputStream
Reads up to len bytes of data from this piped input stream into an array of bytes.
read(byte[], int, int). Method in class java.io.PushbackInputStream
Reads up to len bytes of data from this input stream into an array of bytes.
read(byte[], int, int). Method in class java.io.RandomAccessFile
Reads up to len bytes of data from this file into an array of bytes.
va
read(byte[], int, int). Method in class java.io.SequenceInputStream
Reads up to len bytes of data from this input stream into an array of bytes.
read(byte[], int, int). Method in class java.io.StringBufferInputStream
Reads up to len bytes of data from this input stream into an array of bytes.
read(byte[], int, int). Method in class java.util.zip.ZipInputStream
Reads from the current ZIP entry into an array of bytes.
read(char[]). Method in class java.io.Reader
Read characters into an array.
read(char[], int, int). Method in class java.io.BufferedReader
Read characters into a portion of an array.
ja
389
390
m
readByte(). Method in class java.io.ObjectInputStream
Reads an 8 bit byte.
readByte(). Method in class java.io.RandomAccessFile
Reads a signed 8-bit value from this file.
readChar(). Method in interface java.io.DataInput
Reads a Unicode char value from the input stream.
readChar(). Method in class java.io.DataInputStream
Reads a Unicode character from this data input stream.
o
readChar(). Method in class java.io.ObjectInputStream
Reads a 16 bit char.
readChar(). Method in class java.io.RandomAccessFile
Reads a Unicode character from this file.
readDouble(). Method in interface java.io.DataInput
i.c
Reads a double value from the input stream.
readDouble(). Method in class java.io.DataInputStream
Reads a double from this data input stream.
readDouble(). Method in class java.io.ObjectInputStream
Reads a 64 bit double.
readDouble(). Method in class java.io.RandomAccessFile
Reads a double from this file.
Reader(). Constructor for class java.io.Reader
Create a new character-stream reader whose critical sections will synchronize on the reader itself.
Reader(Object). Constructor for class java.io.Reader
dil
Create a new character-stream reader whose critical sections will synchronize on the given object.
readExternal(ObjectInput). Method in interface java.io.Externalizable
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 java.io.DataInput
Reads a float value from the input stream.
readFloat(). Method in class java.io.DataInputStream
Reads a float from this data input stream.
readFloat(). Method in class java.io.ObjectInputStream
Reads a 32 bit float.
readFloat(). Method in class java.io.RandomAccessFile
va
Reads a float from this file.
readFully(byte[]). Method in interface java.io.DataInput
Reads b.length bytes into the byte array.
readFully(byte[]). Method in class java.io.DataInputStream
Reads b.length bytes from this data input stream into the byte array.
readFully(byte[]). Method in class java.io.ObjectInputStream
Reads bytes, blocking until all bytes are read.
readFully(byte[]). Method in class java.io.RandomAccessFile
Reads b.length bytes from this file into the byte array.
readFully(byte[], int, int). Method in interface java.io.DataInput
ja
390
391
m
Reads a 64 bit long.
readLong(). Method in class java.io.RandomAccessFile
Reads a signed 64-bit integer from this file.
readObject(). Method in interface java.io.ObjectInput
Read and return an object.
readObject(). Method in class java.io.ObjectInputStream
Read an object from the ObjectInputStream.
readShort(). Method in interface java.io.DataInput
o
Reads a 16-bit value from the input stream.
readShort(). Method in class java.io.DataInputStream
Reads a signed 16-bit number from this data input stream.
readShort(). Method in class java.io.ObjectInputStream
Reads a 16 bit short.
i.c
readShort(). Method in class java.io.RandomAccessFile
Reads a signed 16-bit number from this file.
readStreamHeader(). Method in class java.io.ObjectInputStream
The readStreamHeader method is provided to allow subclasses to read and verify their own stream headers.
readUnsignedByte(). Method in interface java.io.DataInput
Reads an unsigned 8-bit value from the input stream.
readUnsignedByte(). Method in class java.io.DataInputStream
Reads an unsigned 8-bit number from this data input stream.
readUnsignedByte(). Method in class java.io.ObjectInputStream
Reads an unsigned 8 bit byte.
dil
readUnsignedByte(). Method in class java.io.RandomAccessFile
Reads an unsigned 8-bit number from this file.
readUnsignedShort(). Method in interface java.io.DataInput
Reads an unsigned 16-bit value from the input stream.
readUnsignedShort(). Method in class java.io.DataInputStream
Reads an unsigned 16-bit number from this data input stream.
readUnsignedShort(). Method in class java.io.ObjectInputStream
Reads an unsigned 16 bit short.
readUnsignedShort(). Method in class java.io.RandomAccessFile
Reads an unsigned 16-bit number from this file.
readUTF(). Method in interface java.io.DataInput
va
Reads in a string that has been encoded using a modified UTF-8 format.
readUTF(). Method in class java.io.DataInputStream
Reads in a string that has been encoded using a modified UTF-8 format from this data input stream.
readUTF(). Method in class java.io.ObjectInputStream
Reads a UTF format String.
readUTF(). Method in class java.io.RandomAccessFile
Reads in a string from this file.
readUTF(DataInput). Static method in class java.io.DataInputStream
Reads in a string from the specified data input stream.
ready(). Method in class java.io.BufferedReader
ja
391
392
Constructs a rectangle and initializes it with the specified width and height parameters.
Rectangle(int, int, int, int). Constructor for class java.awt.Rectangle
Constructs and initializes a rectangle with the specified parameters.
m
Rectangle(Point). Constructor for class java.awt.Rectangle
Constructs a rectangle and initializes it to the specified point.
Rectangle(Point, Dimension). Constructor for class java.awt.Rectangle
Constructs a rectangle and initializes it to a specified point and dimension.
Rectangle(Rectangle). Constructor for class java.awt.Rectangle
Constructs a new rectangle, initialized to match the values of the specificed rectangle.
red. Static variable in class java.awt.Color
The color red.
o
ref. Variable in class java.rmi.server.RemoteObject
regionMatches(boolean, int, String, int, int). Method in class java.lang.String
Tests if two string regions are equal.
regionMatches(int, String, int, int). Method in class java.lang.String
Tests if two string regions are equal.
i.c
registerDriver(Driver). Static method in class java.sql.DriverManager
A newly loaded driver class should call registerDriver to make itself known to the DriverManager.
registerEditor(Class, Class). Static method in class java.beans.PropertyEditorManager
Register an editor class to be used to editor values of a given target class.
registerOutParameter(int, int). Method in interface java.sql.CallableStatement
Before executing a stored procedure call, you must explicitly call registerOutParameter to register the java.sql.Type of each
out parameter.
registerOutParameter(int, int, int). Method in interface java.sql.CallableStatement
Use this version of registerOutParameter for registering Numeric or Decimal out parameters.
registerValidation(ObjectInputValidation, int). Method in class java.io.ObjectInputStream
dil
Register an object to be validated before the graph is returned.
REGISTRY_ID. Static variable in class java.rmi.server.ObjID
well-known id for the registry
REGISTRY_PORT. Static variable in interface java.rmi.registry.Registry
Well known port for registry
registryImpl(int). Method in interface java.rmi.registry.RegistryHandler
Constructs and exports a Registry on the specified port.
registryStub(String, int). Method in interface java.rmi.registry.RegistryHandler
Returns a "stub" for contacting a remote registry on the specified host and port.
rehash(). Method in class java.util.Hashtable
Rehashes the contents of the hashtable into a hashtable with a larger capacity.
va
RELATIVE. Static variable in class java.awt.GridBagConstraints
releaseInputStream(). Method in interface java.rmi.server.RemoteCall
Release the input stream.
releaseOutputStream(). Method in interface java.rmi.server.RemoteCall
Release the output stream; in some transports this would release the stream.
REMAINDER. Static variable in class java.awt.GridBagConstraints
remainder(BigInteger). Method in class java.math.BigInteger
Returns a BigInteger whose value is (this % val).
RemoteDebugger(String, DebuggerCallback, boolean). Constructor for class sun.tools.debug.RemoteDebugger
Create a remote debugger.
ja
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 java.rmi.server.RemoteRef
w.
392
393
m
Removes the old adjustment-listener from adjustment-listener-l and returns the resulting multicast listener.
remove(Component). Method in class java.awt.Container
Removes the specified component from this container.
remove(ComponentListener, ComponentListener). Static method in class java.awt.AWTEventMulticaster
Removes the old component-listener from component-listener-l and returns the resulting multicast listener.
remove(ContainerListener, ContainerListener). Static method in class java.awt.AWTEventMulticaster
Removes the old container-listener from container-listener-l and returns the resulting multicast listener.
remove(EventListener). Method in class java.awt.AWTEventMulticaster
o
Removes a listener from this multicaster and returns the resulting multicast listener.
remove(FocusListener, FocusListener). Static method in class java.awt.AWTEventMulticaster
Removes the old focus-listener from focus-listener-l and returns the resulting multicast listener.
remove(int). Method in class java.awt.Choice
Removes an item from the choice menu.
i.c
remove(int). Method in interface java.awt.peer.ChoicePeer
remove(int). Method in class java.awt.Container
Removes the component at the specified index from this container.
remove(int). Method in class java.awt.List
Removes an item from the list.
remove(int). Method in class java.awt.Menu
Deletes the item from this menu at the specified index.
remove(int). Method in class java.awt.MenuBar
Removes the menu located at the specified index from the menu bar.
remove(ItemListener, ItemListener). Static method in class java.awt.AWTEventMulticaster
dil
Removes the old item-listener from item-listener-l and returns the resulting multicast listener.
remove(KeyListener, KeyListener). Static method in class java.awt.AWTEventMulticaster
Removes the old key-listener from key-listener-l and returns the resulting multicast listener.
remove(MenuComponent). Method in class java.awt.Component
Removes the specified popup menu from the component.
remove(MenuComponent). Method in class java.awt.Frame
Removes the specified menu bar from this Frame.
remove(MenuComponent). Method in class java.awt.Menu
Deletes the specified item from this menu.
remove(MenuComponent). Method in class java.awt.MenuBar
Removes the specified menu from the menu bar.
va
remove(MenuComponent). Method in interface java.awt.MenuContainer
remove(MouseListener, MouseListener). Static method in class java.awt.AWTEventMulticaster
Removes the old mouse-listener from mouse-listener-l and returns the resulting multicast listener.
remove(MouseMotionListener, MouseMotionListener). Static method in class java.awt.AWTEventMulticaster
Removes the old mouse-motion-listener from mouse-motion-listener-l and returns the resulting multicast listener.
remove(Object). Method in class java.util.Dictionary
Removes the key (and its corresponding value) from this dictionary.
remove(Object). Method in class java.util.Hashtable
Removes the key (and its corresponding value) from this hashtable.
remove(String). Method in class java.awt.Choice
ja
Removes the specified action listener so it no longer receives action events from this button.
removeActionListener(ActionListener). Method in class java.awt.List
Removes the specified action listener so it no longer receives action events from this list.
removeActionListener(ActionListener). Method in class java.awt.MenuItem
Removes the specified action listener so it no longer receives action events from this menu item.
removeActionListener(ActionListener). Method in class java.awt.TextField
Removes the specified action listener so that it no longer receives action events from this textfield.
removeAdjustmentListener(AdjustmentListener). Method in interface java.awt.Adjustable
Removes an adjustment listener.
removeAdjustmentListener(AdjustmentListener). Method in class java.awt.Scrollbar
ww
Removes the specified adjustment listener so that it no longer receives adjustment events from this scrollbar..
removeAll(). Method in class java.awt.Choice
Removes all items from the choice menu.
removeAll(). Method in class java.awt.Container
Removes all the components from this container.
removeAll(). Method in class java.awt.List
Removes all items from the list.
removeAll(). Method in interface java.awt.peer.ListPeer
removeAll(). Method in class java.awt.Menu
Deletes all items from this menu.
removeAllElements(). Method in class java.util.Vector
Removes all components from this vector and sets its size to zero.
393
394
m
Removes the specified listener so it no longer receives component events from this component.
removeConsumer(ImageConsumer). Method in class java.awt.image.FilteredImageSource
Removes an ImageConsumer from the list of consumers interested in data for this image.
removeConsumer(ImageConsumer). Method in interface java.awt.image.ImageProducer
This method removes the given ImageConsumer object from the list of consumers currently registered to receive image data.
removeConsumer(ImageConsumer). Method in class java.awt.image.MemoryImageSource
Remove an ImageConsumer from the list of consumers interested in data for this image.
removeContainerListener(ContainerListener). Method in class java.awt.Container
o
Removes the specified container listener so it no longer receives container events from this container.
removeElement(Object). Method in class java.util.Vector
Removes the first occurrence of the argument from this vector.
removeElementAt(int). Method in class java.util.Vector
Deletes the component at the specified index.
i.c
removeEntry(Principal, AclEntry). Method in interface java.security.acl.Acl
Removes an ACL entry from this ACL.
removeFocusListener(FocusListener). Method in class java.awt.Component
Removes the specified focus listener so it no longer receives focus events from this component.
removeIdentity(Identity). Method in class java.security.IdentityScope
Removes an identity from this identity scope.
removeImage(Image). Method in class java.awt.MediaTracker
Remove the specified Image from this MediaTracker.
removeImage(Image, int). Method in class java.awt.MediaTracker
Remove the specified Image from the specified ID of this MediaTracker.
dil
removeImage(Image, int, int, int). Method in class java.awt.MediaTracker
Remove the specified image with the specified size and ID from this MediaTracker.
removeInternal(EventListener, EventListener). Static method in class java.awt.AWTEventMulticaster
Returns the resulting multicast listener after removing the old listener from listener-l.
removeItemListener(ItemListener). Method in class java.awt.Checkbox
Removes the specified item listener so that it no longer receives item events from this checkbox.
removeItemListener(ItemListener). Method in class java.awt.CheckboxMenuItem
Removes the specified item listener so it no longer receives item events from this checkbox menu item.
removeItemListener(ItemListener). Method in class java.awt.Choice
Removes the specified item listener so that it no longer receives item events from this choice.
removeItemListener(ItemListener). Method in interface java.awt.ItemSelectable
va
Removes an item listener.
removeItemListener(ItemListener). Method in class java.awt.List
Removes the specified item listener so it no longer receives item events from this list.
removeKeyListener(KeyListener). Method in class java.awt.Component
Removes the specified key listener so it no longer receives key events from this component.
removeLayoutComponent(Component). Method in class java.awt.BorderLayout
Removes the specified component from the layout.
removeLayoutComponent(Component). Method in class java.awt.CardLayout
Removes the specified component from the layout.
removeLayoutComponent(Component). Method in class java.awt.FlowLayout
ja
394
395
m
Remove a PropertyChangeListener from the listener list.
removePropertyChangeListener(PropertyChangeListener). Method in interface java.beans.PropertyEditor
Remove a listener for the PropertyChange event.
removePropertyChangeListener(PropertyChangeListener). Method in class java.beans.PropertyEditorSupport
Remove a listener for the PropertyChange event.
removeProvider(String). Static method in class java.security.Security
Removes the provider with the specified name.
removeTextListener(TextListener). Method in class java.awt.TextComponent
o
Removes the specified text event listener so that it no longer receives text events from this textcomponent
removeVetoableChangeListener(VetoableChangeListener). Method in class java.beans.VetoableChangeSupport
Remove a VetoableChangeListener from the listener list.
removeWindowListener(WindowListener). Method in class java.awt.Window
Removes the specified window listener so that it no longer receives window events from this window.
i.c
renameTo(File). Method in class java.io.File
Renames the file specified by this File object to have the pathname given by the File argument.
repaint(). Method in class java.awt.Component
Repaints the component.
repaint(int, int, int, int). Method in class java.awt.Component
Repaints part of the component.
repaint(long). Method in class java.awt.Component
Repaints the component.
repaint(long, int, int, int, int). Method in class java.awt.Component
Repaints part of the component.
dil
repaint(long, int, int, int, int). Method in interface java.awt.peer.ComponentPeer
replace(char, char). Method in class java.lang.String
Returns a new string resulting from replacing all occurrences of oldChar in this string with newChar.
replaceItem(String, int). Method in class java.awt.List
Replaces the item at the given index.
replaceObject(Object). Method in class java.io.ObjectOutputStream
This method will allow trusted subclasses of ObjectOutputStream to substitute one object for another during serialization.
replaceRange(String, int, int). Method in class java.awt.TextArea
Replaces text from the indicated start to end position with the new text specified.
replaceRange(String, int, int). Method in interface java.awt.peer.TextAreaPeer
replaceText(String, int, int). Method in class java.awt.TextArea
va
replaceText(String, int, int). Method in interface java.awt.peer.TextAreaPeer
DEPRECATED: Replaced by ReplaceRange(String, int, int).
ReplicateScaleFilter(int, int). Constructor for class java.awt.image.ReplicateScaleFilter
Constructs a ReplicateScaleFilter that scales the pixels from its source Image as specified by the width and height parameters.
requestFocus(). Method in class java.awt.Component
Requests the input focus.
requestFocus(). Method in interface java.awt.peer.ComponentPeer
requestTopDownLeftRightResend(ImageConsumer). Method in class java.awt.image.FilteredImageSource
Requests that a given ImageConsumer have the image data delivered one more time in top-down, left-right order.
requestTopDownLeftRightResend(ImageConsumer). Method in interface java.awt.image.ImageProducer
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 java.awt.image.MemoryImageSource
Requests that a given ImageConsumer have the image data delivered one more time in top-down, left-right order.
required. Variable in class java.sql.DriverPropertyInfo
"required" is true if a value must be supplied for this property during Driver.connect.
w.
395
396
m
reset(). Method in class java.io.FilterInputStream
Repositions this stream to the position at the time the mark method was last called on this input stream.
reset(). Method in class java.io.FilterReader
Reset the stream.
reset(). Method in class java.util.zip.Inflater
Resets inflater so that a new set of input data can be processed.
reset(). Method in class java.io.InputStream
Repositions this stream to the position at the time the mark method was last called on this input stream.
o
reset(). Method in class java.io.LineNumberInputStream
Repositions this stream to the position at the time the mark method was last called on this input stream.
reset(). Method in class java.io.LineNumberReader
Reset the stream to the most recent mark.
reset(). Method in class java.security.MessageDigest
i.c
Resets the digest for further use.
reset(). Method in class java.io.ObjectOutputStream
Reset will disregard the state of any objects already written to the stream.
reset(). Method in class java.io.Reader
Reset the stream.
reset(). Method in class java.io.StringBufferInputStream
Resets the input stream to begin reading from the first character of this input stream's underlying buffer.
reset(). Method in class java.io.StringReader
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 sun.tools.debug.RemoteThread
dil
Reset the current stackframe
resetSyntax(). Method in class java.io.StreamTokenizer
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 java.awt.Component
reshape(int, int, int, int). Method in interface java.awt.peer.ComponentPeer
DEPRECATED: Replaced by setBounds(int, int, int, int).
reshape(int, int, int, int). Method in class java.awt.Rectangle
resize(Dimension). Method in class java.applet.Applet
Requests that this applet be resized.
resize(Dimension). Method in class java.awt.Component
va
resize(int, int). Method in class java.applet.Applet
Requests that this applet be resized.
resize(int, int). Method in class java.awt.Component
resize(int, int). Method in class java.awt.Rectangle
resolveClass(Class). Method in class java.lang.ClassLoader
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 java.io.ObjectInputStream
Subclasses may implement this method to allow classes to be fetched from an alternate source.
resolveObject(Object). Method in class java.io.ObjectInputStream
This method will allow trusted subclasses of ObjectInputStream to substitute one object for another during deserialization.
ja
396
397
m
RMISocketFactory(). Constructor for class java.rmi.server.RMISocketFactory
roll(int, boolean). Method in class java.util.Calendar
Time Field Rolling function.
roll(int, boolean). Method in class java.util.GregorianCalendar
Overrides Calendar Time Field Rolling function.
rollback(). Method in interface java.sql.Connection
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 java.lang.Math
Returns the closest long to the argument.
round(float). Static method in class java.lang.Math
Returns the closest int to the argument.
ROUND_CEILING. Static variable in class java.math.BigDecimal
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 java.math.BigDecimal
Never increment the digit prior to a discarded fraction (i.e., truncate).
ROUND_FLOOR. Static variable in class java.math.BigDecimal
If the BigDecimal is positive, behave as for ROUND_DOWN; if negative behave as for ROUND_UP.
ROUND_HALF_DOWN. Static variable in class java.math.BigDecimal
Behave as for ROUND_UP if the discarded fraction is > .5; otherwise, behave as for ROUND_DOWN.
ROUND_HALF_EVEN. Static variable in class java.math.BigDecimal
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 java.math.BigDecimal
Behave as for ROUND_UP if the discarded fraction is >= .5; otherwise, behave as for ROUND_DOWN.
ROUND_UNNECESSARY. Static variable in class java.math.BigDecimal
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 java.math.BigDecimal
Always increment the digit prior to a non-zero discarded fraction.
rowHeights. Variable in class java.awt.GridBagLayout
rowWeights. Variable in class java.awt.GridBagLayout
RuleBasedCollator(String). Constructor for class java.text.RuleBasedCollator
RuleBasedCollator constructor.
va
run(). Method in interface java.lang.Runnable
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 java.lang.Thread
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 sun.tools.debug.RemoteDebugger
Load and run a runnable Java class, with any optional parameters.
runFinalization(). Method in class java.lang.Runtime
Runs the finalization methods of any objects pending finalization.
ja
been automatically invoked are to be run before the Java runtime exits.
RuntimeException(). Constructor for class java.lang.RuntimeException
Constructs a RuntimeException with no detail message.
RuntimeException(String). Constructor for class java.lang.RuntimeException
Constructs a RuntimeException with the specified detail message.
S
ww
397
398
m
Returns the scale of this number.
SCALE_AREA_AVERAGING. Static variable in class java.awt.Image
Use the Area Averaging image scaling algorithm.
SCALE_DEFAULT. Static variable in class java.awt.Image
Use the default image scaling algorithm.
SCALE_FAST. Static variable in class java.awt.Image
Choose an image scaling algorithm that gives higher priority to scaling speed than smoothness of the scaled image.
SCALE_REPLICATE. Static variable in class java.awt.Image
o
Use the ReplicateScaleFilter image scaling algorithm.
SCALE_SMOOTH. Static variable in class java.awt.Image
Choose an image scaling algorithm that gives higher priority to image smoothness than scaling speed.
SCROLL_ABSOLUTE. Static variable in class java.awt.Event
The absolute scroll event.
i.c
SCROLL_BEGIN. Static variable in class java.awt.Event
The scroll begin event.
SCROLL_END. Static variable in class java.awt.Event
The scroll end event.
SCROLL_LINE_DOWN. Static variable in class java.awt.Event
The line down scroll event.
SCROLL_LINE_UP. Static variable in class java.awt.Event
The line up scroll event.
SCROLL_LOCK. Static variable in class java.awt.Event
The ScrollLock action-key.
dil
SCROLL_PAGE_DOWN. Static variable in class java.awt.Event
The page down scroll event.
SCROLL_PAGE_UP. Static variable in class java.awt.Event
The page up scroll event.
scrollbar. Static variable in class java.awt.SystemColor
The background color for scrollbars.
SCROLLBAR. Static variable in class java.awt.SystemColor
The array index for the scrollbar background color.
Scrollbar(). Constructor for class java.awt.Scrollbar
Constructs a new vertical Scrollbar.
Scrollbar(int). Constructor for class java.awt.Scrollbar
va
Constructs a new Scrollbar with the specified orientation.
Scrollbar(int, int, int, int, int). Constructor for class java.awt.Scrollbar
Constructs a new Scrollbar with the specified orientation, value, page size, and minumum and maximum values.
SCROLLBARS_ALWAYS. Static variable in class java.awt.ScrollPane
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 java.awt.ScrollPane
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 java.awt.TextArea
ja
398
399
m
SecurityException(). Constructor for class java.lang.SecurityException
Constructs a SecurityException with no detail message.
SecurityException(String). Constructor for class java.lang.SecurityException
Constructs a SecurityException with the specified detail message.
SecurityManager(). Constructor for class java.lang.SecurityManager
Constructs a new SecurityManager.
seek(long). Method in class java.io.RandomAccessFile
Sets the offset from the beginning of this file at which the next read or write occurs.
o
select(int). Method in class java.awt.Choice
Selects the item with the specified postion.
select(int). Method in interface java.awt.peer.ChoicePeer
select(int). Method in class java.awt.List
Selects the item at the specified index.
i.c
select(int). Method in interface java.awt.peer.ListPeer
select(int, int). Method in class java.awt.TextComponent
Selects the text found between the specified start and end locations.
select(int, int). Method in interface java.awt.peer.TextComponentPeer
select(String). Method in class java.awt.Choice
Selects the item with the specified String.
selectAll(). Method in class java.awt.TextComponent
Selects all the text in the TextComponent.
SELECTED. Static variable in class java.awt.event.ItemEvent
The item selected state change type.
dil
send(DatagramPacket). Method in class java.net.DatagramSocket
Sends a datagram packet from this socket.
send(DatagramPacket). Method in class java.net.DatagramSocketImpl
Sends a datagram packet.
send(DatagramPacket, byte). Method in class java.net.MulticastSocket
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 java.io.File
The system-dependent path separator character.
separatorChar. Static variable in class java.io.File
The system-dependent path separator string.
SEPTEMBER. Static variable in class java.util.Calendar
va
Useful constant for month.
SequenceInputStream(Enumeration). Constructor for class java.io.SequenceInputStream
Constructs a new sequence input stream initialized to the specified enumeration of input streams.
SequenceInputStream(InputStream, InputStream). Constructor for class java.io.SequenceInputStream
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 java.rmi.server.ServerCloneException
Create A remote exception with the specified string
ServerCloneException(String, Exception). Constructor for class java.rmi.server.ServerCloneException
Create A remote exception with the specified string, and the exception specified.
ServerError(String, Error). Constructor for class java.rmi.ServerError
ja
Create a new "server error" exception with the string and the specified exception.
ServerException(String). Constructor for class java.rmi.ServerException
Create a new server exception with a descriptive string.
ServerException(String, Exception). Constructor for class java.rmi.ServerException
Create a new server exception with a descriptive string and an exception.
ServerNotActiveException(). Constructor for class java.rmi.server.ServerNotActiveException
Create a new exception.
w.
399
400
m
set(String, String, int, String, String). Method in class java.net.URL
Sets the fields of the URL.
setActionCommand(String). Method in class java.awt.Button
Sets the command name of the action event fired by this button.
setActionCommand(String). Method in class java.awt.MenuItem
Sets the command name of the action event fired by this menu item.
setAddress(InetAddress). Method in class java.net.DatagramPacket
setAlignment(int). Method in class java.awt.FlowLayout
o
Sets the alignment value for this layout.
setAlignment(int). Method in class java.awt.Label
Sets the alignment for this label to the specified alignment.
setAlignment(int). Method in interface java.awt.peer.LabelPeer
setAllowUserInteraction(boolean). Method in class java.net.URLConnection
i.c
Set the value of the allowUserInteraction field of this URLConnection.
setAmPmStrings(String[]). Method in class java.text.DateFormatSymbols
Sets ampm strings.
setAnimated(boolean). Method in class java.awt.image.MemoryImageSource
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 java.sql.PreparedStatement
When a very large ASCII value is input to a LONGVARCHAR parameter, it may be more practical to
send it via a java.io.InputStream.
setAsText(String). Method in interface java.beans.PropertyEditor
dil
Set the property value by parsing a given String.
setAsText(String). Method in class java.beans.PropertyEditorSupport
Set the property value by parsing a given String.
setAutoCommit(boolean). Method in interface java.sql.Connection
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 java.awt.Component
Sets the background color.
setBackground(Color). Method in interface java.awt.peer.ComponentPeer
setBeanInfoSearchPath(String[]). Static method in class java.beans.Introspector
Change the list of package names that will be used for finding BeanInfo classes.
va
setBigDecimal(int, BigDecimal). Method in interface java.sql.PreparedStatement
Set a parameter to a java.lang.BigDecimal value.
setBinaryStream(int, InputStream, int). Method in interface java.sql.PreparedStatement
When a very large binary value is input to a LONGVARBINARY parameter, it may be more practical
to send it via a java.io.InputStream.
setBit(int). Method in class java.math.BigInteger
Returns a BigInteger whose value is equivalent to this number with the designated bit set.
setBlockIncrement(int). Method in interface java.awt.Adjustable
Sets the block value increment for the adjustable object.
setBlockIncrement(int). Method in class java.awt.Scrollbar
ja
value.
setBound(boolean). Method in class java.beans.PropertyDescriptor
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 java.awt.Component
Reshapes the Component to the specified bounding box.
setBounds(int, int, int, int). Method in interface java.awt.peer.ComponentPeer
setBounds(int, int, int, int). Method in class java.awt.Rectangle
Set the bounds of this rectangle to the specified x, y, width, and height.
setBounds(Rectangle). Method in class java.awt.Component
ww
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 java.sql.PreparedStatement
m
Set a parameter to a Java array of bytes.
setCalendar(Calendar). Method in class java.text.DateFormat
Set the calendar to be used by this date format.
setCaretPosition(int). Method in class java.awt.TextComponent
Sets the position of the text insertion caret for the TextComponent
setCaretPosition(int). Method in interface java.awt.peer.TextComponentPeer
setCatalog(String). Method in interface java.sql.Connection
A sub-space of this Connection's database may be selected by setting a catalog name.
o
setChanged(). Method in class java.util.Observable
Indicates that this object has changed.
setChar(Object, char). Method in class java.lang.reflect.Field
Set the value of a field as a char on specified object.
setChar(Object, int, char). Static method in class java.lang.reflect.Array
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 java.lang.StringBuffer
The character at the specified index of this string buffer is set to ch.
setCheckboxGroup(CheckboxGroup). Method in class java.awt.Checkbox
Sets the CheckboxGroup to the specified group.
setCheckboxGroup(CheckboxGroup). Method in interface java.awt.peer.CheckboxPeer
setChoices(double[], String[]). Method in class java.text.ChoiceFormat
Set the choices to be used in formatting.
setClip(int, int, int, int). Method in class java.awt.Graphics
dil
Sets the current clip to the rectangle specified by the given coordinates.
setClip(Shape). Method in class java.awt.Graphics
Set the current clipping area to an arbitrary clip shape.
setColor(Color). Method in class java.awt.Graphics
Sets the current color to the specified color.
setColorModel(ColorModel). Method in interface java.awt.image.ImageConsumer
The ColorModel object used for the majority of the pixels reported using the setPixels method
calls.
setColorModel(ColorModel). Method in class java.awt.image.ImageFilter
Filter the information provided in the setColorModel method of the ImageConsumer interface.
setColorModel(ColorModel). Method in class java.awt.image.PixelGrabber
va
The setColorModel method is part of the ImageConsumer API which this class must implement to
retrieve the pixels.
setColorModel(ColorModel). Method in class java.awt.image.RGBImageFilter
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 java.awt.GridLayout
Sets the number of columns in this layout.
setColumns(int). Method in class java.awt.TextArea
Sets the number of columns for this TextArea.
ja
Attempted updates to "Constrained" properties will cause a "VetoableChange" event to get fired
when the property is changed.
setConstraints(Component, GridBagConstraints). Method in class java.awt.GridBagLayout
Sets the constraints for the specified component.
setContentHandlerFactory(ContentHandlerFactory). Static method in class java.net.URLConnection
Sets the ContentHandlerFactory of an application.
setContents(Transferable, ClipboardOwner). Method in class java.awt.datatransfer.Clipboard
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 java.util.zip.ZipEntry
ww
401
402
m
setData(byte[]). Method in class java.net.DatagramPacket
setDate(int). Method in class java.util.Date
Sets the day of the month of this date to the specified value.
setDate(int). Method in class java.sql.Time
Sets the day of the month of this date to the specified value.
setDate(int, Date). Method in interface java.sql.PreparedStatement
Set a parameter to a java.sql.Date value.
setDateFormatSymbols(DateFormatSymbols). Method in class java.text.SimpleDateFormat
o
Allows you to set the date/time formatting data.
setDecimalFormatSymbols(DecimalFormatSymbols). Method in class java.text.DecimalFormat
Sets the decimal format symbols, which is generally not changed by the programmer or user.
setDecimalSeparator(char). Method in class java.text.DecimalFormatSymbols
setDecimalSeparatorAlwaysShown(boolean). Method in class java.text.DecimalFormat
i.c
Allows you to set the behavior of the decimal separator with integers.
setDecomposition(int). Method in class java.text.Collator
Set the decomposition mode of this Collator.
setDefault(Locale). Static method in class java.util.Locale
Sets the default.
setDefault(TimeZone). Static method in class java.util.TimeZone
Sets time zone to using the given TimeZone.
setDefaultAllowUserInteraction(boolean). Static method in class java.net.URLConnection
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 java.net.URLConnection
Sets the default value of a general request property.
setDefaultStream(PrintStream). Static method in class java.rmi.server.LogStream
Set the default stream for new logs.
setDefaultUseCaches(boolean). Method in class java.net.URLConnection
Sets the default value of the useCaches field to the specified value.
setDesignTime(boolean). Static method in class java.beans.Beans
Used to indicate whether of not we are running in an application builder environment.
setDictionary(byte[]). Method in class java.util.zip.Deflater
Sets preset dictionary for compression.
setDictionary(byte[]). Method in class java.util.zip.Inflater
va
Sets the preset dictionary to the given array of bytes.
setDictionary(byte[], int, int). Method in class java.util.zip.Deflater
Sets preset dictionary for compression.
setDictionary(byte[], int, int). Method in class java.util.zip.Inflater
Sets the preset dictionary to the given array of bytes.
setDigit(char). Method in class java.text.DecimalFormatSymbols
setDimensions(int, int). Method in class java.awt.image.CropImageFilter
Override the source image's dimensions and pass the dimensions of the rectangular cropped
region to the ImageConsumer.
setDimensions(int, int). Method in interface java.awt.image.ImageConsumer
ja
The dimensions of the source image are reported using the setDimensions method call.
setDimensions(int, int). Method in class java.awt.image.ImageFilter
Filters the information provided in the setDimensions method of the ImageConsumer interface.
setDimensions(int, int). Method in class java.awt.image.PixelGrabber
The setDimensions method is part of the ImageConsumer API which this class must implement to
retrieve the pixels.
setDimensions(int, int). Method in class java.awt.image.ReplicateScaleFilter
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 java.awt.FileDialog
Set the directory of the Dialog to the specified directory.
setDirectory(String). Method in interface java.awt.peer.FileDialogPeer
setDisplayName(String). Method in class java.beans.FeatureDescriptor
setDoInput(boolean). Method in class java.net.URLConnection
Sets the value of the doInput field for this URLConnection to the specified value.
setDoOutput(boolean). Method in class java.net.URLConnection
Sets the value of the doOutput field for this URLConnection to the specified value.
ww
402
403
m
setEditable(boolean). Method in interface java.awt.peer.TextComponentPeer
setEditorSearchPath(String[]). Static method in class java.beans.PropertyEditorManager
Change the list of package names that will be used for finding property editors.
setElementAt(Object, int). Method in class java.util.Vector
Sets the component at the specified index of this vector to be the specified object.
setEnabled(boolean). Method in class java.awt.Component
Enables a component.
setEnabled(boolean). Method in interface java.awt.peer.ComponentPeer
o
setEnabled(boolean). Method in class java.awt.MenuItem
Sets whether or not this menu item can be chosen.
setEnabled(boolean). Method in interface java.awt.peer.MenuItemPeer
setEndRule(int, int, int, int). Method in class java.util.SimpleTimeZone
Sets the daylight savings ending rule.
i.c
setEras(String[]). Method in class java.text.DateFormatSymbols
Sets era strings.
setErr(PrintStream). Static method in class java.lang.System
Reassigns the "standard" error output stream.
setError(). Method in class java.io.PrintStream
Indicates that an error has occurred.
setError(). Method in class java.io.PrintWriter
Indicate that an error has occurred.
setEscapeProcessing(boolean). Method in interface java.sql.Statement
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 java.beans.FeatureDescriptor
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 java.util.zip.ZipEntry
Sets the optional extra field data for the entry.
setFailureHandler(RMIFailureHandler). Static method in class java.rmi.server.RMISocketFactory
Set the failure handler to be called by the RMI runtime if socket creation fails.
setField(int, boolean). Method in class sun.tools.debug.RemoteObject
Set a boolean instance variable, specified by slot.
setField(int, char). Method in class sun.tools.debug.RemoteObject
va
Set a char instance variable, specified by slot.
setField(int, double). Method in class sun.tools.debug.RemoteObject
Set a double instance variable, specified by slot.
setField(int, float). Method in class sun.tools.debug.RemoteObject
Set a float instance variable, specified by slot.
setField(int, int). Method in class sun.tools.debug.RemoteObject
Set an int instance variable, specified by slot.
setField(int, long). Method in class sun.tools.debug.RemoteObject
Set a long instance variable, specified by slot.
setField(int, RemoteObject). Method in class sun.tools.debug.RemoteObject
ja
403
404
value.
setFollowRedirects(boolean). Static method in class java.net.HttpURLConnection
Sets whether HTTP redirects (requests with response code 3xx) should be automatically followed
m
by this class.
setFont(Font). Method in class java.awt.Component
Sets the font of the component.
setFont(Font). Method in interface java.awt.peer.ComponentPeer
setFont(Font). Method in class java.awt.Graphics
Sets the font for all subsequent text rendering operations.
setFont(Font). Method in class java.awt.MenuComponent
Sets the font to be used for this MenuItem to the specified font.
o
setForeground(Color). Method in class java.awt.Component
Sets the foreground color.
setForeground(Color). Method in interface java.awt.peer.ComponentPeer
setFormat(int, Format). Method in class java.text.MessageFormat
Sets formats individually to use on parameters.
i.c
setFormats(Format[]). Method in class java.text.MessageFormat
Sets formats to use on parameters.
setFullBufferUpdates(boolean). Method in class java.awt.image.MemoryImageSource
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 java.util.GregorianCalendar
Sets the GregorianCalendar change date.
setGroupingSeparator(char). Method in class java.text.DecimalFormatSymbols
setGroupingSize(int). Method in class java.text.DecimalFormat
Set the grouping size.
dil
setGroupingUsed(boolean). Method in class java.text.NumberFormat
Set whether or not grouping will be used in this format.
setGuiAvailable(boolean). Static method in class java.beans.Beans
Used to indicate whether of not we are running in an environment where GUI interaction is
available.
setHelpMenu(Menu). Method in class java.awt.MenuBar
Sets the help menu to the specified menu on the menu bar.
setHgap(int). Method in class java.awt.BorderLayout
Sets the horizontal gap between components.
setHgap(int). Method in class java.awt.CardLayout
Sets the horizontal gap between components.
va
setHgap(int). Method in class java.awt.FlowLayout
Sets the horizontal gap between components.
setHgap(int). Method in class java.awt.GridLayout
Sets the horizontal gap between components.
setHidden(boolean). Method in class java.beans.FeatureDescriptor
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 java.awt.image.AreaAveragingScaleFilter
Detect if the data is being delivered with the necessary hints to allow the averaging
algorithm to do its work.
ja
The setHints method is part of the ImageConsumer API which this class must implement to
retrieve the pixels.
setHours(int). Method in class java.sql.Date
Sets the hour of this date to the specified value.
setHours(int). Method in class java.util.Date
Sets the hour of this date to the specified value.
setHumanPresentableName(String). Method in class java.awt.datatransfer.DataFlavor
Sets the human presentable name for the data format that this DataFlavor represents.
setIconImage(Image). Method in class java.awt.Frame
Sets the image to display when this Frame is iconized.
ww
404
405
m
setInfinity(String). Method in class java.text.DecimalFormatSymbols
setInfo(String). Method in class java.security.Identity
Specifies a general information string for this identity.
setInput(byte[]). Method in class java.util.zip.Deflater
Sets input data for compression.
setInput(byte[]). Method in class java.util.zip.Inflater
Sets input data for decompression.
setInput(byte[], int, int). Method in class java.util.zip.Deflater
o
Sets input data for compression.
setInput(byte[], int, int). Method in class java.util.zip.Inflater
Sets input data for decompression.
setInt(int, int). Method in interface java.sql.PreparedStatement
Set a parameter to a Java int value.
i.c
setInt(Object, int). Method in class java.lang.reflect.Field
Set the value of a field as an int on specified object.
setInt(Object, int, int). Static method in class java.lang.reflect.Array
Sets the value of the indexed component of the specified array object to the specified int
value.
setInterface(InetAddress). Method in class java.net.MulticastSocket
Set the outgoing network interface for multicast packets on this socket, to other than the
system default.
setKeyChar(char). Method in class java.awt.event.KeyEvent
setKeyCode(int). Method in class java.awt.event.KeyEvent
dil
setKeyPair(KeyPair). Method in class java.security.Signer
Sets the key pair (public key and private key) for this signer.
setLabel(String). Method in class java.awt.Button
Sets the button with the specified label.
setLabel(String). Method in interface java.awt.peer.ButtonPeer
setLabel(String). Method in class java.awt.Checkbox
Sets this check box's label to be the specified string.
setLabel(String). Method in interface java.awt.peer.CheckboxPeer
setLabel(String). Method in class java.awt.MenuItem
Sets the label to be the specified label.
setLabel(String). Method in interface java.awt.peer.MenuItemPeer
va
setLayout(LayoutManager). Method in class java.awt.Container
Sets the layout manager for this container.
setLayout(LayoutManager). Method in class java.awt.ScrollPane
Sets the layout manager for this container.
setLength(int). Method in class java.net.DatagramPacket
setLength(int). Method in class java.lang.StringBuffer
Sets the length of this String buffer.
setLenient(boolean). Method in class java.util.Calendar
Specify whether or not date/time interpretation is to be lenient.
setLenient(boolean). Method in class java.text.DateFormat
ja
405
406
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 java.sql.DriverManager
Set the logging/tracing PrintStream that is used by the DriverManager and all drivers.
setLong(int, long). Method in interface java.sql.PreparedStatement
Set a parameter to a Java long value.
setLong(Object, int, long). Static method in class java.lang.reflect.Array
Sets the value of the indexed component of the specified array object to the specified long
o
value.
setLong(Object, long). Method in class java.lang.reflect.Field
Set the value of a field as a long on specified object.
setMaxFieldSize(int). Method in interface java.sql.Statement
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 java.awt.Adjustable
Sets the maximum value of the adjustable object.
setMaximum(int). Method in class java.awt.Scrollbar
Sets the maximum value for this Scrollbar.
setMaximumFractionDigits(int). Method in class java.text.NumberFormat
Sets the maximum number of digits allowed in the fraction portion of a number.
setMaximumIntegerDigits(int). Method in class java.text.NumberFormat
Sets the maximum number of digits allowed in the integer portion of a number.
dil
setMaxPriority(int). Method in class java.lang.ThreadGroup
Sets the maximum priority of the group.
setMaxRows(int). Method in interface java.sql.Statement
The maxRows limit is set to limit the number of rows that any ResultSet can contain.
setMenuBar(MenuBar). Method in class java.awt.Frame
Sets the menubar for this Frame to the specified menubar.
setMenuBar(MenuBar). Method in interface java.awt.peer.FramePeer
setMessageDigest(MessageDigest). Method in class java.security.DigestInputStream
Associates the specified message digest with this stream.
setMessageDigest(MessageDigest). Method in class java.security.DigestOutputStream
Associates the specified message digest with this stream.
va
setMethod(int). Method in class java.util.zip.ZipEntry
Sets the compression method for the entry.
setMethod(int). Method in class java.util.zip.ZipOutputStream
Sets the default compression method for subsequent entries.
setMinimalDaysInFirstWeek(int). Method in class java.util.Calendar
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 java.awt.Adjustable
Sets the minimum value of the adjustable object.
ja
406
407
m
setName(String). Method in class java.awt.Component
Sets the name of the component to the specified string.
setName(String). Method in class java.beans.FeatureDescriptor
setName(String). Method in class java.awt.MenuComponent
Sets the name of the component to the specified string.
setName(String). Method in class java.lang.Thread
Changes the name of this thread to be equal to the argument name.
setNaN(String). Method in class java.text.DecimalFormatSymbols
o
setNanos(int). Method in class java.sql.Timestamp
Set the Timestamp's nanos value
setNegativePermissions(). Method in interface java.security.acl.AclEntry
Sets this ACL entry to be a negative one.
setNegativePrefix(String). Method in class java.text.DecimalFormat
i.c
Set the negative prefix.
setNegativeSuffix(String). Method in class java.text.DecimalFormat
Set the positive suffix.
setNextException(SQLException). Method in class java.sql.SQLException
Add an SQLException to the end of the chain.
setNextWarning(SQLWarning). Method in class java.sql.SQLWarning
Add an SQLWarning to the end of the chain.
setNull(int, int). Method in interface java.sql.PreparedStatement
Set a parameter to SQL NULL.
setNumberFormat(NumberFormat). Method in class java.text.DateFormat
dil
Allows you to set the number formatter.
setObject(int, Object). Method in interface java.sql.PreparedStatement
Set the value of a parameter using an object; use the java.lang equivalent objects for
integral values.
setObject(int, Object, int). Method in interface java.sql.PreparedStatement
This method is like setObject above, but assumes a scale of zero.
setObject(int, Object, int, int). Method in interface java.sql.PreparedStatement
Set the value of a parameter using an object; use the java.lang equivalent objects for
integral values.
va
setObject(Object). Method in interface java.beans.Customizer
Set the object to be customized.
setOrientation(int). Method in class java.awt.Scrollbar
Sets the orientation for this Scrollbar.
setOut(PrintStream). Static method in class java.lang.System
Reassigns the "standard" output stream.
setOutputStream(OutputStream). Method in class java.rmi.server.LogStream
Set the stream to which output from this log is sent.
setPageIncrement(int). Method in class java.awt.Scrollbar
setPageIncrement(int). Method in interface java.awt.peer.ScrollbarPeer
ja
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
java.awt.image.ImageConsumer
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
java.awt.image.ImageFilter
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
java.awt.image.PixelGrabber
The setPixels method is part of the ImageConsumer API which this class must implement to
407
408
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
java.awt.image.RGBImageFilter
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
java.awt.image.AreaAveragingScaleFilter
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
java.awt.image.CropImageFilter
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
java.awt.image.ImageConsumer
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
java.awt.image.ImageFilter
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
java.awt.image.PixelGrabber
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
java.awt.image.ReplicateScaleFilter
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
java.awt.image.RGBImageFilter
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 java.net.DatagramPacket
setPositivePrefix(String). Method in class java.text.DecimalFormat
Set the positive prefix.
setPositiveSuffix(String). Method in class java.text.DecimalFormat
Set the positive suffix.
setPrincipal(Principal). Method in interface java.security.acl.AclEntry
Specifies the principal for which permissions are granted or denied by this ACL entry.
ja
408
409
m
setReadOnly(boolean). Method in interface java.sql.Connection
You can put a connection in read-only mode as a hint to enable database optimizations.
setRef(RemoteStub, RemoteRef). Static method in class java.rmi.server.RemoteStub
setRequestMethod(String). Method in class java.net.HttpURLConnection
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 java.net.URLConnection
Sets the general request property.
setResizable(boolean). Method in class java.awt.Dialog
Sets the resizable flag.
setResizable(boolean). Method in interface java.awt.peer.DialogPeer
setResizable(boolean). Method in class java.awt.Frame
Sets the resizable flag.
setResizable(boolean). Method in interface java.awt.peer.FramePeer
setRows(int). Method in class java.awt.GridLayout
Sets the number of rows in this layout.
dil
setRows(int). Method in class java.awt.TextArea
Sets the number of rows for this TextArea.
setScale(int). Method in class java.math.BigDecimal
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 java.math.BigDecimal
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 java.awt.ScrollPane
Scrolls to the specified position within the child component.
va
setScrollPosition(int, int). Method in interface java.awt.peer.ScrollPanePeer
setScrollPosition(Point). Method in class java.awt.ScrollPane
Scrolls to the specified position within the child component.
setSeconds(int). Method in class java.sql.Date
Sets the seconds of this date to the specified value.
setSeconds(int). Method in class java.util.Date
Sets the seconds of this date to the specified value.
setSecurityManager(SecurityManager). Static method in class java.lang.System
Sets the System security.
setSeed(byte[]). Method in class java.security.SecureRandom
ja
409
410
m
setSize(Dimension). Method in class java.awt.Rectangle
Set the size of this rectangle to match the specified size.
setSize(int). Method in class java.util.Vector
Sets the size of this vector.
setSize(int, int). Method in class java.awt.Component
Resizes the Component to the specified width and height.
setSize(int, int). Method in class java.awt.Dimension
Set the size of this Dimension object to the specified width and height.
o
setSize(int, int). Method in class java.awt.Rectangle
Set the size of this rectangle to the specified width and height.
setSize(long). Method in class java.util.zip.ZipEntry
Sets the uncompressed size of the entry data.
setSocketFactory(RMISocketFactory). Static method in class java.rmi.server.RMISocketFactory
i.c
Set the socket factory from which RMI gets sockets.
setSocketFactory(SocketImplFactory). Static method in class java.net.ServerSocket
Sets the server socket implementation factory for the application.
setSocketImplFactory(SocketImplFactory). Static method in class java.net.Socket
Sets the client socket implementation factory for the application.
setSoLinger(boolean, int). Method in class java.net.Socket
Enable/disable SO_LINGER with the specified linger time.
setSoTimeout(int). Method in class java.net.DatagramSocket
Enable/disable SO_TIMEOUT with the specified timeout, in milliseconds.
setSoTimeout(int). Method in class java.net.ServerSocket
dil
Enable/disable SO_TIMEOUT with the specified timeout, in milliseconds.
setSoTimeout(int). Method in class java.net.Socket
Enable/disable SO_TIMEOUT with the specified timeout, in milliseconds.
setSourcePath(String). Method in class sun.tools.debug.RemoteDebugger
Specify the list of paths to use when searching for a source file.
setStartRule(int, int, int, int). Method in class java.util.SimpleTimeZone
Sets the daylight savings starting rule.
setStartYear(int). Method in class java.util.SimpleTimeZone
Sets the daylight savings starting year.
setState(boolean). Method in class java.awt.Checkbox
Sets the Checkbox to the specifed boolean state.
va
setState(boolean). Method in class java.awt.CheckboxMenuItem
Sets the state of this MenuItem if it is a Checkbox.
setState(boolean). Method in interface java.awt.peer.CheckboxMenuItemPeer
setState(boolean). Method in interface java.awt.peer.CheckboxPeer
setStrategy(int). Method in class java.util.zip.Deflater
Sets the compression strategy to the specified value.
setStrength(int). Method in class java.text.Collator
Sets this Collator's strength property.
setString(int, String). Method in interface java.sql.PreparedStatement
Set a parameter to a Java String value.
ja
410
411
m
Set a parameter to a java.sql.Timestamp value.
setTimeZone(TimeZone). Method in class java.util.Calendar
Sets the time zone with the given time zone value.
setTimeZone(TimeZone). Method in class java.text.DateFormat
Sets the time zone for the calendar of this DateFormat object.
setTitle(String). Method in class java.awt.Dialog
Sets the title of the Dialog.
setTitle(String). Method in interface java.awt.peer.DialogPeer
o
setTitle(String). Method in class java.awt.Frame
Sets the title for this Frame to the specified title.
setTitle(String). Method in interface java.awt.peer.FramePeer
setTransactionIsolation(int). Method in interface java.sql.Connection
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 java.net.DatagramSocketImpl
Set the TTL (time-to-live) option.
setTTL(byte). Method in class java.net.MulticastSocket
Set the default time-to-live for multicast packets sent out on this socket.
setUnicast(boolean). Method in class java.beans.EventSetDescriptor
Mark an event set as unicast (or not).
setUnicodeStream(int, InputStream, int). Method in interface java.sql.PreparedStatement
When a very large UNICODE value is input to a LONGVARCHAR parameter, it may be more practical
to send it via a java.io.InputStream.
dil
setUnitIncrement(Adjustable, int). Method in interface java.awt.peer.ScrollPanePeer
setUnitIncrement(int). Method in interface java.awt.Adjustable
Sets the unit value increment for the adjustable object.
setUnitIncrement(int). Method in class java.awt.Scrollbar
Sets the unit increment for this scrollbar.
setUpdateRect(Rectangle). Method in class java.awt.event.PaintEvent
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 java.net.URLStreamHandler
Sets the fields of the URL argument to the indicated values.
setURLStreamHandlerFactory(URLStreamHandlerFactory). Static method in class java.net.URL
va
Sets an application's URLStreamHandlerFactory.
setUseCaches(boolean). Method in class java.net.URLConnection
Sets the value of the useCaches field of this URLConnection to the specified value.
setValue(Adjustable, int). Method in interface java.awt.peer.ScrollPanePeer
setValue(int). Method in interface java.awt.Adjustable
Sets the current value of the adjustable object.
setValue(int). Method in class java.awt.Scrollbar
Sets the value of this Scrollbar to the specified value.
setValue(Object). Method in interface java.beans.PropertyEditor
Set (or change) the object that is to be edited.
ja
411
412
Sets the year of this date to be the specified value plus 1900.
setYear(int). Method in class java.sql.Time
Sets the year of this date to be the specified value plus 1900.
m
setZeroDigit(char). Method in class java.text.DecimalFormatSymbols
setZoneStrings(String[][]). Method in class java.text.DateFormatSymbols
Sets timezone strings.
SHIFT_MASK. Static variable in class java.awt.event.ActionEvent
The shift modifier constant.
SHIFT_MASK. Static variable in class java.awt.Event
The shift modifier constant.
SHIFT_MASK. Static variable in class java.awt.event.InputEvent
o
The shift key modifier constant.
shiftDown(). Method in class java.awt.Event
Checks if the shift key is down.
shiftLeft(int). Method in class java.math.BigInteger
Returns a BigInteger whose value is (this << n).
i.c
shiftRight(int). Method in class java.math.BigInteger
Returns a BigInteger whose value is (this >> n).
SHORT. Static variable in class java.text.DateFormat
Constant for short style pattern.
Short(short). Constructor for class java.lang.Short
Constructs a Short object initialized to the specified short value.
Short(String). Constructor for class java.lang.Short
Constructs a Short object initialized to the value specified by the String parameter.
shortcuts(). Method in class java.awt.MenuBar
Get an Enumeration of all MenuShortcuts this MenuBar manages.
dil
shortValue(). Method in class java.lang.Byte
Returns the value of this Byte as a short.
shortValue(). Method in class java.lang.Double
Returns the value of this Double as a short (by casting to a short).
shortValue(). Method in class java.lang.Float
Returns the value of this Float as a short (by casting to a short).
shortValue(). Method in class java.lang.Integer
Returns the value of this Integer as a short.
shortValue(). Method in class java.lang.Long
Returns the value of this Long as a short.
shortValue(). Method in class java.lang.Number
va
Returns the value of the specified number as a short.
shortValue(). Method in class java.lang.Short
Returns the value of this Short as a short.
show(). Method in class java.awt.Component
show(). Method in interface java.awt.peer.ComponentPeer
DEPRECATED: Replaced by setVisible(boolean).
show(). Method in class java.awt.Dialog
Shows the dialog.
show(). Method in class java.awt.Window
Shows the Window.
ja
Replaces the Web page currently being viewed with the given URL.
showDocument(URL, String). Method in interface java.applet.AppletContext
Requests that the browser or applet viewer show the Web page indicated by the url argument.
showStatus(String). Method in class java.applet.Applet
Requests that the argument string be displayed in the "status window".
showStatus(String). Method in interface java.applet.AppletContext
Requests that the argument string be displayed in the "status window".
SIGN. Static variable in class java.security.Signature
Possible state value, signifying that this signature object has been initialized for signing.
sign(). Method in class java.security.Signature
ww
412
413
m
negative, zero or positive).
signum(). Method in class java.math.BigInteger
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 java.rmi.server.LogStream
constants for logging levels
SimpleBeanInfo(). Constructor for class java.beans.SimpleBeanInfo
SimpleDateFormat(). Constructor for class java.text.SimpleDateFormat
o
Construct a SimpleDateFormat using the default pattern for the default locale.
SimpleDateFormat(String). Constructor for class java.text.SimpleDateFormat
Construct a SimpleDateFormat using the given pattern in the default locale.
SimpleDateFormat(String, DateFormatSymbols). Constructor for class java.text.SimpleDateFormat
Construct a SimpleDateFormat using the given pattern and locale-specific symbol data.
i.c
SimpleDateFormat(String, Locale). Constructor for class java.text.SimpleDateFormat
Construct a SimpleDateFormat using the given pattern and locale.
SimpleTimeZone(int, String). Constructor for class java.util.SimpleTimeZone
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
java.util.SimpleTimeZone
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 java.util.Locale
Useful constant for language.
dil
sin(double). Static method in class java.lang.Math
Returns the trigonometric sine of an angle.
SINGLEFRAME. Static variable in interface java.awt.image.ImageConsumer
The image contain a single static image.
SINGLEFRAMEDONE. Static variable in interface java.awt.image.ImageConsumer
One frame of the image is complete but there are more frames to be delivered.
SINGLEPASS. Static variable in interface java.awt.image.ImageConsumer
The pixels will be delivered in a single pass.
size. Variable in class java.awt.Font
The point size of this font.
size(). Method in class java.util.BitSet
va
Returns the number of bits currently in this bit set.
size(). Method in class java.io.ByteArrayOutputStream
Returns the current size of the buffer.
size(). Method in class java.io.CharArrayWriter
Returns the current size of the buffer.
size(). Method in class java.awt.Component
size(). Method in class java.io.DataOutputStream
Returns the number of bytes written to this data output stream.
size(). Method in class java.util.Dictionary
Returns the number of keys in this dictionary.
ja
413
414
m
Skips over and discards n bytes of data from this input stream.
skip(long). Method in class java.io.LineNumberInputStream
Skips over and discards n bytes of data from the input stream.
skip(long). Method in class java.io.LineNumberReader
Skip characters.
skip(long). Method in interface java.io.ObjectInput
Skips n bytes of input.
skip(long). Method in class java.io.Reader
o
Skip characters.
skip(long). Method in class java.io.StringBufferInputStream
Skips n bytes of input from this input stream.
skip(long). Method in class java.io.StringReader
Skip characters.
i.c
skip(long). Method in class java.util.zip.ZipInputStream
Skips specified number of bytes in the current ZIP entry.
skipBytes(int). Method in interface java.io.DataInput
Skips exactly n bytes of input.
skipBytes(int). Method in class java.io.DataInputStream
Skips exactly n bytes of input in the underlying input stream.
skipBytes(int). Method in class java.io.ObjectInputStream
Skips bytes, block until all bytes are skipped.
skipBytes(int). Method in class java.io.RandomAccessFile
Skips exactly n bytes of input.
dil
slashSlashComments(boolean). Method in class java.io.StreamTokenizer
Determines whether or not the tokenizer recognizes C++-style comments.
slashStarComments(boolean). Method in class java.io.StreamTokenizer
Determines whether or not the tokenizer recognizes C-style comments.
sleep(long). Static method in class java.lang.Thread
Causes the currently executing thread to sleep (temporarily cease execution) for the specified
number of milliseconds.
sleep(long, int). Static method in class java.lang.Thread
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 java.sql.Types
va
Socket(). Constructor for class java.net.Socket
Creates an unconnected socket, with the system-default type of SocketImpl.
Socket(InetAddress, int). Constructor for class java.net.Socket
Creates a stream socket and connects it to the specified port number at the specified IP
address.
Socket(InetAddress, int, boolean). Constructor for class java.net.Socket
Creates a socket and connects it to the specified port number at the specified IP address.
Socket(InetAddress, int, InetAddress, int). Constructor for class java.net.Socket
Creates a socket and connects it to the specified remote address on the specified remote port.
Socket(SocketImpl). Constructor for class java.net.Socket
ja
414
415
m
SQLException(String, String). Constructor for class java.sql.SQLException
Construct an SQLException with a reason and SQLState; vendorCode defaults to 0.
SQLException(String, String, int). Constructor for class java.sql.SQLException
Construct a fully-specified SQLException
SQLWarning(). Constructor for class java.sql.SQLWarning
Construct an SQLWarning ; reason defaults to null, SQLState defaults to null and vendorCode
defaults to 0.
SQLWarning(String). Constructor for class java.sql.SQLWarning
o
Construct an SQLWarning with a reason; SQLState defaults to null and vendorCode defaults to 0.
SQLWarning(String, String). Constructor for class java.sql.SQLWarning
Construct an SQLWarning with a reason and SQLState; vendorCode defaults to 0.
SQLWarning(String, String, int). Constructor for class java.sql.SQLWarning
Construct a fully specified SQLWarning.
i.c
sqrt(double). Static method in class java.lang.Math
Returns the square root of a double value.
srccols. Variable in class java.awt.image.ReplicateScaleFilter
srcHeight. Variable in class java.awt.image.ReplicateScaleFilter
srcrows. Variable in class java.awt.image.ReplicateScaleFilter
srcWidth. Variable in class java.awt.image.ReplicateScaleFilter
Stack(). Constructor for class java.util.Stack
StackFrame(). Constructor for class sun.tools.debug.StackFrame
StackOverflowError(). Constructor for class java.lang.StackOverflowError
Constructs a StackOverflowError with no detail message.
dil
StackOverflowError(String). Constructor for class java.lang.StackOverflowError
Constructs a StackOverflowError with the specified detail message.
start(). Method in class java.applet.Applet
Called by the browser or applet viewer to inform this applet that it should start its
execution.
start(). Method in class java.lang.Thread
Causes this thread to begin execution; the Java Virtual Machine calls the run method of this
thread.
START_PUNCTUATION. Static variable in class java.lang.Character
startGrabbing(). Method in class java.awt.image.PixelGrabber
Request the PixelGrabber to start fetching the pixels.
va
startProduction(ImageConsumer). Method in class java.awt.image.FilteredImageSource
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 java.awt.image.ImageProducer
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 java.awt.image.MemoryImageSource
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
415
416
m
STORED. Static variable in class java.util.zip.ZipEntry
Compression method for uncompressed entries.
STORED. Static variable in class java.util.zip.ZipOutputStream
Compression method for uncompressed (STORED) entries.
storesLowerCaseIdentifiers(). Method in interface java.sql.DatabaseMetaData
Does the database treat mixed case unquoted SQL identifiers as case insensitive and store them
in lower case?
storesLowerCaseQuotedIdentifiers(). Method in interface java.sql.DatabaseMetaData
o
Does the database treat mixed case quoted SQL identifiers as case insensitive and store them
in lower case?
storesMixedCaseIdentifiers(). Method in interface java.sql.DatabaseMetaData
Does the database treat mixed case unquoted SQL identifiers as case insensitive and store them
in mixed case?
i.c
storesMixedCaseQuotedIdentifiers(). Method in interface java.sql.DatabaseMetaData
Does the database treat mixed case quoted SQL identifiers as case insensitive and store them
in mixed case?
storesUpperCaseIdentifiers(). Method in interface java.sql.DatabaseMetaData
Does the database treat mixed case unquoted SQL identifiers as case insensitive and store them
in upper case?
storesUpperCaseQuotedIdentifiers(). Method in interface java.sql.DatabaseMetaData
Does the database treat mixed case quoted SQL identifiers as case insensitive and store them
in upper case?
StreamCorruptedException(). Constructor for class java.io.StreamCorruptedException
dil
Create a StreamCorruptedException with no reason.
StreamCorruptedException(String). Constructor for class java.io.StreamCorruptedException
Create a StreamCorruptedException with a reason.
StreamTokenizer(InputStream). Constructor for class java.io.StreamTokenizer
Creates a stream tokenizer that parses the specified input stream.
StreamTokenizer(Reader). Constructor for class java.io.StreamTokenizer
Create a tokenizer that parses the given character stream.
String(). Constructor for class java.lang.String
Allocates a new String containing no characters.
String(byte[]). Constructor for class java.lang.String
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 java.lang.String
Allocates a new String containing characters constructed from an array of 8-bit integer
values.
String(byte[], int, int). Constructor for class java.lang.String
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 java.lang.String
Allocates a new String constructed from a subarray of an array of 8-bit integer values.
String(byte[], int, int, String). Constructor for class java.lang.String
ja
Construct a new String by converting the specified subarray of bytes using the specified
character encoding.
String(byte[], String). Constructor for class java.lang.String
Construct a new String by converting the specified array of bytes using the specified
character encoding.
String(char[]). Constructor for class java.lang.String
Allocates a new String so that it represents the sequence of characters currently contained in
w.
416
417
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 java.awt.datatransfer.DataFlavor
The DataFlavor representing a Java Unicode String class, where:
representationClass = java.lang.String
mimeType = "application/x-javaserializedobject"
o
StringIndexOutOfBoundsException(). Constructor for class java.lang.StringIndexOutOfBoundsException
Constructs a StringIndexOutOfBoundsException with no detail message.
StringIndexOutOfBoundsException(int). Constructor for class
java.lang.StringIndexOutOfBoundsException
Constructs a new StringIndexOutOfBoundsException class with an argument indicating the illegal
i.c
index.
StringIndexOutOfBoundsException(String). Constructor for class
java.lang.StringIndexOutOfBoundsException
Constructs a StringIndexOutOfBoundsException with the specified detail message.
StringReader(String). Constructor for class java.io.StringReader
Create a new string reader.
StringSelection(String). Constructor for class java.awt.datatransfer.StringSelection
Creates a transferable object capable of transferring the specified string in plain text
format.
StringTokenizer(String). Constructor for class java.util.StringTokenizer
dil
Constructs a string tokenizer for the specified string.
StringTokenizer(String, String). Constructor for class java.util.StringTokenizer
Constructs a string tokenizer for the specified string.
StringTokenizer(String, String, boolean). Constructor for class java.util.StringTokenizer
Constructs a string tokenizer for the specified string.
stringWidth(String). Method in class java.awt.FontMetrics
Returns the total advance width for showing the specified String in this Font.
StringWriter(). Constructor for class java.io.StringWriter
Create a new string writer, using the default initial string-buffer size.
StringWriter(int). Constructor for class java.io.StringWriter
Create a new string writer, using the specified initial string-buffer size.
va
StubNotFoundException(String). Constructor for class java.rmi.StubNotFoundException
Create a new StubNotFoundException with a descriptive string.
StubNotFoundException(String, Exception). Constructor for class java.rmi.StubNotFoundException
Create a new StubNotFoundException with a descriptive string and an exception.
style. Variable in class java.awt.Font
The style of the font.
substituteColorModel(ColorModel, ColorModel). Method in class java.awt.image.RGBImageFilter
Registers two ColorModel objects for substitution.
substring(int). Method in class java.lang.String
Returns a new string that is a substring of this string.
ja
417
418
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 java.sql.DatabaseMetaData
Is the CONVERT function between SQL types supported?
supportsConvert(int, int). Method in interface java.sql.DatabaseMetaData
Is CONVERT between the given SQL types supported?
supportsCoreSQLGrammar(). Method in interface java.sql.DatabaseMetaData
Is the ODBC Core SQL grammar supported?
o
supportsCorrelatedSubqueries(). Method in interface java.sql.DatabaseMetaData
Are correlated subqueries supported? A JDBC-Compliant driver always returns true.
supportsCustomEditor(). Method in interface java.beans.PropertyEditor
supportsCustomEditor(). Method in class java.beans.PropertyEditorSupport
supportsDataDefinitionAndDataManipulationTransactions(). Method in interface
i.c
java.sql.DatabaseMetaData
Are both data definition and data manipulation statements within a transaction supported?
supportsDataManipulationTransactionsOnly(). Method in interface java.sql.DatabaseMetaData
Are only data manipulation statements within a transaction supported?
supportsDifferentTableCorrelationNames(). Method in interface java.sql.DatabaseMetaData
If table correlation names are supported, are they restricted to be different from the names
of the tables?
supportsExpressionsInOrderBy(). Method in interface java.sql.DatabaseMetaData
Are expressions in "ORDER BY" lists supported?
supportsExtendedSQLGrammar(). Method in interface java.sql.DatabaseMetaData
dil
Is the ODBC Extended SQL grammar supported?
supportsFullOuterJoins(). Method in interface java.sql.DatabaseMetaData
Are full nested outer joins supported?
supportsGroupBy(). Method in interface java.sql.DatabaseMetaData
Is some form of "GROUP BY" clause supported?
supportsGroupByBeyondSelect(). Method in interface java.sql.DatabaseMetaData
Can a "GROUP BY" clause add columns not in the SELECT provided it specifies all the columns in
the SELECT?
supportsGroupByUnrelated(). Method in interface java.sql.DatabaseMetaData
Can a "GROUP BY" clause use columns not in the SELECT?
supportsIntegrityEnhancementFacility(). Method in interface java.sql.DatabaseMetaData
va
Is the SQL Integrity Enhancement Facility supported?
supportsLikeEscapeClause(). Method in interface java.sql.DatabaseMetaData
Is the escape character in "LIKE" clauses supported? A JDBC-Compliant driver always returns
true.
supportsLimitedOuterJoins(). Method in interface java.sql.DatabaseMetaData
Is there limited support for outer joins? (This will be true if supportFullOuterJoins is
true.)
supportsMinimumSQLGrammar(). Method in interface java.sql.DatabaseMetaData
Is the ODBC Minimum SQL grammar supported? All JDBC-Compliant drivers must return true.
supportsMixedCaseIdentifiers(). Method in interface java.sql.DatabaseMetaData
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 java.sql.DatabaseMetaData
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 java.sql.DatabaseMetaData
Are multiple ResultSets from a single execute supported?
w.
418
419
m
Can a schema name be used in a privilege definition statement?
supportsSchemasInProcedureCalls(). Method in interface java.sql.DatabaseMetaData
Can a schema name be used in a procedure call statement?
supportsSchemasInTableDefinitions(). Method in interface java.sql.DatabaseMetaData
Can a schema name be used in a table definition statement?
supportsSelectForUpdate(). Method in interface java.sql.DatabaseMetaData
Is SELECT for UPDATE supported?
supportsStoredProcedures(). Method in interface java.sql.DatabaseMetaData
o
Are stored procedure calls using the stored procedure escape syntax supported?
supportsSubqueriesInComparisons(). Method in interface java.sql.DatabaseMetaData
Are subqueries in comparison expressions supported? A JDBC-Compliant driver always returns
true.
supportsSubqueriesInExists(). Method in interface java.sql.DatabaseMetaData
i.c
Are subqueries in 'exists' expressions supported? A JDBC-Compliant driver always returns true.
supportsSubqueriesInIns(). Method in interface java.sql.DatabaseMetaData
Are subqueries in 'in' statements supported? A JDBC-Compliant driver always returns true.
supportsSubqueriesInQuantifieds(). Method in interface java.sql.DatabaseMetaData
Are subqueries in quantified expressions supported? A JDBC-Compliant driver always returns
true.
supportsTableCorrelationNames(). Method in interface java.sql.DatabaseMetaData
Are table correlation names supported? A JDBC-Compliant driver always returns true.
supportsTransactionIsolationLevel(int). Method in interface java.sql.DatabaseMetaData
Does the database support the given transaction isolation level?
dil
supportsTransactions(). Method in interface java.sql.DatabaseMetaData
Are transactions supported? If not, commit is a noop and the isolation level is
TRANSACTION_NONE.
supportsUnion(). Method in interface java.sql.DatabaseMetaData
Is SQL UNION supported?
supportsUnionAll(). Method in interface java.sql.DatabaseMetaData
Is SQL UNION ALL supported?
SURROGATE. Static variable in class java.lang.Character
suspend(). Method in class sun.tools.debug.RemoteThread
Suspend execution of this thread.
suspend(). Method in class java.lang.Thread
va
Suspends this thread.
suspend(). Method in class java.lang.ThreadGroup
Suspends all processes in this thread group.
sval. Variable in class java.io.StreamTokenizer
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 java.awt.Cursor
The south-west-resize cursor type.
SW_RESIZE_CURSOR. Static variable in class java.awt.Frame
sync(). Method in class java.io.FileDescriptor
ja
419
420
m
testBit(int). Method in class java.math.BigInteger
Returns true iff the designated bit is set.
text. Static variable in class java.awt.SystemColor
The background color for text components.
TEXT. Static variable in class java.awt.SystemColor
The array index for the text background color.
TEXT_CURSOR. Static variable in class java.awt.Cursor
The text cursor type.
o
TEXT_CURSOR. Static variable in class java.awt.Frame
TEXT_EVENT_MASK. Static variable in class java.awt.AWTEvent
The event mask for selecting text events.
TEXT_FIRST. Static variable in class java.awt.event.TextEvent
Marks the first integer id for the range of adjustment event ids.
i.c
TEXT_HIGHLIGHT. Static variable in class java.awt.SystemColor
The array index for the text highlight color.
TEXT_HIGHLIGHT_TEXT. Static variable in class java.awt.SystemColor
The array index for the text highlight text color.
TEXT_INACTIVE_TEXT. Static variable in class java.awt.SystemColor
The array index for the text inactive text color.
TEXT_LAST. Static variable in class java.awt.event.TextEvent
Marks the last integer id for the range of adjustment event ids.
TEXT_TEXT. Static variable in class java.awt.SystemColor
The array index for the text text color.
dil
TEXT_VALUE_CHANGED. Static variable in class java.awt.event.TextEvent
The adjustment value changed event.
TextArea(). Constructor for class java.awt.TextArea
Constructs a new TextArea.
TextArea(int, int). Constructor for class java.awt.TextArea
Constructs a new empty TextArea with the specified number of rows and columns.
TextArea(String). Constructor for class java.awt.TextArea
Constructs a new TextArea with the specified text displayed.
TextArea(String, int, int). Constructor for class java.awt.TextArea
Constructs a new TextArea with the specified text and number of rows and columns.
TextArea(String, int, int, int). Constructor for class java.awt.TextArea
va
Constructs a new TextArea with the specified text and number of rows, columns, and scrollbar
visibility.
TextEvent(Object, int). Constructor for class java.awt.event.TextEvent
Constructs a TextEvent object with the specified TextComponent source, and type.
TextField(). Constructor for class java.awt.TextField
Constructs a new TextField.
TextField(int). Constructor for class java.awt.TextField
Constructs a new empty TextField with the specified number of columns.
TextField(String). Constructor for class java.awt.TextField
Constructs a new TextField initialized with the specified text.
ja
420
421
m
ThreadGroup(String). Constructor for class java.lang.ThreadGroup
Constructs a new thread group.
ThreadGroup(ThreadGroup, String). Constructor for class java.lang.ThreadGroup
Creates a new thread group.
Throwable(). Constructor for class java.lang.Throwable
Constructs a new Throwable with no detail message.
Throwable(String). Constructor for class java.lang.Throwable
Constructs a new Throwable with the specified detail message.
o
THURSDAY. Static variable in class java.util.Calendar
Useful constant for days of week.
time. Variable in class java.util.Calendar
The current time set for the calendar.
TIME. Static variable in class java.sql.Types
i.c
Time(int, int, int). Constructor for class java.sql.Time
Construct a Time Object
Time(long). Constructor for class java.sql.Time
Construct a Time using a milliseconds time value
TIMESTAMP. Static variable in class java.sql.Types
Timestamp(int, int, int, int, int, int, int). Constructor for class java.sql.Timestamp
Construct a Timestamp Object
Timestamp(long). Constructor for class java.sql.Timestamp
Construct a Timestamp using a milliseconds time value.
TimeZone(). Constructor for class java.util.TimeZone
dil
TIMEZONE_FIELD. Static variable in class java.text.DateFormat
Useful constant for TIMEZONE field alignment.
TINYINT. Static variable in class java.sql.Types
TITLECASE_LETTER. Static variable in class java.lang.Character
toBack(). Method in class java.awt.Window
Places this window at the bottom of the stacking order and makes the corresponding adjustment
to other visible windows.
toBack(). Method in interface java.awt.peer.WindowPeer
toBigInteger(). Method in class java.math.BigDecimal
Converts this number to a BigInteger.
toBinaryString(int). Static method in class java.lang.Integer
va
Creates a string representation of the integer argument as an unsigned integer in base 2.
toBinaryString(long). Static method in class java.lang.Long
Creates a string representation of the long argument as an unsigned integer in base 2.
toByteArray(). Method in class java.math.BigInteger
Returns the two's-complement representation of this number.
toByteArray(). Method in class java.io.ByteArrayOutputStream
Creates a newly allocated byte array.
toByteArray(). Method in class java.text.CollationKey
Converts the CollationKey to a sequence of bits.
toCharArray(). Method in class java.io.CharArrayWriter
ja
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 java.lang.String
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 java.lang.Integer
Creates a string representation of the integer argument as an unsigned integer in base 8.
toOctalString(long). Static method in class java.lang.Long
Creates a string representation of the long argument as an unsigned integer in base 8.
Toolkit(). Constructor for class java.awt.Toolkit
TooManyListenersException(). Constructor for class java.util.TooManyListenersException
o
Constructs a TooManyListenersException with no detail message.
TooManyListenersException(String). Constructor for class java.util.TooManyListenersException
Constructs a TooManyListenersException with the specified detail message.
top. Variable in class java.awt.Insets
The inset from the top.
i.c
TOP_ALIGNMENT. Static variable in class java.awt.Component
Ease of use constant for getAlignmentY().
toPattern(). Method in class java.text.ChoiceFormat
Gets the pattern.
toPattern(). Method in class java.text.DecimalFormat
Synthesizes a pattern string that represents the current state of this Format object.
toPattern(). Method in class java.text.MessageFormat
Gets the pattern.
toPattern(). Method in class java.text.SimpleDateFormat
Return a pattern string describing this date format.
dil
TOPDOWNLEFTRIGHT. Static variable in interface java.awt.image.ImageConsumer
The pixels will be delivered in top-down, left-to-right order.
toString(). Method in interface java.security.acl.Acl
Returns a string representation of the ACL contents.
toString(). Method in interface java.security.acl.AclEntry
Returns a string representation of the contents of this ACL entry.
toString(). Method in class java.awt.AWTEvent
Returns a string representation of the object.
toString(). Method in class java.math.BigDecimal
Returns the string representation of this number.
toString(). Method in class java.math.BigInteger
va
Returns the string representation of this number, radix 10.
toString(). Method in class java.util.BitSet
Returns a string representation of this bit set.
toString(). Method in class java.lang.Boolean
Returns a String object representing this Boolean's value.
toString(). Method in class java.awt.BorderLayout
Returns the String representation of this BorderLayout's values.
toString(). Method in class java.lang.Byte
Returns a String object representing this Byte's value.
toString(). Method in class java.io.ByteArrayOutputStream
ja
422
423
m
Returns the String representation of this Event's values.
toString(). Method in class java.util.EventObject
Returns a string representation of the object.
toString(). Method in class java.lang.reflect.Field
Return a string describing this Field.
toString(). Method in class java.io.File
Returns a string representation of this object.
toString(). Method in class java.lang.Float
o
Returns a String representation of this Float object.
toString(). Method in class java.awt.FlowLayout
Returns the String representation of this FlowLayout's values.
toString(). Method in class java.awt.Font
Converts this object to a String representation.
i.c
toString(). Method in class java.awt.FontMetrics
Returns the String representation of this FontMetric's values.
toString(). Method in class java.awt.Graphics
Returns a String object representing this Graphics object's value.
toString(). Method in class java.awt.GridBagLayout
Returns the String representation of this GridLayout's values.
toString(). Method in class java.awt.GridLayout
Returns the String representation of this GridLayout's values.
toString(). Method in class java.util.Hashtable
Returns a rather long string representation of this hashtable.
dil
toString(). Method in class java.security.Identity
Returns a short string describing this identity, telling its name and its scope (if any).
toString(). Method in class java.security.IdentityScope
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 java.net.InetAddress
Converts this IP address to a String.
toString(). Method in class java.awt.Insets
Returns a String object representing this Inset's values.
toString(). Method in class java.lang.Integer
Returns a String object representing this Integer's value.
va
toString(). Method in class java.util.Locale
Getter for the programmatic name of the entire locale, with the language, country and variant
separated by underbars.
toString(). Method in class java.rmi.server.LogStream
Return log name as string representation
toString(). Method in class java.lang.Long
Returns a String object representing this Long's value.
toString(). Method in class java.awt.MenuComponent
Returns the String representation of this MenuComponent's values.
toString(). Method in class java.awt.MenuShortcut
ja
423
424
m
Return a (somewhat verbose) description.
toString(). Method in class sun.tools.debug.RemoteDouble
Return the double's value as a string.
toString(). Method in class sun.tools.debug.RemoteField
Returns a string representation of the object.
toString(). Method in class sun.tools.debug.RemoteFloat
Return the float's value as a string.
toString(). Method in class sun.tools.debug.RemoteInt
o
Return the int's value as a string.
toString(). Method in class sun.tools.debug.RemoteLong
Return the long's value as a string.
toString(). Method in class java.rmi.server.RemoteObject
Returns a String that represents the value of this remote object.
i.c
toString(). Method in class sun.tools.debug.RemoteObject
Return object as a string.
toString(). Method in class sun.tools.debug.RemoteShort
Return the short's value as a string.
toString(). Method in class sun.tools.debug.RemoteString
Return the string value, or "null"
toString(). Method in class java.net.ServerSocket
Returns the implementation address and implementation port of this socket as a String.
toString(). Method in class java.lang.Short
Returns a String object representing this Short's value.
dil
toString(). Method in class java.security.Signature
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 java.security.Signer
Returns a string of information about the signer.
toString(). Method in class java.net.Socket
Converts this socket to a String.
toString(). Method in class java.net.SocketImpl
Returns the address and port of this socket as a String.
toString(). Method in class sun.tools.debug.StackFrame
Returns a string representation of the object.
va
toString(). Method in class java.io.StreamTokenizer
Returns the string representation of the current stream token.
toString(). Method in class java.lang.String
This object (which is already a string!) is itself returned.
toString(). Method in class java.lang.StringBuffer
Converts to a string representing the data in this string buffer.
toString(). Method in class java.io.StringWriter
Return the buffer's current value as a string.
toString(). Method in class java.awt.SystemColor
Returns the String representation of this Color's values.
ja
424
425
m
toString(float). Static method in class java.lang.Float
Returns a String representation for the specified float value.
toString(int). Method in class java.math.BigInteger
Returns the string representation of this number in the given radix.
toString(int). Method in class java.io.ByteArrayOutputStream
Creates a newly allocated string.
toString(int). Static method in class java.lang.Integer
Returns a new String object representing the specified integer.
o
toString(int). Static method in class java.lang.reflect.Modifier
Return a string describing the access modifier flags in the specified modifier.
toString(int, int). Static method in class java.lang.Integer
Creates a string representation of the first argument in the radix specified by the second
argument.
i.c
toString(long). Static method in class java.lang.Long
Returns a new String object representing the specified integer.
toString(long, int). Static method in class java.lang.Long
Creates a string representation of the first argument in the radix specified by the second
argument.
toString(short). Static method in class java.lang.Short
Returns a new String object representing the specified Short.
toString(String). Method in class java.io.ByteArrayOutputStream
Converts input data to a string, using the specified character encoding.
totalMemory(). Method in class sun.tools.debug.RemoteDebugger
dil
Report the total memory usage of the Java interpreter being debugged.
totalMemory(). Method in class java.lang.Runtime
Returns the total amount of memory in the Java Virtual Machine.
toTitleCase(char). Static method in class java.lang.Character
Converts the character argument to titlecase.
toUpperCase(). Method in class java.lang.String
Converts this string to uppercase.
toUpperCase(char). Static method in class java.lang.Character
Converts the character argument to uppercase.
toUpperCase(Locale). Method in class java.lang.String
Converts all of the characters in this String to upper case using the rules of the given
va
locale.
trace(boolean). Method in class sun.tools.debug.RemoteDebugger
Turn on/off method call tracing.
traceInstructions(boolean). Method in class java.lang.Runtime
Enables/Disables tracing of instructions.
traceMethodCalls(boolean). Method in class java.lang.Runtime
Enables/Disables tracing of method calls.
TRACK. Static variable in class java.awt.event.AdjustmentEvent
The absolute tracking adjustment type.
TRADITIONAL_CHINESE. Static variable in class java.util.Locale
ja
Translates the origin of the graphics context to the point (x, y) in the current coordinate
system.
translate(int, int). Method in class java.awt.Point
Translates the point.
translate(int, int). Method in class java.awt.Polygon
Translates the vertices by deltaX, deltaY.
translate(int, int). Method in class java.awt.Rectangle
Translates the rectangle.
translatePoint(int, int). Method in class java.awt.event.MouseEvent
Translates the coordinate position of the event by x, y.
trim(). Method in class java.lang.String
Removes white space from both ends of this string.
425
426
m
The Boolean object corresponding to the primitive value true.
TT_EOF. Static variable in class java.io.StreamTokenizer
A constant indicating that the end of the stream has been read.
TT_EOL. Static variable in class java.io.StreamTokenizer
A constant indicating that the end of the line has been read.
TT_NUMBER. Static variable in class java.io.StreamTokenizer
A constant indicating that a number token has been read.
TT_WORD. Static variable in class java.io.StreamTokenizer
o
A constant indicating that a word token has been read.
ttype. Variable in class java.io.StreamTokenizer
After a call to the nextToken method, this field contains the type of the token just read.
TUESDAY. Static variable in class java.util.Calendar
Useful constant for days of week.
i.c
TYPE. Static variable in class java.lang.Boolean
The Class object representing the primitive type boolean.
TYPE. Static variable in class java.lang.Byte
The Class object representing the primitive type byte.
TYPE. Static variable in class java.lang.Character
The Class object representing the primitive type char.
TYPE. Static variable in class java.lang.Double
The Class object representing the primitive type double.
TYPE. Static variable in class java.lang.Float
The Class object representing the primitive type float.
dil
TYPE. Static variable in class java.lang.Integer
The Class object representing the primitive type int.
TYPE. Static variable in class java.lang.Long
The Class object representing the primitive type long.
TYPE. Static variable in class java.lang.Short
The Class object representing the primitive type short.
TYPE. Static variable in class java.lang.Void
The Class object representing the primitive Java type void.
typeName(). Method in class sun.tools.debug.RemoteArray
Return this RemoteValue's type ("array").
typeName(). Method in class sun.tools.debug.RemoteBoolean
va
Print this RemoteValue's type ("boolean").
typeName(). Method in class sun.tools.debug.RemoteByte
Print this RemoteValue's type ("byte").
typeName(). Method in class sun.tools.debug.RemoteChar
Print this RemoteValue's type ("char").
typeName(). Method in class sun.tools.debug.RemoteClass
Returns the name of the class as its type.
typeName(). Method in class sun.tools.debug.RemoteDouble
Print this RemoteValue's type ("double").
typeName(). Method in class sun.tools.debug.RemoteFloat
ja
426
427
m
UID(). Constructor for class java.rmi.server.UID
Create a pure identifier that is unique with respect to the host on which it is generated.
UID(short). Constructor for class java.rmi.server.UID
Create a "well-known" ID.
UK. Static variable in class java.util.Locale
Useful constant for country.
UNASSIGNED. Static variable in class java.lang.Character
unbind(String). Static method in class java.rmi.Naming
o
Unbind the name.
unbind(String). Method in interface java.rmi.registry.Registry
Unbind the name.
uncaughtException(Thread, Throwable). Method in class java.lang.ThreadGroup
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 java.util.Calendar
Useful constant for month.
UndefinedProperty. Static variable in class java.awt.Image
The UndefinedProperty object should be returned whenever a property which was not defined for
a particular image is fetched.
UnexpectedException(String). Constructor for class java.rmi.UnexpectedException
Create a new UnexpectedException with a description.
UnexpectedException(String, Exception). Constructor for class java.rmi.UnexpectedException
Create a new UnexpectedException with a description, and detail exception.
dil
UnicastRemoteObject(). Constructor for class java.rmi.server.UnicastRemoteObject
Create and export a new UnicastRemoteObject object using an anonymous port.
UNINITIALIZED. Static variable in class java.security.Signature
Possible state value, signifying that this signature object has not yet been initialized.
union(Rectangle). Method in class java.awt.Rectangle
Computes the union of two rectangles.
UNIT_DECREMENT. Static variable in class java.awt.event.AdjustmentEvent
The unit decrement adjustment type.
UNIT_INCREMENT. Static variable in class java.awt.event.AdjustmentEvent
The unit increment adjustment type.
UnknownError(). Constructor for class java.lang.UnknownError
va
Constructs an UnknownError with no detail message.
UnknownError(String). Constructor for class java.lang.UnknownError
Constructs an UnknownError with the specified detail message.
UnknownHostException(). Constructor for class java.net.UnknownHostException
Constructs a new UnknownHostException with no detail message.
UnknownHostException(String). Constructor for class java.net.UnknownHostException
Constructs a new UnknownHostException with the specified detail message.
UnknownHostException(String). Constructor for class java.rmi.UnknownHostException
Create a new UnknownHostException with a description.
UnknownHostException(String, Exception). Constructor for class java.rmi.UnknownHostException
ja
427
428
no detailed message
UnsupportedEncodingException(String). Constructor for class java.io.UnsupportedEncodingException
detailed message
m
UnsupportedFlavorException(DataFlavor). Constructor for class
java.awt.datatransfer.UnsupportedFlavorException
Constructs an UnsupportedFlavorException.
UP. Static variable in class java.awt.Event
The up arrow action-key.
up(int). Method in class sun.tools.debug.RemoteThread
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 java.awt.event.PaintEvent
The update event type.
update(byte). Method in class java.security.MessageDigest
Updates the digest using the specified byte.
update(byte). Method in class java.security.Signature
i.c
Updates the data to be signed or verified by a byte.
update(byte[]). Method in class java.util.zip.Adler32
Updates checksum with specified array of bytes.
update(byte[]). Method in class java.util.zip.CRC32
Updates CRC-32 with specified array of bytes.
update(byte[]). Method in class java.security.MessageDigest
Updates the digest using the specified array of bytes.
update(byte[]). Method in class java.security.Signature
Updates the data to be signed or verified, using the specified array of bytes.
update(byte[], int, int). Method in class java.util.zip.Adler32
dil
Updates checksum with specified array of bytes.
update(byte[], int, int). Method in interface java.util.zip.Checksum
Updates the current checksum with the specified array of bytes.
update(byte[], int, int). Method in class java.util.zip.CRC32
Updates CRC-32 with specified array of bytes.
update(byte[], int, int). Method in class java.security.MessageDigest
Updates the digest using the specified array of bytes, starting at the specified offset.
update(byte[], int, int). Method in class java.security.Signature
Updates the data to be signed or verified, using the specified array of bytes, starting at the
specified offset.
update(Graphics). Method in class java.awt.Component
va
Updates the component.
update(int). Method in class java.util.zip.Adler32
Updates checksum with specified byte.
update(int). Method in interface java.util.zip.Checksum
Updates the current checksum with the specified byte.
update(int). Method in class java.util.zip.CRC32
Updates CRC-32 with specified byte.
update(Observable, Object). Method in interface java.util.Observer
This method is called whenever the observed object is changed.
UPPERCASE_LETTER. Static variable in class java.lang.Character
ja
Creates an absolute URL from the specified protocol name, host name, and file name.
URL(URL, String). Constructor for class java.net.URL
Creates a URL by parsing the specification spec within a specified context.
URLConnection(URL). Constructor for class java.net.URLConnection
Constructs a URL connection to the specified URL.
URLStreamHandler(). Constructor for class java.net.URLStreamHandler
US. Static variable in class java.util.Locale
Useful constant for country.
useCaches. Variable in class java.net.URLConnection
If true, the protocol is allowed to use caching whenever it can.
ww
428
429
UTC(int, int, int, int, int, int). Static method in class java.util.Date
Determines the date and time based on the arguments.
UTFDataFormatException(). Constructor for class java.io.UTFDataFormatException
m
Constructs a UTFDataFormatException with no detail message.
UTFDataFormatException(String). Constructor for class java.io.UTFDataFormatException
Constructs a UTFDataFormatException with the specified detail message.
o
valid(). Method in class java.io.FileDescriptor
Tests if this file descriptor object is valid.
validate(). Method in class java.awt.Component
Ensures that a component has a valid layout.
validate(). Method in class java.awt.Container
i.c
Validates this Container and all of the components contained within it.
validateObject(). Method in interface java.io.ObjectInputValidation
Validates the object
validateTree(). Method in class java.awt.Container
Recursively descends the container tree and recomputes the layout for any subtrees marked as
needing it (those marked as invalid).
value. Variable in class java.sql.DriverPropertyInfo
"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 java.lang.String
dil
Returns the string representation of the boolean argument.
valueOf(char). Static method in class java.lang.String
Returns the string representation of the char * argument.
valueOf(char[]). Static method in class java.lang.String
Returns the string representation of the char array argument.
valueOf(char[], int, int). Static method in class java.lang.String
Returns the string representation of a specific subarray of the char array argument.
valueOf(double). Static method in class java.lang.String
Returns the string representation of the double argument.
valueOf(float). Static method in class java.lang.String
Returns the string representation of the float argument.
va
valueOf(int). Static method in class java.lang.String
Returns the string representation of the int argument.
valueOf(long). Static method in class java.math.BigDecimal
Returns a BigDecimal with the given value and a scale of zero.
valueOf(long). Static method in class java.math.BigInteger
Returns a BigInteger with the specified value.
valueOf(long). Static method in class java.lang.String
Returns the string representation of the long argument.
valueOf(long, int). Static method in class java.math.BigDecimal
Returns a BigDecimal with a value of (val/10**scale).
ja
429
430
m
Assuming the specified String represents a short, returns a new Short object initialized to
that value.
VARBINARY. Static variable in class java.sql.Types
VARCHAR. Static variable in class java.sql.Types
Vector(). Constructor for class java.util.Vector
Constructs an empty vector.
Vector(int). Constructor for class java.util.Vector
Constructs an empty vector with the specified initial capacity.
o
Vector(int, int). Constructor for class java.util.Vector
Constructs an empty vector with the specified initial capacity and capacity increment.
VERBOSE. Static variable in class java.rmi.server.LogStream
VERIFY. Static variable in class java.security.Signature
Possible state value, signifying that this signature object has been initialized for
i.c
verification.
verify(byte[]). Method in class java.security.Signature
Verifies the passed-in signature.
VerifyError(). Constructor for class java.lang.VerifyError
Constructs an VerifyError with no detail message.
VerifyError(String). Constructor for class java.lang.VerifyError
Constructs an VerifyError with the specified detail message.
versionColumnNotPseudo. Static variable in interface java.sql.DatabaseMetaData
VERSION COLUMNS PSEUDO_COLUMN - is NOT a pseudo column.
versionColumnPseudo. Static variable in interface java.sql.DatabaseMetaData
dil
VERSION COLUMNS PSEUDO_COLUMN - is a pseudo column.
versionColumnUnknown. Static variable in interface java.sql.DatabaseMetaData
VERSION COLUMNS PSEUDO_COLUMN - may or may not be pseudo column.
VERTICAL. Static variable in interface java.awt.Adjustable
The vertical orientation.
VERTICAL. Static variable in class java.awt.GridBagConstraints
VERTICAL. Static variable in class java.awt.Scrollbar
The vertical Scrollbar variable.
vetoableChange(PropertyChangeEvent). Method in interface java.beans.VetoableChangeListener
This method gets called when a constrained property is changed.
VetoableChangeSupport(Object). Constructor for class java.beans.VetoableChangeSupport
va
VirtualMachineError(). Constructor for class java.lang.VirtualMachineError
Constructs a VirtualMachineError with no detail message.
VirtualMachineError(String). Constructor for class java.lang.VirtualMachineError
Constructs a VirtualMachineError with the specified detail message.
VK_0. Static variable in class java.awt.event.KeyEvent
VK_0 thru VK_9 are the same as ASCII '0' thru '9' (0x30 - 0x39)
VK_1. Static variable in class java.awt.event.KeyEvent
VK_2. Static variable in class java.awt.event.KeyEvent
VK_3. Static variable in class java.awt.event.KeyEvent
VK_4. Static variable in class java.awt.event.KeyEvent
ja
430
431
m
VK_ESCAPE. Static variable in class java.awt.event.KeyEvent
VK_F. Static variable in class java.awt.event.KeyEvent
VK_F1. Static variable in class java.awt.event.KeyEvent
VK_F10. Static variable in class java.awt.event.KeyEvent
VK_F11. Static variable in class java.awt.event.KeyEvent
VK_F12. Static variable in class java.awt.event.KeyEvent
VK_F2. Static variable in class java.awt.event.KeyEvent
VK_F3. Static variable in class java.awt.event.KeyEvent
o
VK_F4. Static variable in class java.awt.event.KeyEvent
VK_F5. Static variable in class java.awt.event.KeyEvent
VK_F6. Static variable in class java.awt.event.KeyEvent
VK_F7. Static variable in class java.awt.event.KeyEvent
VK_F8. Static variable in class java.awt.event.KeyEvent
i.c
VK_F9. Static variable in class java.awt.event.KeyEvent
VK_FINAL. Static variable in class java.awt.event.KeyEvent
for Asian Keyboard
VK_G. Static variable in class java.awt.event.KeyEvent
VK_H. Static variable in class java.awt.event.KeyEvent
VK_HELP. Static variable in class java.awt.event.KeyEvent
VK_HOME. Static variable in class java.awt.event.KeyEvent
VK_I. Static variable in class java.awt.event.KeyEvent
VK_INSERT. Static variable in class java.awt.event.KeyEvent
VK_J. Static variable in class java.awt.event.KeyEvent
dil
VK_K. Static variable in class java.awt.event.KeyEvent
VK_KANA. Static variable in class java.awt.event.KeyEvent
VK_KANJI. Static variable in class java.awt.event.KeyEvent
VK_L. Static variable in class java.awt.event.KeyEvent
VK_LEFT. Static variable in class java.awt.event.KeyEvent
VK_M. Static variable in class java.awt.event.KeyEvent
VK_META. Static variable in class java.awt.event.KeyEvent
VK_MODECHANGE. Static variable in class java.awt.event.KeyEvent
VK_MULTIPLY. Static variable in class java.awt.event.KeyEvent
VK_N. Static variable in class java.awt.event.KeyEvent
VK_NONCONVERT. Static variable in class java.awt.event.KeyEvent
va
VK_NUM_LOCK. Static variable in class java.awt.event.KeyEvent
VK_NUMPAD0. Static variable in class java.awt.event.KeyEvent
VK_NUMPAD1. Static variable in class java.awt.event.KeyEvent
VK_NUMPAD2. Static variable in class java.awt.event.KeyEvent
VK_NUMPAD3. Static variable in class java.awt.event.KeyEvent
VK_NUMPAD4. Static variable in class java.awt.event.KeyEvent
VK_NUMPAD5. Static variable in class java.awt.event.KeyEvent
VK_NUMPAD6. Static variable in class java.awt.event.KeyEvent
VK_NUMPAD7. Static variable in class java.awt.event.KeyEvent
VK_NUMPAD8. Static variable in class java.awt.event.KeyEvent
ja
431
432
m
VMID(). Constructor for class java.rmi.dgc.VMID
Create a new VMID.
VOLATILE. Static variable in class java.lang.reflect.Modifier
o
W_RESIZE_CURSOR. Static variable in class java.awt.Cursor
The west-resize cursor type.
W_RESIZE_CURSOR. Static variable in class java.awt.Frame
wait(). Method in class java.lang.Object
Waits to be notified by another thread of a change in this object.
i.c
wait(long). Method in class java.lang.Object
Waits to be notified by another thread of a change in this object.
wait(long, int). Method in class java.lang.Object
Waits to be notified by another thread of a change in this object.
WAIT_CURSOR. Static variable in class java.awt.Cursor
The wait cursor type.
WAIT_CURSOR. Static variable in class java.awt.Frame
waitFor(). Method in class java.lang.Process
Waits for the subprocess to complete.
waitForAll(). Method in class java.awt.MediaTracker
dil
Starts loading all images.
waitForAll(long). Method in class java.awt.MediaTracker
Starts loading all images.
waitForID(int). Method in class java.awt.MediaTracker
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 java.awt.MediaTracker
Starts loading all images with the specified ID.
wasNull(). Method in interface java.sql.CallableStatement
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 java.sql.ResultSet
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 java.util.Calendar
Useful constant for days of week.
WEEK_OF_MONTH. Static variable in class java.util.Calendar
Useful constant for date and time.
WEEK_OF_MONTH_FIELD. Static variable in class java.text.DateFormat
Useful constant for WEEK_OF_MONTH field alignment.
WEEK_OF_YEAR. Static variable in class java.util.Calendar
ja
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 java.awt.Rectangle
The width of the rectangle.
window. Static variable in class java.awt.SystemColor
The background color for windows.
WINDOW. Static variable in class java.awt.SystemColor
The array index for the window background color.
Window(Frame). Constructor for class java.awt.Window
Constructs a new Window initialized to an invisible state.
WINDOW_ACTIVATED. Static variable in class java.awt.event.WindowEvent
The window activated event type.
432
433
m
The window closed event type.
WINDOW_CLOSING. Static variable in class java.awt.event.WindowEvent
The window closing event type.
WINDOW_DEACTIVATED. Static variable in class java.awt.event.WindowEvent
The window deactivated event type.
WINDOW_DEICONIFIED. Static variable in class java.awt.event.WindowEvent
The window deiconified event type.
WINDOW_DEICONIFY. Static variable in class java.awt.Event
o
The de-iconify window event.
WINDOW_DESTROY. Static variable in class java.awt.Event
The destroy window event.
WINDOW_EVENT_MASK. Static variable in class java.awt.AWTEvent
The event mask for selecting window events.
i.c
WINDOW_EXPOSE. Static variable in class java.awt.Event
The expose window event.
WINDOW_FIRST. Static variable in class java.awt.event.WindowEvent
Marks the first integer id for the range of window event ids.
WINDOW_ICONIFIED. Static variable in class java.awt.event.WindowEvent
The window iconified event type.
WINDOW_ICONIFY. Static variable in class java.awt.Event
The iconify window event.
WINDOW_LAST. Static variable in class java.awt.event.WindowEvent
Marks the last integer id for the range of window event ids.
dil
WINDOW_MOVED. Static variable in class java.awt.Event
The move window event.
WINDOW_OPENED. Static variable in class java.awt.event.WindowEvent
The window opened event type.
WINDOW_TEXT. Static variable in class java.awt.SystemColor
The array index for the window text color.
windowActivated(WindowEvent). Method in class java.awt.AWTEventMulticaster
Handles the windowActivated event by invoking the windowActivated methods on listener-a and
listener-b.
windowActivated(WindowEvent). Method in class java.awt.event.WindowAdapter
windowActivated(WindowEvent). Method in interface java.awt.event.WindowListener
va
Invoked when a window is activated.
WindowAdapter(). Constructor for class java.awt.event.WindowAdapter
windowBorder. Static variable in class java.awt.SystemColor
The border color for windows.
windowClosed(WindowEvent). Method in class java.awt.AWTEventMulticaster
Handles the windowClosed event by invoking the windowClosed methods on listener-a and
listener-b.
windowClosed(WindowEvent). Method in class java.awt.event.WindowAdapter
windowClosed(WindowEvent). Method in interface java.awt.event.WindowListener
Invoked when a window has been closed.
ja
433
434
m
windowText. Static variable in class java.awt.SystemColor
The text color for windows.
wordChars(int, int). Method in class java.io.StreamTokenizer
Specifies that all characters c in the range low <= c <= high are word constituents.
write(byte[]). Method in interface java.io.DataOutput
Writes b.length bytes from the specified byte array to this output stream.
write(byte[]). Method in class java.io.FileOutputStream
Writes b.length bytes from the specified byte array to this file output stream.
o
write(byte[]). Method in class java.io.FilterOutputStream
Writes b.length bytes to this output stream.
write(byte[]). Method in interface java.io.ObjectOutput
Writes an array of bytes.
write(byte[]). Method in class java.io.ObjectOutputStream
i.c
Writes an array of bytes.
write(byte[]). Method in class java.io.OutputStream
Writes b.length bytes from the specified byte array to this output stream.
write(byte[]). Method in class java.io.RandomAccessFile
Writes b.length bytes from the specified byte array starting at offset off to this file.
write(byte[], int, int). Method in class java.io.BufferedOutputStream
Writes len bytes from the specified byte array starting at offset off to this buffered output
stream.
write(byte[], int, int). Method in class java.io.ByteArrayOutputStream
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 java.util.zip.CheckedOutputStream
Writes an array of bytes.
write(byte[], int, int). Method in interface java.io.DataOutput
Writes len bytes from the specified byte array starting at offset off to this output stream.
write(byte[], int, int). Method in class java.io.DataOutputStream
Writes len bytes from the specified byte array starting at offset off to the underlying output
stream.
write(byte[], int, int). Method in class java.util.zip.DeflaterOutputStream
Writes an array of bytes to the compressed output stream.
write(byte[], int, int). Method in class java.security.DigestOutputStream
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 java.io.FileOutputStream
Writes len bytes from the specified byte array starting at offset off to this file output
stream.
write(byte[], int, int). Method in class java.io.FilterOutputStream
Writes len bytes from the specified byte array starting at offset off to this output stream.
write(byte[], int, int). Method in class java.util.zip.GZIPOutputStream
Writes array of bytes to the compressed output stream.
write(byte[], int, int). Method in class java.rmi.server.LogStream
ja
434
435
m
write(char[], int, int). Method in class java.io.StringWriter
Write a portion of an array of characters.
write(char[], int, int). Method in class java.io.Writer
Write a portion of an array of characters.
write(DataOutput). Method in class java.rmi.server.UID
Write uid to output stream.
write(int). Method in class java.io.BufferedOutputStream
Writes the specified byte to this buffered output stream.
o
write(int). Method in class java.io.BufferedWriter
Write a single character.
write(int). Method in class java.io.ByteArrayOutputStream
Writes the specified byte to this byte array output stream.
write(int). Method in class java.io.CharArrayWriter
i.c
Writes a character to the buffer.
write(int). Method in class java.util.zip.CheckedOutputStream
Writes a byte.
write(int). Method in interface java.io.DataOutput
Writes the specified byte to this data output stream.
write(int). Method in class java.io.DataOutputStream
Writes the specified byte to the underlying output stream.
write(int). Method in class java.util.zip.DeflaterOutputStream
Writes a byte to the compressed output stream.
write(int). Method in class java.security.DigestOutputStream
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 java.io.FileOutputStream
Writes the specified byte to this file output stream.
write(int). Method in class java.io.FilterOutputStream
Writes the specified byte to this output stream.
write(int). Method in class java.io.FilterWriter
Write a single character.
write(int). Method in class java.rmi.server.LogStream
Write a byte of data to the stream.
write(int). Method in interface java.io.ObjectOutput
va
Writes a byte.
write(int). Method in class java.io.ObjectOutputStream
Writes a byte.
write(int). Method in class java.io.OutputStream
Writes the specified byte to this output stream.
write(int). Method in class java.io.OutputStreamWriter
Write a single character.
write(int). Method in class java.io.PipedOutputStream
Writes the specified byte to the piped output stream.
write(int). Method in class java.io.PrintStream
ja
435
436
m
A WriteAbortedException is thrown during a read when one of the ObjectStreamExceptions was
thrown during writing.
writeBoolean(boolean). Method in interface java.io.DataOutput
Writes a boolean value to this output stream.
writeBoolean(boolean). Method in class java.io.DataOutputStream
Writes a boolean to the underlying output stream as a 1-byte value.
writeBoolean(boolean). Method in class java.io.ObjectOutputStream
Writes a boolean.
o
writeBoolean(boolean). Method in class java.io.RandomAccessFile
Writes a boolean to the file as a 1-byte value.
writeByte(int). Method in interface java.io.DataOutput
Writes an 8-bit value to this output stream.
writeByte(int). Method in class java.io.DataOutputStream
i.c
Writes out a byte to the underlying output stream as a 1-byte value.
writeByte(int). Method in class java.io.ObjectOutputStream
Writes an 8 bit byte.
writeByte(int). Method in class java.io.RandomAccessFile
Writes a byte to the file as a 1-byte value.
writeBytes(String). Method in interface java.io.DataOutput
Writes a string to this output stream.
writeBytes(String). Method in class java.io.DataOutputStream
Writes out the string to the underlying output stream as a sequence of bytes.
writeBytes(String). Method in class java.io.ObjectOutputStream
dil
Writes a String as a sequence of bytes.
writeBytes(String). Method in class java.io.RandomAccessFile
Writes the string to the file as a sequence of bytes.
writeChar(int). Method in interface java.io.DataOutput
Writes a char value to this output stream.
writeChar(int). Method in class java.io.DataOutputStream
Writes a char to the underlying output stream as a 2-byte value, high byte first.
writeChar(int). Method in class java.io.ObjectOutputStream
Writes a 16 bit char.
writeChar(int). Method in class java.io.RandomAccessFile
Writes a char to the file as a 2-byte value, high byte first.
va
writeChars(String). Method in interface java.io.DataOutput
Writes a string to this output stream.
writeChars(String). Method in class java.io.DataOutputStream
Writes a string to the underlying output stream as a sequence of characters.
writeChars(String). Method in class java.io.ObjectOutputStream
Writes a String as a sequence of chars.
writeChars(String). Method in class java.io.RandomAccessFile
Writes a string to the file as a sequence of characters.
writeDouble(double). Method in interface java.io.DataOutput
Writes a double value to this output stream.
ja
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 java.io.Externalizable
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 java.io.DataOutput
Writes a float value to this output stream.
writeFloat(float). Method in class java.io.DataOutputStream
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 java.io.ObjectOutputStream
Writes a 32 bit float.
writeFloat(float). Method in class java.io.RandomAccessFile
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 java.io.DataOutput
Writes an int value to this output stream.
writeInt(int). Method in class java.io.DataOutputStream
Writes an int to the underlying output stream as four bytes, high byte first.
writeInt(int). Method in class java.io.ObjectOutputStream
Writes a 32 bit int.
436
437
m
Writes a long value to this output stream.
writeLong(long). Method in class java.io.DataOutputStream
Writes a long to the underlying output stream as eight bytes, high byte first.
writeLong(long). Method in class java.io.ObjectOutputStream
Writes a 64 bit long.
writeLong(long). Method in class java.io.RandomAccessFile
Writes a long to the file as eight bytes, high byte first.
writeObject(Object). Method in interface java.io.ObjectOutput
o
Write an object to the underlying storage or stream.
writeObject(Object). Method in class java.io.ObjectOutputStream
Write the specified object to the ObjectOutputStream.
Writer(). Constructor for class java.io.Writer
Create a new character-stream writer whose critical sections will synchronize on the writer
i.c
itself.
Writer(Object). Constructor for class java.io.Writer
Create a new character-stream writer whose critical sections will synchronize on the given
object.
writeShort(int). Method in interface java.io.DataOutput
Writes a 16-bit value to this output stream.
writeShort(int). Method in class java.io.DataOutputStream
Writes a short to the underlying output stream as two bytes, high byte first.
writeShort(int). Method in class java.io.ObjectOutputStream
Writes a 16 bit short.
dil
writeShort(int). Method in class java.io.RandomAccessFile
Writes a short to the file as two bytes, high byte first.
writeStreamHeader(). Method in class java.io.ObjectOutputStream
The writeStreamHeader method is provided so subclasses can append or prepend their own header
to the stream.
writeTo(OutputStream). Method in class java.io.ByteArrayOutputStream
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 out.write(buf, 0, count).
writeTo(Writer). Method in class java.io.CharArrayWriter
Writes the contents of the buffer to another character stream.
writeUTF(String). Method in interface java.io.DataOutput
va
Writes a Unicode string by encoding it using modified UTF-8 format.
writeUTF(String). Method in class java.io.DataOutputStream
Writes a string to the underlying output stream using UTF-8 encoding in a machine-independent
manner.
writeUTF(String). Method in class java.io.ObjectOutputStream
Writes a String in UTF format.
writeUTF(String). Method in class java.io.RandomAccessFile
Writes a string to the file using UTF-8 encoding in a machine-independent manner.
written. Variable in class java.io.DataOutputStream
The number of bytes written to the data output stream.
ja
437
438
m
yellow. Static variable in class java.awt.Color
The color yellow.
yield(). Static method in class java.lang.Thread
Causes the currently executing thread object to temporarily pause and allow other threads to
execute.
ypoints. Variable in class java.awt.Polygon
The array of y coordinates.
o
i.c
dil
ja va
w.
ww
438