Java Program Lama Dili TCOBAN WwwJavaDiliCom
Java Program Lama Dili TCOBAN WwwJavaDiliCom
o m
i.c
JAVA PROGRAMLAMA DİLİ
(1.1 SÜRÜMÜ)
dil
Dr. M. Turhan Çoban
TÜBİTAK Marmara Araştırma Merkezi
va
Enerji Sistemleri ve Çevre Araştırma Enstitüsü
Email : turhan@[Link]
ja
w.
ww
1
2
İNDEKS
m
BÖLÜM 1 : JAVAYA GİRİŞ
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
[Link] veya
[Link]
internet adreslerinden bedava çekilebilir. Çekme zahmeti çekmek istemiyorsanız SUN bu
programları CD formatında da satmaktadır.
ja
Java programı [Link] seklinde editörle yazılır. Java programınız yazıldıktan sonra ilk step
java derleyici (compiler) programıyla [Link] ara bilgisayar kodunu oluşturmaktır.
Java programını yazarken dikkat etmeniz gereken diğer bir özellik de javanın nesne sınıfının
ismiyle dosyadaki isminin aynı olmasıdır. Bilgisayar konsol ekranında (DOS veya UNIX
w.
Console)
javac [Link]
programları iki ortam için yaratılabilir. Birincisi Konsol ortamıdır (DOS, Unix console gibi).
İkincisi ise Pencere (Applet) ortamıdır. Eğer Program konsol ortamında yazılmışsa
java isim
komutu kullanılarak sonuçlar ekranda görülebilir. Eğer Program applet ortamında yazılmışsa
html diline [Link] dosyası açılır. En basit şekilde html dosyası şu şekilde tanımlanabilir :
6
7
<html>
<applet code="[Link]" wıdth=200 heıght=50>
m
</applet>
</html>
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: [Link]("Java Sinifina Hos Geldiniz!");
8: }
9: }
Şekil 1.2.1 Hoş[Link] konsol programı
va
bu programı çalıştırmak için
javac [Link]
java Hosgeldiniz
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 [Link].*;
3:
dil
İlk applet programımız [Link] listesi Şekil 1.2.2 de verilmiştir
1: import [Link];
javac [Link]
appletviewer [Link]
w.
8
9
m
Bu programında temel olarak bazı farklılıklar dışında bir önceki programa benzediğini
gözlemleyebiliriz.
import [Link];
import [Link].*;
o
deyimleri java kütüphanesindeki Applet ve pencere(awt) sınıf programlarını programımıza
aktarır.
public class HosgeldinizApplet extends Applet deyimi HosgeldinizApplet isimli sınıfı
(class) yaratır. Bu sınıf tüm Applet sınıfının bir devamı olarak tanımlanmaktadır (extends
i.c
Applet) diğer bir deyimle Applet sınıfının bütün metotları extends deyimiyle
HosgeldinizApplet sınıfımızın içine kopyalanmıştır.
public void paint(Graphics g) deyimi appletin grafik olarak çizilmesini sağlar. Bu Metot
Graphics sınıfı g nesnesini girdi olarak kullanır. Metodun çıktısı yoktur.
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:\\[Link] internet
adresini ziyaret edebilirsiniz. Aşağıdaki küçük program parçacığı char tipi A1, A2 ve
alpha1,alpha2 değişkenlerine A ve a harflerini yüklemektedir.
char A1,A2;
w.
char alpha1,alpha2;
A1='\u0041';
A2='A';
alpha1='\u03E1';
alpha2='a';
ww
Burada şunu kaydedelim alpha1 değişkenini her ortamda doğru olarak görebiliriz, fakat
alpha2 değişkeni bazı ortamlarda görülmeyebilir.
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"
[Link](d); // bu satır ali veli çıktısı verir
String türü sabitler her zaman " işaretleri arasına yazılırlar ve + işaretiyle bir araya
getirilebilirler.
11
12
m
Javadaki temel aritmetik işlemler şunlardır :
+ toplama
- çıkarma
* çarpma
/ bölme
o
% tamsayılar için bölmede kalan (modül)
Şekil 1.4.1 deki program örneği int tamsayı kullanarak bu aritmetik işlemlerin yapılmasını
göstermektedir.
i.c
1: import [Link].*; //java girdi cikti sinifini cagir
2:
3: class Aritmetik
4: {
5: public static void main(String args[])
6: {
7:
8:
9:
10:
11:
12:
13:
int sayi1,sayi2;
sayi2=3;
toplama = sayi1+sayi12;
cikarma = sayi1-sayi2;
carpma = sayi1*sayi2;
dil
int toplama,cikarma,carpma,bolme,kalan;
sayi1=2;
va
14: bolme=sayi1/sayi2;
15: kalan=sayi1%sayi2;
16: [Link]("sayi1 + sayi2 ="+toplama);
17: [Link]("sayi1 - sayi2 ="+cikarma);
18: [Link]("sayi1 * sayi2 ="+carpma);
19: [Link]("sayi1 / sayi2 ="+bolme);
ja
sayi1 + sayi2 =5
sayi1 - sayi2 =-1
sayi1 * sayi2 =6
sayi1 / sayi2 =0
sayi1 % sayi2 =2
Şekil 1.4.2 [Link] konsol programı çıktısı
ww
Java ve C dillerinde temel aritmetik işlemlerinin yanı sıra bu işlemlerin kısaltılmış sembolleri
de oldukça sık kullanılır. Bu işlemler :
++ bir ilave et
-- bir çıkar
+= sağ taraftaki rakamı ilave et
-= sağ taraftaki rakamı çıkar
*= sağ taraftaki rakamla çarp
12
13
m
++ ve -- işlemleri değişkenden önce veya sonra gelebilir. Bu iki şeklin değişken tek başlarına
kullanıldığında bir farklılıkları yoktur, fakat ikinci bir değişkenle birlikte tek bir deyimde
kullanıldıklarında ikinci değişkenin değeri değişir. Aşağıdaki iki program parçacığına göz
atalım.
o
int a=2;
int c;
c=a++; // a nın değeri 3 c nin değeri 2
i.c
Şekil 1.4.2 ++ işlemcisinin değişkenden sonra kullanılması
int a=2;
int c;
c=++a; // a nın değeri 3 c nin değeri 3
Şekil 1.4.2 ++ işlemcisinin değişkenden önce kullanılması
dil
a değişkeninin değeri başlangıçta 2 ise görüldüğü gibi hem ++a işleminde hem de a++
işleminde değeri 3 e çıkmaktadır. Ancak c değişkeninin değeri c=a++ işleminde 2 olarak
kalırken (önce değeri yükle sonra arttır), c=++a işleminde 3 olmaktadır(önce arttır, sonra
değeri yükle). ++ ve -- işlemleri genelde tam sayı değişkenler için kullanılır.
Şekil 1.4.3 de aritmetik işlemleri gösteren bir program verilmiştir. Şekil 1.4.4 Bu programın
va
sonuçlarını vermektedir. Programı basamak basamak takip ederek sonuçların doğruluğunu
elde hesaplayarak kontrol edebilirsiniz.
import [Link].*;
public class Aritmetik1
{ public static void main(String[] args)
{
ja
int sayi1=1;
int sayi2=2;
sayi1+=sayi2;
[Link]("sayi1+= : "+ sayi1);
sayi1-=sayi2;
w.
}
}
Şekil 1.4.3 [Link] aritmetik işlem örneği
sayi1+= : 3
sayi1-= : 1
sayi1*= : 2
13
14
sayi1/= : 1
Şekil 1.4.4 Aritmetik1 sınıfının sonuçları
m
1.5 Javada Mantıksal işlemler
Javadaki temel değişken türlerine bakarken boolean türü değişkenleri tanımlamıştık. Tam sayı
ve gerçek değişkenlerin aritmetik işlemlerde kullanılabildiği gibi boolean değişkenler de
o
mantıksal işlemlerde kullanılabilirler. Mantıksal işlem işlemcileri şunlardır :
i.c
|| veya
> büyüktür
< küçüktür
== eţittir
>= büyük ve eţittir
<= küçük ve eţittir
! değildir
!= eşit değildir
dil
Şekil 1.5.1 java dilindeki mantıksal işlemler
Mantıksal işlemleri pekiştirmek amacıyla Şekil 1.5.2 de bir örnek verilmiştir. Şekil 1.5.3 bu
örnek problemin sonucunu vermektedir. Satır satır proğramı takip ederek sonucuları kontrol
ediniz.
import [Link].*;
va
public class booleanvar
{ public static void main(String[] args)
{
boolean b1,b2;
b1=true;
b2=false;
ja
sayı2=2;
[Link]("sayi 1 : "+sayi1);
[Link]("sayi 2 : "+sayi2);
b1=(sayi1 > sayi2);
[Link]("sayi1 > sayi2 "+ b1 );
b1=(sayi1 < sayi2);
[Link]("sayi1 < sayi2 "+ b1 );
ww
b1=(sayi1 == sayi2);
[Link]("sayi1 == sayi2 "+ b1 );
b1=(sayi1 >= sayi2);
[Link]("sayi1 >= sayi2 "+ b1 );
b1=(sayi1 <= sayi2);
[Link]("sayi1 <= sayi2 "+ b1 );
b1=(sayi1 != sayi2);
14
15
m
}
Şekil 1.5.2 Java mantıksal işlemleri örnek problemi [Link]
b1 : true b2 : false
o
b1 && b2 false
b1 || b2 true
sayi 1 : 1
sayi 2 : 2
i.c
1 > 2 false
1 < 2 true
1 == 2 false
1 >= 2 false
1 <= 2 true
1 != 2 true
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([Link]);
15
16
m
if( not >= 90)
{ [Link]("A"); }
else if(not >=75)
{ [Link]("B"); }
else if(not >=60)
o
{ [Link]("C"); }
else if(not >=50)
{ [Link]("D"); }
else if(not >=40)
i.c
{ [Link]("E"); }
else
{ [Link]("F"); }
}
}
Şekil [Link] if yapısını gösteren [Link] programı
Bu programda öğrenci notu girdi olduğundan girilen nota göre bilgisayar A,B,C,D,E veya F
va
notlarından birini verecektir. Bu ilk programımızda if ve else if parantezlerinin içinde direk
olarak boolean sabit kullanılmıştır. Parantez içi boolean değişken de olabilir.
Şekil [Link] deki program parçası a degiskeninin degeri : true yazısını yazdıracaktır.
boolean a=true;
if(a)
ja
if - elseif - else yapıları iç içe girmiş yapılar veya basit mantıkların && (ve), ||(veya)
işlemleriyle bağlanmasıyla daha kompleks mantıksal şartlar oluşturulabilir. Şekil [Link] de iç
içe geçmis ve Şekil [Link] de && terimiyle bağlanmış iki proğram parçacığı görüyorsunuz.
double x = 7.0;
double y = 3.0;
ww
if(x > 5)
{
if(y>5) { [Link]("x ve y besten buyuktur.");}
elseif(y==5) { [Link]("x besten buyuktur ve y bese esittir.");}
else { [Link]("x besten buyuktur ve y besten kucuktur.");}
}
else
16
17
{
if(y>5) { [Link]("x besten kucuktur veya esittir ve y 5 den buyuktur.");}
m
elseif(y==5) { [Link]("x besten kucuktur veya esittir ve y bese esittir.");}
else { [Link]("x besten kucuktur veya esıttır ve y besten kucuktur.");
}
}
Şekil [Link] İç içe geçmiş if yapısı
o
double x = 7.0;
double y = 3.0;
if(x > 5 && y> 5) { [Link]("x ve y besten buyuktur.");}
i.c
else if(x > 5 && y==5) { [Link]("x besten buyuktur ve y bese esittir.");}
else if(x>5 && y<5) { [Link]("x besten buyuktur ve y besten kucuktur.");}
else if(x< && y>5) { [Link]("x besten kucuktur ve y 5 den buyuktur.");}
else if(x < 5 && y==5) { [Link]("x besten kucuktur ve y bese esittir.");}
}
}
dil
Şekil [Link] && (ve) deyimiyle bağlanmış if yapısı
ö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 [Link] de dowhile döngüsünün kullanıldığı bir [Link] programı
görülmektedir
i.c
import [Link];
import [Link];
public class dowhileApplet
{
public void paint(Graphics g)
{
dil
int saydirici=1;
int x=25;
do {
[Link]([Link](saydırıcı),x,25);
x += 15;
} while(++saydirici <= 10);
}
va
}
Ţekil [Link] [Link]
for tekrarlama yapısıgenellikle sayıları belli bir düzen içinde arttırmak için kullanılır. Genel
yapısı Şekil [Link] de gösterilmiş[Link] sayı saydırmaya dönük uygulamalarda
ww
18
19
Şekil [Link] de 1 den yüze kadar sayıların toplamını hesaplayan bir konsol programı
m
verilmiştir.
import [Link].*;
class foryapisi
{
o
public static void main(String args[])
{
int toplam=0;
for(int sayi=1;sayi<=100;sayi++)
i.c
{ toplam+=sayi;}
[Link]("1 den 100 e sayilarin toplami : "+toplam);
}
}
Şekil [Link] [Link] konsol proğramı
dil
[Link] kompile edildiğinde
1 den 100 e sayilarin toplami : 5050
sonucunu verecektir.
int y=40;
[Link]("Yil",25,25);
[Link]("paraMiktari",100,25);
for(int yil=1; yil<=10 ; yil++)
{
w.
paraMiktari*=(1.0+faizOrani);
[Link](" "+yil,25,y);
[Link](" "+paraMiktari,100,y);
// not: drawString terimi daima String turu
// degiskenle baslamali veya string e donusturulmelidir.
y+=15;
ww
Şekil [Link] de yine for döngüsünün uygulaması konusunda bir örnek problem verilmiştir.
Programı nasıl çalıştığını inceleyiniz. Ilk iki faiz oranını elde hesaplayınız. Programı
çalıştırarak sonuçları kontrol ediniz. Program sonuçları Şekil [Link] de listelenmiştir.
19
20
o m
i.c
[Link] [Link] appletinin appletviewer browser programında görünümü
dil
Switch case yapısı çeşitli alternatifler içeren bir tablodan seçme yapma türü işlerde kullanılır.
Temel yapısı Şekil [Link] de verilmiştir.
................
default :
eğer yukarıdaki case kutularından hiçbirine girilemediyse
yapılacak işlemler
w.
break;
}
Şekil [Link] 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.
[Link](this);
}
dil
[Link]("Her harf notun toplami : ",25,40);
[Link]("A : "+Asayisi,25,55);
[Link]("B : "+Bsayisi,25,70);
[Link]("C : "+Csayisi,25,85);
[Link]("D : "+Dsayisi,25,100);
[Link]("E : "+Esayisi,25,115);
[Link]("F : "+Fsayisi,25,130);
va
}
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 [Link] switch - case yapısı örneği [Link]
dil
va
JAVA PROGRAMLAMA DİLİ
ja
HAFTA 1
ALIŞTIRMALAR
1. Notdefteri programını kullanarak [Link] proğramını incele. Konsole (MS Dos) ortamında aşağıdaki
komutları kullanarak calıştır :
w.
javac [Link]
java Hosgeldiniz
import [Link].*;
class Hosgeldiniz { public static void main (String args[]) {
[Link]("Java Sinifina Hos Geldiniz!");
}
ww
22
23
m
geldiniz!",25,25); }}
3. Notdefteri programını kullanarak [Link] proğramını incele. Konsole (MS Dos) ortamında aşağıdaki
komutları kullanarak calıştır :
javac [Link]
java ikitamsayitopla
o
import [Link].*; //giris çikis import Text;
class ikitamsayitopla {
public static void main (String args[]) throws IOException
{
i.c
int sayi1,sayi2;
int toplam=0;
//
DataInputStream cin=new DataInputStream([Link]);
[Link]("Bir tam sayi giriniz : ");
sayi1=[Link](cin);
[Link]("Ikinci bir tamsayi giriniz : ");
sayi2=[Link](cin);
dil
toplam=sayi1+sayi2;
[Link]("Iki tam sayinin toplami : "+toplam);
}
}
{
//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([Link]() );
sayi=[Link]();
// sayiyi okutma islemini asagidaki deyimle de yapabiliriz
// sayi=[Link]( [Link]() );
toplam+=sayi; // veya toplam=toplam+sayi;
repaint();//pencereyi yeniden paint metoduna göre ciz
}
o
public void paint(Graphics g)
{
[Link]("Su ana kadarki sayilarin toplami : "+toplam,25,50);
i.c
}
}
//
DataInputStream cin=new DataInputStream([Link]);
[Link]("Bir tam sayi giriniz : ");
sayi1=[Link](cin);
[Link]("Ikinci bir tam sayi giriniz : ");
sayi2=[Link](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
[Link]("dogru ve yanlis : "+(mantik1 && mantik2));
[Link]("dogru veya yanlis : "+(mantik1 || mantik2));
mantik1=( sayi1 > sayi2 );
mantik2=( sayi1 < sayi2 );
// Boolean (mantik) tipi degisken islemleri :
// > : buyuktur
dil
// < : kucuktur
// == : esittir
// >= : buyuk veya esittir
// <= : kucuk veya esittir
// ! : mantigi tersine cevirme
// != : esit degildir
// && : ve
// || : veya
mantik1=( sayi1 > sayi2 );
va
mantik2=( sayi1 < sayi2 );
[Link]("sayi1 buyuktur sayi2 : "+mantik1);
[Link]("sayi 1 kucuktur sayi2 : "+mantik2);
}
}
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;
[Link](this);
}
// -----------------------> x ekseni
// |
// |
// |
// V y ekseni
[Link]("Su ana kadarki sayilarin toplami : "+toplam,25,50);
[Link]("Su ana kadarki sayilarin aritmetik ortalamasi :
"+aritmetikOrtalama,25,65);
ww
26
27
o m
7. Notdefteri programını kullanarak bessayı[Link] proğramını incele. Konsole (MS Dos) ortamında aşağıdaki
i.c
komutları kullanarak calıştır :
javac bessayı[Link]
java bessayıtopla
dil
double sayi;
double toplam=0;
int saydirici=0;
//
DataInputStream cin=new DataInputStream([Link]);
while( saydirici < 5)
{
[Link]("Bir tam sayi giriniz : ");
va
sayi=[Link](cin);
toplam+=sayi;
saydirici++;
}
[Link]("sayilarin toplami : "+toplam);
}
}
ja
8. Notdefteri programını kullanarak [Link] programını incele. Konsole (MS Dos) ortamında
aşağıdaki komutları kullanarak calıştır :
javac [Link]
java StringDegisken
27
28
s3="49";
s4=" Elli";
m
s=s1+s2+s3+s4;
[Link](s);
i1=49;
s=s1+s2+i1+s4;
[Link](s);
}
}
o
Ali Veli 49 Elli
Ali Veli 49 Elli
i.c
9. alıstırma 7 deki bessayi [Link] programini iyice anladiktan sonra birden yüze (100) kadar sayiların
ortalamasini hesaplayan birdenyü[Link] program ve sinifini (Konsole) yaz ve calistir.
class birdenyuzeortalama
{
public static void main (String args[])
{
double sayi=1;
double toplam=0;
while( sayi <= 100)
{
}
toplam+=sayi++;
dil
va
[Link]("sayilarin toplami : "+toplam);
[Link]("sayilarin ortalamasi : "+toplam/100.0);
}
}
[Link]
w.
[Link]
[Link]
[Link]
[Link]
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
[Link](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)
[Link](sayi1+" == "+sayi2,100,90);
if(sayi1 != sayi2)
[Link](sayi1+" != "+sayi2,100,105);
if(sayi1 < sayi2)
[Link](sayi1+" < "+sayi2,100,120);
if(sayi1 > sayi2)
[Link](sayi1+" > "+sayi2,100,135);
if(sayi1 <= sayi2)
va
[Link](sayi1+" <= "+sayi2,100,150);
if(sayi1 >= sayi2)
[Link](sayi1+" >= "+sayi2,100,165);
}
{
// sayi 1 i girdi kutusundan oku
sayi1=[Link]([Link]());
// sayi 2 i girdi kutusundan oku
sayi2=[Link]([Link]());
repaint();
w.
}
}
ww
29
30
o m
i.c
[Link]
dil
{ public static void main(String args[])
{
int sayi=2;
while(sayi<=1000)
{
sayi*=2;
[Link]("sayi = "+sayi);
}//while yapisinin sonu
va
}
}
sayi = 4
sayi = 8
sayi = 16
sayi = 32
sayi = 64
ja
sayi = 128
sayi = 256
sayi = 512
sayi = 1024
[Link]
w.
[Link]
[Link]
[Link]
Ödev problem 1
ww
30
31
m
Bu haftaki yeni java dosyaları
o
import [Link];import [Link];
public class yildiz3forApplet extends Applet
{
public void paint(Graphics g)
i.c
{
int x,y;
for(y=15;y <= 150;y+=15)
{
for(x=15;x <= y;x+=15)
{
[Link]("*",x,y);
}
dil
}
}
}
ja va
31
32
o m
i.c
YILDIZ~3 JAV 404 02/05/98 23:36 [Link]
dil
int x=0;
for(i=1;i <= 11;i++) //i degeri birden 11 a kadar degisir
{
x += 15; // x degeri her i icin 15 artiyor
[Link]("*",x,x);
[Link]("*",x,(180-x));
}
}
}
ja va
w.
import [Link];
import [Link];
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
[Link]("*",x,15); // x lineer degisken y 15
[Link]("*",15,x); // x 15 y lineer de§isken
[Link]("*",x,165); // x lineer degisken y 165
[Link]("*",165,x); // x 165 y lineer de§isken
[Link]("*",x,x); // \ ciz
[Link]("*",x,(180-x)); // / ciz
o
}
}
}
i.c
dil
va
YILDIZ~5 JAV 366 02/05/98 23:10 [Link]
ja
import [Link];
import [Link];
public class yildiz1forApplet extends Applet
{
public void paint(Graphics g)
w.
{
int i;
int x=25;
for(i=1;i <= 10;i++) //i degeri birden 10 a kadar degisir
{
[Link]("*",x,x);
x += 15; // x degeri her i icin 15 artiyor
ww
}
}
}
33
34
o m
i.c
KILO~1 JAV 556 02/05/98 13:18 [Link]
class kilo
{
kilonuzu giriniz : 45
normal
kilonuzu giriniz : 95
sisman
w.
34
35
[Link]("pi : "+pi,25,25);
}
m
}
o
ALIŞTIRMALAR
i.c
1. Java applet programı kullanarak aşağıdaki şekli applet de çizdiriniz :
**********
*********
********
*******
******
dil
*****
****
***
**
*
}
}
}
}
w.
ww
35
36
m
**********
* *
* *
**********
import [Link];
o
import [Link];
i.c
public void paint(Graphics g)
{
int x,y;
for(x=15;x <= 150;x+=15)
{
[Link]("*",x,15);
[Link]("*",x,60);
}
dil
for(y=15;y <= 60;y+=15)
{
[Link]("*",15,y);
[Link]("*",150,y);
}
}
}
ja va
import [Link].*;
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 [Link].*;
import Text;
i.c
class H3A4
{
public static void main(String args[]) throws IOException
{
double faktoriyel=1;
double x;
double us=1;
double exponent=1;
DataInputStream cin=new DataInputStream([Link]);
[Link]("Bir sayi giriniz:");
x=[Link](cin);
for(double sayi=1;sayi<=200;sayi++)
{
faktoriyel*=sayi;
us*=x;
exponent+=us/faktoriyel;
}
dil
va
[Link]("exp("+x+") = "+exponent);
[Link]("gercek exp("+x+") = "+[Link](x));
}
}
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 [Link], [Link] ve [Link] API paketlerini kullandık.
[Link] paketi appletleri oluşturma, appletlere giriş çıkısları ve ses dosyalarını applet
dil
içerisinde çalıştırmayı sağlar. [Link] pencere(window) ortamındaki tüm programlama
sınıflarını ve metodlarını içerir. Bu metodları ilerideki bölümlerde daha detaylı inceleyeceğiz.
[Link] paketi javaya dışarıdan(dosya,ekran v.b) bilgi giriş çıkışını ayarlar. Java dilinde en çok
kullanılan API sınıfı Math sınıfıdır. Bu sınıf(class) [Link] paketinde yer alır. [Link]
paketi java programı açılırken otomatik olarak çağırılır. Bütün diğer paketler import deyimi
kullanılarak programa ilave edilirler. Math sınıfında tanımlanan metodların bazıları Şekil 2.1
de listelenmiştir. Tablodaki x veya y değişkenleri double değişken türündendir. Math
sınıfında(class) iki tane de sabit tanımlanmıştır. Bu sabitlerden birisi [Link]
va
3.14159265358979323846 (pi) sayısına eşittir. Diğeri Math.E 2.7182818284590452354 (e)
sayısına eşittir.
tanımlanmıştır.)
Sin(x) x in trigonometrik sinüsü [Link](1.0)=0.8414709840709
(x radyan cinsinden
tanımlanmıştır.)
Tan(x) x in trigonometrik tanjantı [Link](1.0)=1.557040724655
(x radyan cinsinden
tanımlanmıştır.)
ww
38
39
tanımlanmıştır.)
exp(x) e(2.7182818284590452354) nin [Link](1.0) =2.718281828459
m
x inci kuvveti [Link](2.0) =7.389056098931
Log(x) e tabanına göre logaritma [Link](2.718281828459)=1.0
Pow(x,y) x in y inci kuvveti [Link](3,2)=9.0
Max(x,y) x ve y nin büyük olanı [Link](2.3,12.7)=12.7
min(x,y) x ve y nin küçük olanı [Link](2.3,12.7)=2.3
Random() Raslantısal sayı (0 ile 1 arasinda) [Link]() = 0 ila bir
o
arasında her sayı çıkabilir
Şekil 2.1.1 Math sınıfında(class) çalışan metotlardan bazıları
i.c
Ţekil 2.2 de Math sınıfındaki metodları kullanan Matematik1 sınıfını görüyoruz.
Bu programın sonuçları şekil 2.3 de gösterilmektedir.
dil
class matematik1
{
public static void main (String args[]) throws IOException
{
double x,y;
// DataInputStream sinifi cin nesnesini tanimla
DataInputStream cin=new DataInputStream([Link]);
[Link]("Bir gercek sayi giriniz : ");
x=[Link](cin);
va
[Link]("Bir gercek sayi giriniz : ");
y=[Link](cin);
[Link]("Statik Matematik kutuphanesi Math de ");
[Link]("en cok kullanilan metodlar :" );
// [Link](3.2)=3.2 [Link](-3.2)=3.2
[Link]("[Link]("+x+") = "+[Link](x));
// [Link](9.2)=10 [Link](-9.8)=-9
// [Link](x) x den buyuk en kucuk tam say ya yuvarlar
ja
[Link]("[Link]("+x+") = "+[Link](x));
// [Link](9.2)=9 [Link](-9.8)=-10
// [Link](x) x den kucuk en buyuk tam say ya yuvarlar
[Link]("[Link]("+x+") = "+[Link](x));
// Trigonometrik fonksiyonlar sin(x) cos(x) tan(x) x:radyan
// [Link] pi sayisi
w.
[Link]("[Link] = "+[Link]);
[Link]("[Link]("+x+") = "+[Link](x));
[Link]("[Link]("+x+") = "+[Link](x));
[Link]("[Link]("+x+") = "+[Link](x));
//Trigonometrik fonksiyonlar asin(y) acos(y) atan(y)
// asin,acos,atan : radyan
[Link]("[Link]("+y+") = "+[Link](y));
ww
[Link]("[Link]("+y+") = "+[Link](y));
[Link]("[Link]("+y+") = "+[Link](y));
// [Link](x) dogal logaritma (e) taban na gore
// Math.E e sayisi = 2.718281828...
[Link]("Math.E = "+Math.E);
[Link]("[Link]("+x+") = "+[Link](x));
// [Link](x,y) x in y inci kuvveti
[Link]("[Link]("+x+","+y+" ) = "+[Link](x,y));
// [Link](x) Math.E=e=2.718281828.. in x inci kuvveti
[Link]("[Link]("+x+" ) = "+[Link](x));
39
40
m
// Maximum - minimum functions
// [Link](x,y) [Link](x,y)
[Link]("[Link]("+x+","+y+" ) = "+[Link](x,y));
[Link]("[Link]("+x+","+y+" ) = "+[Link](x,y));
}
}
Şekil 2.1.2 Math sınıfında(class) çalışan metotlardan bazılarını gösteren
o
[Link] programı
i.c
Bir gercek sayi giriniz : 0.6
Statik Matematik kutuphanesi Math de
en cok kullanilan metodlar :
[Link](9.2) = 9.2
[Link](9.2) = 10.0
[Link](9.2) = 9.0
[Link] = 3.141592653589793
[Link](9.2) = -0.9748436214041636
dil
[Link](9.2) = 0.22288991410024764
[Link](9.2) = -0.22864171155902654
[Link](0.6) = 0.9272952180016123
[Link](0.6) = 0.6435011087932844
[Link](0.6) = 0.5404195002705842
Math.E = 2.718281828459045
[Link](9.2) = 2.2192034840549946
[Link](9.2,0.6 ) = 3.7868028596424734
[Link](9.2 ) = 9897.129058743905
va
[Link](9.2 ) = 3.03315017762062
[Link](9.2,0.6 ) = 9.2
[Link](9.2,0.6 ) = 0.6
Şekil 2.1.3 [Link] programının sonuçları
2.2 Metotlar
ja
Metotlar java programlarının ana parçalarıdır. Metodlar sınıfların(class) içinde yer alan küçük
program parçacıklarıdır. Metodların çogunda değişken parametreler metodlar ve sınıflar
arasında iletişimi sağlarlar. Ayrıca her metodun kendine özgü değişkenleri de vardır. Metod
yapısının ana sebebi programları modüler hale getirmektir. Aynı zamanda aynı program
parçacığının tekrarlanmasını önlemeyi de sağlar. Her metod çağrıldığı proğram parçacığına
w.
belli bir değişkeni aktarabilir. Metodların tanımlarında aktardıkları değişken türü tanımlanır.
Eğer metod hiçbir değişken aktarmıyorsa void sözcüğüyle tanımlanır. Metodların genel
tanımı aşağıdaki gibidir. Parantez içindeki terimler kullanılmıyabilir.
(public) (static) sınıf değişken türü sınıf ismi( sınıf değişken girdi listesi)
{
sınıf içinde geçerli degişken tanımları
ww
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);
[Link](“r = “+r);
dil
va
r = 34 sonucuna ulaşılır.
Şimdi aynı metodun dinamik metod olarak bir appletin içinde kullanılmasını görelim.
import [Link].*;
ja
}
Şekil 2.2.2 [Link] programında kare metodunun kullanılması
41
42
m
import [Link].*; // java pencere kullanma sinifini cagir
o
public double kare(double x)
{
return x*x;
}
i.c
public void paint(Graphics g)
{
[Link](sayi+"nin karesi = "+kare(sayi),25,50);
}
}
dil
va
Şekil 2.2.3 [Link] programında kare metodunun kullanılması
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 [Link] nesnesini girdi olarak
kullanır. Nesne(object) tanımı yaparken aynı metodlarda olduğu
gibi değişken veya nesneleri girdi olarak tanımlamamız
i.c
mümkündür. Yukarıdaki tanımda [Link] nesnesini tanımda
girdi olarak kullanmaktadır.
Diğer bir örnek olarak yine daha önceki örnek problemlerde
kullandığımız Label sınıfından(class) kutubasligi nesnesinin
tanımını ve TextField sınıfından(class) kutugirdisi nesnesini
gösterebiliriz.
dil
Label kutubasligi; //Label sinifi degiskeni (nesnesi) kutubasligi
kutubasligi=new Label("Ogrencinin notunu giriniz (A B C.. : ");
class metodornegi3a
{
// sayinin karesi dinamik metodu
public double kare(double x)
{
ww
return x*x;
}
}
43
44
{
[Link](sayi+"nin karesi = "+[Link](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 [Link](sayi) olarak
i.c
çağırılmıştır. Bu metod nesne1 nesnesi için bilgisayar
belleğinde bir yer ayırır. Kare metodunu çağırırken bu yerin
adresini kullanır. [Link] programında kare(sayı)
dogrudan kullanılmıştı. Çunku kare metodu aynı sınıfın(class)
içinde tanımlanmıştı. [Link] programında ise kare
metodu ayrı bir sınıf(class) ta tanımlandığından yerinin
tanımlanması gerekir. Bu bizim kendi odamızın yatak odasını
dil
tanımlarken sadece yatak odası dememizle baska bir evin yatak
odasını tanımlarken Ahmet beyin evinin yatak odası dememiz
gibidir. Metotlar statik olarak da tanımlanabilirler. Statik
olarak tanımlanan metodlar nesne kullanılmadan direk olarak
sınıf(class) adları kullanılarak çağırılabilirler.
class metotornegi4a
{
// sayinin karesi dinamik metodu
public static double kare(double x)
{
return x*x;
ja
}
}
44
45
m
[Link] ve [Link] programlarında iki
sınıf(class) aynı dosyada yer almiştı. Her sinifi ayri bir
dosyada da tanımlamak mumkündür. Bu yapıldığında diğer dosya
import(ithal) terimiyle diğer programa aktarılır. Şekil 2.2.6
o
ve 2.2.7 de Şekil 2.2.5 de verilen programın iki ayrı dosyada
yazılımını görüyoruz.
i.c
class metotornegi6
{
// sayinin karesi dinamik metodu
public double kare(double x)
{
return x*x;
}
}
dil
Şekil 2.2.6 [Link] programında static kare metodunun tanımlanması
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 [Link].*;
import Text;
class faktoriyel
{
45
46
m
long faktoriyel=1;
DataInputStream cin=new DataInputStream([Link]);
int faktoriyelsayi;
[Link]("Bir tamsayi giriniz:");
faktoriyelsayi=[Link](cin);
for(int sayi=1;sayi<=faktoriyelsayi;sayi++)
{ faktoriyel*=sayi;}
o
[Link](faktoriyelsayi+" faktoriyel: "+faktoriyel);
}
}
Şekil 2.3.1 Metod kullanılmadan faktoriyel hesaplayan [Link] programı
i.c
import [Link].*;
import Text;
class faktoriyel1
{
dil
public static long faktoriyel(int x)
{
long faktoriyel=1;
for(int sayi=1;sayi<=x;sayi++)
{ faktoriyel*=sayi;}
return faktoriyel;
}
}
Şekil 2.3.2 for döngülü faktoriyel metodunu kullarak faktoriyel hesaplayan
[Link] programı
İkinci olarak faktoriyeli kendi kendini çağıran proğram yardımcılığı ile hesaplayalım.
w.
import [Link].*;
import Text;
class faktoriyel2
{
public static long faktoriyel(int x)
{
ww
if( x <= 1 )
return 1;
else
return x * faktoriyel( x – 1);
}
46
47
int faktoriyelsayi;
[Link]("Bir tamsayi giriniz:");
m
faktoriyelsayi=[Link](cin);
[Link](faktoriyelsayi+" faktoriyel:" +
faktoriyel(faktoriyelsayi));
}
}
o
Bir tamsayi giriniz: 4
4 faktoriyel:24
Şekil 2.3.3 kendi kendini çağıran (recursive) faktoriyel metodunu kullarak faktoriyel
i.c
hesaplayan [Link] programı
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 [Link];
import [Link];
47
48
m
{
[Link](“ 7 nin karesi = “+kare(7),25,25);
[Link]( 7.5 un karesi = “+kare(7.5),25,40);
}
o
// int tipi kare metodu
int kare(int x)
{
return x*x;
i.c
}
dil
Şekil 2.4.1 [Link] programı
va
Şekil 2.4.2 [Link] programıyla [Link] ın gösterilmesi
Bu programda parantez içerisinde 7 (tamsayı) verildiğinde java tamsayi metodu kare(int x),
ja
Metodların içinde kullanılan değişkenler sadece metodlara aittir. O metodun dışında tanımları
w.
import [Link];
import [Link];
ww
48
49
y=6;
[Link]("metod1 in ici : x = "+x+" y = "+y,25,40);
m
}
o
metod1(g);
[Link]("metod1 in disi : x = "+x+" y = "+y,25,55);
}
i.c
}
Şekil 2.5.1 [Link] programında metod değişkenlerinin sınıfa aktarılması
import [Link];
import [Link]; dil
public class metotvesinifdeg1 extends Applet
{
va
//buradaki değişkenler tüm sınıfa aittir
double x ;
int y ;
x=5.5;
y=6;
[Link]("metod1 in ici : x = "+x+" y = "+y,25,40);
}
{
x = 2.5;
y = 3;
[Link]("metod1 in disi : x = "+x+" y = "+y,25,25);
metod1(g);
[Link]("metod1 in disi : x = "+x+" y = "+y,25,55);
}
ww
49
50
m
Metod1 in disi : x=2.5 y=3
Şekil 2.5.4 [Link] 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 [Link].*;
class Point1
{ dil
// nesne olarak tanimlanmasi ve adres paylasimi
//java girdi cikti sinifini cagir
import [Link]; //Point sinifini cagir
nokta1.x=200;
nokta1.y=200;
[Link]("nokta1 in degeri degistirildi");
[Link]("nokta 1 : "+nokta1.x+" , "+nokta1.y);
[Link]("nokta 2 : "+nokta2.x+" , "+nokta2.y);
}
}
50
51
m
[Link] 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)([Link]()*6);
}
}
b) H4A1b sinifinda(class) java konsol ana metodu (public void main) yazarak
zar degerini yazdiriniz.
import [Link].*; // giris cikis
import H4A1a;
51
52
class H4A1b
m
{
public static void main (String args[]) throws IOException
{
[Link]("zar degeri : "+[Link]());
}
}
o
c) H4A1c sinifinda java konsol ana metodunda (public void main) metodunda
yüz(100) kere zar attırarak ortalamasını hesaplayınız.
Not : for veya while döngüsü kullanabilirsiniz.
i.c
import [Link].*; // giris cikis
import H4A1a;
class H4A1c
{
//yuz zarin ortalamasi
public static void main (String args[]) throws IOException
{
dil
double ortalama;
double toplam=0;
for(int sayi=0;sayi<100;sayi++)
{
toplam+=[Link]();
}
ortalama=toplam/100.0;
[Link]("100 zarin ortalamasi = "+ortalama);
va
}
}
zar2=0;
zar3=0;
zar4=0;
zar5=0;
zar6=0;
while(zaratimsayisi<1000)
{
zardegeri=[Link]();
switch(zardegeri)
{
52
53
case 1:
zar1++;
m
break;
case 2:
zar2++;
break;
case 3:
zar3++;
break;
o
case 4:
zar4++;
break;
case 5:
i.c
zar5++;
break;
case 6:
zar6++;
break;
}
zaratimsayisi++;
}
dil
[Link]("toplam zar 1 sayisi : "+zar1);
[Link]("toplam zar 2 sayisi : "+zar2);
[Link]("toplam zar 3 sayisi : "+zar3);
[Link]("toplam zar 4 sayisi : "+zar4);
[Link]("toplam zar 5 sayisi : "+zar5);
[Link]("toplam zar 6 sayisi : "+zar6);
}
}
va
ALIŞTIRMA 2
import [Link].*;
import [Link];
import [Link].*;
w.
53
54
m
add(ikincizar); // ikinci zar nesnesini pencereye ekle
salla=new Button("Zari salla ve at");
add(salla);
[Link](this);
}
o
{
zar1=zar();
zar2=zar();
[Link]([Link](zar1));
i.c
[Link]([Link](zar2));
toplam+=(zar1+zar2);
toplamzaratisi++;
repaint();
}
dil
[Link]("toplam = "+toplam+" Atilan zar sayisi =
"+toplamzaratisi,25,50);
}
}
import [Link].*;
import [Link];
import [Link].*;
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);
[Link](this);
54
55
m
public void actionPerformed(ActionEvent e)
{
zar1=[Link]();
zar2=[Link]();
[Link]([Link](zar1));
[Link]([Link](zar2));
toplam+=(zar1+zar2);
o
toplamzaratisi++;
repaint();
}
i.c
public void paint( Graphics g)
{
[Link]("toplam = "+toplam+" Atilan zar sayisi =
"+toplamzaratisi,25,50);
}
}
import [Link].*;
w.
import Text;
class faktoriyel
{
public static void main(String args[]) throws IOException
{
int faktoriyel=1;
DataInputStream cin=new DataInputStream([Link]);
ww
int faktoriyelsayi;
[Link]("Bir tamsayi giriniz:");
faktoriyelsayi=[Link](cin);
for(int sayi=1;sayi<=faktoriyelsayi;sayi++)
{ faktoriyel*=sayi;}
[Link](faktoriyelsayi+" faktoriyel: "+faktoriyel);
}
}
55
56
m
import [Link];
import [Link];
o
int y=25;
for(long i=0;i<=10;i++)
{
[Link](i+"! = "+faktoriyel(i),25,y);
i.c
y+=15;
}
}
dil
}
for(long i=0;i<=15;i++)
{
[Link]("Fibonachi("+i+") = "+fibonachi(i),25,y);
y+=15;
}
}
w.
56
57
o m
i.c
FIBONA~2 JAV
import [Link].*;
1.063
import [Link];
import [Link].*;
dil
20/05/98 0:47 [Link]
[Link](this);
sonucetiketi=new Label("Fibonachi degeri : ");
sonuc=new TextField(10);
[Link](false);
add(rakametiketi);
add(rakam);
w.
add(sonucetiketi);
add(sonuc);
}
sayi=[Link]([Link]());
showStatus("Fibonachi hesaplan yor....");
fibonachisayisi=fibonachi(sayi);
showStatus("Fibonachi hesaplandi....");
[Link]([Link](fibonachisayisi));
}
57
58
m
}
o
i.c
FAKTOR~3 JAV 522 20/05/98 1:12 [Link]
import [Link].*;
import Text;
class faktoriyel2
{
{
if( x <= 1 )
return 1;
else
dil
public static long faktoriyel(int x)
[Link](faktoriyelsayi+" faktoriyel:" +
faktoriyel(faktoriyelsayi));
}
}
w.
Bu haftaki alıştırmalar :
ALIŞTIRMA 1
Bir kürenin hacmini hesaplayacak bir applet programı yazınız. Kürenin hacmi
küreHacmi isimli metod tarafından hesaplansın. Applet bir girdi alanına
kürenin yariçapını sorsun ve yarıçap girildiğinde yeni küre hacmi ekranda
ww
gösterilsin.
Not : Kürenin hacmi : (4.0/3.0)*[Link]*[Link](r,3);
58
59
//=====================================================
// sinif degiskenleri
m
// bu degiskenler tum s n fa aittir
Label kutubasligi; //Label sinifi degiskeni (nesnesi) kutubasligi
TextField kutugirdisi;// Textfield sinifi degiskeni (nesnesi)
kutugirdisi
double yaricap; // Gercek degisken yar cap
double hacim; // Gercek degisken hacim
//=====================================================
o
// pencereyi baslatma metodu
// pencere ilk basladiginda
// degiskenler buradaki degerleri alirlar
public void init()
i.c
{
kutubasligi=new Label("Kubun yaricapini (m)giriniz : ");
add(kutubasligi);
kutugirdisi=new TextField(10);
add(kutugirdisi);
yaricap=0;
hacim=0;
[Link](this);
dil
}
//=====================================================
// girdi alanindaki olan olaylari dinleme metodu
// Her yeni rakam girildiginde bu metod cagirilir
public void actionPerformed(ActionEvent e)
{
Double sayi1=new Double([Link]() );
yaricap=[Link]();
hacim=kubunhacmi(yaricap);
va
[Link](" ");//kutudaki rakami sil
repaint();//pencereyi yeniden paint metoduna gore ciz
}
//=====================================================
// paint (boya=pencereye ciz metodu)
public void paint(Graphics g)
{
[Link](yaricap+" m capindaki kubun hacmi : "+hacim+" m^3",25,50);
ja
}
//=====================================================
//kubun hacmini hesaplama metodu
public double kubunhacmi(double r)
{
return (4.0/3.0)*[Link]*r*r*r;
w.
}
}
ww
59
60
ALIŞTIRMA 2
m
Bir dik üçgenin hipotenüsünü hesaplayan bir applet programı yazınız.
Program dik üçgenin iki dik kenarını applet de girsin ve hipotenus
metoduyla hesaplasın ve sonucu applete yazdırsın.
Not : Dik üçgenin hipotenüsü :
Hipotenüs = [Link](dikkkenar1*dikkenar1+dikkenar2*dikkenar2);
o
import [Link].*; // java pencere kullanma sinifini cagir
import [Link].*; // java pencereyi dinleme sinifini cagir
public class H5A2 extends Applet implements ActionListener
{
i.c
// bu s n f dik ucgenin hipotenusunu hesaplar
//=====================================================
// sinif degiskenleri
// bu degiskenler tum s n fa aittir
Label kutubasligi1; //Label sinifi degiskeni (nesnesi)
kutubasligi1
TextField kutugirdisi1; // Textfield sinifi degiskeni (nesnesi)
kutugirdisi1
dil
Label kutubasligi2; //Label sinifi degiskeni (nesnesi)
kutubasligi2
TextField kutugirdisi2; // Textfield sinifi degiskeni (nesnesi)
kutugirdisi2
double dikkenar1; // Gercek degisken dikkenar1
double dikkenar2; // Gercek degisken dikkenar1
//=====================================================
// pencereyi baslatma metodu
// pencere ilk basladiginda
va
// degiskenler buradaki degerleri alirlar
public void init()
{
kutubasligi1=new Label("Birinci dik kenari giriniz : ");
add(kutubasligi1);
kutugirdisi1=new TextField(10);
add(kutugirdisi1);
kutubasligi2=new Label("Ikinci dik kenari giriniz : ");
ja
add(kutubasligi2);
kutugirdisi2=new TextField(10);
add(kutugirdisi2);
dikkenar1=0;
dikkenar2=0;
[Link](this);
w.
}
//=====================================================
// girdi alanindaki olan olaylari dinleme metodu
// Her yeni rakam girildiginde bu metod cagirilir
public void actionPerformed(ActionEvent e)
{
Double sayi1=new Double([Link]() );
dikkenar1=[Link]();
ww
60
61
m
//=====================================================
//ucgenin hipotenusunu hesaplama metodu
public double hipotenus(double dk1,double dk2)
{
return [Link](dk1*dk1+dk2*dk2);
}
}
o
i.c
dil
ja va
w.
ww
61
62
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 :
[Link]=1.0;
o
Şimdi Kutu değişkenini kullanacak ufak bir kututestı sınıfı oluşturalım ve Kutu sınıfını bu
sınıfta kullanalım.
import [Link].*;
i.c
class Kutu
{
double en;
double boy;
double yukseklik;
}
dil
class kututesti
{
public static void main(String args[])
{
Kutu benimkutum=new Kutu();
double hacim;
[Link]=10.0;
[Link]=20.0;
va
[Link]=30.0;
hacim=[Link]*[Link]*[Link];
[Link]("Benim kutumun hacmi : "+hacim);
}
}
sınıfında tanımlanmıştır. Fakat programı javac terimiyle bilgisayar diline çevirdiğimizde iki
tane sınıf(class) dosyasının oluştuğunu görürüz. Birisi [Link] diğeride [Link].
Ana program kututesti olduğu için bu programın işletimi
java kututesti
deyimini kullanarak yapılır. Program işletildiğinde
w.
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 [Link] programı tanımlanmıştır.
import [Link].*;
class Kutu
{
double en;
double boy;
double yukseklik;
}
class kututesti1
{
dil
va
public static void main(String args[])
{
double hacim;
Kutu benimkutum1=new Kutu();
[Link]=10.0;
[Link]=20.0;
[Link]=30.0;
hacim=[Link]*[Link]*[Link];
ja
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 [Link].*;
class Kutu
{
o
double en;
double boy;
double yukseklik;
i.c
//kurucu metod kutu
Kutu(double e,double b,double y)
{
en=e;
boy=b;
yukseklik=y;
}
dil
}
class kututesti2
{
public static void main(String args[])
{
double hacim;
Kutu benimkutum1=new Kutu(10.0,20.0,30.0);
hacim=[Link]*[Link]*[Link];
va
[Link]("Benim kutumun hacmi : "+hacim);
Kutu benimkutum2=new Kutu(5.0,10.0,15.0);
hacim=[Link]*[Link]*[Link];
[Link]("Benim kutumun hacmi : "+hacim);
}
}
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
[Link] programında hacim hesaplarını yapan hacim metodu Kutu sınıfının içinde
tanımlanmıştır.
o
import [Link].*;
class Kutu
i.c
{
double en;
double boy;
double yukseklik;
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 [Link]ğişken_ismi komutuyla çağırılabilir. Eçen bölümde sınıf ve metota ait
değişkenleri izlerken [Link] ve [Link] isimlerinde iki örnek
66
67
m
import [Link];
import [Link];
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
[Link]("metod1 in dis degiskenleri this ile ulasim : x = "+this.x+"
y = "+this.y,25,25);
[Link]("metod1 in ic degiskenleri : x = "+x+" y = "+y,25,40);
dil
}
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
[Link]=b;
[Link]=y;
}
şeklinde yazılabilirdi. Fakat sınıfta aynı isimde başka değişken olmadığından bilgisayar zaten
bu değişkenlerin sınıfa ait olduklarını bilmektedir ve ayrıca tekrarlamaya gerek yoktur.
ww
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
[Link] 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
[Link](2.0);
[Link](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 [Link] programı ve nokta sınıfının tanımı.
va
import nokta;
public class daire extends nokta
{
protected double yaricap;
public daire()
ja
{
//daire kalitim yaptigi nokta sinifinin kurucu metodunu
// super deyimi ile cagirabilir.
super(0,0);
yaricapgir(0);
}
w.
}
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 [Link]*yaricap*yaricap;
}
o
return "Merkez = "+"["+merkez.x+","+merkez.y+"]"+
"; Yaricap="+yaricap;
}
}
i.c
Şekil 3.7.1 [Link] programı ve daire sınıfının tanımı. Nokta sınıfı
daire1 sınıfında merkez adlı nesne olarak tanımlanmıstır.
3.8 Kalıtım yoluyla alt sınıfa bağlanmış üst sınıf referansı üzerinden alt
sınıfı çağırma
import [Link];
import [Link];
dil
Yukarıda nokta ve daire sınıflarını tanımlamıştık. Baska bir sınıftan kalıtım yoluyla türeyen
sınıfın(dairenin noktadan kalıtım yoluyla türemesi gibi), üst sınıfın adresi(tanımı) üzerinden
va
public class noktatesti extends Applet
{
private nokta noktaref,n;
private daire daireref,d;
public void init()
{
n=new nokta(30,50);
d=new daire(2.7,120,89);
}
ja
noktaref=d;
[Link]("Daire(noktaref uzerinden) :"+[Link](),25,70);
//noktaref nesnesini daireref degiskenine aktaral m
daireref=(daire)noktaref;
[Link]("Daire(daireref uzerinden) :"+[Link](),25,85);
[Link]("Dairenin alani(daireref uzerinden)
:"+[Link](),25,100);
ww
}
}
Şekil 3.8.1 [Link] sınıfında üst sınıf üzerinden adres referansı
kullanımı
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.
[Link]();
}
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)
{
[Link](x1,y1);
[Link](x2,y2);
}
o
public String toString()
{
return "("+[Link]()+","+[Link]()+")";
}
i.c
public double boy()
{
return [Link](([Link]()-[Link]())*([Link]()-[Link]()) +
([Link]()-[Link]())*([Link]()-[Link]()) );
}
}
DOGRUT~2 JAV
import [Link].*;
import nokta;
307
([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)
{
[Link](x1,y1);
[Link](x2,y2);
}
o
{
return "dikdortgen : ("+[Link]()+","+[Link]()+")";
}
i.c
public double alan()
{
return ([Link]()-[Link]())*([Link]()-[Link]());
}
dil
}
}
[Link]([Link](),20,20);
[Link]("Alan : "+ [Link](),20,35);
}
}
public nokta()
{
noktagir(0,0);
}
76
77
m
noktagir(a,b);
}
public nokta(nokta n)
{
noktagir([Link](),[Link]());
}
o
public void noktagir(double a, double b)
{
x = a;
i.c
y = b;
}
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
[Link]("Iki tam sayinin carpimi : "+[Link]());
[Link]("Iki tam sayinin bolumu : "+[Link]());
}
}
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 [Link].*;
m
// sınıf kompleks
// bu sınıf kompleks sayıların matematik
// işlemlerini tanımlar
//
class kompleks {
// sınıf degiskenleri
double ger;
o
double imaj;
// kurucu metodlar
public kompleks()
i.c
{
ger=0;
imaj=0;
}
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 [Link](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/[Link](1.0);
}
{
// iki kompleks say n n toplam n return deyimiyle kompleks olarak
// aktar r
double r1=([Link]() + [Link]());
double i1=([Link]() + [Link]());
kompleks sonuc;
sonuc=new kompleks(r1,i1);
return sonuc;
}
81
82
m
{ // iki kompleks sayinin sonuclarini aktar
kompleks sonuc;
sonuc=new kompleks(([Link]() - [Link]()),
([Link]() - [Link]()));
return sonuc;
}
o
public static kompleks carp(kompleks sol, kompleks sag)
{ // iki kompleks sayinin carpimini aktar
kompleks sonuc;
sonuc=new kompleks
i.c
(([Link]()*[Link]() - [Link]()*[Link]()),
([Link]()*[Link]() + [Link]()*[Link]()));
return sonuc;
}
dil
double a=[Link]()*[Link]()+[Link]()*[Link]();
kompleks sonuc;
sonuc=new kompleks
(([Link]()*[Link]() + [Link]()*[Link]())/a,
(-[Link]()*[Link]() + [Link]()*[Link]())/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([Link]() >= 0)
b=b+"("+[Link]()+" + "+[Link]()+"i )";
else
b=b+"("+[Link]()+" - "+(-[Link]())+"i )";
}
else
{
if([Link]() >= 0)
b=b+"("+[Link]()+" + i )";
va
else
b=b+"("+[Link]()+" - i )";
}
return b;
}
b=b+"("+gercek()+" + i )";
else if(imajineri() < 0)
b=b+"("+gercek()+" - i )";
else
b=b+gercek()+" ";
}
return b;
}
};
83
84
m
import [Link]; // java applet sinifini cagir
import [Link].*; // java pencere kullanma sinifini cagir
import [Link].*; // 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);
[Link](this);
add(kutugirdisi1);
kutugirdisi2=new TextField(5);
[Link](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([Link]() );
Double sayi2=new Double([Link]() );
Double sayi3=new Double([Link]() );
84
85
m
[Link]([Link](),[Link]());
repaint();//pencereyi yeniden paint metoduna gore ciz
}
//=====================================================
// paint (boya=pencereye ciz metodu)
public void paint(Graphics g)
{
o
[Link]("ilk sayi : "+[Link](),25,80);
[Link]("ikinci sayi : "+[Link](),25,95);
i.c
"+[Link]([Link](k1,k2)),25,110);
[Link]("iki sayinin farki :
"+[Link]([Link](k1,k2)),25,125);
[Link]("iki sayinin carpimi :
"+[Link]([Link](k1,k2)),25,140 );
[Link]("iki sayinin bolumu :
"+[Link]([Link](k1,k2)),25,155 );
}
dil
} va
ja
//===========================================
// bayagikesir sinifi tanimi
// Dr. Turhan Coban
//===========================================
import [Link].*;
// sinif bayagikesir
// bu sinif bayagikesir sayilarin matematik
ww
// islemlerini tanimlar
//
class bayagikesir {
// sinif degiskenleri
int pay;
int payda;
// kurucu metodlar
85
86
public bayagikesir()
{
m
pay=0;
payda=1;
}
o
payda=npayda;
}
i.c
{
pay=numer;
payda=1;
}
public bayagikesir(bayagikesir c )
{
pay=[Link]();
dil
payda=[Link]();
}
// 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
{
[Link]("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();
[Link]((int)d*10000,10000);
[Link]();
return b;
}
o
public void topla(bayagikesir sag)
{
i.c
//ikinci bir bayagikesirle topla
pay = pay*[Link]() + [Link]()*payda;
payda = payda*[Link]();
}
dil
pay = pay + sag*payda;
sadelestir();
}
payda = payda*[Link]();
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= [Link]() * [Link]() + [Link]() * [Link]();
int i1= [Link]()* [Link]();
bayagikesir sonuc;
sonuc=new bayagikesir(r1,i1);
[Link]();
return sonuc;
}
dil
public static bayagikesir topla(bayagikesir sol, int sag)
{
// bir bayagikesir ve bir Pay say n n toplam n return deyimiyle
bayagikesir olarak
// aktar r
int r1=[Link]() + sag*[Link]();
int i1=[Link]();
bayagikesir sonuc;
sonuc=new bayagikesir(r1,i1);
va
[Link]();
return sonuc;
}
// aktar r
int r1=[Link]() + sol*[Link]();
int i1=[Link]();
bayagikesir sonuc;
sonuc=new bayagikesir(r1,i1);
[Link]();
w.
return sonuc;
}
//===================================
public static bayagikesir cikar(bayagikesir sol, bayagikesir sag)
{
// iki bayagikesir say n n toplam n return deyimiyle bayagikesir olarak
// aktar r
ww
89
90
{
// bir bayagikesir ve bir Pay say n n toplam n return deyimiyle
m
bayagikesir olarak
// aktar r
int r1=[Link]() - sag*[Link]();
int i1=[Link]();
bayagikesir sonuc;
sonuc=new bayagikesir(r1,i1);
[Link]();
o
return sonuc;
}
i.c
{
// bir bayagikesir ve bir Pay say n n toplam n return deyimiyle
bayagikesir olarak
// aktar r
int r1=[Link]() - sol*[Link]();
int i1=[Link]();
bayagikesir sonuc;
sonuc=new bayagikesir(r1,i1);
dil
[Link]();
return sonuc;
}
//===================================
sonuc=new bayagikesir([Link]()*sag,[Link]());
[Link]();
return sonuc;
}
90
91
m
sonuc=new bayagikesir([Link](),([Link]()*sag));
[Link]();
return sonuc;
}
o
// less then comparison of two bayagikesir numbers
return ([Link]() < [Link]());
}
i.c
public boolean kucuktur_esittir(bayagikesir sol,bayagikesir sag)
{
// less then and esittir comparison of two bayagikesir numbers
return ([Link]() <= [Link]());
}
dil
// buyuktur then comparison of two bayagikesir numbers
return [Link]() > [Link]();
}
{
// not esittir comparison of two bayagikesir numbers
return [Link]() != [Link]();
}
{
String b="";
if([Link]([Link]())!=1)
{
b=b+"( "+[Link]()+" / "+[Link]()+" )";
}
else
{
ww
b=b+[Link]()+" ";
}
return b;
}
91
92
if([Link](Payda())!=1)
{
m
b=b+"( "+pay+" / "+Payda()+" )";
}
else
{
b=b+Pay()+" ";
}
return b;
o
}
};
//bayagikesir sinifinin taniminin sonu
i.c
Bayagıkesir sınıfı test programı bkTesti
{
//
//=====================================================
kutugirdisi1=new TextField(5);
[Link](this);
add(kutugirdisi1);
kutugirdisi2=new TextField(5);
[Link](this);
add(kutugirdisi2);
kutubasligi2=new Label("Ikinci bayagikesir sayiyi giriniz : ");
add(kutubasligi2);
kutugirdisi3=new TextField(5);
[Link](this);
92
93
add(kutugirdisi3);
kutugirdisi4=new TextField(5);
m
[Link](this);
add(kutugirdisi4);
}
//=====================================================
// girdi alanindaki olan olaylari dinleme metodu
// Her yeni rakam girildiginde bu metod cagirilir
public void actionPerformed(ActionEvent e)
o
{
Integer sayi1=new Integer([Link]() );
Integer sayi2=new Integer([Link]() );
Integer sayi3=new Integer([Link]() );
i.c
Integer sayi4=new Integer([Link]() );
[Link]([Link](),[Link]());
[Link]([Link](),[Link]());
repaint();//pencereyi yeniden paint metoduna gore ciz
}
//=====================================================
// paint (boya=pencereye ciz metodu)
public void paint(Graphics g)
dil
{
[Link]("ilk sayi : "+[Link](),25,80);
[Link]("ikinci sayi : "+[Link](),25,95);
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;
[Link](“Nisan ayı “+ayin_gunleri[3]+”gun ceker”);
m
}
}
Şekil 4.1.1 [Link] programı
Bu programı daha kısa olarak yazmak için Şekil 4.1.2 de görülen şekilde bütün değişkenlerin
o
değerlerini aynı anda tanımlıyabiliriz.
Class boyut1
{
i.c
Public static void main(String args[] )
{
int ayin_gunleri[]={31,28,31,30,31,30,31,31,30,31,30,31};
[Link](“Nisan ayı “+ayin_gunleri[3]+”gun ceker”);
}
}
dil
Şekil 4.1.2 [Link] programı
Şekil 4.1.3 de boyut kavramının for döngüsüyle birlikte kullanışını görüyorsunuz. Boyutlu
değişkenin toplam boyutuna da sayı.length değişkeniyle ulaşabiliriz.
}
[Link]("Ortalama = "+toplam/[Link]);
}
}
w.
Şimdi de bir applet örneğinde tek boyutlu değişkenleri kullanalım. Daha önce [Link]
programını incelemiştik. Şimdi bu programa her bir zar yüzeyinin atılış frekanslarını
ekleyelim. Toplam altı yüz olduğundan birden altıya kadar her sayının kaç kere geldiğini
saydırmamız gerekir. Bunun için bir boyutlu zarfrekansi değişkenini tanımlayacağız.
Program listesi ve sonuç appleti Şekil 4.1.4 ve şekil 4.1.5 de görülmektedir.
ww
import [Link].*;
import [Link];
import [Link].*;
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);
[Link](this);
dil
}
}
}
ww
96
97
o m
i.c
Şekil 4.1.4 [Link] 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ı[Link] iki boyutlu değişkenleri direk olarak açamaz. Tek
boyutlu değişkenlerin yine tek boyutlu degişkenini açar. Sonuç olarak iki boyut sağlanmış
olur. Örnek verecek olursak
ww
Int b[][]=new int[3][4]. Genel olarak ilk parantes satır sayısı, ikinci parantez sütun sayısı
olarak kabul edilir. Buna göre b değişkenini şöyle düşünebiliriz :
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 [Link];
import [Link];
dil
{
// void tipi paint metodu
public void paint( Graphics g)
{
int a1[][]={{1,2,3},{4,5,6}};
int a2[][]={{1,2},{4}};
[Link](" a1 : ",25,25);
ikiboyutyazdir(a1,g,40);
[Link](" a2 : ",25,70);
va
ikiboyutyazdir(a2,g,85);
}
for(int j=0;j<a[i].length;j++)
{
[Link]([Link](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 [Link], sütunların boyutuna ise a[satır].length terimiyle ulaştık. Bu tanım
bize toplam satır ve sütun boyutunu direk tanımlar, ve kullanımda yeterince esneklik sağlar.
98
99
m
Boyutlu değişkenler aynen boyutsuz değişkenler gibi metotlara aktarılırlar. Örneğin eğer
int sıcaklık[] = new int[24];
o
i.c
Şekil 4.3.1 İki boyutlu değişkenler örnegi [Link] doyasının appletviewer ile görünümü
dil
deyimiyle tanımlanan sicaklık;
sicakligidegistir(sıcaklik);
terimiyle sicakligidegistir metotuna aktarılabilir. Metot tanımlanırken, sıcaklığın boyutlu
değişken olduğu tanımlanmalıdır:
double void sicakligideğiştir(int sicaklik[])
{
..........................
va
}
gibi.
gibi.
HAFTA 8
//kurucu metodlar
public nokta3()
{
nokta3gir(0,0,0);
}
99
100
nokta3gir(a,b,c);
}
m
public nokta3(nokta3 n)
{
nokta3gir([Link](),[Link](),[Link]());
}
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([Link](),[Link](),[Link]());
}
{
n1.nokta3gir(x1,y1,z1);
}
n1.nokta3gir(in1.x,in1.y,in1.z);
}
101
102
m
{
return n2;
}
o
return ([Link]()-[Link]());
}
i.c
{
//dogrunun y koordinat uzunlugu
return ([Link]()-[Link]());
}
dil
return ([Link]()-[Link]());
}
{
//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<[Link];i++)
{
[Link](sayi[i]);
}
[Link]((double)[Link]);
[Link]("Ortalama = "+[Link]());
}
va
}
class H8A1a
{
public static void main(String args[]) throws IOException
{
kompleks sayi[]=new kompleks[5];
double n1,n2;
w.
n2=[Link](cin);
sayi[i]=new kompleks(n1,n2);
[Link](sayi[i]);
}
[Link]((double)[Link]);
[Link]("Ortalama = "+[Link]());
}
}
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<[Link];i++)
{
va
[Link](n[i].toString()+"boy : "+n[i].R());
[Link]("aci xy = "+n[i].aci_n1_xy());
[Link]("aci xz = "+n[i].aci_n1_xz());
[Link]("aci yz = "+n[i].aci_n1_yz());
}
}
}
ja
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 ([Link] 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* [Link]()+
2*[Link]*yaricap*yukseklik;
}
public double hacim(){return [Link]()*yukseklik;}
public String toString()
{return [Link]()+";yukseklik="+yukseklik;}
public String isimOku(){return "Silindir";}
}
va
Şekil 5.1.4 sınıf daireden kalıtımla türetilen silindir sınıfı
import [Link];
import [Link];
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<[Link];i++)
m
{
[Link](a[i].isimOku()+": "+a[i].toString(),25,y);
y+=15;
[Link]("Alan : "+a[i].alan()+" Hacim : "+a[i].hacim(),25,y);
y+=15;
}
}
o
}
Şekil 5.1.5 Abstract sınıf ve indirek referanslamayı test eden abstractTesti sınıfı
i.c
dil
va
Şekil 5.1.5 Abstract sınıf ve indirek referanslamayı test eden abstractTesti sınıfının
sonuclarının applet de görülmesi
Örnekten de görüldügü gibi nokta, daire ve silindir abstract sekil sınıfının alt sınıfları olarak
oluşturulmuş, ve aynı zamanda bu sınıflara indirek referans olarak kullanılmıştır. Diğer bir
deyimle nokta daire ve silindirin adresleri sekil sınıfı nesneye aktarılmış ve bu nesne
üzerinden üç sınıfta indirek olarak kullanılmıştır. Bu indirek kullanımın bize temel faydası,
ja
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 [Link] zaman interface kullanırız. Interface de
abstract sınıf gibi kendi içinde bir işlem yapmaz. Sadece öbür sınıfların bağlanmasını teşkil
eden bir adres noktası olarak iş görür. İnterface’i bir başka sınıfa bağlamak gerektiğinde
extends yerine implements sözcüğü kullanılır.
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ı ([Link]
dosyasında yer alıyor)
Görüldüğü gibi burada nokta sınıfının bir öncekinden farkı implements kelimesinin
kullanılmış olaması ve bos alan ve hacim metodlarının bu dosyada yazılmasının
gerekmesinden ibarettir. Daire ve silindir sınıflarında bir fark mevcut degildir. İki seklin
işlemsel sonuçları arasında da bir fark mevcut değildir.
109
110
m
JAVA PROGRAMLAMA DİLİ
HAFTA 9
ALIŞTIRMA 1
Derste gördüğümüz abstract class sekil,nokta,daire, silindir sınıflarını ve ilave olarak koni
o
sınıfını yaratınız. Bu sınıfların [Link] test sınıfında alanlarını ve hacimlerini sekil
referansını kullanarak yazdırınız.
ALIŞTIRMA 2
i.c
Derste gördüğümüz interface sekil,nokta,daire, silindir sınıflarını ve ilave olarak küre sınıfını
yaratınız. Bu sınıfların [Link] test sınıfında alanlarını ve hacimlerini sekil referansını
kullanarak yazdırınız.
dil
ja va
w.
ww
110
111
m
BÖLÜM 6 : GRAFİKLER, FONTLAR VE RENKLER
Daha önce applet çizerken [Link] kütüphanesindeki grafik (Graphics) sınıfını kullanmıştık.
Ve grafik (Graphics) sinifinina ait drawString metotunu kullanarak applete yazı yazdırmıştık.
Şimdi bu sınıfın diğer özelliklerini ve metodlarını öğreneceğiz. Graphics sınıfı, yazı yazma,
o
çizgi çizme, dikdörtgen, oval çizme gibi bir dizi metodu barındırır. Bunun dışında awt
kütüphanesinin önemli bir sınıfı da Color sınıfıdır. Color sınıfı rekleri tanımlar ve değişik
renklerin kullanımına imkan verir. Font sınıfı grafikte kullanılan yazıların fontlarının (yazı
tipinin ve boyutunun) belirlenmesi amacıyla kullanılır. FontMetrics sınıfı fontların
i.c
boyutlarının belirlenmesiyle ilgili metodları içerir. Polygon sınıfı polygon çizimiyle ilgili
metodları barındırır.
Java appletlerinde çizim yaparken ilk hatırlamamız gereken şey, coordinat merkezinin ekranın
sol üst köşesi olduğudur. X ekseni aşağı doğru, Y ekseni sola doğru gider.
X ekseni
Y ekseni dil
Y ekseninin alta doğru gitmesi konsol programlarında satırların alta dogru ilerlemesi gibi
tarihi bir nedene dayanmaktadır. Bütün bilgisayar grafik programlamasında standartdır.
va
6.1 Graphics sınıfı
Graphics sınıfı gafik çizimi için gerekli olan bir çok metodu içinde barındırır. Grafik sınıfı
Applet sınıfının alt sınıflarındandır. Bu yüzden applet sınıfının alt sınıfı olan (extends applet )
Her sınıfta direk olarak tanımlıdır. Grafik çizme amacıyla genellikle Graphics sınıfından bir
ja
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 [Link];
import [Link].*;
dil
public class ciz extends Applet
{
private String s ="Bunu drawString Metoduyla yazdir";
private char c[]={'c','h','a','r','s',' ','8'};
private byte b[]={'b','y','t','e',55,56,57};
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 [Link].*;
import [Link];
}
}
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 [Link] programını görüyoruz.
o
import [Link].*;
import [Link].*;
i.c
public void paint(Graphics g)
{
String stilListesi[];
stilListesi=getToolkit().getFontList();
int y=15;
for(int i=0;i<[Link];i++)
{
[Link](stilListesi[i],15,y);
}
}
y+=15;
}
dil
Şekil 6.3.1 [Link] programı, java kütüphanesinde mevcut olan yazı sitillerini gösterir
ja va
Şekil 6.3.2 [Link] programı, java kütüphanesinde mevcut olan yazı sitillerini gösterir
w.
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
[Link](new Font(“Serif”,[Link],12);
i.c
import [Link].*;
import [Link];
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 [Link];
import [Link].*;
o
public class cizgiciz extends Applet
{
public void paint(Graphics g)
i.c
{
[Link](new Color(0,255,255));
[Link](new Font("SansSerif",[Link],24));
[Link](10,10,230,95);
}
}
dil
va
Şekil 6.4.1 Çizgi çizim örneği [Link] ve çizginin appletde görünümü
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 [Link];
import [Link].*;
o
{
[Link](new Color(255,0,0));
[Link](10,10,100,50);
[Link](129,10,100,50);
i.c
}
}
dil
Şekil 6.5.1 [Link] programı ve [Link] appleti
import [Link];
import [Link].*;
ww
117
118
}
}
o m
i.c
Şekil 6.5.2 [Link] programı ve appleti
dil
metotların tanımları şu şekilde verilmiştir.
import [Link];
import [Link].*;
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 [Link] 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 [Link];
119
120
import [Link].*;
m
public class daireCiz extends Applet
{
public void paint(Graphics g)
{
[Link](new Color(0,0,255));
[Link](10,10,50,50);
[Link](70,10,50,50);
o
}
}
i.c
dil
Şekil 6.6.2 [Link] programı ve apleti
Eğer bir ovalin tamamını değilde sadece bir bölümünü çizmek dilenilirse, drawArc ve fillArc
metotları kullanılabilir. Bu metotların tanımı :
va
Public abstract void drawArc(
int x1, // üst tepe noktanın x koordinatı
int y1, // üst tepe noktanın y koordinatı
int en, // ovalin genişliği
int yukseklik, // ovalin yüksekliği
int başlangıçaçısı, //arkın başlangıç açısı, derece
ja
import [Link];
import [Link].*;
120
121
[Link](new Font("SansSerif",[Link],12));
[Link](70,10,50,50);
m
[Link](10,10,50,50,30,60);
[Link](70,10,50,50,30,60);
}
}
o
i.c
Şekil 6.6.3 [Link] programı ve apleti
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*[Link]([Link]/3.0)),100,100};
int x1[]={130,(int)(130+100*[Link]([Link]/3.0)),230,130};
m
int y1[];
y1=y;
[Link](new Color(0,0,255));
[Link](x,y,4);
[Link](x1,y1,4);
}
}
o
i.c
6.8 Resim gösterimi
dil
Şekil 6.7.1 [Link] programı ve apleti
Java dili sadece .gif ve .jpg standartlarındaki resimleri gösterebilir. Bu standartlar internet
va
ortamından kaynaklanmaktadır.
Resim önce getImage metoduyla bir Image sınıfı nesneye yuklenir, sonra drawImage
metoduyla gösterilir.
Orneğin Image resim=getImage(getDocumentBase(),”[Link]”);
Ve resim [Link](resim,1,1,this); deyimiyle çizilir. Burada ikinci ve üçüncü noktalar
başlangıç x ve y koordinatlarıdı[Link] olarak this resmin çizileceği appletin içinde bulunulan
sınıfın appleti olduğunu belirtmektedir.
ja
Bir örnek problemle resim çizimini biraz daha belirgin hale getitelim :
import [Link];
import [Link].*;
w.
122
123
o m
i.c
dil
ja va
import [Link];
import [Link].*;
123
124
m
[Link](new Color(100,255,125));
[Link](new Font("SansSerif",[Link],24));
[Link](s,100,25);
[Link](c,2,3,100,50);
[Link](b,0,6,100,75);
}
}
o
i.c
CIZGIC~2 JAV
PLOT~1 JAV
251
8.987
dil
16/06/98
16/06/98
1:42 [Link]
1:57 [Link]
//======================================================
// Numerical Analysis package in java
// Plot class to plot 2D data
// Dr. Turhan Coban
va
// =====================================================
import [Link].*;
import [Link].*;
import [Link].*;
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=[Link];
xntic=xnt;
yntic=ynt;
xgridon=xgo;
ygridon=ygo;
n=new int[nline];
red=new int[nline];
ja
green=new int[nline];
blue=new int[nline];
plottype=new int[nline];
ch=new char[nline];
//read all data to determine limit values
String fn[];
w.
fn=new String[nline];
int i,j;
for(i=0;i<nline;i++)
{
fn[i]=ifn[i];
plottype[i]=ipt[i];
if(plottype[i] == 10) ch[i]='*';
red[i]=ir[i];
ww
green[i]=ig[i];
blue[i]=ib[i];
j=0;
n[i]=0;
//open ffile
lineDataFile=new File(fn[i]);
lineDataFile=new File([Link]());
try{
ffile=new DataInputStream(new FileInputStream(lineDataFile));
125
126
} catch(IOException e)
{
m
[Link]("Error Opening File \n"+[Link]());
[Link](1);
}
try{
while(ffile!=null)
{
xtemp=[Link](ffile);
o
ytemp=[Link](ffile);
if(xtemp<xmin) xmin=xtemp;
if(xtemp>xmax) xmax=xtemp;
if(ytemp<ymin) ymin=ytemp;
i.c
if(ytemp>ymax) ymax=ytemp;
n[i]++;
}
} catch(EOFException e_eof)
{
//close ffile
try{
[Link]();
dil
} catch(IOException e)
{
[Link]("Error Closing File\n"+[Link]());
[Link](1);
}
} //End of EOFException
if(i==0) nmax=n[i];
else
{
va
if(n[i]>nmax) nmax=n[i];
}
}
x=new double[nline][nmax];
y=new double[nline][nmax];
//re-read the data again to load it
lineDataFile=new File(fn[i]);
lineDataFile=new File([Link]());
ja
for(i=0;i<nline;i++)
{
//open ffile
try{
ffile=new DataInputStream(new FileInputStream(lineDataFile));
} catch(IOException e)
w.
{
[Link]("Error Opening File \n"+[Link]());
[Link](1);
}
for(j=0;j<n[i];j++)
{
x[i][j]=[Link](ffile);
y[i][j]=[Link](ffile);
ww
}
//close ffile
try{
[Link]();
} catch(IOException e)
{
[Link]("Error Closing File\n"+[Link]());
[Link](1);
}
126
127
}
set_plotwindow(600,500,0.15,0.1,0.8,0.6);
m
}
o
// filename
// xlabel
// ylabel
// nline xntic yntic xgridon ygridon
i.c
// datafilename plottype redcolor greencolor bluecolor
// ........
// datafilename plottype redcolor greencolor bluecolor
//
// A sample data file input :
//
dil
// 4 10 10 1 1
// [Link] 22 0 0 0
// [Link] 21 0 255 0
// [Link] 0 0 255 0
// [Link] 0 0 0 255
//
// see above for meaning of plot types
xmin=9.99e50;
xmax=-9.99e50;
va
ymin=9.99e50;
ymax=-9.99e50;
xntic=8;
yntic=8;
double xtemp,ytemp;
plotFile=new File("[Link]");
plotFile=new File([Link]());
try{
ja
label=[Link](fin);
xlabel=[Link](fin);
ylabel=[Link](fin);
nline=[Link](fin);
xntic=[Link](fin);
yntic=[Link](fin);
xgridon=[Link](fin);
ygridon=[Link](fin);
ww
n=new int[30];
red=new int[30];
green=new int[30];
blue=new int[30];
plottype=new int[30];
ch=new char[30];
//read all data to determine limit values
String fn[];
fn=new String[nline];
127
128
int i,j;
for(i=0;i<nline;i++)
m
{
fn[i]=[Link](fin);
plottype[i]=[Link](fin);
if(plottype[i] == 10) ch[i]=[Link](fin);
red[i]=[Link](fin);
green[i]=[Link](fin);
blue[i]=[Link](fin);
o
j=0;
n[i]=0;
//open ffile
lineDataFile=new File(fn[i]);
i.c
lineDataFile=new File([Link]());
try{
ffile=new DataInputStream(new FileInputStream(lineDataFile));
} catch(IOException e)
{
[Link]("Error Opening File \n"+[Link]());
[Link](1);
}
dil
try{
while(ffile!=null)
{
xtemp=[Link](ffile);
ytemp=[Link](ffile);
if(xtemp<xmin) xmin=xtemp;
if(xtemp>xmax) xmax=xtemp;
if(ytemp<ymin) ymin=ytemp;
if(ytemp>ymax) ymax=ytemp;
va
n[i]++;
}
} catch(EOFException e_eof)
{
//close ffile
try{
[Link]();
} catch(IOException e)
ja
{
[Link]("Error Closing File\n"+[Link]());
[Link](1);
}
} //End of EOFException
w.
if(i==0) nmax=n[i];
else
{
if(n[i]>nmax) nmax=n[i];
}
}
//close ffile
try{
ww
[Link]();
} catch(IOException e)
{
[Link]("Error Closing File\n"+[Link]());
[Link](1);
}
x=new double[nline][nmax];
y=new double[nline][nmax];
//re-read the data again to load it
128
129
for(i=0;i<nline;i++)
{
m
//open ffile
try{
lineDataFile=new File(fn[i]);
lineDataFile=new File([Link]());
ffile=new DataInputStream(new FileInputStream(lineDataFile));
} catch(IOException e)
{
o
[Link]("Error Opening File \n"+[Link]());
[Link](1);
}
for(j=0;j<n[i];j++)
i.c
{
x[i][j]=[Link](ffile);
y[i][j]=[Link](ffile);
}
//close ffile
try{
[Link]();
dil
} catch(IOException e)
{
[Link]("Error Closing File\n"+[Link]());
[Link](1);
}
set_plotwindow(400,400,0.1,0.1,0.8,0.6);
va
//close fin
try{
[Link]();
} catch(IOException e)
{
[Link]("Error Closing File\n"+[Link]());
[Link](1);
}
ja
//======================================================
// Numerical Analysis package in java
// PlotShapes class
// This class convert graphic draw methods to
// plot coordinates and gives additional plotting methods
// Dr. Turhan Coban
// =====================================================
ww
import [Link].*;
import [Link].*;
import [Link].*;
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 [Link]
130
131
int h=[Link]().getHeight();
int w=h-2;
m
[Link](ch,firstspace,numberofchars,
(int)((xabsmin+(x1-xmin)/(xmax-xmin)*abswidth)+5),
(int)((yabsmin+absheight-(y1-ymin)/(ymax-
ymin)*absheight)+h/2));
} //end of [Link]
o
public void drawString(String s,double x1,double y1)
{
//draws a String at (x1,y1)
int h=[Link]().getHeight();
i.c
int w=h-2;
[Link](s,
(int)(xabsmin+(x1-xmin)/(xmax-xmin)*abswidth),
(int)(yabsmin+absheight-(y1-ymin)/(ymax-ymin)*absheight));
} //end of [Link]
dil
{
// draw a rectangle starting at (x1,y1)
// with dimensions of (rectwidth,rectheight)
[Link](
(int)(xabsmin+(x1-xmin)/(xmax-xmin)*abswidth-rectwidth/2),
(int)(yabsmin+absheight-(y1-ymin)/(ymax-ymin)*absheight-
rectheight/2),
rectwidth,rectheight);
va
}//end of drawRect
(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*[Link](1.0);
int xvalues[]=new int[side+1];
int yvalues[]=new int[side+1];
double angle_increase;
double angle;
angle_increase=2.0*Pi/side;
ww
angle=Pi/2.0;
for(int i=0;i<side;i++)
{
xvalues[i]= (int)([Link](xabsmin+(x1-xmin)/
(xmax-xmin)*abswidth+radius*[Link](angle)));
yvalues[i]= (int)([Link](yabsmin+absheight-(y1-ymin)/
(ymax-ymin)*absheight-radius*[Link](angle)));
if(i==0) {xvalues[side]=xvalues[i];yvalues[side]=yvalues[i];}
angle+=angle_increase;
131
132
}
[Link](xvalues,yvalues,side+1);
m
}//end of drawPolygon
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=[Link]([Link](x1*100.0)/100.00);
[Link](s,(int)(xabsmin+(x1-xmin)/(xmax-xmin)*abswidth),
(int)(yabsmin+absheight-(y1-ymin)/(ymax-ymin)*absheight)+20);
va
x1=x1+dtic;
}
}
// draw y numbers
double dtic=(ymax-ymin)/ticNumber;
double x1=xmin;
double y1=ymin;
String s;
s=" ";
w.
for(int i=0;i<=ticNumber;i++)
{
s=[Link]([Link](y1*100)/100.0)+" ";
[Link](s,(int)(xabsmin+(x1-xmin)/(xmax-xmin)*abswidth-40),
(int)(yabsmin+absheight-(y1-ymin)/(ymax-ymin)*absheight));
y1=y1+dtic;
}
}
ww
133
134
m
{
// draw y labels
double x1=xmin-(xmax-xmin)/6.0;
double y1=ymax-(ymax-ymin)/3.0;
int n=[Link]();
char ch[]=new char[n];
[Link](0,n,ch,0);
o
// [Link](yLabel,(int)(xabsmin+(x1-xmin)/(xmax-xmin)*abswidth-60),
// (int)(yabsmin+absheight-(y1-ymin)/(ymax-ymin)*absheight));
for(int i=0;i<n;i++)
{
i.c
drawChar(ch[i],x1,y1);
y1=y1-(ymax-ymin)/30;
}
}
dil
double x1=xmin+(xmax-xmin)/2.0;
double y1=ymax;
[Link](Label,(int)(xabsmin+(x1-xmin)/(xmax-xmin)*abswidth),
(int)(yabsmin+absheight-(y1-ymin)/(ymax-ymin)*absheight)-10);
}
public void
drawPlotLines(int i,int plottype[],double x[][],double y[][],int n[],char
ch[])
va
{
int j;
//draw lines
if(plottype[i]==0)
{
for(j=0;j<n[i]-1;j++)
{
if((x[i][j]>=xmin && x[i][j]<=xmax )
ja
}
else if(x[i][j+1]>xmax)
{
double b=(y[i][j+1]-y[i][j])/(x[i][j+1]-x[i][j]);
double a=y[i][j]-b*x[i][j];
drawLine(0,x[i][j],y[i][j],xmax,(a+b*xmax));
}
else if(y[i][j+1]>ymax)
ww
{
double b=(y[i][j+1]-y[i][j])/(x[i][j+1]-x[i][j]);
double a=y[i][j]-b*x[i][j];
drawLine(0,x[i][j],y[i][j],(ymax-a)/b,ymax);
}
else if(x[i][j+1]>xmax && y[i][j+1]>ymax)
{
double b=(y[i][j+1]-y[i][j])/(x[i][j+1]-x[i][j]);
double a=y[i][j]-b*x[i][j];
134
135
drawLine(0,x[i][j],y[i][j],(ymax-a)/b,(a+b*xmax));
}
m
}
else if((x[i][j+1]>=xmin && x[i][j+1]<=xmax )
&& (y[i][j+1]>=ymin && y[i][j+1]<=ymax))
{
if(x[i][j]<xmin)
{
double b=(y[i][j+1]-y[i][j])/(x[i][j+1]-x[i][j]);
o
double a=y[i][j+1]-b*x[i][j+1];
drawLine(0,xmin,(a+b*xmin),x[i][j+1],y[i][j+1]);
}
if(y[i][j]<ymin)
i.c
{
double b=(y[i][j+1]-y[i][j])/(x[i][j+1]-x[i][j]);
double a=y[i][j+1]-b*x[i][j+1];
drawLine(0,(ymin-a)/b,ymin,x[i][j+1],y[i][j+1]);
}
}
}//end of for(j=0
}//end of if(plottype
dil
//draw characters
else if(plottype[i]==10)
{
for(j=0;j<n[i];j++)
{
if((x[i][j]>=xmin && x[i][j]<=xmax )
&& (y[i][j]>=ymin && y[i][j]<=ymax))
{ drawChar(ch[i],x[i][j],y[i][j]); }
}//end of for(j=0;
va
}//end else if(plottype[i]==10)
//draw rectangles
else if(plottype[i]==20)
{
for(j=0;j<n[i];j++)
{
if((x[i][j]>=xmin && x[i][j]<=xmax )
&& (y[i][j]>=ymin && y[i][j]<=ymax))
ja
{ drawRect(x[i][j],y[i][j],4,4); }
}//end of for(j=0;
}//end else if(plottype[i]==20)
//draw circle
else if(plottype[i]==21)
{
w.
for(j=0;j<n[i];j++)
{
if((x[i][j]>=xmin && x[i][j]<=xmax )
&& (y[i][j]>=ymin && y[i][j]<=ymax))
{ drawOval(x[i][j],y[i][j],4,4); }
}//end of for(j=0;
}//end else if(plottype[i]==21)
else if(plottype[i]>=22 && plottype[i]<=27)
ww
{
for(j=0;j<n[i];j++)
{ if((x[i][j]>=xmin && x[i][j]<=xmax )
&& (y[i][j]>=ymin && y[i][j]<=ymax))
{drawPolygon(x[i][j],y[i][j],5,(plottype[i]-19));}
}//end of for(j=0;
}//end else if(plottype[i]==21..27)
}
135
136
m
PLOTAP~2 JAV 4.119 16/05/98 22:21 [Link]
//======================================================
// Numerical Analysis package in java
// PlotApplet class to plot 2D data
o
// Dr. Turhan Coban
// =====================================================
import [Link].*;
import [Link].*;
import [Link].*;
i.c
import [Link].*;
import PlotShapes;
import Plot;
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.
// [Link] 22 0 0 0
// [Link] 21 0 255 0
// [Link] 0 0 255 0
// [Link] 0 0 0 255
int xnt=10;
int ynt=10;
int xgo=1;
int ygo=1;
ww
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) {[Link]("applet security
exception");}
promptXmin=new Label("Xmin ");
inputXmin=new TextField(5);
promptXmax=new Label("Xmax ");
inputXmax=new TextField(5);
promptYmin=new Label("Ymin ");
va
inputYmin=new TextField(5);
promptYmax=new Label("Ymax ");
inputYmax=new TextField(5);
[Link](this);
[Link](this);
[Link](this);
[Link](this);
add(promptXmin);
ja
add(inputXmin);
add(promptXmax);
add(inputXmax);
add(promptYmin);
add(inputYmin);
add(promptYmax);
w.
add(inputYmax);
}
[Link]([Link]([Link]));
PlotShapes ps=new PlotShapes(g,[Link],[Link],
[Link],[Link],[Link],[Link],[Link],[Link]);
[Link]([Link],[Link],[Link],[Link]);
[Link]([Link],([Link])/80.0,0);
[Link]([Link],([Link])/80.0,0);
[Link]([Link]);
[Link]([Link]);
[Link]([Link]);
137
138
[Link]([Link]);
[Link]([Link]);
m
if([Link]!=0)
[Link]([Link]);
if([Link]!=0)
[Link]([Link]);
int i,j;
for(i=0;i<[Link];i++)
{
o
// Select plot colors
[Link](new Color([Link][i],[Link][i],[Link][i]));
[Link](i,[Link],p1.x,p1.y,p1.n,[Link]);
}//end of for(i=0
i.c
}//end of method
dil
Double valYmin=new Double([Link]());
[Link]=[Link]();
Double valYmax=new Double([Link]());
[Link]=[Link]();
repaint();
}
}
ja va
w.
ww
138
139
m
[Link] 10 * 0 0 255 dosyaİsmi plot_türü (10 ise plot char) Kırmızı Yesil Ma
[Link] 0 255 0 0 dosyaİsmi Plot_türü Kırmızı Yesil Mavi
[Link] 0 255 100 0 dosya_ismi Plot_türü Kırmızı Yeşil Mavi
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 [Link];
139
140
import [Link].*;
m
public class resim extends Applet
{
private Image bebek;
o
}
i.c
[Link](bebek,1,1,this);
}
}
ALIŞTIRMA 4
drawPolygon ve fillPolygon metodlarını kullanarak biri dolu diğeri sadece bir çizgi
olan iki eşkenar üçgen çiz.
import [Link];
import [Link].*;
{
public void paint(Graphics g)
{
dil
public class ucgenCiz extends Applet
int x[]={10,(int)(10+100*[Link]([Link]/3.0)),110,10};
va
int y[]={100,(int)(100-100*[Link]([Link]/3.0)),100,100};
int x1[]={130,(int)(130+100*[Link]([Link]/3.0)),230,130};
int y1[];
y1=y;
[Link](new Color(0,255,0));
[Link](x,y,4);
[Link](x1,y1,4);
}
ja
}
w.
ww
ALIŞTIRMA 5
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ı [Link] (Abstract windowing toolkit) paketinde yer almaktadır. Bu pakette
Container ve Component isimli iki alt pakette yer almaktadır. Her zaman kullndığımız
Applet sınıfı Component sınıfından türiyen Panel sınıfının alt sınıfıdır. Yani Component
Appletlerin süper sınıfıdır.
Burada Component sınıfının
dil
1. TextComponent
• TextField
• TextArea
2. Button
3. Label
4. Checkbox
5. List
va
6. Choice
7. Canvas
8. Scrollbar
9. Container
• Panel
[Link]
• ScrollPane
ja
• Window
Frame
Dialog
Label sınıfı Appletin içine sadece okunabşlen fakat değiştirilemeyen yazılar yazma amacıyla
kullanılırlar. Label sınıfında tanımlanan metotlar şunlardır:
1. Kurucu Metotlar :
ww
public Label() // Label sınıfı nesneyi olusturur herhangi bir yazı göstermez
public Label(String s) // Label sınıfı nesneyi olusturur ve s stringini gösterir
public void Label(String s,int pozisyon) // Label sınıfı nesneyi olusturur ve s stringi gösterir
aynı zamanda Labeli pozisyonda verilen değere göre istenilen yere yerleştirir.
Yerleştirme konumları :[Link],[Link],[Link] (sol,orta,sağ)
konumlarıdır.
2. Giriş çıkış metotları
public String getText() // Label sınıfının String değişkenini okur.
142
143
m
public void setAlignment(int pozisyon)
Labeli pozisyonda verilen değere göre istenilen yere yerleştirir.
Yerleştirme konumları :[Link],[Link],[Link] (sol,orta,sağ)
konumlarıdır.
Örnek olarak bir bir program verelim :
o
import [Link];
import [Link].*;
i.c
public class LabelTesti extends Applet
{
private Label L1,L2;
public void init()
{
L1=new Label();
[Link]("Bu etiket once bos tanimlandi");
add(L1);
L2=new Label("Bu etiket yazisi ilk tanimda tanimlandi");
add(L2);
}
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
[Link]
• [Link]
1. ActionEvent // Bir dügme(Button) basıldığında,Listeden (List) iki klikle bir
seçim yapıldığında veya menuden seçim yapıldığında kullanılır.
2. AdjustmentEvent // asağı yukarı kaydırma cubugunda (scroll bar) bir işlem
o
yapıldığında kullanılır.
3. ItemEvent // List veya CheckBox kliklendiginde (bir kere) kullanılır
4. ComponentEvent //appletteki elemanların gizlenmesi, boylarının değiştirilmesi,
veya değişik yerlere alınması amacıyla kullanılır.
i.c
4.1 ContainerEvent //Containera(applete) yeni bir eleman eklenilir veya
çıkarılırken kullanılır.
4.2 FocusEvent//herhangi bir applet elemanı kullanılmaya baslandıgında on plana
cıkarılmakk, ve kullanılmadıgında arka plana atılmak istendiğinde kullanılır.
4.3 PaintEvent
4.4 WindowEvent//pencere acılıp kapandığında,kücültülüp büyütüldüğünde vb.
4.5 InputEvent
dil
4.5.1 KeyEvent//keyboarddan bir girdi alındığında kullanılır
4.5.2 MouseEvent//mouse dan bir girdi alındığında kullanılır
Kullanıcı bir applet programı yazarken dinleme ile ilgili iki işlem yapar ilk işlem herhangi bir
GUI dan bir girdi olup olmadığını dinlemek olduysa kaydetmek ikincisi ise bu işlemin sebep
olacağı işlemleri oluşturmaktır. Dinleme işlemini yapan metodlar şunlardır :
[Link]
1. ActionListener
va
2. AdjustmentListener
3. ComponentListener
4. ContainerListener
5. FocusListener
6. ItemListener
7. KeyListener
ja
8. MouseListener
9. MouseMotionListener
10. TextListener
11. WindowListener
w.
Bu metotların birçoğunu ilgili orneklerde yeri geldiğinde kullanacağız. Şimdi aynı sonucu
veren iki button orneği ile bu kavramı biraz daha açmaya çalışalım :
import [Link];
import [Link].*;
import [Link].*;
ww
144
145
B2=new Button("B2");
[Link](new B2Basilinca(this));
m
add(B2);
}
}
o
public B1Basilinca(Applet a) {applet=a;}
i.c
{
[Link](" "+[Link]()+"dugmesine basildi");
}
dil
Applet applet;
import [Link];
w.
import [Link].*;
import [Link].*;
{
B1=new Button("B1");
[Link](this);
add(B1);
B2=new Button("B2");
[Link](this);
add(B2);
}
145
146
m
if([Link]()==B1)
{showStatus(" "+[Link]()+"dugmesine basildi");}
else if([Link]()==B2)
{showStatus(" "+[Link]()+"dugmesine basildi");}
}
o
Şekil 7.3.2 [Link] sınıfı (sonuclar [Link] ile aynıdır)
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 [Link];
w.
import [Link].*;
import [Link].*;
{
setBackground([Link]);
//bos textField
T1=new TextField();
[Link](this);
add(T1);
T2=new TextField("Buraya yazi yaziniz");
[Link](this);
add(T2);
146
147
m
[Link](this);
add(T2);
T3=new TextField("gizli yazi");
[Link](false);
add(T3);
}
o
public void actionPerformed(ActionEvent e)
{
showStatus("Yazi : "+[Link]());
}
i.c
}
dil
ja va
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 [Link];
import [Link].*;
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 [Link];
148
149
import [Link].*;
import [Link].*;
m
public class TextAreaTesti1 extends Applet
implements ActionListener,TextListener
{
private TextArea T1,T2;
private Button kopye;
public void init()
{
setBackground([Link]);
o
//bos textField
String s="buraya denemek icin\nyazi yazildi\n\t sonrada bu yazi aktarildi";
//not \n sat rbaŸ kontrol
// \t bir sonraki tab setine git
T1=new TextArea(s,5,20,TextArea.SCROLLBARS_NONE);
i.c
[Link](this);
add(T1);
kopye=new Button("Kopye >>>");
[Link](this);
add(kopye);
T2=new TextArea(5,20);
[Link](false);
add(T2);
}
dil
public void actionPerformed(ActionEvent e)
149
150
m
Kopye düğmesine basılınca ise sadece [Link]() metoduyla secilmiş olan text
actionPerforned metodu üzerinden T2 Yazım Alanına (TextArea) aktarılmaktadır.
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 [Link].*;
va
import [Link];
import [Link].*;
{
F=new Choice();
[Link]("MonoSpaced"); // Courier
[Link]("SansSerif"); // Helvetica
[Link]("Serif"); // Times
T=new TextField([Link](0),30);
w.
[Link](false);
[Link](new Font([Link](0),[Link],12));
[Link](new FontIsmiKontrolu(T));
[Link](new TextFieldKontrolu(T));
add(F);
add(T);
}
}
ww
150
151
{
[Link](new Font([Link]().toString(),
m
[Link]().getStyle(),
[Link]().getSize()));
}
}
o
private TextField T;
public TextFieldKontrolu(TextField T)
{
this.T=T;
i.c
}
dil
Sekil 7.6.1 [Link] 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 [Link] programına göz atalım :
import [Link];
import [Link].*;
i.c
import [Link].*;
dil
{
setBackground([Link]);
//bos textField
T=new TextField("Buradaki yazinin degismesini izleyiniz");
add(T);
Kalin=new Checkbox("Kalin");
[Link](this);
add(Kalin);
Italic=new Checkbox("Italik");
va
[Link](this);
add(Italic);
}
{KalinAyari=[Link];}
else
{KalinAyari=[Link];}
int ItalicAyari;
if([Link]())
w.
{ItalicAyari=[Link];}
else
{ItalicAyari=[Link];}
[Link](new Font("Serif",KalinAyari+ItalicAyari,14));
}
}
ww
152
153
o m
i.c
Şekil 7.7.2 [Link] programının sonuçlarının appletde görülmesi
import [Link];
import [Link].*;
import [Link].*;
dil
public class RadiobuttonTesti extends Applet implements ItemListener
{
private TextField T;
va
private Font NormalFont,KalinFont,ItalicFont,KalinItalicFont;
private Checkbox Normal,Kalin,Italic,KalinItalic;
private CheckboxGroup fontGurubu;
Kalin=new Checkbox("Kalin",fontGurubu,true);
[Link](this);
add(Kalin);
Italic=new Checkbox("Italik",fontGurubu,true);
[Link](this);
add(Italic);
KalinItalic=new Checkbox("Kalin Italik",fontGurubu,true);
[Link](this);
ww
add(KalinItalic);
NormalFont=new Font("Serif",[Link],14);
KalinFont=new Font("Serif",[Link],14);
ItalicFont=new Font("Serif",[Link],14);
KalinItalicFont=new Font("Serif",[Link]+[Link],14);
[Link](NormalFont);
}
public void itemStateChanged(ItemEvent e)
{
153
154
int KalinAyari;
if([Link]()== Normal)
m
{[Link](NormalFont);}
else if([Link]()== Kalin)
{[Link](KalinFont);}
else if([Link]()== Italic)
{[Link](ItalicFont);}
else if([Link]()== KalinItalic)
{[Link](KalinItalicFont);}
o
}
}
i.c
dil
va
Şekil 7.7.3 [Link] programı ve sonuçlarının applette gösterilmesi
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 [Link];
import [Link].*;
import [Link].*;
o
public class FareTesti extends Applet
implements MouseListener, MouseMotionListener
{
private int nx,ny=-10;
private String s="";
i.c
public void init()
{
addMouseListener(this);
addMouseMotionListener(this);
}
dil
[Link](s+"["+nx+","+ny+"]",nx,ny);
}
{ degerleriGir("Basildi",[Link](),[Link]()); }
public void mouseReleased(MouseEvent e)
{ degerleriGir("Birakildi",[Link](),[Link]()); }
public void mouseEntered(MouseEvent e)
{ showStatus("Fare applet alani icinde"); }
public void mouseExited(MouseEvent e)
w.
}
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 [Link];
o
import [Link].*;
import [Link].*;
i.c
{
private List renkListesi;
private String renkIsmi[]={"Siyah","Mavi","Cam Gobegi","Koyu Gri","Gri",
"Yesil","Acik gri","Mor","Portakal","Pembe","Kirmizi","Beyaz","Sari"};
private Color C[]={[Link],[Link],[Link],[Link],
[Link],[Link],[Link],[Link],[Link],
[Link],[Link],[Link],[Link]};
dil
public void init()
{
//Ekranda 5 isim g”r lebilecel bir liste ac
//ayn ismi birden fazla tekrarlama
renkListesi=new List(5,false);
[Link](this);
[Link](this);
//listeye ekle
va
for(int i=0;i<[Link];i++)
{
[Link](renkIsmi[i]);
}
add(renkListesi);
}
setBackground(C[[Link]()]);
repaint();
}
}
ww
156
157
m
Şekil 7.9.1 [Link] 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 [Link], [Link] veya [Link]
i.c
değerlerini alabilir.
public Flowlayout(int formatbolgesi,int yatay_bosluk,int dikey_bosluk)
formatbolgesi [Link], [Link] veya [Link]
değerlerini alabilir. Yatay_bosluk pixel olarak yatay posisyonda elemanlar arasında kalan
boslugu gosterir. Dikey bosluk ise dikey dogrultudaki pixel olarak boşluktur.
Küçuk bir örnek problemle FlowLayout kullanımını daha açık hale getirebiliriz.
import [Link];
import [Link].*;
import [Link].*;
dil
public class FlowLayoutTesti extends Applet implements ActionListener
{
private Button B[];
va
public void init()
{
B=new Button[3];
B[0]=new Button("Sol");
B[1]=new Button("Orta");
B[2]=new Button("Sag");
for(int i=0;i<[Link];i++)
{
ja
B[i].addActionListener(this);
add(B[i]);
}
}
public void actionPerformed(ActionEvent e)
{
w.
int pozisyon=[Link];;
if([Link]()==B[0])
{
pozisyon=[Link];
}
else if([Link]()==B[1])
{
pozisyon=[Link];
ww
}
else if([Link]()==B[2])
{
pozisyon=[Link];
}
setLayout(new FlowLayout(pozisyon));
validate();
}
}
157
158
o m
i.c
dil
Şekil 7.10.1 FlowLayout sınıfı ve sonuçlarının Appletde görülmesi
import [Link];
import [Link].*;
ja
import [Link].*;
B[i].addActionListener(this);
}
add(B[0],[Link]);
add(B[1],[Link]);
add(B[2],[Link]);
add(B[3],[Link]);
add(B[4],[Link]);
}
158
159
m
for(int i=0;i<[Link];i++)
{
if([Link]()==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 [Link] 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 [Link];
import [Link].*;
import [Link].*;
B=new Button[6];
for(int i=0;i<[Link];i++)
{
B[i]=new Button(S[i]);
add(B[i]);
}
}
}
ww
160
161
m
7.13 Panel sınıfı
o
import [Link];
import [Link].*;
import [Link].*;
i.c
public class Paneltesti extends Applet
{
private Panel buttonPanel;
private Button buttons[];
public void init()
{
buttonPanel=new Panel();
buttons=new Button[5];
dil
[Link](new GridLayout(1,[Link]));
for(int i=0;i<[Link];i++)
{
buttons[i]=new Button("Button "+(i+1));
[Link](buttons[i]);
}
setLayout(new BorderLayout());
add(buttonPanel,[Link]);
}
va
}
ja
import [Link].*;
import [Link];
ww
import [Link].*;
161
162
Label prompta;
TextField inputa; //
m
Label promptb; //
TextField inputb; //
Label promptc; //
TextField inputc; //
double a,b,c; //polinomun katsayilari
double delta=0.0; //determinant
double x1,x2; //kokler
o
public void init()
{
i.c
setBackground([Link]);
YaziPaneli=new Panel();
[Link](new Font("Serif",[Link],12));
[Link]( new GridLayout(4,2) );
prompt1=new Label("a*x^2+b*x+c = 0");
prompt2=new Label("Polinomunun kokleri");
prompta=new Label(" a : ");
inputa =new TextField(5);
dil
[Link](this);
promptb=new Label(" b : ");
inputb =new TextField(5);
[Link](this);
promptc=new Label(" c : ");
inputc =new TextField(5);
[Link](this);
[Link](prompt1);
[Link](prompt2);
va
[Link](prompta);
[Link](inputa);
[Link](promptb);
[Link](inputb);
[Link](promptc);
[Link](inputc);
add(YaziPaneli);
}
ja
delta)/2.0/a,100,205);
}
if(delta==0)
{
[Link]("Kok 1 :"+(-b/2.0/a),100,190 );
[Link]("Kok 2 :"+(-b/2.0/a),100,205 );
}
if(delta>0)
{
162
163
x1=-b/2.0/a+[Link](delta)/20/a;
x2=-b/2.0/[Link](delta)/2.0/a;
m
[Link]("Kok 1 :"+x1,100,190 );
[Link]("Kok 2 :"+x2,100,205);
}
}
o
Double sayi1=new Double([Link]() );
Double sayi2=new Double([Link]() );
Double sayi3=new Double([Link]() );
a=[Link]();
i.c
b=[Link]();
c=[Link]();
delta=b*b-4.0*a*c;
repaint();
}
}
dil
ja va
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
[Link] programını ve gecen hafta incelediğimiz drawRect metodunu birleştirerek
fareyi kallanarak ekrana dikdortrtgen çizdiriniz (dikdortgenin baslangic ve bitis noktaları fare
tarafindan belirlenecektir)
i.c
ALISTIRMA 3
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 [Link];
import [Link].*;
import [Link].*;
164
165
T=new TextField(s[0]);
m
buttonPanel=new Panel();
buttons=new Button[10];
[Link](new GridLayout(2,[Link]/2));
for(int i=0;i<[Link];i++)
{
buttons[i]=new Button("Button "+(i+1));
buttons[i].addActionListener(this);
o
[Link](buttons[i]);
}
setLayout(new BorderLayout());
add(buttonPanel,[Link]);
i.c
add(T,[Link]);
}
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
[Link] Exception listesi
ArithmeticException
ArrayIndexOutOfBoundsException
ArrayStoreException
ja
ClassCastException
ClassNotFoundException
CloneNotSupportedException
Exception
IllegalAccessException
w.
IllegalArgumentException
IllegalMonitorStateException
IllegalStateException
IllegalThreadStateException
IndexOutOfBoundsException
InstantiationException
InterruptedException
ww
NegativeArraySizeException
NoSuchFieldException
NoSuchMethodException
NullPointerException
NumberFormatException
RuntimeException
SecurityException
166
167
StringIndexOutOfBoundsException
m
[Link] exception listesi
EmptyStackException
MissingResourceException
NoSuchElementException
o
TooManyListenersException
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 [Link] hata kontrolü
programı
import [Link];
import [Link].*;
import [Link].*;
o
import [Link];
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);
[Link](this);
add(L1);
add(T1);
va
add(L2);
add(T2);
}
}
catch(NumberFormatException nfe)
{showStatus("iki tam sayi girmelisiniz.");}
catch(sifiraBolunmeException sbh)
{showStatus([Link]());}
}
}
168
169
o m
i.c
dil
Şekil 8.2 Bizim tarafımızdan oluşturulan [Link] hata kontrolü ve
sayı formatı hata kontrolü (NumberFormatException) yapan [Link]
programı ve sonuçlarının applet ekranında izlenimi
try{
sayi1=[Link]([Link]());
sayi2=[Link]([Link]());
[Link]("");
[Link]("");
sonuc=bol(sayi1,sayi2);
showStatus(sayi1+" / "+sayi2+" = "+[Link](sonuc));
ww
}
catch(NumberFormatException nfe)
{showStatus("iki tam sayi girmelisiniz.");}
catch(sifiraBolunmeException sbh)
{showStatus([Link]());}
}
}
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 {[Link](1000);}
catch(InterruptedException e)
{[Link]([Link]());}
}
}
}
171
172
Date D;
DateFormat df;
m
Locale tr;
saatThread r;
o
D=new Date();
df= [Link]([Link],tr);
r=new saatThread(this);
[Link]();
i.c
}
dil
{
[Link]([Link](),10,50);
}
catch(NullPointerException e){}
}
}
Şekil 9.1 [Link] sınıfının thread sınıfından türemiş olarak yazılımı.
va
import [Link];import [Link];import [Link];import
[Link];
public class saat extends Applet implements Runnable{ Font theFont=new
Font("TimesRoman",[Link],24);
ja
Date theDate;
Thread runner;
{
runner=new Thread(this);
[Link]();
}
}
if(runner!=null)
{
[Link]();
runner=null;
}
}
172
173
while(true)
m
{
theDate=new Date();
repaint();
try {[Link](1000);}
catch(InterruptedException e) {}
}
}
o
public void paint(Graphics g)
{
i.c
[Link](theFont);
try
{
[Link]([Link](),10,50);
}
catch(NullPointerException e){}
}
}
dil
va
Şekil 9.1 [Link] sınıfının Runnable interface’i ile yazılımı ve applet çıktısı
ja
İ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++)
{
[Link](count);
[Link]("OrtakInteger "+count+" degerini uretti");
i.c
try{
sleep( (int) ([Link]()*5000 ) );
}
catch(InterruptedException e)
{
[Link]("Exeption "+[Link]());
}
dil
}
}
}
public KullanInteger(TutInteger h)
va
{
cTut=h;
}
catch(InterruptedException e)
{
[Link]("Exeption "+[Link]());
}
Intdegeri=[Link](); [Link]("Kullan
Integer"+Intdegeri+" degerini okudu"); } }}
class TutInteger{ private int OrtakInt; public void setOrtakInt(int
ww
Intdegeri)
{
OrtakInt=Intdegeri;
}
174
175
m
OrtakInteger 0 degerini urettiOrtakInteger 1 degerini urettiOrtakInteger 2
degerini urettiKullan Integer2 degerini okudu
OrtakInteger 3 degerini uretti
OrtakInteger 4 degerini uretti
OrtakInteger 5 degerini uretti
o
Kullan Integer5 degerini okudu
Kullan Integer5 degerini okudu
OrtakInteger 6 degerini uretti
OrtakInteger 7 degerini uretti
Kullan Integer7 degerini okudu
i.c
OrtakInteger 8 degerini uretti
OrtakInteger 9 degerini uretti
Kullan Integer9 degerini okudu
Şekil 9.2 [Link] programı ve çıktısı
dil
import [Link].*;import [Link].*;import [Link].*;//runnable interfacei
kullanarakclass UretInteger implements Runnable { private TutInteger
pTut; private Thread thread; public UretInteger(TutInteger h) {
pTut=h;
thread = new Thread(this);
[Link]();
}
public void run() {
for(int count=0; count < 10; count++) {
va
[Link](count);
[Link]("Ortak Integer " + count+" Olarak
olusturuldu");
try {
[Link]((int)([Link]()*3000));
}
catch(InterruptedException exception) {
[Link]("Exception " + [Link]());
ja
}
}
}
}
class KullanInteger implements Runnable{
private TutInteger cTut;
w.
while(Intdegeri != 9) {
try {
[Link]((int)([Link]()*3000));
}
catch(InterruptedException e) {
[Link]("Exception " + [Link]());
}
Intdegeri = [Link]();
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 [Link] sınıfı
[Link]();
[Link]();
}
}
{
private Tutinteger pTut;
private TextArea cikti;
public Uretinteger(Tutinteger h)
{
pTut=h;
ww
try{
sleep( (int) ([Link]()*500 ) );
176
177
}
catch(InterruptedException e)
m
{
[Link]("Hata : "+[Link]());
}
}
}
}
o
class Consumeinteger extends Thread
{
private Tutinteger cTut;
i.c
public Consumeinteger(Tutinteger h)
{
cTut=h;
}
}
dil
intdegeri=[Link]();
catch(InterruptedException e)
va
{
[Link]("Hata "+[Link]());
}
intdegeri=[Link]();
}
}
}
ja
class Tutinteger
{
private int Ortakint[] = {9,9,9,9,9};
private boolean writeable = true;
private boolean okunabilir = false;
private int YerelOku =0, YerelYaz=0;
w.
{
while (!writeable)
{
try{
177
178
{
[Link]("Hata :"+[Link]() );
m
}
}
Ortakint[YerelYaz]=intdegeri;
okunabilir = true;
[Link]("\n Uretilen "+intdegeri+" Yazilan "+YerelYaz);
YerelYaz = ++YerelYaz % 5;
o
[Link]("\t yazilan hucre "+YerelYaz+"\t okunan hucre
"+YerelOku);
i.c
printBuffer(cikti, Ortakint);
if(YerelYaz==YerelOku)
{
writeable=false;
[Link]("\nDEPOLAMA YERLER˜ DOLU ");
}
notify();
dil
}
writeable=true;
intdegeri=Ortakint[YerelOku];
printBuffer(cikti, Ortakint);
if (YerelOku==YerelYaz)
{okunabilir=false;
[Link]("\niNTEGER DEPOSU BOS");
}
ww
notify();
return intdegeri;
}
178
179
m
[Link](" "+buf[i]);
}
}
o
Uretilen 0 Yazilan 0 yazilan hucre 1 okunan hucre 0 depo: 0 9 9 9 9
Kullanilan 0 Okundugu Hucre 0 yazilan hucre 1 okunan hucre 1 depo: 0 9 9 9 9
INTEGER DEPOSU BOS
i.c
Uretilen 1 Yazilan 1 yazilan hucre 2 okunan hucre 1 depo: 0 1 9 9 9
Kullanilan 1 Okundugu Hucre 1 yazilan hucre 2 okunan hucre 2 depo: 0 1 9 9 9
INTEGER DEPOSU BOS
Uretilen 2 Yazilan 2 yazilan hucre 3 okunan hucre 2 depo: 0 1 2 9 9
Uretilen 3 Yazilan 3 yazilan hucre 4 okunan hucre 2 depo: 0 1 2 3 9
Kullanilan 2 Okundugu Hucre 2 yazilan hucre 4 okunan hucre 3 depo: 0 1 2 3 9
Uretilen 4 Yazilan 4 yazilan hucre 0 okunan hucre 3 depo: 0 1 2 3 4
Kullanilan 3 Okundugu Hucre 3 yazilan hucre 0 okunan hucre 4 depo: 0 1 2 3 4
dil
Uretilen 5 Yazilan 0 yazilan hucre 1 okunan hucre 4 depo: 5 1 2 3 4
Uretilen 6 Yazilan 1 yazilan hucre 2 okunan hucre 4 depo: 5 6 2 3 4
Uretilen 7 Yazilan 2 yazilan hucre 3 okunan hucre 4 depo: 5 6 7 3 4
Kullanilan 4 Okundugu Hucre 4 yazilan hucre 3 okunan hucre 0 depo: 5 6 7 3 4
Kullanilan 5 Okundugu Hucre 0 yazilan hucre 3 okunan hucre 1 depo: 5 6 7 3 4
Uretilen 8 Yazilan 3 yazilan hucre 4 okunan hucre 1 depo: 5 6 7 8 4
Kullanilan 6 Okundugu Hucre 1 yazilan hucre 4 okunan hucre 2 depo: 5 6 7 8 4
Uretilen 9 Yazilan 4 yazilan hucre 0 okunan hucre 2 depo: 5 6 7 8 9
va
Kullanilan 7 Okundugu Hucre 2 yazilan hucre 0 okunan hucre 3 depo: 5 6 7 8 9
Kullanilan 8 Okundugu Hucre 3 yazilan hucre 0 okunan hucre 4 depo: 5 6 7 8 9
Kullanilan 9 Okundugu Hucre 4 yazilan hucre 0 okunan hucre 0 depo: 5 6 7 8 9
INTEGER DEPOSU BOS
Şekil 9.4 Buffer ile uyum sağlanmış [Link] sınıfı ve applet çıktısı
ja
[Link]();
w.
[Link]();
}
}
public UretInteger(TutInteger h)
{
pTut=h;
}
179
180
[Link]("UretInteger OrtakInteger
degerini"+count+"olarak olusturdu");
m
try{
sleep( (int) ([Link]()*3000 ) );
}
catch(InterruptedException e)
{
[Link]("Exeption "+[Link]());
o
}
}
}
}
i.c
class KullanInteger extends Thread
{
private TutInteger cTut;
public KullanInteger(TutInteger h)
{
cTut=h;
dil
}
}
}
}
class TutInteger
{
w.
try{
wait();
}
catch (InterruptedException e)
{
[Link]("Exception:"+[Link]() );
}
}
180
181
OrtakInt=Intedegeri;
Yazilabilir=false;
m
notify();
o
{
try{
wait();
}
i.c
catch (InterruptedException e)
{
[Link]("Exception:"+[Link]() );
}
}
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(“/”,”[Link]”);
File f3=new File(f1,”[Link]”);
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/[Link]
olarak verilmişse true değeri verir.)
isDirectory()
verilen isimin bir dizin ismi olup olmadığını kontrol eder.
isFile()
verilen isimin birdosya isimi olup olamdığını kontrol eder.
w.
lastModified()
Dosyanın en son değiştirildiği tarihi verir
length()
Dosyanın boyutunu Byte olarak verir.
list()
Verilen dizinin içindeki dosyaların listesini verir.
list(FilenameFiltre)
Verilen dizinin içindeki Filtre nesnesindeki tanıma uyan dosyaların listesini verir.
ww
mkdir()
Yeni bir dizin oluşturur.
mkdirs()
O anda tanımlı olan dizinin içine bir alt dizin oluşturur.
renameTo(File)
Dosyanın ismini değiştirir.
toString()
Dosya ve dizin isimleri topluluğunun String değişkeni eşdeğerini verir.
184
185
m
import [Link].*;
class FileTesti
{
public static void main(String args[])
{
File f1=new File("[Link]");
o
[Link]("Dosya ismi : "+[Link]());
[Link]("Dizin ismi : "+[Link]());
[Link]("Mutlak Dizin ismi : "+[Link]());
[Link]("Ust Dizin ismi : "+[Link]());
i.c
[Link]( [Link]() ? "Mevcut " : " Mevcut degil ");
[Link]( [Link]() ? "Yazilabilir " : " Yazilamaz");
[Link]( [Link]() ? "Okunabilir " : " Okunamaz");
[Link]( [Link]() ? "Dizin " : " Dizin degil");
[Link]( [Link]() ? "Dosya " : " Dosya degil");
[Link]( [Link]() ? "Mutlak dizin ismi " : " Mutlak dizin ismi degil");
[Link]("Son Degisiklik : "+[Link]());
[Link]("Dosya boyutu : "+[Link]()+" Byte");
dil
}
}
Şekil 10.1.1 [Link] programı
işaretiyle sonlanır. Yeni bir dosya açıldığında bu dosyayla ilgili bir nesne oluşturulur. Yeni
bir java programı açıldığında üç akış nesnesi otomatik olarak açılır. Bunlar [Link] ,
[Link], [Link] nesneleridir. Eğer kendimiz bir girdi veya çıktı akış nesnesi
oluşturmak istersek FileInputStream veya FileOutputStream sınıfı bir nesne
tanımlıyabiliriz. Akısın içindeki değişkenleri sadece byte olarak okumak yerine direk
olarak double veya integer gibi değişkenler türünden okumak istersek DataInputStream
ww
Bu deyim bize [Link] isimli dosyadan bir fileOutputStream aracılığıyla açılan dosyayı
DataOutputStream’e çevirip gerçek değişkenler cinsinden akış kanalı açar. Kanal açıldıktan
185
186
m
import [Link].*;
import [Link].*;
import [Link].*;
o
private TextField hesapIsmiKutusu,isimKutusu,soyIsimKutusu,hesapKutusu;
private Button enter,done;
private DataOutputStream cikti;
private Label H,I,S,P;
public ardisikDosyaYarat()
i.c
{
super("Musteri dosyasi Ac");
try{
cikti=new DataOutputStream(new FileOutputStream("[Link]"));
} catch(IOException e)
{ [Link]("Dosya dogru acilamadi\n"+[Link]());
[Link](1);
}
dil
setSize(300,150);
setLayout(new GridLayout(5,2));
H=new Label("Hesap numarasi :");
add(H);
hesapIsmiKutusu=new TextField();
add(hesapIsmiKutusu);
I=new Label("isim : ");
add(I);
va
isimKutusu=new TextField(20);
add(isimKutusu);
S=new Label("Soyisim : ");
add(S);
soyIsimKutusu=new TextField(20);
add(soyIsimKutusu);
P=new Label("Hesaptaki para : ");
add(P);
hesapKutusu=new TextField(20);
ja
add(hesapKutusu);
enter=new Button("Gir");
[Link](this);
add(enter);
done=new Button("Cikis");
[Link](this);
w.
add(done);
setVisible(true);
}
Double d;
if(![Link]().equals(""))
{
try{
accountNumber=[Link]([Link]());
if(accountNumber>0)
{
[Link](accountNumber);
[Link]([Link]());
[Link]([Link]());
186
187
d=new Double([Link]());
[Link]([Link]());
m
}
[Link]("");
[Link]("");
[Link]("");
[Link]("");
}
o
catch(NumberFormatException nfe)
{
[Link]("Hesap numarasi tamsayi degisken olamalidir");
}
catch(IOException io)
i.c
{
[Link]("Dosyaya yazarken hata olustu\n"+[Link]());
[Link](1);
}
}
}
public void actionPerformed(ActionEvent e)
{
dil
hesapEkle();
if([Link]()==done)
{
try{ [Link]();}
catch(IOException io)
{
[Link]("Dosya kapatilamadi\n"+[Link]());
}
[Link](0);
va
}
}
import [Link].*;
import [Link].*;
import [Link].*;
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("[Link]"));
} catch(IOException e) { [Link]("Dosya
acilamadi\n"+[Link]());
o
[Link](1);
}
setSize(300,150);
setLayout(new GridLayout(5,2));
i.c
add(new Label("Hesap Numarasi :"));
accountField=new TextField();
add(accountField);
add(new Label("isim : "));
firstNameField=new TextField(20);
add(firstNameField);
add(new Label("soyisim : "));
lastNameField=new TextField(20);
dil
add(lastNameField);
add(new Label("Hesaptaki para : "));
balanceField=new TextField(20);
add(balanceField);
next=new Button("bir sonraki hesap");
[Link](this);
add(next);
done=new Button("cikis");
[Link](this);
va
add(done);
setVisible(true);
}
public void readRecord()
{
int account;
String first,last;
double balance;
ja
{
try{
account=[Link]();
first=[Link]();
last=[Link]();
balance=[Link]();
w.
[Link]([Link](account));
[Link](first);
[Link](last);
[Link]([Link](balance));
}
catch(EOFException eof)
{
closeFile();
ww
}
catch(IOException io)
{
[Link]("Dosyay okurken hata olustu\n"+[Link]());
[Link](1);
}
}
}
public void actionPerformed(ActionEvent e)
188
189
{
if([Link]()==next)
m
readRecord();
else
closeFile();
}
o
{
try{
[Link]();
[Link](0);
}
i.c
catch(IOException e)
{
[Link]("Dosya Kapama Hatası oluştu\n"+[Link]());
[Link](1);
}
}
dil
{
new ardisikDosyaOku();
}
}
ja va
try{
cikti=new DataOutputStream(new FileOutputStream("[Link]"));
}
catch(IOException e)
{
[Link]("Dosya dogru acilamadi\n"+[Link]());
[Link](1);
ww
189
190
}
catch(IOException e)
m
{ [Link]("Dosya dogru acilamadi\n"+[Link]());
[Link](1);
}
şeklinde de yaratabilirdik. İkinci şekilde dosyayı tanımlarken tam dizin ismini de otomatik
olarak tanımlamış olurduk.
o
Dosyanın okunması içinse
try{
i.c
input=new DataInputStream(new FileInputStream("[Link]"));
}
catch(IOException e)
{
[Link]("Dosya acilamadi\n"+[Link]());
[Link](1);
}
dil
gurubunu kullandık. Eğer dosya ismi de değişkende dışarıdan okuduktan sonra ismi File
sınıfına yükleyip sonra akış kanalı açabiliriz.
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 [Link] 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)
[Link](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("[Link]","rw");
m
} catch(IOException e)
{
[Link]("Dosya acma hatasi\n"+[Link]());
[Link](1);
}
o
yapısı kullanbilir. Buradaki “rw” yapısı dosyaya hem yazı yazılıp hem okunabileceğini
belirtir. “r” sadece okumak için “w” sadece yazmak için kullanılır.
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
[Link] 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 [Link].*;
195
196
m
{
//RandomAccessFile = Raslantisal Ulasim dosyasi
hesap=[Link]();
char first[]=new char[15];
for(int i=0;i<[Link];i++)
{ first[i]=[Link](); }
Isim=new String(first);
o
char last[]=new char[15];
for(int i=0;i<[Link];i++)
{ last[i]=[Link](); }
soyIsim=new String(last);
i.c
hesaptakiPara=[Link]();
}
dil
buf=new StringBuffer(Isim);
else
buf=new StringBuffer(15);
[Link](15);
[Link]([Link]());
if(soyIsim!=null)
buf=new StringBuffer(soyIsim);
else
buf=new StringBuffer(15);
va
[Link](15);
[Link]([Link]());
[Link](hesaptakiPara);
}
import [Link].*;
import [Link].*;
import [Link].*;
ww
import Kayit;
196
197
try{
girdi = new RandomAccessFile("[Link]","rw");
m
for(int i=0;i<100;i++)
{ [Link](girdi); }
} catch(IOException e)
{
[Link]("Dosya acma hatasi\n"+[Link]());
[Link](1);
}
o
}
i.c
RaslantisalUlasimDosyasiYarat H=
new RaslantisalUlasimDosyasiYarat();
}
}
import [Link].*;
import
import
import
[Link].*;
[Link].*;
Kayit;
dil
public class RaslantisalUlasimDosyasiYaz extends Frame implements
ActionListener
{
private TextField hesapAlani,isimAlani,soyisimAlani,hesaptakiParaAlani;
va
private Button birsonraki,kapat;
private RandomAccessFile girdi;
private Kayit hesapDosyasi;
public RaslantisalUlasimDosyasiYaz()
{
super("Tesadufi ulasim dosyasina yaz");
hesapDosyasi=new Kayit();
try{
ja
girdi=new RandomAccessFile("[Link]","rw");
} catch(IOException e)
{
[Link]("Dosya acma hatasi\n"+[Link]());
[Link](1);
}
setSize(300,150);
w.
setLayout(new GridLayout(5,2));
add(new Label("Hesap numarasi:"));
hesapAlani=new TextField();
add(hesapAlani);
add(new Label("isim : "));
isimAlani=new TextField(20);
add(isimAlani);
ww
197
198
kapat=new Button("cikis");
[Link](this);
m
add(kapat);
setVisible(true);
}
o
Double d;
if(![Link]().equals(""))
{
try{
i.c
accountNumber=[Link]([Link]());
if(accountNumber>0 && accountNumber <=100)
{
[Link](accountNumber);
[Link]([Link]());
[Link]([Link]());
d=new Double([Link]());
[Link]([Link]());
dil
[Link]((long)(accountNumber-1)*[Link]());
[Link](girdi);
}
[Link]("");
[Link]("");
[Link]("");
[Link]("");
}
catch(NumberFormatException nfe)
va
{
[Link]("Hesap numarasi tamsayi degisken olamalidir");
}
catch(IOException io)
{
[Link]("Dosyaya yazarken hata olustu\n"+[Link]());
[Link](1);
}
ja
}
}
public void actionPerformed(ActionEvent e)
{
addKayit();
if([Link]()==kapat)
w.
{
try{ [Link]();}
catch(IOException io)
{
[Link]("Dosya kapatilamadi\n"+[Link]());
}
[Link](0);
}
ww
}
public static void main(String args[])
{
new RaslantisalUlasimDosyasiYaz();
}
}
198
199
o m
i.c
10.4.3 [Link] dosyası ve Frame çıktısı
import
import
import
import
[Link].*;
[Link].*;
[Link].*;
Kayit; dil
public class RaslantisalUlasimDosyasiOku extends Frame implements
ActionListener
va
{
private TextField hesapAlani,isimAlani,soyisimAlani,hesaptakiParaAlani;
private Button birsonraki,kapat;
private RandomAccessFile girdi;
private Kayit hesapDosyasi;
public RaslantisalUlasimDosyasiOku()
{
super("Musteri dosyasini oku");
ja
try{
girdi=new RandomAccessFile("[Link]","r");
} catch(IOException e)
{ [Link]("Dosya acilamadi\n"+[Link]());
[Link](1);
}
w.
hesapDosyasi=new Kayit();
setSize(300,150);
setLayout(new GridLayout(5,2));
add(new Label("Hesap numarasi :"));
hesapAlani=new TextField();
add(hesapAlani);
add(new Label("isim : "));
isimAlani=new TextField(20);
ww
add(isimAlani);
add(new Label("soyisim : "));
soyisimAlani=new TextField(20);
add(soyisimAlani);
add(new Label("Hesaptaki para : "));
hesaptakiParaAlani=new TextField(20);
add(hesaptakiParaAlani);
birsonraki=new Button("bir sonraki hesap");
[Link](this);
199
200
add(birsonraki);
kapat=new Button("cikis");
m
[Link](this);
add(kapat);
setVisible(true);
}
o
int hesap;
String ilk,son;
double balance;
{
i.c
try{
do{
[Link](girdi);
} while([Link]()==0);
[Link]([Link]([Link]()));
[Link]([Link]([Link]()));
[Link]([Link]([Link]()));
dil
[Link]([Link]([Link]()))
;
}
catch(EOFException eof)
{
closeFile();
}
catch(IOException io)
{
va
[Link]("Dosyay okurken hata olustu\n"+[Link]());
[Link](1);
}
}
}
if([Link]()==birsonraki)
okuKayit();
else
closeFile();
}
w.
200
201
o m
i.c
10.4.4 [Link] dosyası ve Frame çıktısı
Yukardaki proğramın ilginç bir yönü de Applet yerine Frame sınıfını kullanmış olmasıdır.
dil
Frame sadece yerel bilgisayarda kullanılabilen grafik ortamı programlamasıdır. Temel olarak
applet yapılarında kullanılan her yapı Frame de de kullanılabilir. Yalnız frame main
programdan başlatılır. Html dosyasından başlatılmaz. Sadece yerel bilgisayarda geçerli bir
programlama türüdür.
ja va
w.
ww
201
202
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([Link]);
YaziPaneli=new Panel();
[Link](new Font("Serif",[Link],12));
[Link]( 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);
[Link](this);
[Link](addBtn);
[Link](this);
[Link](removeBtn);
[Link](this);
[Link](firstBtn);
[Link](this);
dil
[Link](lastBtn);
[Link](this);
[Link](emptyBtn);
[Link](this);
[Link](containsBtn);
[Link](this);
[Link](locationBtn);
[Link](this);
[Link](trimBtn);
va
[Link](this);
[Link](statsBtn);
[Link](this);
[Link](displayBtn);
add(YaziPaneli);
}
{
if([Link]()==addBtn)
{ [Link]([Link]());
showStatus("Listenin sonuna eklendi: "+[Link]()); }
else if([Link]()==removeBtn)
{ if([Link]([Link]()))
w.
showStatus("Silindi :"+[Link]());
else
showStatus([Link]()+"not in vector");
}
else if([Link]() == firstBtn)
{
try{
showStatus("Ilk eleman : "+[Link]());
ww
}
catch(NoSuchElementException exception)
{
showStatus([Link]() );
}
}
else if([Link]()==lastBtn)
{ try{
showStatus("Son eleman : "+[Link]());
205
206
}
catch(NoSuchElementException exception)
m
{ showStatus([Link]() );}
}
else if([Link]() == emptyBtn)
{
showStatus([Link]()? "Vector bos ":"vector dolu ");
}
else if([Link]()==containsBtn)
o
{
String searchKey = [Link]();
if([Link](searchKey) )
i.c
showStatus("Vektor elemanlari " +searchKey);
else
showStatus("Aranan eleman Vektorde bulunamadi "+searchKey);
}
else if([Link]()==locationBtn)
{ showStatus("Eleman "+[Link]([Link]() )+" pozisyonunda
bulundu");
}
dil
else if([Link]()==trimBtn)
{ [Link]();
showStatus("Vector boyu eleman boyuna k salt ld ");
}
else if([Link]()== statsBtn)
{
showStatus("Boyut = "+[Link]()+"; Toplam kapasite =
"+[Link]());
}
va
else if([Link]()== displayBtn) {
Enumeration enum=[Link]();
StringBuffer buf = new StringBuffer();
while([Link]())
{
[Link]([Link]() );
[Link](" ");
}
ja
showStatus([Link]() );
}
[Link]("");
}
}
w.
ww
206
207
o m
i.c
Şekil 11.1.1 [Link] programı ve applet çıktısı
dil
Kümelerin kaç elemandan oluştuğu tanımlanmamıştır. İşlemler vector sınıfını kullanarak
yapılmaktadır. Ayrıca bu yapıda vector sınıfını bir döngü içinde kullanmak için vector sınıfı
Enumeration sınıfına yüklenmektedir.
Enumeration n1=[Link]();
Enumeration n2=[Link]();
while([Link]())
{
va
s1=(String)[Link]();
[Link](s1);
}
sınıftır.
// Bu program vector ve Enumeration siniflarını// Kullanmaktadır. Bilesim,
kesisim kümelerini hesaplar// Ayni zamanda StringTokaniser sınıfını
kullanır.
import [Link].*;
w.
import [Link].*;
import [Link];
import [Link].*;
class SetA
{
public Vector bilesim(Vector list1, Vector list2)
ww
{
Vector bilesimVectoru = new Vector();
String s1,s2;
Enumeration n1=[Link]();
Enumeration n2=[Link]();
while([Link]())
{
s1=(String)[Link]();
[Link](s1);
}
207
208
while([Link]())
{
m
s2=(String)[Link]();
if()
[Link](s2);
}
return bilesimVectoru;
}
o
public Vector kesisim(Vector list1,Vector list2)
{
Vector kesisimVectoru = new Vector();
String s;
i.c
Enumeration n = [Link]();
while([Link]())
{
s=(String)[Link]();
if([Link](s))
[Link](s);
}
return kesisimVectoru;
dil
}
}
Vector ansUn;
Vector ansInt;
add(T1);
[Link](this);
add(P2);
add(T2);
[Link](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([Link]()) {
String test = [Link]();
[Link](test);
}
o
}
i.c
Enumeration enum = [Link]();
while([Link]())
{
String ans = (String)[Link]();
[Link](ans + "\n");
}
}
dil
public void actionPerformed(ActionEvent e)
{
if([Link]()==T1)
{
String stringToTokenize = [Link]();
girdiA(stringToTokenize,list1);
}
else if([Link]()==T2)
{
va
String stringToTokenize = [Link]();
girdiA(stringToTokenize,list2);
// Iki listenin bilesim ve kesisim k melerini hesapla.
ansUn = [Link](list1,list2);
ansInt = [Link](list1,list2);
// sonuclari cikti alanina gonder
[Link]("\nIki listenin bilesim kumesi : \n");
ciktiA(ansUn);
ja
209
210
o m
i.c
dil
Şekil 11.1.2 Vector sınıfını kullanarak iki kumenin bileşim ve kesişim kümelerini
hesaplayan [Link] programı ve applet çıktısı
va
JAVA PROGRAMLAMA DİLİ
HAFTA 14
Hafta 13 dosyaları :
Bu haftaki dosyalar
w.
ALISTIRMA 1
ww
Hafta 13 dosyaları ve [Link] programını inceleyiniz. [Link] runnable interface’i ile yazılmıştır (implements
Runnable). Aynı programın abstract Tread ile (extends Threat) yazılmış şeklini oluşturunuz. Saati gösteren bu
programın niçin threat olarak yazılması gerektiğini izah ediniz.
ALIŞTIRMA 2
[Link] programını inceleyiniz. Kesişim kumesiyle bileşim kumesinin farkını oluşturan kümeyi hesaplayan
bir metod yazınız ve test programına da ekleyerek çalıştırınız.
210
211
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 [Link].*;
import complex;
n=[Link]();
}
return s;
}
212
213
String b;
b="";
m
n=[Link];
m=left[0].length;
for(int i=0;i<n;i++)
{
for(int j=0;j<m;j++)
{
b=b+toString(left[i][j]);
o
}
b=b+"\n";
}
return b;
i.c
}
dil
n=[Link];
m=left[0].length;
for(int i=0;i<n;i++)
{
for(int j=0;j<m;j++)
{
b=b+left[i][j].toString()+"\t";
}
b=b+"\n";
va
}
return b;
}
int n,m;
String b;
b="";
n=[Link];
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=[Link];
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=[Link];
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=[Link];
for(int i=0;i<n;i++)
{
b=b+toString(left[i]);
va
}
b=b+"\n";
return b;
}
public static String toString(int[] left)
{
// returns a horizontal string representation
// of a integer vector
ja
int n,m;
String b;
b="";
n=[Link];
for(int i=0;i<n;i++)
{
w.
b=b+left[i]+"\t";
}
b=b+"\n";
return b;
}
214
215
m
public static double[][] inv(double[][] a)
{
// INVERSION OF A MATRIX
// inversion by using gaussian elimination
// with full pivoting
int n=[Link];
o
int m=a[0].length;
double b[][];
b=new double[n][n];
int indxc[];
i.c
int indxr[];
double ipiv[];
indxc=new int[n];
indxr=new int[n];
ipiv=new double[n];
int i,j,k,l,ll,ii,jj;
int icol=0;
int irow=0;
dil
double big,dum,pivinv,temp;
if(n!=m)
{
[Link]("Matrix must be square ");
for(ii=0;ii<n;ii++)
for(jj=0;jj<n;jj++)
b[ii][jj]=0.0;
return b;
}
va
for(i=0;i<n;i++)
for(j=0;j<n;j++)
b[i][j]=a[i][j];
for(i=0;i<n;i++)
{
big=0.0;
for(j=0;j<n;j++)
{
ja
if(ipiv[j] != 1)
for(k=0;k<n;k++)
{
if(ipiv[k] == 0)
{
if([Link](b[j][k]) >= big)
w.
{
big=[Link](b[j][k]);
irow=j;
icol=k;
}
}
else if(ipiv[k] > 1 )
{
ww
215
216
++ ipiv[icol];
if(irow != icol)
m
for(l=0;l<n;l++)
{
temp=b[irow][l];
b[irow][l]=b[icol][l];
b[icol][l]=temp;
}
indxr[i]=irow;
o
indxc[i]=icol;
if(b[icol][icol] == 0.0)
{
[Link]("error : inverse of the matrix : singular matrix-
i.c
2");
for(ii=0;ii<n;ii++)
for(jj=0;jj<n;jj++)
b[ii][jj]=0.0;
return b;
}
pivinv=1.0/b[icol][icol];
b[icol][icol]=1.0;
dil
for(l=0;l<n;l++) b[icol][l] *=pivinv;
for(ll=0;ll<n;ll++)
if(ll != icol)
{
dum=b[ll][icol];
b[ll][icol]=0.0;
for(l=0;l<n;l++) b[ll][l]-= b[icol][l]*dum;
}
}
va
for(l=n-1;l>=0;l--)
{
if(indxr[l] != indxc[l])
for(k=0;k<n;k++)
{
temp=b[k][indxc[l]];
b[k][indxc[l]]=b[k][indxr[l]];
b[k][indxr[l]]=temp;
ja
}
}
return b;
}
{
//inverse of a matrix
//this method enable usage of inv or inverse as
//name of mtrix inversion method
return [Link](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([Link](a[i-1][j-1])>big) big=[Link](a[i-1][j-1]);
}
if(big==0) {[Link]("singular matrix");return a;}
vv[i-1]=1.0/big;
}
dil
for(j=1;j<=n;j++)
{
for(i=1;i<j;i++)
{
sum=a[i-1][j-1];
for(k=1;k<i;k++)
{
sum-=a[i-1][k-1]*a[k-1][j-1];
}
va
a[i-1][j-1]=sum;
}
big=0;
for(i=j;i<=n;i++)
{
sum=a[i-1][j-1];
for(k=1;k<j;k++)
{
ja
sum-=a[i-1][k-1]*a[k-1][j-1];
}
a[i-1][j-1]=sum;
dum=vv[i-1]*[Link](sum);
if(dum>=big)
{
w.
imax=i;
big=dum;
}
} //end of i=0
if(j != imax)
{
for(k=1;k<=n;k++)
{
ww
dum=a[imax-1][k-1];
a[imax-1][k-1]=a[j-1][k-1];
a[j-1][k-1]=dum;
}
d[0]=-d[0];
vv[imax-1]=vv[j-1];
} //end of if
indx[j-1]=imax;
if(a[j-1][j-1]==0) a[j-1][j-1]=tiny;
217
218
if(j!=n)
{
m
dum=1.0/a[j-1][j-1];
for(i=j+1;i<=n;i++)
a[i-1][j-1]*=dum;
}//endif
} //end for j=
return a;
}
o
public static double[] LUaxb(double a[][],double x[],int indx[])
{
i.c
//solves AX=B system of linear equation of LU decomposed matrix a
//(calculated by method LU)
int ii=0;
int i,j,ll=0;
double sum=0;
int n=[Link];
double b[];
b=new double[n];
dil
for(i=1;i<=n;i++)
{
b[i-1]=x[i-1];
}
for(i=1;i<=n;i++)
{
ll=indx[i-1];
sum=b[ll-1];
b[ll-1]=b[i-1];
va
if(ii!=0)
{
for(j=ii;j<=(i-1);j++)
{
sum-=a[i-1][j-1]*b[j-1];
}
}
else if(sum!=0) ii=i;
ja
b[i-1]=sum;
}
for(i=n;i>=1;i--)
{
sum=b[i-1];
if(i<n)
w.
{
for(j=(i+1);j<=n;j++)
{
sum-=a[i-1][j-1]*b[j-1];
}
}
b[i-1]=sum/a[i-1][i-1];
}
ww
return b;
}
218
219
int d[]={1};
int indx[]=new int[n];
m
double e[][]=new double[n][n];
e=[Link](a,indx,d);
c=[Link](e,b,indx);
return c;
} //end of AXB
o
{
//inverse of a matrix by using LU decomposition method
//this method is more efficient than inv (or inverse)
int n=[Link];
i.c
double c[][]=new double[n][n];
double b[][]=Matrix.I(n);
int d[]={0};
int indx[]=new int[n];
double e[][]=new double[n][n];
e=[Link](a,indx,d);
for(int i=0;i<n;i++)
{
dil
c[i]=[Link](e,b[i],indx);
}
return Matrix.T(c);
} //end of LUinv
return e;
} //end of det
return [Link](a);
}
219
220
int n2=[Link];
double[][] b;
m
b=new double[m1][n2];
if(n1 != m2)
{
[Link]("inner matrix dimensions must agree");
for(ii=0;ii<n1;ii++)
{
for(jj=0;jj<m2;jj++)
o
b[ii][jj]=0;
}
return b;
}
i.c
for(i=0;i<m1;i++)
{
for(j=0;j<n2;j++)
{
for(k=0;k<n1;k++)
b[i][j]+=left[i][k]*right[k][j];
}
}
dil
return b;
//end of multiply of two matrices
}
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)
{
[Link]("inner matrix dimensions must agree");
for(ii=0;ii<n2;ii++)
{
b[ii]=0;
}
o
return b;
}
for(i=0;i<m2;i++)
{
i.c
b[i]=0;
for(k=0;k<m1;k++)
b[i]+=right[i][k]*left[k];
}
return b;
//end of multiply of a vector and a matrix
}
dil
public static double[][] multiply(double left,double[][] right)
{
//multiplying a matrix with a constant
int i,j;
int n=[Link];
int m=right[0].length;
double b[][];
b=new double[n][m];
for(i=0;i<n;i++)
va
{
for(j=0;j<m;j++)
b[i][j]=right[i][j]*left;
}
return b;
//end of multiplying a matrix with a constant double
}
ja
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=[Link];
i.c
double b[];
b=new double[n];
for(i=0;i<n;i++)
{
b[i]=right*left[i];
}
return b;
}
dil
//*************** end of multiply methods definitions **************
//=============== defination of power methods pow ==============
public static double[][] pow(double[][] right,double left)
{
// power of a matrix
int i,j;
double b[][];
int n=[Link];
int m=right[0].length;
va
b=new double[n][m];
for(i=0;i<n;i++)
{
for(j=0;j<m;j++)
{
if(left==0.0)
{
b[i][j]=1.0;
ja
}
else
{
b[i][j]=[Link](right[i][j],left);
}
}
w.
}
return b;
//end of power of a matrix
}
int i;
int n=[Link];
double b[];
b=new double[n];
for(i=0;i<n;i++)
{
if(left==0.0)
{
b[i]=1.0;
222
223
}
else
m
{
b[i]=[Link](right[i],left);
}
}
return b;
//end of power of a vector
}
o
//=================end of power method pow definitions =============
//***************** addition add methods **************************
i.c
public static double[][] add(double[][] left,double[][] right)
{
//addition of two matrices
int n1=[Link];
int m1=left[0].length;
int n2=[Link];
int m2=right[0].length;
int nMax,mMax;
dil
int i,j;
if(m1>=m2) mMax=m1;
else mMax=m2;
if(n1>=n2) nMax=n1;
else nMax=n2;
double b[][];
b=new double[nMax][mMax];
for(i=0;i<n1;i++)
{
va
for(j=0;j<m1;j++)
{
b[i][j]=b[i][j]+left[i][j];
}
}
for(i=0;i<n2;i++)
{
for(j=0;j<m2;j++)
ja
{
b[i][j]=b[i][j]+right[i][j];
}
}
return b;
//end of matrix addition method
w.
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=[Link];
int m1=left[0].length;
i.c
int n2=[Link];
int m2=right[0].length;
int nMax,mMax;
int i,j;
if(m1>=m2) mMax=m1;
else mMax=m2;
if(n1>=n2) nMax=n1;
else nMax=n2;
dil
double b[][];
b=new double[nMax][mMax];
for(i=0;i<n1;i++)
{
for(j=0;j<m1;j++)
{
b[i][j]=b[i][j]+left[i][j];
}
}
va
for(i=0;i<n2;i++)
{
for(j=0;j<m2;j++)
{
b[i][j]=b[i][j]-right[i][j];
}
}
return b;
ja
int n1=[Link];
int n2=[Link];
int nMax;
int i;
if(n1>=n2) nMax=n1;
else nMax=n2;
double b[];
b=new double[nMax];
ww
for(i=0;i<n1;i++)
{
b[i]=b[i]+left[i];
}
for(i=0;i<n2;i++)
{
b[i]=b[i]-right[i];
}
return b;
224
225
m
//============== division of the matrices
public static double[][] divide(double[][] left,double[][] right)
{
//division of two matrices
int n=[Link];
int m=right[0].length;
o
double b[][];
b=new double[n][m];
b=[Link]([Link](right),left);
return b;
i.c
}
dil
b=new double[n][m];
b=[Link]([Link](right),left);
return b;
}
int n=[Link];
int m=left[0].length;
double b=0;
for(i=0;i<n;i++)
for(j=0;j<m;j++)
{
b=b+[Link](left[i][j]);
}
return b;
225
226
m
public static double abs(double[] left)
{
// absolute value of a vector
int i;
int n=[Link];
double b=0;
for(i=0;i<n;i++)
o
{
b=b+[Link](left[i]);
}
return b;
i.c
}
//===============special matrices==============================
public static double[][] Transpose(double [][] left)
{
//transpose matrix (if A=a(i,j) Transpose(A)=a(j,i)
int i,j;
int n=[Link];
dil
int m=left[0].length;
double b[][];
b=new double[m][n];
for(i=0;i<n;i++)
{
for(j=0;j<m;j++)
{
b[j][i]=left[i][j];
}
va
}
return b;
}
int n=[Link];
int m=left[0].length;
double b[][];
b=new double[m][n];
for(i=0;i<n;i++)
{
w.
for(j=0;j<m;j++)
{
b[j][i]=left[i][j];
}
}
return b;
}
ww
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=[Link]-1;
int i;
double a[][]=new double[n][n];
for(i=0;i<n;i++)
ja
{
a[0][i]=-c[i+1]/c[0];
}
for(i=0;i<n-1;i++)
{
a[i+1][i]=1;
w.
}
return a;
}
227
228
a=new double[n][n];
f=1;
m
s=1;
for(i=1;i<=n;i++)
for(j=1;j<=n;j++)
a[i-1][j-1]=b[i-1][j-1];
while(last==0)
{
last=1;
o
for(i=1;i<=n;i++)
{
c=0;r=0;
for(j=1;j<=n;j++)
i.c
{
if(j != i)
{
c+=[Link](a[j-1][i-1]);
r+=[Link](a[i-1][j-1]);
} //end of if(j!=..
} //end of for(j=1...
if(c != 0 && r != 0 )
dil
{
g=r/radix;
f=1.0;
s=c+r;
while(c<g)
{
f*=radix;
c*=sqrdx;
}
va
g=r*radix;
while(c>g)
{
f/=radix;
c/=sqrdx;
}
} //end of if(c != 0 && ....
if( (c+r)/f < 0.95*s )
ja
{
last=0;
g=1.0/f;
for(j=1;j<=n;j++) { a[i-1][j-1]*=g; }
for(j=1;j<=n;j++) { a[j-1][i-1]*=f; }
} //end of if( ((c+r..
w.
}//end of for(i=1;i<=n....
} //end of while last==0
return a;
}
228
229
double x,y;
if(n>2)
m
{
for(m=2;m<=(n-1);m++)
{
x=0.0;
i=m;
for(j=m;j<=n;j++)
{
o
if([Link](a[j-1][m-2]) > [Link](x))
{
x=a[j-1][m-2];
i=j;
i.c
} //end of if([Link](..
}//end of for(j=m,j<=n...
if(i!=m)
{
for(j=(m-1);j<=n;j++)
{
y=a[i-1][j-1];
a[i-1][j-1]=a[m-1][j-1];
dil
a[m-1][j-1]=y;
}//end of for(j=(m-1)..
for(j=1;j<=n;j++)
{
y=a[j-1][i-1];
a[j-1][i-1]=a[j-1][m-1];
a[j-1][m-1]=y;
}//end of for(j=1;j<=n....
} //end of if(i!=m)
va
if(x != 0.0)
{
for(i=(m+1);i<=n;i++)
{
y=a[i-1][m-2];
if(y!=0.0)
{
y=y/x;
ja
a[i-1][m-2]=y;
for(j=m;j<=n;j++)
{
a[i-1][j-1]-=y*a[m-1][j-1];
}
for(j=1;j<=n;j++)
w.
{
a[j-1][m-1]+=y*a[j-1][i-1];
}
}//end of if(y!=0..
}//end of for(i=(m+1)...
} //end of if(x != 0.0...
}//end of for(m=2;m<=(n-1)..
}//end of Hessenberg
ww
for(i=1;i<=n;i++)
for(j=1;j<=n;j++)
{
if(i>(j+1)) a[i-1][j-1]=0;
}
return a;
}
229
230
{
//calculates eigenvalues of a Hessenberg matrix
m
int n=[Link];
double rm[][]=new double[2][n];
double a[][]=new double[n+1][n+1];
double wr[]=new double[n+1];
double wi[]=new double[n+1];
int nn,m,l,k,j,its,i,mmin;
double z,y,x,w,v,u,t,s,r=0,q=0,p=0,anorm;
o
for(i=0;i<n;i++)
for(j=0;j<n;j++)
a[i+1][j+1]=b[i][j];
anorm=[Link](a[1][1]);
i.c
for (i=2;i<=n;i++)
for (j=(i-1);j<=n;j++)
anorm += [Link](a[i][j]);
nn=n;
t=0.0;
while (nn >= 1) {
its=0;
do {
dil
for (l=nn;l>=2;l--) {
s=[Link](a[l-1][l-1])+[Link](a[l][l]);
if (s == 0.0) s=anorm;
if ((double)([Link](a[l][l-1]) + s) == s) break;
}
x=a[nn][nn];
if (l == nn) {
wr[nn]=x+t;
wi[nn--]=0.0;
va
}
else {
y=a[nn-1][nn-1];
w=a[nn][nn-1]*a[nn-1][nn];
if (l == (nn-1)) {
p=0.5*(y-x);
q=p*p+w;
z=[Link]([Link](q));
ja
x += t;
if (q >= 0.0) {
z=p+[Link](z,p);
wr[nn-1]=wr[nn]=x+z;
if (z!=0) wr[nn]=x-w/z;
wi[nn-1]=wi[nn]=0.0;
w.
}
else {
wr[nn-1]=wr[nn]=x+p;
wi[nn-1]= -(wi[nn]=z);
}
nn -= 2;
}
else {
ww
230
231
++its;
for (m=(nn-2);m>=l;m--) {
m
z=a[m][m];
r=x-z;
s=y-z;
p=(r*s-w)/a[m+1][m]+a[m][m+1];
q=a[m+1][m+1]-z-r-s;
r=a[m+2][m+1];
s=[Link](p)+[Link](q)+[Link](r);
o
p /= s;
q /= s;
r /= s;
if (m == l) break;
i.c
u=[Link](a[m][m-1])*([Link](q)+[Link](r));
v=[Link](p)*([Link](a[m-1][m-1])+
[Link](z)+[Link](a[m+1][m+1]));
if ((double)(u+v) == v) break;
}
for (i=m+2;i<=nn;i++) {
a[i][i-2]=0.0;
if (i != (m+2)) a[i][i-3]=0.0;
dil
}
for (k=m;k<=nn-1;k++) {
if (k != m) {
p=a[k][k-1];
q=a[k+1][k-1];
r=0.0;
if (k != (nn-1)) r=a[k+2][k-1];
if ((x=[Link](p)+[Link](q)+[Link](r)) != 0.0) {
p /= x;
va
q /= x;
r /= x;
}
}
if ((s=[Link]([Link](p*p+q*q+r*r),p)) != 0.0) {
if (k == m) {
if (l != m)
a[k][k-1] = -a[k][k-1];
ja
}
else
a[k][k-1] = -s*x;
p += s;
x=p/s;
y=q/s;
w.
z=r/s;
q /= p;
r /= p;
for (j=k;j<=nn;j++) {
p=a[k][j]+q*a[k+1][j];
if (k != (nn-1)) {
p += r*a[k+2][j];
a[k+2][j] -= p*z;
ww
}
a[k+1][j] -= p*y;
a[k][j] -= p*x;
}
mmin = nn<k+3 ? nn : k+3;
for (i=l;i<=mmin;i++) {
p=x*a[i][k]+y*a[i][k+1];
if (k != (nn-1)) {
p += z*a[i][k+2];
231
232
a[i][k+2] -= p*r;
}
m
a[i][k+1] -= p*q;
a[i][k] -= p;
}
}
}
}
}
o
} while (l < nn-1);
}
for(i=0;i<n;i++)
{
i.c
rm[0][i]=wr[i+1];
rm[1][i]=wi[i+1];
}
return rm;
} //end of QR
dil
// this routine input a matrix (non symetric or symmetric)
// and calculate eigen values
// method balance can be used prior to this method to balance
// the input matrix
int n=[Link];
double d[][]=new double[2][n];
d=[Link]([Link](b));
return d;
}
va
public static complex[] eigenValueC(double b[][])
{
// this routine input a matrix (non symetric or symmetric)
// and calculate eigen values
// method balance can be used prior to this method to balance
// the input matrix
//output eigenvalues will be in a vector of complex form
ja
int n=[Link];
double d[][]=new double[2][n];
d=[Link]([Link](b));
complex c[]=new complex[n];
for(int i=0;i<n;i++)
{
w.
c[i]=new complex(d[0][i],d[1][i]);
}
return c;
}
//roots of a polynomial
public static double[][] poly_roots(double c[])
{
ww
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=[Link]-1;
double a[][]=new double[n][n];
a=characteristic_matrix(c);
o
double d[][]=new double[2][n];
d=eigenValue(a);
complex e[]=new complex[n];
for(int i=0;i<n;i++)
i.c
e[i]=new complex(d[0][i],d[1][i]);
return e;
}
dil
// method balance is used to balance the matrix previous to
// actual calculations
int n=[Link];
double d[][]=new double[2][n];
d=[Link]([Link]([Link](b)));
return d;
}
h=scale=0.0;
if (l > 1) {
for (k=1;k<=l;k++)
scale += [Link](a[i-1][k-1]);
if (scale == 0.0)
e[i-1]=a[i-1][l-1];
else {
for (k=1;k<=l;k++) {
ww
a[i-1][k-1] /= scale;
h += a[i-1][k-1]*a[i-1][k-1];
}
f=a[i-1][l-1];
g=(f >= 0.0 ? -[Link](h) : [Link](h));
e[i-1]=scale*g;
h -= f*g;
a[i-1][l-1]=f-g;
f=0.0;
233
234
for (j=1;j<=l;j++) {
a[j-1][i-1]=a[i-1][j-1]/h;
m
g=0.0;
for (k=1;k<=j;k++)
g += a[j-1][k-1]*a[i-1][k-1];
for (k=j+1;k<=l;k++)
g += a[k-1][j-1]*a[i-1][k-1];
e[j-1]=g/h;
f += e[j-1]*a[i-1][j-1];
o
}
hh=f/(h+h);
for (j=1;j<=l;j++) {
f=a[i-1][j-1];
i.c
e[j-1]=g=e[j-1]-hh*f;
for (k=1;k<=j;k++)
a[j-1][k-1] -= (f*e[k-1]+g*a[i-1][k-
1]);
}
}
} else
e[i-1]=a[i-1][l-1];
dil
d[i-1]=h;
}
d[1-1]=0.0;
e[1-1]=0.0;
/* Contents of this loop can be omitted if eigenvectors not
wanted except for statement d[i-1]=a[i-1][i-1]; */
for (i=1;i<=n;i++) {
l=i-1;
if (d[i-1] != 0) {
va
for (j=1;j<=l;j++) {
g=0.0;
for (k=1;k<=l;k++)
g += a[i-1][k-1]*a[k-1][j-1];
for (k=1;k<=l;k++)
a[k-1][j-1] -= g*a[k-1][i-1];
}
}
ja
d[i-1]=a[i-1][i-1];
a[i-1][i-1]=1.0;
for (j=1;j<=l;j++) a[j-1][i-1]=a[i-1][j-1]=0.0;
}
return a;
}
w.
234
235
int m,l,iter,i,j,k;
double s,r,p,g,f,dd,c,b;
m
for (i=2;i<=n;i++) e[i-2]=e[i-1];
e[n-1]=0.0;
double z[][]=new double[n][n];
for(i=0;i<n;i++)
for(j=0;j<n;j++)
z[i][j]=a[i][j];
for (l=1;l<=n;l++) {
o
iter=0;
do {
for (m=l;m<=n-1;m++) {
dd=[Link](d[m-1])+[Link](d[m]);
i.c
if ((double)([Link](e[m-1])+dd) == dd) break;
}
if (m != l) {
if (iter++ == 30) [Link]("Too many iterations in
QL");
g=(d[l]-d[l-1])/(2.0*e[l-1]);
r=[Link](g,1.0);
g=d[m-1]-d[l-1]+e[l-1]/(g+[Link](r,g));
dil
s=c=1.0;
p=0.0;
for (i=m-1;i>=l;i--) {
f=s*e[i-1];
b=c*e[i-1];
e[i]=(r=[Link](f,g));
if (r == 0.0) {
d[i] -= p;
e[m-1]=0.0;
va
break;
}
s=f/r;
c=g/r;
g=d[i ]-p;
r=(d[i-1]-g)*s+2.0*c*b;
d[i ]=g+(p=s*r);
g=c*r-b;
ja
for (k=1;k<=n;k++) {
f=z[k-1][i ];
z[k-1][i ]=s*z[k-1][i-1]+c*f;
z[k-1][i-1]=c*z[k-1][i-1]-s*f;
}
}
w.
235
236
m
int n=[Link];
double sum[]=new double[n];;
double d[]=new double[n];
double b[][]=new double[n][n];
double e[]=new double[n];
double z[][]=new double[n+1][n];
b=tridiagonal(a,d,e);
o
b=QL(d,e,b);
for(j=0;j<n;j++)
{
z[0][j]=d[j];
i.c
for(i=0;i<n;i++)
{
z[i+1][j]=b[i][j]/b[0][j];
if(z[i+1][j]<1e-13) z[i+1][i]=0;
}
}
return z;
}
class Matrix3
{
public static void main(String args[]) throws IOException
{
ja
/*
double a[][];
a=new double[5][5];
a[0][0]=1;
a[0][1]=2;
a[0][2]=0;
w.
a[0][3]=0;
a[0][4]=0;
a[1][0]=-2;
a[1][1]=3;
a[1][2]=0;
a[1][3]=0;
a[1][4]=0;
a[2][0]=3;
ww
a[2][1]=4;
a[2][2]=50;
a[2][3]=0;
a[2][4]=0;
a[3][0]=-4;
a[3][1]=5;
a[3][2]=-60;
a[3][3]=7;
a[3][4]=0;
a[4][0]=-5;
236
237
a[4][1]=6;
a[4][2]=-70;
m
a[4][3]=8;
a[4][4]=-9;
*/
double c[][]=new double[5][5];
double a[][]={{1,2,0,0,0},{-2,3,0,0,0},{3,4,50,0,0},{-4,5,-60,7,0},
{-5,6,-70,8,-9}};
double b[]=new double[5];
o
int d[]=new int[1];
b[0]=1;
b[1]=0;
b[2]=0;
i.c
b[3]=0;
b[4]=0;
[Link]("Original Matrix : ");
[Link]([Link](a));
[Link]("Inverse Matrix : (Method inv) ");
[Link]([Link]([Link](a)));
[Link]("Matrix * Inverse Matrix : (Method multiply) ");
[Link]([Link]([Link](a,[Link](a))));
dil
[Link]("Solution of system of equation : ");
[Link]("with second side : ");
[Link]([Link](b));
[Link]([Link]([Link](b,a)));
int indx[]=new int[5];
d[0]=0;
c=[Link](a,indx,d);
[Link]("LU decomposed matrix : (Method LU) ");
[Link]([Link](c));
va
[Link]("Matrix inversion by LU decomposition : (Method
LUinv)");
[Link]([Link]([Link](a)));
[Link]("Matrix * Inverse Matrix (LU Decomposition) :");
[Link]([Link]([Link](a,[Link](a))));
}
}
ja
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 [Link].*;
import Numeric;
va
class Matrix4
{
public static void main(String args[]) throws IOException
{
//calculation of the roots of a polynomial (degree n)
double a[][];
a=new double[3][3];
ja
/*
double e[]=new double[4];
e[0]= -1;
e[1]= 8;
e[2]=-19;
e[3]= 12;
w.
*/
double e[]={-1,8,-19,12};
//e represents polynomial P(x)=-x^3+8*x^2-19*x+12
// indirect way calculate charecteristic matrix and then calculate
// eigenvalue of the characteristic matrix
// by using charecteristic_matrix and eigenValue
// (or eigenValueC or balancedEigenValue)
ww
238
239
m
[Link]([Link](Matrix.T([Link](a))))
;
complex c[]=new complex[5];
c=[Link](a);
[Link]("eigen values (Method eigenValueC)");
[Link]([Link](c));
//direct way use poly_roots (or poly_rootsC)
o
//poly_roots returns double matrix 2xn as complex value representation
//poly_rootsC returns complex vector solution as roots
[Link]("roots of polynomial (Method poly_roots)");
[Link]([Link](Matrix.T(Matrix.poly_roots(e))));
i.c
[Link]("roots of polynomial (Method poly_roots)");
[Link]([Link](Matrix.poly_rootsC(e)));
}
}
cözüm :
dil
Original polynomial :
-1.0 8.0 -19.0 12.0
Characteristic Matrix :
8.0 -19.0 12.0
1.0 0.0 0.0
0.0 1.0 0.0
0.9999999999999991
3. Determinant
import [Link].*;
import Numeric;
239
240
class Matrix5
{
m
public static void main(String args[]) throws IOException
{
//calculation of an inverse matrix
double a[][];
a=new double[2][2];
a[0][0]=1;
a[0][1]=2;
o
a[1][0]=3;
a[1][1]=4;
[Link]("Matrix : ");
[Link]([Link](a));
i.c
[Link]("Inverse Matrix : ");
[Link]([Link]([Link](a)));
[Link]("Matrix * Inverse Matrix :");
[Link]([Link]([Link](a,[Link](a))));
[Link]("Determinant = "+[Link](a));
}
}
dil
cözümü :
Matrix :
1.0 2.0
3.0 4.0
Inverse Matrix :
-2.0 1.0
1.5 -0.5
va
Matrix * Inverse Matrix :
1.0 0.0
0.0 1.0
Determinant = -2.0
4. Eigenvalue
ja
import [Link].*;
import Numeric;
class Matrix6
{
w.
[Link]([Link]([Link](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]=[Link](x[0]+x[1]*x[1]
// func(x) f[0][0], f[0][1]
// f[1][0], f[1][1]
// değerlerin iki boyutlu matrix olarak verir.
abstract double[][] func(double x[]);
w.
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 [Link].*;
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]+[Link](x[1]) f[0][1]=x[0]-x[1]
// f[1][0]=x[0]*x[0]-x[1] f[1][1]=[Link](x[0]+x[1]*x[1]
// func(x) returns the value of f[0][0], f[0][1]
o
// f[1][0], f[1][1]
// as a two dimensional matrix
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*[Link](r,i);
}
for(i=0;i<n;i++)
{
T[i][0]=( f_deriv.func(x + h[i]) - f_deriv.func( x - h[i]))/(2.0*h[i]);
ww
}
for(m=1;m<n;m++)
{
for(i=0;i<n-m;i++)
{
T[i][m]=(h[i]*h[i]*T[i+1][m-1] - h[i+m]*h[i+m]*T[i][m-1])/(h[i]*h[i]
- h[i+m]*h[i+m]);
}
}
243
244
double xx=T[0][n-1];
return xx;
m
}
o
// variables h0 and n
// function input should be in the form given in abstract class
// f_xi
i.c
double h0=0.0256;
int i,m;
int n=7;
double x1[];
x1=new double[[Link]];
double x2[];
x2=new double[[Link]];
for(i=0;i<[Link];i++)
dil
{
x1[i]=x[i];
x2[i]=x[i];
}
//derivative of a simple function
double T[][];
T=new double[n][n];
double h[];
h=new double[n];
va
//vector<double> h(n,0);
for(i=0;i<n;i++)
{
h[i]=0;
for(int j=0;j<n;j++)
T[i][j]=0;
}
h[0]=h0;
ja
double r=0.5;
for( i=1;i<n;i++)
{
h[i]=h0*[Link](r,i);
}
w.
for(i=0;i<n;i++)
{
x1[x_ref]+=h[i];
x2[x_ref]-=h[i];
T[i][0]=( f_deriv.func(x1,equation_ref) -
f_deriv.func(x2,equation_ref))/(2.0*h[i]);
x1[x_ref]=x[x_ref];
x2[x_ref]=x[x_ref];
ww
}
for(m=1;m<n;m++)
{
for(i=0;i<n-m;i++)
{
T[i][m]=(h[i]*h[i]*T[i+1][m-1] -
h[i+m]*h[i+m]*T[i][m-1])/(h[i]*h[i] - h[i+m]*h[i+m]);
}
}
244
245
double xx=T[0][n-1];
return xx;
m
}
o
// variables h0 and n
// function input should be in the form given in abstract class
// f_xi
double h0=0.0256;
i.c
int i,m;
int n=7;
double f1[];
f1=new double[[Link]];
double f2[];
f2=new double[[Link]];
double x1[];
x1=new double[[Link]];
dil
double x2[];
x2=new double[[Link]];
for(i=0;i<[Link];i++)
{
x1[i]=x[i];
x2[i]=x[i];
}
//derivative of a simple function
double T[][];
va
T=new double[n][n];
double h[];
h=new double[n];
//vector<double> h(n,0);
for(i=0;i<n;i++)
{
h[i]=0;
for(int j=0;j<n;j++)
ja
T[i][j]=0;
}
h[0]=h0;
double r=0.5;
for( i=1;i<n;i++)
{
w.
h[i]=h0*[Link](r,i);
}
for(i=0;i<n;i++)
{
x1[x_ref]+=h[i];
x2[x_ref]-=h[i];
f1=f_deriv.func(x1);
ww
f2=f_deriv.func(x2);
T[i][0]=( f1[equation_ref] - f2[equation_ref])/(2.0*h[i]);
x1[x_ref]=x[x_ref];
x2[x_ref]=x[x_ref];
}
for(m=1;m<n;m++)
{
for(i=0;i<n-m;i++)
{
245
246
T[i][m]=(h[i]*h[i]*T[i+1][m-1] - h[i+m]*h[i+m]*T[i][m-1])/(h[i]*h[i]
- h[i+m]*h[i+m]);
m
}
}
double xx=T[0][n-1];
return xx;
}
o
{
//integral of a function by using gauss-legendre quadrature
//
double s[],w[];
i.c
int i;
s=new double[30];
w=new double[30];
s[ 0] = .15532579626752470000E-02;
s[ 1] = .81659383601264120000E-02;
s[ 2] = .19989067515846230000E-01;
s[ 3] = .36899976285362850000E-01;
s[ 4] = .58719732103973630000E-01;
dil
s[ 5] = .85217118808615820000E-01;
s[ 6] = .11611128394758690000E+00;
s[ 7] = .15107475260334210000E+00;
s[ 8] = .18973690850537860000E+00;
s[ 9] = .23168792592899010000E+00;
s[10] = .27648311523095540000E+00;
s[11] = .32364763723456090000E+00;
s[12] = .37268153691605510000E+00;
s[13] = .42306504319570830000E+00;
va
s[14] = .47426407872234120000E+00;
s[15] = .52573592127765890000E+00;
s[16] = .57693495680429170000E+00;
s[17] = .62731846308394490000E+00;
s[18] = .67635236276543910000E+00;
s[19] = .72351688476904450000E+00;
s[20] = .76831207407100990000E+00;
s[21] = .81026309149462140000E+00;
ja
s[22] = .84892524739665800000E+00;
s[23] = .88388871605241310000E+00;
s[24] = .91478288119138420000E+00;
s[25] = .94128026789602640000E+00;
s[26] = .96310002371463720000E+00;
s[27] = .98001093248415370000E+00;
w.
s[28] = .99183406163987350000E+00;
s[29] = .99844674203732480000E+00;
w[ 0] = .39840962480827790000E-02;
w[ 1] = .92332341555455000000E-02;
w[ 2] = .14392353941661670000E-01;
w[ 3] = .19399596284813530000E-01;
w[ 4] = .24201336415292590000E-01;
w[ 5] = .28746578108808720000E-01;
ww
w[ 6] = .32987114941090080000E-01;
w[ 7] = .36877987368852570000E-01;
w[ 8] = .40377947614710090000E-01;
w[ 9] = .43449893600541500000E-01;
w[10] = .46061261118893050000E-01;
w[11] = .48184368587322120000E-01;
w[12] = .49796710293397640000E-01;
w[13] = .50881194874202750000E-01;
w[14] = .51426326446779420000E-01;
246
247
w[15] = .51426326446779420000E-01;
w[16] = .50881194874202750000E-01;
m
w[17] = .49796710293397640000E-01;
w[18] = .48184368587322120000E-01;
w[19] = .46061261118893050000E-01;
w[20] = .43449893600541500000E-01;
w[21] = .40377947614710090000E-01;
w[22] = .36877987368852570000E-01;
w[23] = .32987114941090080000E-01;
o
w[24] = .28746578108808720000E-01;
w[25] = .24201336415292590000E-01;
w[26] = .19399596284813530000E-01;
w[27] = .14392353941661670000E-01;
i.c
w[28] = .92332341555455000000E-02;
w[29] = .39840962480827790000E-02;
int n=30;
double z=0;
double x,y;
for(i=0;i<n;i++)
{
x=(b+a)/2.0+(b-a)/2.0*s[i];
dil
y=f_xnt.func(x);
z+=(b-a)/2*w[i]*y;
}
for(i=0;i<n;i++)
{
x=(b+a)/2.0+(b-a)/2.0*(-s[i]);
y=f_xnt.func(x);
z+=(b-a)/2.0*w[i]*y;
}
va
return z;
}
public static void trap(f_x ff,double a,double h, int j,int m,double R[][])
{
// successive trapezoidal integration rule
// this program will be utilised in romberg integration
ja
double sum=0;
int p;
for(p=1;p<=m;p++)
{ sum+=[Link](a+h*(2*p-1)); }
R[j][0]=R[j-1][0]/2.0+h*sum;
}
w.
double h=b-a;
double close=1;
double tol=1e-40;
int j=0,k=0;
double ret=0;
R[0][0]=h/2.0*([Link](a)+[Link](b));
do
{
j++;
247
248
h/=2.0;
[Link](ff,a,h,j,m,R);
m
m*=2;
for(k=1;k<=j;k++)
{
R[j][k]=R[j][k-1]+(R[j][k-1]-R[j-1][k-1])/([Link](4,k)-1.0);
close=[Link](R[j-1][j-1]-R[j][j]);
ret=R[j][k];
}
o
}while(close>tol && j<n);
return ret;
}
i.c
//==================================================
//Finding Non-linear Roots of Functions
dil
// required function and its derivative
int nmax=500;
double tolerance=1.0e-15;
double fx,dfx;
for(int i=0;i<nmax;i++)
{
fx=[Link](x);
dfx=[Link](x);
va
x-=fx/dfx;
if([Link](fx)<tolerance)
{
return x;
}
}
return x;
}
ja
int nmax=500;
double tolerance=1.0e-15;
double fx,dfx;
for(int i=0;i<nmax;i++)
{
fx=[Link](x);
ww
dfx=[Link](y,x);
x-=fx/dfx;
if([Link](fx)<tolerance)
{
return x;
}
}
return x;
}
248
249
m
public static double newton_2nd_derivative(double x,f_x y,f_x dy)
{
// Newton - Raphson type method for single equation
// includes 2nd order derivative calculations
//function and first order derivative is required
int nmax=500;
double dx=1e-3;
o
double x1m;
double tolerance=1.0e-15;
double fx,fxm,dfx,dfxm,d2fx;
for(int i=0;i<nmax;i++)
i.c
{
fx=[Link](x);
fxm=[Link](x-dx);
dfx=[Link](x);
dfxm=[Link](x-dx);
d2fx=-6.0/dx/dx*(fx-fxm)+2.0/dx*(2.0*dfx+dfxm);
x-=(fx/dfx+.5*fx*fx/(dfx*dfx*dfx)*d2fx);
if([Link](fx)<tolerance)
dil
{
return x;
}
}
return x;
}
double fx,fxm,dfx,dfxm,d2fx;
for(int i=0;i<nmax;i++)
{
fx=[Link](x);
fxm=[Link](x-dx);
dfx=[Link](y,x);
w.
dfxm=[Link](y,(x-dx));
d2fx=-6.0/dx/dx*(fx-fxm)+2.0/dx*(2.0*dfx+dfxm);
x-=(fx/dfx+.5*fx*fx/(dfx*dfx*dfx)*d2fx);
if([Link](fx)<tolerance)
{
return x;
}
}
ww
return x;
}
249
250
double dx=1.0e-3;
double dx1=2.0e-3;
m
double x1m;
double tolerance=1.0e-15;
double fx,fxm,fxm1,dfx,dfxm,d2fx;
for(int i=0;i<nmax;i++)
{
fx=[Link](x);
fxm=[Link](x-dx);
o
fxm1=[Link](x-dx1);
dfx=(fx-fxm)/dx;
dfxm=(fx-fxm1)/dx1;
d2fx=-6.0/dx/dx*(fx-fxm)+2.0/dx*(2.0*dfx+dfxm);
i.c
x-=(fx/dfx+.5*fx*fx/(dfx*dfx*dfx)*d2fx);
if([Link](fx)<tolerance)
{
return x;
}
}
return x;
}
double fxl,fxr;
int maxit=500,iter=0;
es=0.000001;
ea=1.1*es;
while((ea>es)&&(iter<maxit))
{
w.
xr=(xl+xu)/2.0;
iter++;
if((xl+xu)!=0)
{ ea=[Link]((xu-xl)/(xl+xu))*100;}
fxl= [Link](xl);
fxr= [Link](xr);
test= fxl*fxr;
if(test==0.0) ea=0;
ww
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=[Link];
i.c
double b[];
b=new double[n];
for(i=0;i<n;i++)
{
b[i]=1.0;
}
i=0;
while( i++ < nmax && [Link](b) > tolerance )
dil
{
b=[Link]([Link]([Link](x),[Link](x)),-ti);
x=[Link](x,b);
}
if(i >= nmax) [Link]("warning maximum number"+
" of iterations results may not be valid");
return x;
}
va
public static double[] newton( double x[],fi_xi y)
{
//solution of nonlinear system of equations
//by using newton raphson method.
//this function does not require derivatives
//it is utilised method derivative to calculate derivatives
double ti=1.0;
int i,ii,jj;
ja
int nmax=400;
double tolerance=1.0e-15;
int n=[Link];
double b[];
b=new double[n];
double dy[][];
w.
dy=new double[n][n];
i=0;
for(i=0;i<n;i++)
{
b[i]=1.0;
}
while( i++ < nmax && [Link](b) > tolerance )
{
ww
for(ii=0;ii<n;ii++)
{
for(jj=0;jj<n;jj++)
{
dy[ii][jj]=[Link](y,ii,x,jj);
}
}
b=[Link]([Link]([Link](x),dy),-ti);
x=[Link](x,b);
251
252
}
if(i >= nmax) [Link]("warning maximum number of iterations"+
m
" results may not be valid" );
return x;
}
o
public static double[] poly_least_square
(double xi[],double yi[],int n)
//polynomial least square curve fitting
i.c
//variables xi,yi vector of data points
//degree of curve fitting
{
//xi vector of independent variable
//yi vector of dependent variable
//n : degree of curve fitting
int l=[Link];
int i,j,k;
dil
int np1=n+1;
double A[][];
A=new double[np1][np1];
double B[];
B=new double[np1];
double X[];
X=new double[np1];
for(i=0;i<n+1;i++)
va
{
for(j=0;j<n+1;j++)
{
if(i==0 && j==0)
A[i][j]=l;
else
for(k=0;k<l;k++)
A[i][j] += [Link](xi[k],(i+j));
ja
}
for(k=0;k<l;k++)
{
if(i==0)
B[i]+= yi[k];
else
w.
B[i] += [Link](xi[k],i)*yi[k];
}
}
X=[Link](B,A);
//X=B/A;
double max=0;
for(i=0;i<n+1;i++)
ww
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=[Link];
int k;
double total=0;
for(k=0;k<n;k++)
{
dil
total+=(y[k]-f_least_square(e,x[k]))*(y[k]-f_least_square(e,x[k]));
}
total=[Link](total);
return total;
}
int n=[Link];
int mp2=n+2;
int mp1=n+1;
//matrix<double> p(m+2,n,0);
double p[][];
p=new double[mp2][n];
w.
//vector<double> gamma(m+1,0);
double gamma[];
gamma=new double[mp1];
//vector<double> beta(m+1,0);
double beta[];
beta=new double[mp1];
//vector<double> omega(m+1,0);
double omega[];
ww
omega=new double[mp1];
//vector<double> alpha(m+1,0);
double alpha[];
alpha=new double[mp1];
//vector<double> b(m+1,0);
double b[];
b=new double[mp1];
//vector<double> wi(n,1.);
double wi[];
253
254
wi=new double[n];
//matrix<double> a(3,m+1);
m
double a[][];
a=new double[3][mp1];
for(i=0;i<n;i++)
{
p[1][i]=1.0;
p[0][i]=0.0;
}
o
gamma[0]=0;
for(i=0;i<n;i++)
{
gamma[0]+=wi[i];
i.c
}
beta[0]=0.0;
for(j=0;j<m+1;j++)
{
omega[j]=0;
for(i=0;i<n;i++)
{
omega[j]+=wi[i]*fi[i]*p[j+1][i];
dil
}
b[j]=omega[j]/gamma[j];
if( j != m)
{
alpha[j+1]=0;
for(i=0;i<n;i++)
{
alpha[j+1]+=wi[i]*xi[i]*p[j+1][i]*p[j+1][i]/gamma[j];
}
va
for(i=0;i<n;i++)
{
p[j+2][i]=(xi[i]-alpha[j+1])*p[j+1][i]-beta[j]*p[j][i];
}
gamma[j+1]=0;
for(i=0;i<n;i++)
{
gamma[j+1]+=wi[i]*p[j+2][i]*p[j+2][i];
ja
}
beta[j+1]=gamma[j+1]/gamma[j];
}
}//end of j
for(j=0;j<m+1;j++)
{
w.
a[0][j]=b[j];
a[1][j]=alpha[j];
a[2][j]=beta[j];
}
return a;
}
double yy=0;
int k;
int m=a[0].length-1;
int mp2=m+2;
double q[];
q=new double[mp2];
//vector<double> q(m+2,0.0);
254
255
for(k=m-1;k>=0;k--)
{
m
q[k]=a[0][k]+(x-a[1][k+1])*q[k+1]-a[2][k+1]*q[k+2];
yy=q[k];
}
return yy;
}
//minimization of a function
o
public static double amotry(double p[][], double y[], double psum[], int
ndim,
f_xi ff, int ihi, double fac)
{
i.c
int j;
double fac1,fac2,ytry;
double ptry[]=new double[ndim];
fac1=(1.0-fac)/ndim;
fac2=fac1-fac;
for (j=1;j<=ndim;j++) ptry[j-1]=psum[j-1]*fac1-p[ihi-1][j-1]*fac2;
ytry=[Link](ptry,0);
if (ytry < y[ihi-1]) {
dil
y[ihi-1]=ytry;
for (j=1;j<=ndim;j++) {
psum[j-1] += ptry[j-1]-p[ihi-1][j-1];
p[ihi-1][j-1]=ptry[j-1];
}
}
return ytry;
}
va
public static void amoeba(double p[][], double y[], int ndim, double ftol,
f_xi ff, int nfunk)
{
int i,ihi,ilo,inhi,j,mpts=ndim+1;
int NMAX=5000;
double rtol,sum,swap,ysave,ytry;
double psum[]=new double[ndim];
ja
nfunk=0;
for (j=1;j<=ndim;j++)
{
for (sum=0.0,i=1;i<=mpts;i++) sum += p[i-1][j-1];
psum[j-1]=sum;
}
w.
for (;;) {
ilo=1;
//ihi = y[1]>y[2] ? (inhi=2,1) : (inhi=1,2);
if(y[0]>y[1])
{
inhi=2;
ihi=1;
}
ww
else
{
inhi=1;
ihi=2;
}
for (i=1;i<=mpts;i++) {
if (y[i-1] <= y[ilo-1]) ilo=i;
if (y[i-1] > y[ihi-1]) {
inhi=ihi;
255
256
ihi=i;
} else if (y[i-1] > y[inhi-1] && i != ihi) inhi=i;
m
}
rtol=2.0*[Link](y[ihi-1]-y[ilo-1])
/([Link](y[ihi-1])+[Link](y[ilo-1]));
if (rtol < ftol) {
swap=y[0];
y[0]=y[ilo-1];
y[ilo-1]=swap;
o
for (i=1;i<=ndim;i++)
{
swap=p[0][i-1];
p[0][i-1]=p[ilo-1][i-1];
i.c
p[ilo-1][i-1]=swap;
}
break;
}
if (nfunk >= NMAX) [Link]("NMAX exceeded");
nfunk += 2;
ytry=amotry(p,y,psum,ndim,ff,ihi,-1.0);
if (ytry <= y[ilo-1])
dil
ytry=amotry(p,y,psum,ndim,ff,ihi,2.0);
else if (ytry >= y[inhi-1]) {
ysave=y[ihi-1];
ytry=amotry(p,y,psum,ndim,ff,ihi,0.5);
if (ytry >= ysave) {
for (i=1;i<=mpts;i++) {
if (i != ilo) {
for (j=1;j<=ndim;j++)
psum[j-1]=0.5*(p[i-1][j-1]+p[ilo-
va
1][j-1]);
p[i-1][j-1]=psum[j-
1];
y[i]=[Link](psum,0);
}
}
nfunk += ndim;
for (j=1;j<=ndim;j++)
ja
{
for (sum=0.0,i=1;i<=mpts;i++) sum +=
p[i][j];
psum[j]=sum;
}
w.
}
} else --nfunk;
}
}
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*[Link](xi,0);
xi[0]=x+h/2.0;
xi[1]=fi[i]+k[0]/2;
i.c
k[1]=h*[Link](xi,0);
xi[1]=fi[i]+k[1]/2.0;
k[2]=h*[Link](xi,0);
xi[0]=x+h;
xi[1]=fi[i]+k[2];
k[3]=h*[Link](xi,0);
fi[i+1]=fi[i]+k[0]/6.0+k[1]/3.0+k[2]/3.0+k[3]/6.0;
}
dil
return fi;
}
{
for(j=1;j<=M;j++)
{
xi[0]=x;
xi[1]=fi[j-1][i];
k[0]=h*[Link](xi,j-1);
xi[0]=x+h/2.0;
xi[1]=fi[j-1][i]+k[0]/2;
ww
k[1]=h*[Link](xi,j-1);
xi[1]=fi[j-1][i]+k[1]/2.0;
k[2]=h*[Link](xi,j-1);
xi[0]=x+h;
xi[1]=fi[j-1][i]+k[2];
k[3]=h*[Link](xi,j-1);
fi[j-1][i+1]=fi[j-1][i]+k[0]/6.0+k[1]/3.0+k[2]/3.0+k[3]/6.0;
}
}
257
258
return fi;
}
m
public static double[][]
RKF45(f_xi fp,double x0,double xn,double f0,int N) throws IOException
{
// Runge Kutta - Fehlberg Method
// fp : derivative function df/dx(f,x) (defined as a class)
// Tol :Tolerance
o
//Hmax : maximum possible step size
//Hmin : minimum possible step size
//k : Runge kutta coefficients
//Err : error
i.c
//x[i] : input variable to fp = df/dx(f,x) = df/dx(x[i])
//j : actual step size
//fi[][]:solution matrix
//fj[][]:solution matrix in exact size(j) (return function)
double h=(xn-x0)/N;
double fi[][]=new double[2][1000];
double Tol=2.0e-3;
double Hmin=h/64.0;
dil
double Hmax=h*64.0;
double k[]=new double[6];
double Err;
double s;
double xi[]=new double[2];
int j=0;
fi[0][j]=x0;
fi[1][j]=f0;
while(fi[0][j] < xn )
va
{
if(fi[0][j]+h > xn) h=xn-fi[0][j];
xi[0]=fi[0][j];
xi[1]=fi[1][j];
k[0]=h*[Link](xi,0);
xi[0]=fi[0][j]+h/4.0;
xi[1]=fi[1][j]+k[0]/4.0;
k[1]=h*[Link](xi,0);
ja
xi[0]=fi[0][j]+3.0/8.0*h;
xi[1]=fi[1][j]+3.0/32.0*k[0]+9.0/32.0*k[1];
k[2]=h*[Link](xi,0);
xi[0]=fi[0][j]+12.0/13.0*h;
xi[1]=fi[1][j]+1932.0/2197.0*k[0]-7200.0/2197.0*k[1]+7296.0/2197.0*k[2];
k[3]=h*[Link](xi,0);
w.
xi[0]=fi[0][j]+h;
xi[1]=fi[1][j]+439.0/216.0*k[0]-8.0*k[1]+3680.0/513.0*k[2]-
845.0/4104.0*k[3];
k[4]=h*[Link](xi,0);
xi[0]=fi[0][j]+0.5*h;
xi[1]=fi[1][j]-8.0/27.0*k[0]+2.0*k[1]
-3544/2565*k[2]+1859.0/4104.0*k[3]-11.0/40.0*k[4];
k[5]=h*[Link](xi,0);
ww
Err=[Link](1.0/360.0*k[0]-128/4275*k[2]
-2197.0/75240*k[3]+1.0/5.0*k[4]+2.0/55.0*k[5]);
if(Err<Tol || h<2*Hmin)
{
fi[0][j+1]=fi[0][j]+h;
fi[1][j+1]=fi[1][j]+16.0/135.0*k[0]+6656.0/12825.0*k[2]+
28561.0/56430.0*k[3]-9.0/50.0*k[4]+2.0/55.0*k[5];
j++;
}
258
259
else
{
m
if(Err==0) s=0;
else s=0.84*([Link](Tol*h/Err,0.25));
if(s<0.75 && h>(2*Hmin) ) h/=2.0;
if(s>1.5 && Hmax >(2*h) ) h*=2.0;
}
}
double fj[][]=new double[2][j+1];
o
for(int i=0;i<=j;i++)
{
fj[0][i]=fi[0][i];
fj[1][i]=fi[1][i];
i.c
}
return fj;
}
dil
Numeric sınıfı örnek problemleri :
import [Link].*;
import Numeric;
import complex;
va
class f1 extends fi_xi
{
double[] func(double[] x)
{
double b[];
b=new double[2];
b[0]=x[0]*x[0]-x[1]-1;
b[1]=(x[0]-2)*(x[0]-2)+(x[1]-0.5)*(x[1]-0.5)-1.0;
ja
return b;
}
}
return b;
}
}
259
260
}
}
m
class df2 extends f_x
{
double func(double x)
{
return [Link](x)-0.5;
}
o
}
class Matrix2
i.c
{
public static void main(String args[]) throws IOException
{
//Solution of zero of functions of one or multivariable equations
f1 b1;
b1=new f1();
df1 db1;
db1=new df1();
dil
f2 b2;
b2=new f2();
df2 db2;
db2=new df2();
double x[];
x=new double[2];
x[0]=0;
x[1]=0.5;
double xx=2.5;
va
[Link]("Roots of equations : ");
[Link]("Newtons method y=f(x)=0 f(x) and df(x)/dx is
given");
[Link]("Newton y,dy x= "+[Link](xx,b2,db2));
[Link]("");
[Link]("Newtons method y=f(x)=0 f(x) is given");
[Link]("Newton y, x= "+[Link](xx,b2));
[Link]("");
ja
[Link]("");
[Link]("Newtons method for system of equations");
[Link]("yi=fi(xi)=0,i=0,n ");
[Link]("fi(xi) and dfi(xi)/dxj,i=1,n,j=1,n is given");
[Link](" "+[Link]([Link](x,b1,db1)));
[Link]("");
[Link]("Newtons method for system of equations");
[Link]("yi=fi(xi)=0,i=0,n ");
260
261
m
[Link](" "+[Link]([Link](x,b1)));
}
}
o
Çözüm seti :
Roots of equations :
Newtons method y=f(x)=0 f(x) and df(x)/dx is given
Newton y,dy x= 1.895494267033981
i.c
Newtons method y=f(x)=0 f(x) is given
Newton y, x= 1.895494267033981
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 [Link].*;
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;
[Link]("integral of class f1 : "+
[Link](b1,0.0,1.0));
[Link]("romberg integral of class f1 : "+
Numeric.integral_romberg(b1,0.0,1.0));
262
263
m
[Link]("Derivative of class f1 : "+
[Link](b1,1.0));
[Link]("Derivative of class f2 : "+
[Link](b2,1.0));
o
[Link]("Derivative of fm2,0 : "+
[Link](b4,1,x,0));
[Link]("Derivative of fm1,0 : "+
[Link](b3,1,x,0));
i.c
[Link]("Derivative of fm2,0 : "+
[Link](b4,1,x,0));
[Link]();
}
}
çözüm :
integral of class
integral of class
Derivative of class
Derivative of class
Derivative of fm1,0
Derivative of fm2,0
Derivative of fm1,0
:
:
:
dil
f1 : 0.333333333333329
romberg integral of class f1 : 0.3333333333333333
f2 : 0.49999999999999384
f1 : 1.9999999999994864
f2 : 0.9999999999998606
3.0000000000028932
3.0000000000028932
3.0000000000028932
va
Derivative of fm2,0 : 3.0000000000028932
//===========================================
// Polynomial least square curve fitting
// Dr. Turhan Coban
//===========================================
ja
import [Link].*;
import Numeric;
import Text;
w.
class least
{
public static void main(String args[]) throws IOException
{
//polynomial least square curve fitting
double e[]; //coefficients of polynomial least square
e=new double[20];
double xi[];
ww
xi=new double[500];
double yi[];
yi=new double[500];
DataInputStream cin=new DataInputStream([Link]);
[Link]("name of input file : ");
String in_name=[Link](cin);
[Link](" ");
DataInputStream fin=new DataInputStream(new FileInputStream(in_name));
PrintStream fout=new PrintStream(new FileOutputStream("[Link]"));
263
264
int i=-1;
try {
m
while(fin != null)
{
i++;
xi[i]=[Link](fin);
yi[i]=[Link](fin);
[Link](" "+xi[i]+" "+yi[i]);
}
o
} catch(EOFException e_eof) {[Link]("end of file"); }
[Link]("degree of curve fitting : ");
int n=[Link](cin);
e=Numeric.poly_least_square(xi,yi,n);
i.c
[Link]([Link](e));
[Link]([Link](e));
[Link]("least square error : "+[Link](xi,yi,e));
[Link]("would you like to send curve fitted data to a data
file (y/n) ");
char answer=[Link](cin);
if(answer=='y')
{
dil
[Link]("name of output file : ");
String out_name=[Link](cin);
PrintStream fout1=new PrintStream(new FileOutputStream(out_name));
double xmin,xmax;
[Link]("minimum x : ");
xmin=[Link](cin);
[Link]("maximum x : ");
xmax=[Link](cin);
[Link]("number of data points : ");
va
int n_data=[Link](cin);
double x;
for(i=0;i<n_data;i++)
{
x=xmin+(xmax-xmin)/(n_data-1.0)*i;
[Link](" "+x+" "+Numeric.f_least_square(e,x));
[Link](" "+x+" "+Numeric.f_least_square(e,x));
} //end of for
ja
}//end of if
}
}
4. Diferansiyel denklemler :
w.
//======================================================
// Numerical Analysis package in java
// example to show differential equation solution
// and differentiation (derivative) functions
// Dr. Turhan Coban
// =====================================================
ww
import [Link].*;
import Numeric;
import complex;
import Matrix;
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
[Link]([Link](Numeric.RK4(b3,0.0,1.0,1.0,50)));
}
}
1.0
1.02020134
1.0408107741377959
va
1.0618365464618167
1.0832870675613175
1.1051709179307265
1.1274968514019572
1.1502737986460576
1.1735108707455981
1.197217362839226
1.2214027578398445
ja
1.2460767302279048
1.271249149921327
1.2969300862235986
1.3231298118516308
1.3498588070449815
1.3771277637580916
w.
1.4049475899372086
1.4333294138837107
1.4622845887055762
1.4918246968587778
1.5219615547804188
1.5527072176154666
1.5840739840389706
1.6160744011756962
ww
1.648721269619143
1.682027648551951
1.7160068609697496
1.7506724990105325
1.7860384293916938
1.8221187989569014
1.8589280403350215
1.896480877713363
1.9347923327275491
265
266
1.9738777304703714
2.0137527056220317
m
2.0544332087042223
2.095935512460547
2.1382762183658373
2.1814722632669596
2.2255409261577848
2.270499835091013
2.3163669742296302
o
2.363160691040814
2.4108997036351645
2.4596031082541976
2.5092903869090972
i.c
2.5599814151737794
2.611696470135386
2.6644562385053905
2.7182818248945586
//======================================================
// Numerical Analysis package in java
// example to show differential equation solution
dil
// and differentiation (derivative) functions
// Dr. Turhan Coban
// =====================================================
import [Link].*;
import Numeric;
import complex;
import Matrix;
va
class fm1 extends f_xi
{
//multivariable function
double func(double x[],int x_ref)
{
//x[0] is x, x[1] is y
if(x_ref==0) return -2.0*x[0]-x[1];
else return 0;
ja
}
}
class dif2
{
w.
Cözüm :
0.0 -1.0
266
267
0.0050 -0.9950377826066799
0.01 -0.9901501844020889
m
0.015 -0.9853368332473136
0.02 -0.9805973588593618
0.025 -0.9759313928019077
0.030000000000000002-0.9713385684760812
0.035 -0.9668185211113052
0.04 -0.9623708877561767
0.045 -0.9579953072693951
o
0.049999999999999996-0.9536914203107341
0.05499999999999999-0.94945886933206
0.05999999999999999-0.9452972985683943
0.06499999999999999-0.9412063540290199
i.c
0.06999999999999999-0.9371856834886335
0.075 -0.9332349364785408
0.08 -0.9293537642778962
0.085 -0.9255418199049855
0.09000000000000001-0.9217987581085532
0.09500000000000001-0.9181242353591716
0.10000000000000002-0.9145179098406548
0.10500000000000002-0.9109794414415133
dil
0.11000000000000003-0.9075084917464531
0.11500000000000003-0.9041047240279163
0.12000000000000004-0.9007678032376644
0.12500000000000003-0.8974973959984025
0.13000000000000003-0.8942931705954467
0.13500000000000004-0.891154796968432
0.14000000000000004-0.8880819467030621
0.14500000000000005-0.8850742930228999
0.15000000000000005-0.8821315107811996
va
0.15500000000000005-0.8792532764527788
0.16000000000000006-0.8764392681259321
0.16500000000000006-0.8736891654943832
0.17000000000000007-0.8710026498492798
0.17500000000000007-0.8683794040712255
0.18000000000000008-0.8658191126223544
0.18500000000000008-0.8633214615384427
0.19000000000000009-0.8608861384210608
ja
0.1950000000000001-0.8585128324297647
0.2000000000000001-0.856201234274326
0.2050000000000001-0.8539510362070005
0.2100000000000001-0.8517619320148359
0.2150000000000001-0.849633617012017
0.2200000000000001-0.8475657880322502
w.
0.22500000000000012-0.8455581434211851
0.23000000000000012-0.843610383028874
0.23500000000000013-0.8417222082022695
0.24000000000000013-0.8398933217777589
0.24500000000000013-0.8381234280737365
0.2500000000000001-0.8364122328832122
0.2550000000000001-0.8347594434664576
0.2600000000000001-0.8331647685436885
ww
0.2650000000000001-0.8316279182877833
0.27000000000000013-0.8301486043170393
0.27500000000000013-0.8287265396879636
0.28000000000000014-0.8273614388881004
0.28500000000000014-0.8260530178288946
0.29000000000000015-0.8248009938385901
0.29500000000000015-0.8236050856551641
0.30000000000000016-0.8224650134192967
0.30500000000000016-0.8213804986673754
267
268
0.31000000000000016-0.8203512643245341
0.31500000000000017-0.8193770346977273
m
0.3200000000000002-0.8184575354688391
0.3250000000000002-0.8175924936878259
0.3300000000000002-0.8167816377658933
0.3350000000000002-0.8160246974687078
0.3400000000000002-0.8153214039096416
0.3450000000000002-0.8146714895430517
0.3500000000000002-0.8140746881575915
o
0.3550000000000002-0.8135307348695573
0.3600000000000002-0.8130393661162659
0.3650000000000002-0.812600319649468
0.3700000000000002-0.8122133345287916
i.c
0.3750000000000002-0.8118781511152201
0.3800000000000002-0.8115945110646018
0.38500000000000023-0.8113621573211925
0.39000000000000024-0.8111808341112298
0.39500000000000024-0.8110502869365394
0.4 -0.8109702625681743
//======================================================
dil
// Numerical Analysis package in java
// example to show differential equation solution
// and differentiation (derivative) functions
// Dr. Turhan Coban
// =====================================================
import [Link].*;
import Numeric;
import complex;
import Matrix;
va
class fm1 extends f_xi
{
//multivariable function
double func(double x[],int x_ref)
{
//x[0] is x, x[1] is y
if(x_ref==0) return -2.0*x[0]-x[1];
ja
else return 0;
}
}
class dif3
w.
{
public static void main(String args[]) throws IOException
{
Çözüm :
268
269
-1.0
m
-0.9960239680320001
-0.992095744511233
-0.9882151385858677
-0.9843819601659565
-0.9805960199203918
-0.9768571292738785
o
-0.9731651004039156
-0.9695197462377918
-0.9659208804495921
-0.9623683174572164
-0.9588618724194105
i.c
-0.955401361232808
-0.9519866005289858
-0.9486174076715289
-0.945293600753109
-0.942014998592574
-0.9387814207320486
-0.9355926874340476
-0.9324486196785992
dil
-0.9293490391603817
-0.9262937682858702
-0.9232826301704945
-0.9203154486358103
-0.9173920482066786
-0.9145122541084599
-0.9116758922642163
-0.9088827892919272
-0.9061327725017148
va
-0.903425669893081
-0.900761310152156
-0.898139522648956
-0.8955601374346547
-0.8930229852388627
-0.8905278974669202
-0.888074706197199
-0.8856632441784156
ja
-0.8832933448269559
-0.8809648422242088
-0.8786775711139124
-0.8764313668995095
-0.8742260656415141
-0.872061504054888
w.
-0.8699375195064296
-0.8678539500121697
-0.8658106342347813
-0.8638074114809979
-0.8618441216990421
-0.8599206054760645
-0.8580367040355941
-0.8561922592349969
ww
-0.854387113562946
-0.8526211101369017
-0.8508940927006006
-0.8492059056215563
-0.8475563938885688
-0.8459454031092447
-0.8443727795075264
-0.8428383699212321
-0.8413420217996048
269
270
-0.8398835832008722
-0.8384629027898148
m
-0.8370798298353451
-0.8357342142080957
-0.8344259063780173
-0.8331547574119857
-0.8319206189714199
-0.8307233433099079
-0.8295627832708429
o
-0.8284387922850687
-0.8273512243685349
-0.826299934119961
-0.8252847767185101
i.c
-0.8243056079214711
-0.8233622840619519
-0.8224546620465801
-0.8215825993532133
-0.8207459540286591
-0.8199445846864039
-0.8191783505043502
-0.8184471112225643
dil
-0.8177507271410314
-0.8170890591174206
-0.8164619685648588
-0.8158693174497131
-0.8153109682893825
-0.8147867841500976
-0.8142966286447304
-0.8138403659306118
-0.8134178607073579
va
-0.8130289782147054
-0.8126735842303556
-0.8123515450678265
-0.8120627275743135
-0.8118069991285605
-0.8115842276387357
-0.8113942815403203
-0.811237029794002
ja
-0.8111123418835786
-0.8110200878138704
-0.8109601381086393
w.
ww
270
271
m
EK A TEXT SINIFI
//============================================
// Numerical Analysis Package in Java
// Class Text to read data from screen or file
// and write (by using print) to screen or file
o
// formatted c printf like comand structure
// Dr. Turhan Coban
//============================================
import [Link].*;
import [Link].*;
i.c
class Text
{
/*
Text class by J M Bishop Aug 1996
Text book : Java gently, Addison Westley Longman 1997
ISBN 0-201-59399-8
provides simple input from the keyboard and files.
dil
Routines provided are:
public static void prompt(String s);
public static int readInt(DataInputStream in);
public static int readDouble (DataInputStreamin);
public static int readString (DataInputStream in);
public static int readChar (DataInputStream in);
----------------------------------------------------
Sample use :
va
--------- reading a double--------------
DataInputStream cin=new DataInputStream([Link]);
double number;
number=[Link](cin);
------ reading data from a file "[Link]"------
DataInputStream fin=new DataInputStream
(new FileInputStream("[Link]"));
double number;
number=[Link](fin);
ja
*/
public Text () {} ;
private static StringTokenizer T;
private static String S;
271
272
{
try {
m
String item = [Link]();
return [Link]([Link]()).intValue();
}
catch (NoSuchElementException e1) { refresh (in);
} catch(NumberFormatException e2)
{ [Link]("Error in number, try again.");}
}
o
}
i.c
IOException
{
if (T==null) refresh(in);
while (true)
{
try {
return [Link]().charAt(0);
}
dil
catch(NoSuchElementException e1) {refresh (in);}
}
}
again.");
}
}
}
IOException
{
if(T==null) refresh (in);
while (true) {
try {return [Link]();}
catch (NoSuchElementException e1) {
refresh (in);
}
ww
}
}
272
273
m
{ try
{ ch = [Link]();
if (ch < 0 || (char)ch == '\n' || (char)ch == '\0')
done = true;
else
r = r + (char) ch;
}
o
catch([Link] e)
{ done = true;
}
}
i.c
return [Link](0,([Link]()-1));
}
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 = [Link]();
int parse_state = 0;
ww
while (parse_state == 0)
{ if (i >= length) parse_state = 5;
else if ([Link](i) == '%')
{ if (i < length - 1)
{ if ([Link](i + 1) == '%')
274
275
m
}
else
parse_state = 1;
}
else throw new [Link]();
}
else
o
pre = pre + [Link](i);
i++;
}
while (parse_state == 1)
i.c
{ if (i >= length) parse_state = 5;
else if ([Link](i) == ' ') show_space = true;
else if ([Link](i) == '-') left_align = true;
else if ([Link](i) == '+') show_plus = true;
else if ([Link](i) == '0') leading_zeroes = true;
else if ([Link](i) == '#') alternate = true;
else { parse_state = 2; i--; }
i++;
dil
}
while (parse_state == 2)
{ if (i >= length) parse_state = 5;
else if ('0' <= [Link](i) && [Link](i) <= '9')
{ width = width * 10 + [Link](i) - '0';
i++;
}
else if ([Link](i) == '.')
{ parse_state = 3;
va
precision = 0;
i++;
}
else
parse_state = 4;
}
while (parse_state == 3)
{ if (i >= length) parse_state = 5;
ja
}
if (parse_state == 4)
{ if (i >= length) parse_state = 5;
else fmt = [Link](i);
i++;
}
if (i < length)
post = [Link](i, length);
ww
/**
* prints a formatted number following printf conventions
* @param s a PrintStream
* @param fmt the format string
* @param x the double to print
*/
275
276
m
}
/**
* prints a formatted number following printf conventions
* @param s a PrintStream
* @param fmt the format string
* @param x the long to print
o
*/
public static void print([Link] s, String fmt, long x)
{ [Link](new Text(fmt).form(x));
}
i.c
/**
* prints a formatted number following printf conventions
* @param s a PrintStream
* @param fmt the format string
* @param x the character to
*/
dil
public static void print([Link] s, String fmt, char x)
{ [Link](new Text(fmt).form(x));
}
/**
* prints a formatted number following printf conventions
* @param s a PrintStream, fmt the format string
* @param x a string that represents the digits to print
*/
va
public static void print([Link] s, String fmt, String x)
{ [Link](new Text(fmt).form(x));
}
/**
* Converts a string of digits (decimal, octal or hex) to an integer
* @param s a string
ja
/**
* 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 < [Link]() && [Link]([Link](i))) i++;
if (i < [Link]() && [Link](i) == '-') { sign = -1; i++; }
else if (i < [Link]() && [Link](i) == '+') { i++; }
i.c
while (i < [Link]())
{ char ch = [Link](i);
if ('0' <= ch && ch < '0' + base)
r = r * base + ch - '0';
else if ('A' <= ch && ch < 'A' + base - 10)
r = r * base + ch - 'A' + 10 ;
else if ('a' <= ch && ch < 'a' + base - 10)
r = r * base + ch - 'a' + 10 ;
dil
else
return r * sign;
i++;
}
return r * sign;
}
/**
* Converts a string of digits to an double
va
* @param s a string
*/
}
}
else if (ch == '.')
{ if (state == 0) state = 1;
else return sign * r;
}
else if (ch == 'e' || ch == 'E')
{ long e = (int)parseLong([Link](i + 1), 10);
return sign * r * [Link](10, e);
277
278
}
else return sign * r;
m
i++;
}
return sign * r;
}
/**
* Formats a double into a string (like sprintf in C)
o
* @param x the number to format
* @return the formatted string
* @exception IllegalArgumentException if bad argument
*/
i.c
public String form(double x)
{ String r;
if (precision < 0) precision = 6;
int s = 1;
if (x < 0) { x = -x; s = -1; }
if (fmt == 'f')
r = fixed_Text(x);
dil
else if (fmt == 'e' || fmt == 'E' || fmt == 'g' || fmt == 'G')
r = exp_Text(x);
else throw new [Link]();
/**
* 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 [Link]();
if (precision >= 0) s = [Link](0, precision);
return pad(s);
}
/**
dil
* a test stub for the format class
*/
279
280
m
[Link]([Link], "d = |%020d|\n", d);
[Link]([Link], "d = |%+20d|\n", d);
[Link]([Link], "d = |% 020d|\n", d);
[Link]([Link], "d = |%-20d|\n", d);
[Link]([Link], "d = |%20.8d|\n", d);
[Link]([Link], "d = |%x|\n", d);
[Link]([Link], "d = |%20X|\n", d);
o
[Link]([Link], "d = |%#20x|\n", d);
[Link]([Link], "d = |%020X|\n", d);
[Link]([Link], "d = |%20.8x|\n", d);
[Link]([Link], "d = |%o|\n", d);
i.c
[Link]([Link], "d = |%020o|\n", d);
[Link]([Link], "d = |%#20o|\n", d);
[Link]([Link], "d = |%#020o|\n", d);
[Link]([Link], "d = |%20.12o|\n", d);
}
dil
private static String repeat(char c, int n)
{ if (n <= 0) return "";
StringBuffer s = new StringBuffer(n);
for (int i = 0; i < n; i++) [Link](c);
return [Link]();
va
private static String convert(long x, int n, int m, String d)
{ if (x == 0) return "0";
String r = "";
while (x != 0)
{ r = [Link]((int)(x & m)) + r;
x = x >>> n;
}
return r;
ja
}
else
{ if (fmt == 'o' && alternate && [Link]() > 0 && [Link](0) !=
'0') p = "0";
else if (fmt == 'x' && alternate) p = "0x";
else if (fmt == 'X' && alternate) p = "0X";
}
int w = 0;
if (leading_zeroes)
280
281
w = width;
else if ((fmt == 'd' || fmt == 'i' || fmt == 'x' || fmt == 'X' || fmt
m
== 'o')
&& precision > 0) w = precision;
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 = [Link]([Link]() - precision, [Link]());
ja
{ int t = [Link]() - 1;
while (t >= 0 && [Link](t) == '0') t--;
if (t >= 0 && [Link](t) == '.') t--;
z = [Link](0, t + 1);
}
return z;
}
ww
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 [Link]
class [Link] (implements [Link],
[Link], [Link], [Link],
[Link], [Link], [Link],
[Link], [Link], [Link],
o
[Link])
interface [Link] (extends [Link])
interface [Link] (extends [Link])
interface [Link] (extends [Link])
interface [Link]
i.c
interface [Link] (extends [Link])
class [Link].Adler32 (implements [Link])
interface [Link]
interface [Link]
class [Link]
interface [Link]
interface [Link]
class [Link]
class [Link] (implements [Link], [Link])
dil
class [Link] (implements [Link])
class [Link] (implements [Link].LayoutManager2, [Link])
class [Link] (implements [Link], [Link])
interface [Link] (extends [Link])
class [Link].CRC32 (implements [Link])
class [Link] (implements [Link], [Link])
class [Link]
interface [Link] (extends [Link])
interface [Link] (extends [Link])
class [Link] (implements [Link].LayoutManager2, [Link])
va
interface [Link]
class [Link] (implements [Link])
interface [Link] (extends [Link])
class [Link] (implements [Link])
interface [Link] (extends [Link])
interface [Link] (extends [Link])
interface [Link]
interface [Link] (extends [Link])
ja
[Link])
class [Link]
class [Link]
class [Link] (implements [Link])
class [Link] (implements [Link])
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
283
284
class [Link]
class [Link]
m
class [Link] (implements [Link])
class [Link]
class [Link] (implements [Link])
class [Link] (implements [Link])
class [Link]
class [Link]
class [Link]
class [Link] (implements [Link])
o
interface [Link] (extends [Link])
interface [Link]
interface [Link]
class [Link] (implements [Link])
class [Link] (implements [Link])
i.c
interface [Link] (extends [Link])
interface [Link] (extends [Link])
class [Link]
interface [Link]
class [Link] (implements [Link])
interface [Link]
interface [Link] (extends [Link])
interface [Link]
dil
interface [Link]
interface [Link]
interface [Link] (extends [Link], [Link])
interface [Link] (extends [Link], [Link])
class [Link]
interface [Link]
interface [Link]
interface [Link]
class [Link]
class [Link]
va
class [Link]
class [Link] (implements [Link])
class [Link] (implements [Link], [Link])
class [Link]
class [Link]
class [Link]
class [Link] (implements [Link], [Link])
interface [Link]
class [Link] (implements [Link], [Link])
ja
class [Link]
interface [Link] (extends [Link])
class [Link]
class [Link] (implements [Link], [Link])
class [Link]
class [Link]
w.
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
284
285
class [Link]
class [Link]
m
class [Link]
class [Link]
class [Link]
class [Link]
interface [Link] (extends [Link])
class [Link]
class [Link]
class [Link]
o
class [Link]
class [Link]
class [Link]
class [Link]
class [Link] (implements [Link])
i.c
class [Link]
class [Link] (implements [Link])
class [Link]
class [Link] (implements [Link])
class [Link]
interface [Link] (extends [Link])
interface [Link]
interface [Link]
dil
class [Link] (implements [Link])
class [Link] (implements [Link], [Link])
class [Link] (implements [Link])
interface [Link] (extends [Link])
class [Link] (implements [Link])
class [Link] (implements [Link])
interface [Link]
class [Link] (implements [Link], [Link])
class [Link] (implements [Link])
class [Link]
va
class [Link]
class [Link] (implements [Link])
class [Link]
class [Link]
interface [Link] (extends [Link])
class [Link]
class [Link] (implements [Link], [Link])
class [Link] (implements [Link].LayoutManager2, [Link])
class [Link] (implements [Link], [Link])
ja
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link] (implements [Link])
class [Link]
class [Link]
class [Link]
285
286
m
class [Link]
class [Link] (implements [Link], [Link])
class [Link]
class [Link]
class [Link]
class [Link] (implements [Link], [Link])
class [Link]
interface [Link] (extends [Link])
o
interface [Link]
interface [Link] (extends [Link])
class [Link] (implements [Link])
interface [Link] (extends [Link])
class [Link]
i.c
class [Link]
interface [Link] (extends [Link])
interface [Link]
interface [Link].LayoutManager2 (extends [Link])
class [Link] (implements [Link])
interface [Link] (extends [Link])
interface [Link] (extends [Link])
interface [Link]
dil
class [Link]
class [Link] (implements [Link])
class [Link] (implements [Link], [Link])
class [Link]
class [Link]
class [Link] (implements [Link])
interface [Link]
class [Link] (implements [Link])
interface [Link] (extends [Link])
class [Link] (implements [Link])
va
class [Link] (implements [Link])
class [Link]
class [Link] (implements [Link])
class [Link] (implements [Link])
class [Link]
interface [Link]
interface [Link]
interface [Link] (extends [Link])
interface [Link] (extends [Link])
ja
class [Link]
class [Link]
class [Link]
class [Link] (implements [Link])
interface [Link] (extends [Link])
interface [Link]
interface [Link] (extends [Link])
class [Link] (implements [Link])
class [Link]
interface [Link]
286
287
class [Link]
class [Link]
m
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link] (implements [Link])
class [Link]
class [Link]
o
class [Link] (implements [Link])
class [Link]
class [Link]
class [Link]
class [Link] (implements [Link], [Link])
i.c
class [Link]
interface [Link]
interface [Link] (extends [Link])
class [Link]
interface [Link]
class [Link] (implements [Link])
class [Link] (implements [Link])
class [Link] (implements [Link], [Link])
dil
interface [Link] (extends [Link])
interface [Link] (extends [Link])
interface [Link]
interface [Link]
class [Link]
interface [Link] (extends [Link])
class [Link]
interface [Link] (extends [Link])
class [Link] (implements [Link])
interface [Link]
va
class [Link]
class [Link] (implements [Link])
interface [Link] (extends [Link])
class [Link]
interface [Link]
class [Link]
class [Link] (implements [Link])
class [Link]
class [Link] (implements [Link], [Link])
ja
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
w.
class [Link]
class [Link]
class [Link]
class [Link]
class [Link] (implements [Link], [Link])
interface [Link] (extends [Link])
interface [Link]
interface [Link]
interface [Link]
ww
class [Link]
class [Link] (implements [Link], [Link])
class [Link]
class [Link]
class [Link]
interface [Link] (extends [Link])
class [Link] (implements [Link])
class [Link]
class [Link]
class [Link]
287
288
class [Link]
class [Link]
m
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
o
class [Link]
class [Link]
class [Link]
class [Link]
interface [Link]
i.c
interface [Link]
interface [Link]
class [Link]
interface [Link] (extends [Link])
interface [Link] (extends [Link])
class [Link]
class [Link]
class [Link]
dil
interface [Link]
interface [Link] (extends [Link])
interface [Link] (extends [Link])
class [Link]
interface [Link]
class [Link]
class [Link] (implements [Link])
interface [Link]
class [Link]
class [Link] (implements [Link])
va
interface [Link]
class [Link]
class [Link]
interface [Link]
class [Link]
class [Link] (implements [Link])
class [Link] (implements [Link])
class [Link] (implements [Link])
class [Link] (implements [Link],
ja
[Link])
class [Link] (implements [Link])
class [Link]
interface [Link] (extends [Link])
interface [Link] (extends [Link])
interface [Link] (extends [Link])
w.
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
288
289
class [Link]
class [Link]
m
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
o
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
i.c
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
dil
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
va
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
ja
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
w.
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
ww
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
289
290
class [Link]
class [Link]
m
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
o
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
i.c
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
dil
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
va
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
class [Link] (implements [Link], [Link])
class [Link]
class [Link]
ja
interface [Link]
class [Link]
class [Link] (implements [Link])
class [Link] (implements [Link])
class [Link]
class [Link]
w.
class [Link]
class [Link]
interface [Link]
interface [Link]
class [Link] (implements [Link])
class [Link] (implements [Link], [Link])
class [Link]
interface [Link] (extends [Link])
class [Link] (implements [Link])
ww
interface [Link]
class [Link]
class [Link] (implements [Link])
interface [Link] (extends [Link])
interface [Link] (extends [Link])
class [Link]
class [Link]
class [Link]
class [Link]
class [Link]
290
291
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 [Link]
Flag indicating the download of some media was aborted.
abortGrabbing(). Method in class [Link]
Request the PixelGrabber to abort the image fetch.
abs(). Method in class [Link]
i.c
Returns a BigDecimal whose value is the absolute value of this number, and whose scale is [Link]().
abs(). Method in class [Link]
Returns a BigInteger whose value is the absolute value of this number.
abs(double). Static method in class [Link]
Returns the absolute value of a double value.
abs(float). Static method in class [Link]
Returns the absolute value of a float value.
abs(int). Static method in class [Link]
Returns the absolute value of an int value.
abs(long). Static method in class [Link]
dil
Returns the absolute value of a long value.
ABSTRACT. Static variable in class [Link]
AbstractMethodError(). Constructor for class [Link]
Constructs an AbstractMethodError with no detail message.
AbstractMethodError(String). Constructor for class [Link]
Constructs an AbstractMethodError with the specified detail message.
accept(). Method in class [Link]
Listens for a connection to be made to this socket and accepts it.
accept(File, String). Method in interface [Link]
Tests if a specified file should be included in a file list.
va
accept(SocketImpl). Method in class [Link]
Accepts a connection.
acceptsURL(String). Method in interface [Link]
Returns true if the driver thinks that it can open a connection to the given URL.
AccessException(String). Constructor for class [Link]
Create a new AccessException with a description.
AccessException(String, Exception). Constructor for class [Link]
Create a new AccessException with a description and detail exception.
AclNotFoundException(). Constructor for class [Link]
Constructs an AclNotFoundException.
ja
Marks the first integer id for the range of action event ids.
ACTION_LAST. Static variable in class [Link]
Marks the last integer id for the range of action event ids.
ACTION_PERFORMED. Static variable in class [Link]
An action performed event type.
ActionEvent(Object, int, String). Constructor for class [Link]
Constructs an ActionEvent object with the specified source object.
ActionEvent(Object, int, String, int). Constructor for class [Link]
Constructs an ActionEvent object with the specified source object.
ww
291
292
m
The text color for captions in window borders.
activeCount(). Static method in class [Link]
Returns the current number of active threads in this thread group.
activeCount(). Method in class [Link]
Returns an estimate of the number of active threads in this thread group.
activeGroupCount(). Method in class [Link]
Returns an estimate of the number of active groups in this thread group.
AD. Static variable in class [Link]
o
Useful constant for GregorianCalendar.
add(ActionListener, ActionListener). Static method in class [Link]
Adds action-listener-a with action-listener-b and returns the resulting multicast listener.
add(AdjustmentListener, AdjustmentListener). Static method in class [Link]
Adds adjustment-listener-a with adjustment-listener-b and returns the resulting multicast listener.
i.c
add(BigDecimal). Method in class [Link]
Returns a BigDecimal whose value is (this + val), and whose scale is MAX([Link](), [Link]).
add(BigInteger). Method in class [Link]
Returns a BigInteger whose value is (this + val).
add(Component). Method in class [Link]
Adds the specified component to this container.
add(Component, int). Method in class [Link]
Adds the specified component to this container at the given position in the container's component list.
add(Component, Object). Method in class [Link]
Adds the specified component to this container at the specified index.
dil
add(Component, Object, int). Method in class [Link]
Adds the specified component to this container with the specified constraints at the specified index.
add(ComponentListener, ComponentListener). Static method in class [Link]
Adds component-listener-a with component-listener-b and returns the resulting multicast listener.
add(ContainerListener, ContainerListener). Static method in class [Link]
Adds container-listener-a with container-listener-b and returns the resulting multicast listener.
add(FocusListener, FocusListener). Static method in class [Link]
Adds focus-listener-a with focus-listener-b and returns the resulting multicast listener.
add(int, int). Method in class [Link]
Date Arithmetic function.
add(int, int). Method in class [Link]
va
Overrides Calendar Date Arithmetic function.
add(int, int). Method in class [Link]
Adds a point to a rectangle.
add(ItemListener, ItemListener). Static method in class [Link]
Adds item-listener-a with item-listener-b and returns the resulting multicast listener.
add(KeyListener, KeyListener). Static method in class [Link]
Adds key-listener-a with key-listener-b and returns the resulting multicast listener.
add(Menu). Method in class [Link]
Adds the specified menu to the menu bar.
add(MenuItem). Method in class [Link]
ja
292
293
Adds the specified action listener to receive action events from this list.
addActionListener(ActionListener). Method in class [Link]
Adds the specified action listener to receive action events from this menu item.
m
addActionListener(ActionListener). Method in class [Link]
Adds the specified action listener to recieve action events from this textfield.
addAdjustmentListener(AdjustmentListener). Method in interface [Link]
Add a listener to recieve adjustment events when the value of the adjustable object changes.
addAdjustmentListener(AdjustmentListener). Method in class [Link]
Adds the specified adjustment listener to recieve adjustment events from this scrollbar.
addCertificate(Certificate). Method in class [Link]
Adds a certificate for this identity.
o
addComponentListener(ComponentListener). Method in class [Link]
Adds the specified component listener to receive component events from this component.
addConsumer(ImageConsumer). Method in class [Link]
Adds an ImageConsumer to the list of consumers interested in data for this image.
addConsumer(ImageConsumer). Method in interface [Link]
i.c
This method is used to register an ImageConsumer with the ImageProducer for access to the image data during a later
reconstruction of the Image.
addConsumer(ImageConsumer). Method in class [Link]
Adds an ImageConsumer to the list of consumers interested in data for this image.
addContainerListener(ContainerListener). Method in class [Link]
Adds the specified container listener to receive container events from this container.
addElement(Object). Method in class [Link]
Adds the specified component to the end of this vector, increasing its size by one.
addEntry(Principal, AclEntry). Method in interface [Link]
Adds an ACL entry to this ACL.
dil
addFocusListener(FocusListener). Method in class [Link]
Adds the specified focus listener to receive focus events from this component.
addHelpMenu(Menu). Method in interface [Link]
addIdentity(Identity). Method in class [Link]
Adds an identity to this identity scope.
addImage(Image, int). Method in class [Link]
Adds an image to the list of images being tracked.
addImage(Image, int, int, int). Method in class [Link]
Adds a scaled image to the list of images being tracked.
addImpl(Component, Object, int). Method in class [Link]
Adds the specified component to this container at the specified index.
va
addImpl(Component, Object, int). Method in class [Link]
Adds the specified component to this scroll pane container.
addInternal(EventListener, EventListener). Static method in class [Link]
Returns the resulting multicast listener from adding listener-a and listener-b together.
addItem(MenuItem). Method in interface [Link]
addItem(String). Method in class [Link]
Adds an item to this Choice.
addItem(String). Method in class [Link]
Adds the specified item to the end of scrolling list.
addItem(String, int). Method in interface [Link]
ja
Adds the specified item listener to recieve item events from this checkbox menu item.
addItemListener(ItemListener). Method in class [Link]
Adds the specified item listener to recieve item events from this choice.
addItemListener(ItemListener). Method in interface [Link]
Add a listener to recieve item events when the state of an item changes.
addItemListener(ItemListener). Method in class [Link]
Adds the specified item listener to recieve item events from this list.
addKeyListener(KeyListener). Method in class [Link]
Adds the specified key listener to receive key events from this component.
addLayoutComponent(Component, Object). Method in class [Link]
ww
Adds the specified component to the layout, using the specified constraint object.
addLayoutComponent(Component, Object). Method in class [Link]
Adds the specified component to the layout, using the specified constraint object.
addLayoutComponent(Component, Object). Method in class [Link]
Adds the specified component to the layout, using the specified constraint object.
addLayoutComponent(Component, Object). Method in interface [Link].LayoutManager2
Adds the specified component to the layout, using the specified constraint object.
addLayoutComponent(String, Component). Method in class [Link]
Replaced by addLayoutComponent(Component, Object).
addLayoutComponent(String, Component). Method in class [Link]
Replaced by addLayoutComponent(Component, Object).
addLayoutComponent(String, Component). Method in class [Link]
293
294
m
addLayoutComponent(String, Component). Method in class [Link]
Adds the specified component with the specified name to the layout.
addLayoutComponent(String, Component). Method in interface [Link]
Adds the specified component with the specified name to the layout.
addMember(Principal). Method in interface [Link]
Adds the specified member to the group.
addMenu(Menu). Method in interface [Link]
addMouseListener(MouseListener). Method in class [Link]
o
Adds the specified mouse listener to receive mouse events from this component.
addMouseMotionListener(MouseMotionListener). Method in class [Link]
Adds the specified mouse motion listener to receive mouse motion events from this component.
addNotify(). Method in class [Link]
Creates the peer of the button.
i.c
addNotify(). Method in class [Link]
Creates the peer of the canvas.
addNotify(). Method in class [Link]
Creates the peer of the Checkbox.
addNotify(). Method in class [Link]
Creates the peer of the checkbox item.
addNotify(). Method in class [Link]
Creates the Choice's peer.
addNotify(). Method in class [Link]
Notifies the Component that it has been added to a container and if a peer is required, it should be created.
dil
addNotify(). Method in class [Link]
Notifies the container to create a peer.
addNotify(). Method in class [Link]
Creates the frame's peer.
addNotify(). Method in class [Link]
Creates the file dialog's peer.
addNotify(). Method in class [Link]
Creates the Frame's peer.
addNotify(). Method in class [Link]
Creates the peer for this label.
addNotify(). Method in class [Link]
va
Creates the peer for the list.
addNotify(). Method in class [Link]
Creates the menu's peer.
addNotify(). Method in class [Link]
Creates the menu bar's peer.
addNotify(). Method in class [Link]
Creates the menu item's peer.
addNotify(). Method in class [Link]
Creates the Panel's peer.
addNotify(). Method in class [Link]
ja
294
295
m
Adds a separator line, or a hypen, to the menu at the current position.
addSeparator(). Method in interface [Link]
addSystemThread(). Method in class [Link]
Add the calling thread to the list of threads which aren't suspended by the RemoteDebugger.
addSystemThread(Thread). Method in class [Link]
Add the specified thread to the list of threads which aren't suspended by the RemoteDebugger.
addTextListener(TextListener). Method in class [Link]
Adds the specified text event listener to recieve text events from this textcomponent.
o
addVetoableChangeListener(VetoableChangeListener). Method in class [Link]
Add a VetoableListener to the listener list.
addWindowListener(WindowListener). Method in class [Link]
Adds the specified window listener to receive window events from this window.
AdjustForGravity(GridBagConstraints, Rectangle). Method in class [Link]
i.c
ADJUSTMENT_EVENT_MASK. Static variable in class [Link]
The event mask for selecting adjustment events.
ADJUSTMENT_FIRST. Static variable in class [Link]
Marks the first integer id for the range of adjustment event ids.
ADJUSTMENT_LAST. Static variable in class [Link]
Marks the last integer id for the range of adjustment event ids.
ADJUSTMENT_VALUE_CHANGED. Static variable in class [Link]
The adjustment value changed event.
AdjustmentEvent(Adjustable, int, int, int). Constructor for class [Link]
Constructs a AdjustmentEvent object with the specified Adjustable source, type, and value.
dil
adjustmentValueChanged(AdjustmentEvent). Method in interface [Link]
Invoked when the value of the adjustable has changed.
adjustmentValueChanged(AdjustmentEvent). Method in class [Link]
Handles the adjustmentValueChanged event by invoking the adjustmentValueChanged methods on listener-a and listener-b.
Adler32(). Constructor for class [Link].Adler32
after(Date). Method in class [Link]
Tests if this date is after the specified date.
after(Object). Method in class [Link]
Compares the time field records.
after(Object). Method in class [Link]
Overrides Calendar Compares the time field records.
va
after(Timestamp). Method in class [Link]
Is this timestamp later than the timestamp argument?
ALLBITS. Static variable in interface [Link]
A static image which was previously drawn is now complete and can be drawn again in its final form.
allowsMultipleSelections(). Method in class [Link]
allowThreadSuspension(boolean). Method in class [Link]
Used by VM to control lowmem implicit suspension.
allowUserInteraction. Variable in class [Link]
If true, this URL is being examined in a context in which it makes sense to allow user interactions such as popping up an
authentication dialog.
ja
295
296
m
Appends the string representation of the char array argument to this string buffer.
append(char[], int, int). Method in class [Link]
Appends the string representation of a subarray of the char array argument to this string buffer.
append(double). Method in class [Link]
Appends the string representation of the double argument to this string buffer.
append(float). Method in class [Link]
Appends the string representation of the float argument to this string buffer.
append(int). Method in class [Link]
o
Appends the string representation of the int argument to this string buffer.
append(long). Method in class [Link]
Appends the string representation of the long argument to this string buffer.
append(Object). Method in class [Link]
Appends the string representation of the Object argument to this string buffer.
i.c
append(String). Method in class [Link]
Appends the string to this string buffer.
append(String). Method in class [Link]
Appends the given text to the end.
appendText(String). Method in class [Link]
Applet(). Constructor for class [Link]
appletResize(int, int). Method in interface [Link]
Called when the applet wants to be resized.
applyLocalizedPattern(String). Method in class [Link]
Apply the given pattern to this Format object.
dil
applyLocalizedPattern(String). Method in class [Link]
Apply the given localized pattern string to this date format.
applyPattern(String). Method in class [Link]
Sets the pattern.
applyPattern(String). Method in class [Link]
Apply the given pattern to this Format object.
applyPattern(String). Method in class [Link]
Sets the pattern.
applyPattern(String). Method in class [Link]
Apply the given unlocalized pattern string to this date format.
APRIL. Static variable in class [Link]
va
Useful constant for month.
AreaAveragingScaleFilter(int, int). Constructor for class [Link]
Constructs an AreaAveragingScaleFilter that scales the pixels from its source Image as specified by the width and height
parameters.
areFieldsSet. Variable in class [Link]
The flag which tells if the time fields are set for the calendar.
arg. Variable in class [Link]
An arbitrary argument.
ArithmeticException(). Constructor for class [Link]
Constructs an ArithmeticException with no detail message.
ja
296
297
m
Returns the number of bytes that can be read from this file input stream without blocking.
available(). Method in class [Link]
Returns the number of bytes that can be read from this input stream without blocking.
available(). Method in class [Link]
Returns the number of bytes that can be read from this input stream without blocking.
available(). Method in class [Link]
Returns the number of bytes that can be read from this input stream without blocking.
available(). Method in interface [Link]
o
Returns the number of bytes that can be read without blocking.
available(). Method in class [Link]
Returns the number of bytes that can be read without blocking.
available(). Method in class [Link]
Returns the number of bytes that can be read from this input stream without blocking.
i.c
available(). Method in class [Link]
Returns the number of bytes that can be read from this input stream without blocking.
available(). Method in class [Link]
Returns the number of bytes available on the current stream.
available(). Method in class [Link]
Returns the number of bytes that can be read from this socket without blocking.
available(). Method in class [Link]
Returns the number of bytes that can be read from the input stream without blocking.
avoidingGui(). Method in interface [Link]
AWTError(String). Constructor for class [Link]
dil
AWTEvent(Event). Constructor for class [Link]
Constructs an AWTEvent object from the parameters of a 1.0-style event.
AWTEvent(Object, int). Constructor for class [Link]
Constructs an AWTEvent object with the specified source object and type.
AWTEventMulticaster(EventListener, EventListener). Constructor for class [Link]
Creates an event multicaster instance which chains listener-a with listener-b.
AWTException(String). Constructor for class [Link]
Constructs an AWTException with the specified detail message.
va
B
297
298
m
Translates a BigInteger and a scale into a BigDecimal.
BigDecimal(double). Constructor for class [Link]
Translates a double into a BigDecimal.
BigDecimal(String). Constructor for class [Link]
Constructs a BigDecimal from a string containing an optional minus sign followed by a sequence of zero or more decimal
digits, optionally followed by a fraction, which consists of a decimal point followed by zero or more decimal digits.
BIGINT. Static variable in class [Link]
BigInteger(byte[]). Constructor for class [Link]
o
Translates a byte array containing the two's-complement representation of a (signed) integer into a BigInteger.
BigInteger(int, byte[]). Constructor for class [Link]
Translates the sign-magnitude representation of an integer into a BigInteger.
BigInteger(int, int, Random). Constructor for class [Link]
Returns a randomly selected BigInteger with the specified bitLength that is probably prime.
i.c
BigInteger(int, Random). Constructor for class [Link]
Returns a random number uniformly distributed on [0, 2**numBits - 1] (assuming a fair source of random bits is provided in
rndSrc).
BigInteger(String). Constructor for class [Link]
Translates a string containing an optional minus sign followed by a sequence of one or more decimal digits into a BigInteger.
BigInteger(String, int). Constructor for class [Link]
Translates a string containing an optional minus sign followed by a sequence of one or more digits in the specified radix into a
BigInteger.
BINARY. Static variable in class [Link]
bind(InetAddress, int). Method in class [Link]
dil
Binds this socket to the specified port number on the specified host.
bind(int, InetAddress). Method in class [Link]
Binds a datagram socket to a local port and address.
bind(String, Remote). Static method in class [Link]
Binds the name to the specified remote object.
bind(String, Remote). Method in interface [Link]
Binds the name to the specified remote object.
BindException(). Constructor for class [Link]
Construct a new BindException with no detailed message.
BindException(String). Constructor for class [Link]
Constructs a new BindException with the specified detail message as to why the bind error occurred.
va
BIT. Static variable in class [Link]
bitCount(). Method in class [Link]
Returns the number of bits in the two's complement representation of this number that differ from its sign bit.
bitLength(). Method in class [Link]
Returns the number of bits in the minimal two's-complement representation of this number, *excluding* a sign bit, i.e.,
(ceil(log2(this < 0 ? -this : this + 1))).
BitSet(). Constructor for class [Link]
Creates a new bit set.
BitSet(int). Constructor for class [Link]
Creates a bit set whose initial size is the specified number of bits.
ja
298
299
Constructor.
breakpointEvent(RemoteThread). Method in interface [Link]
A breakpoint has been hit in the specified thread.
m
BRIEF. Static variable in class [Link]
brighter(). Method in class [Link]
Returns a brighter version of this color.
buf. Variable in class [Link]
The buffer where data is stored.
buf. Variable in class [Link]
The buffer where data is stored.
buf. Variable in class [Link]
o
The byte array containing the data.
buf. Variable in class [Link]
The buffer where data is stored.
buf. Variable in class [Link]
Character buffer
i.c
buf. Variable in class [Link]
The buffer where data is stored.
buf. Variable in class [Link]
Output buffer for writing compressed data.
buf. Variable in class [Link]
Input buffer for decompression.
buf. Variable in class [Link]
The push back buffer.
buffer. Variable in class [Link]
The circular buffer into which incoming data is placed.
dil
buffer. Variable in class [Link]
The string from which bytes are read.
BufferedInputStream(InputStream). Constructor for class [Link]
Creates a new buffered input stream to read data from the specified input stream with a default 512-byte buffer size.
BufferedInputStream(InputStream, int). Constructor for class [Link]
Creates a new buffered input stream to read data from the specified input stream with the specified buffer size.
BufferedOutputStream(OutputStream). Constructor for class [Link]
Creates a new buffered output stream to write data to the specified underlying output stream with a default 512-byte buffer
size.
BufferedOutputStream(OutputStream, int). Constructor for class [Link]
Creates a new buffered output stream to write data to the specified underlying output stream with the specified buffer size.
va
BufferedReader(Reader). Constructor for class [Link]
Create a buffering character-input stream that uses a default-sized input buffer.
BufferedReader(Reader, int). Constructor for class [Link]
Create a buffering character-input stream that uses an input buffer of the specified size.
BufferedWriter(Writer). Constructor for class [Link]
Create a buffered character-output stream that uses a default-sized output buffer.
BufferedWriter(Writer, int). Constructor for class [Link]
Create a new buffered character-output stream that uses an output buffer of the given size.
Button(). Constructor for class [Link]
Constructs a Button with no label.
ja
299
300
m
byteValue(). Method in class [Link]
Returns the value of this Long as a byte.
byteValue(). Method in class [Link]
Returns the value of the specified number as a byte.
byteValue(). Method in class [Link]
Returns the value of this Short as a byte.
o
C
i.c
Calendar(). Constructor for class [Link]
Constructs a Calendar with the default time zone as returned by [Link](), and the default locale.
Calendar(TimeZone, Locale). Constructor for class [Link]
Constructs a Calendar with the given time zone and locale.
CANADA. Static variable in class [Link]
Useful constant for country.
CANADA_FRENCH. Static variable in class [Link]
Useful constant for country.
cancel(). Method in interface [Link]
Cancel can be used by one thread to cancel a statement that is being executed by another thread.
dil
canFilterIndexColorModel. Variable in class [Link]
This boolean indicates whether or not it is acceptable to apply the color filtering of the filterRGB method to the color table
entries of an IndexColorModel object in lieu of pixel by pixel filtering.
CANONICAL_DECOMPOSITION. Static variable in class [Link]
Decomposition mode value.
canRead(). Method in class [Link]
Tests if the application can read from the specified file.
Canvas(). Constructor for class [Link]
Constructs a new Canvas.
canWrite(). Method in class [Link]
Tests if the application can write to this file.
va
capacity(). Method in class [Link]
Returns the current capacity of the String buffer.
capacity(). Method in class [Link]
Returns the current capacity of this vector.
capacityIncrement. Variable in class [Link]
The amount by which the capacity of the vector is automatically incremented when its size becomes greater than its capacity.
CAPS_LOCK. Static variable in class [Link]
The CapsLock action-key.
CardLayout(). Constructor for class [Link]
Creates a new card layout with gaps of size zero.
ja
300
301
m
charAt(int). Method in class [Link]
Returns the character at the specified index.
charAt(int). Method in class [Link]
Returns the character at a specific index in this string buffer.
CharConversionException(). Constructor for class [Link]
provides no detailed message
CharConversionException(String). Constructor for class [Link]
provides a detailed message
o
charsWidth(char[], int, int). Method in class [Link]
Returns the total advance width for showing the specified array of characters in this Font.
charValue(). Method in class [Link]
Returns the value of this Character object.
charWidth(char). Method in class [Link]
i.c
Returns the advance width of the specified character in this Font.
charWidth(int). Method in class [Link]
Returns the advance width of the specified character in this Font.
checkAccept(String, int). Method in class [Link]
For now stubs can't accept connections on any port.
checkAccept(String, int). Method in class [Link]
Throws a SecurityException if the calling thread is not permitted to accept a socket connection from the specified host
and port number.
checkAccess(). Method in class [Link]
Determines if the currently running thread has permission to modify this thread.
dil
checkAccess(). Method in class [Link]
Determines if the currently running thread has permission to modify this thread group.
checkAccess(Thread). Method in class [Link]
Stubs are not allowed to manipulate threads.
checkAccess(Thread). Method in class [Link]
Throws a SecurityException if the calling thread is not allowed to modify the thread argument.
checkAccess(ThreadGroup). Method in class [Link]
Stubs are not allowed to manipulate thread groups.
checkAccess(ThreadGroup). Method in class [Link]
Throws a SecurityException if the calling thread is not allowed to modify the thread group argument.
checkAll(). Method in class [Link]
va
Checks to see if all images have finished loading but does not start loading the images if they are not already loading.
checkAll(boolean). Method in class [Link]
Checks to see if all images have finished loading.
checkAwtEventQueueAccess(). Method in class [Link]
Checks to see if an client can get access to the AWT event queue (disallowed from stubs).
checkAwtEventQueueAccess(). Method in class [Link]
Tests if a client can get access to the AWT event queue.
Checkbox(). Constructor for class [Link]
Constructs a Checkbox with an empty label.
Checkbox(String). Constructor for class [Link]
ja
301
302
m
Throws a SecurityException if the calling thread is not allowed to delete the specified file.
CheckedInputStream(InputStream, Checksum). Constructor for class [Link]
Creates an input stream using the specified Checksum.
CheckedOutputStream(OutputStream, Checksum). Constructor for class [Link]
Creates an output stream with the specified Checksum.
checkError(). Method in class [Link]
Flushes this print stream's underlying output stream, and tests if there has been an error on the underlying output stream.
checkError(). Method in class [Link]
o
Flush the stream and check its error state.
checkExec(String). Method in class [Link]
Stubs are not allowed to fork processes.
checkExec(String). Method in class [Link]
Throws a SecurityException if the calling thread is not allowed to create a subprocss.
i.c
checkExit(int). Method in class [Link]
Stubs are not allowed to exit the VM.
checkExit(int). Method in class [Link]
Throws a SecurityException if the calling thread is not allowed to cause the Java Virtual Machine to halt with the
specified status code.
checkID(int). Method in class [Link]
Checks to see if all images tagged with the indicated ID have finished loading, but does not start loading the images if they are
not already loading.
checkID(int, boolean). Method in class [Link]
Checks to see if all images tagged with the indicated ID have finished loading.
dil
checkImage(Image, ImageObserver). Method in class [Link]
Returns the status of the construction of a screen representation of the specified image.
checkImage(Image, int, int, ImageObserver). Method in class [Link]
Returns the status of the construction of a scaled screen representation of the specified image.
checkImage(Image, int, int, ImageObserver). Method in interface [Link]
checkImage(Image, int, int, ImageObserver). Method in class [Link]
Returns the status of the construction of the indicated method at the indicated width and height for the default screen.
checkLink(String). Method in class [Link]
Stubs are not allowed to link dynamic libraries.
checkLink(String). Method in class [Link]
Throws a SecurityException if the calling thread is not allowed to dynamic link the library code specified by the string
va
argument file.
checkListen(int). Method in class [Link]
For now stubs can't listen on any port.
checkListen(int). Method in class [Link]
Throws a SecurityException if the calling thread is not allowed to wait for a connection request on the specified local port
number.
checkMemberAccess(Class, int). Method in class [Link]
Checks to see if client code can access class members.
checkMemberAccess(Class, int). Method in class [Link]
Tests if a client is allowed to access members.
ja
Checks if the specified permission is part of the permission set in this entry.
checkPermission(Principal, Permission). Method in interface [Link]
Checks whether or not the specified principal has the specified permission.
checkPrintJobAccess(). Method in class [Link]
Disallow printing from stubs.
checkPrintJobAccess(). Method in class [Link]
Tests if a client can initiate a print job request.
checkPropertiesAccess(). Method in class [Link]
Stubs are not allowed to access the entire system properties list, only properties explicitly labeled as accessible to stubs.
checkPropertiesAccess(). Method in class [Link]
Throws a SecurityException if the calling thread is not allowed to access or modify the system properties.
checkPropertyAccess(String). Method in class [Link]
302
303
Stubs can access the system property named by key only if its twin [Link] property is set to true.
checkPropertyAccess(String). Method in class [Link]
Throws a SecurityException if the calling thread is not allowed to access the system property with the specified key
m
name.
checkRead(FileDescriptor). Method in class [Link]
Stubs are not allowed to open file descriptors for reading unless it is done through a socket, in which case other access
restrictions still apply.
checkRead(FileDescriptor). Method in class [Link]
Throws a SecurityException if the calling thread is not allowed to read from the specified file descriptor.
checkRead(String). Method in class [Link]
Check if a stub can read a particular file.
o
checkRead(String). Method in class [Link]
Throws a SecurityException if the calling thread is not allowed to read the file specified by the string argument.
checkRead(String, Object). Method in class [Link]
No file reads are valid from a stub.
checkRead(String, Object). Method in class [Link]
i.c
Throws a SecurityException if the specified security context is not allowed to read the file specified by the string
argument.
checkSecurityAccess(String). Method in class [Link]
Stubs cannot perform security provider operations.
checkSecurityAccess(String). Method in class [Link]
Tests access to certain operations for a security API action.
checkSetFactory(). Method in class [Link]
Check if a stub can set a networking-related object factory.
checkSetFactory(). Method in class [Link]
Throws a SecurityException if the calling thread is not allowed to set the socket factory used by ServerSocket or
dil
Socket, or the stream handler factory used by URL.
checkSystemClipboardAccess(). Method in class [Link]
Checks to see if an client can get access to the System Clipboard (disallowed from stubs).
checkSystemClipboardAccess(). Method in class [Link]
Tests if a client can get access to the system clipboard.
checkTopLevelWindow(Object). Method in class [Link]
Allow caller to create top-level windows.
checkTopLevelWindow(Object). Method in class [Link]
Returns false if the calling thread is not trusted to bring up the top-level window indicated by the window argument.
checkWrite(FileDescriptor). Method in class [Link]
Stubs are not allowed to open file descriptors for writing unless it is done through a socket, in which case other access
va
restrictions still apply.
checkWrite(FileDescriptor). Method in class [Link]
Throws a SecurityException if the calling thread is not allowed to write to the specified file descriptor.
checkWrite(String). Method in class [Link]
Check if a Stub can write a particular file.
checkWrite(String). Method in class [Link]
Throws a SecurityException if the calling thread is not allowed to write to the file specified by the string argument.
childResized(int, int). Method in interface [Link]
CHINA. Static variable in class [Link]
Useful constant for country.
ja
303
304
m
Constructs a ClassNotFoundException with the specified detail message.
clean(ObjID[], long, VMID, boolean). Method in interface [Link]
The clean call removes the 'vmid' from the reference list of each remote object indicated in 'id's.
clear(). Method in class [Link]
Clears the values of all the time fields.
clear(). Method in class [Link]
Clears this hashtable so that it contains no keys.
clear(). Method in class [Link]
o
clear(). Method in interface [Link]
DEPRECATED: Replaced by removeAll().
clear(int). Method in class [Link]
Sets the bit specified by the index to false.
clear(int). Method in class [Link]
i.c
Clears the value in the given time field.
clearBit(int). Method in class [Link]
Returns a BigInteger whose value is equivalent to this number with the designated bit cleared.
clearBreakpoint(int). Method in class [Link]
Clear a breakpoint at a specific address in a class.
clearBreakpointLine(int). Method in class [Link]
Clear a breakpoint at a specified line.
clearBreakpointMethod(RemoteField). Method in class [Link]
Clear a breakpoint at the start of a specified method.
clearChanged(). Method in class [Link]
dil
Indicates that this object has no longer changed, or that it has already notified all of its observers of its most recent change.
clearParameters(). Method in interface [Link]
304
305
m
Overrides Cloneable
clone(). Method in class [Link]
Returns a clone if the implementation is cloneable.
clone(). Method in class [Link]
Overrides Cloneable
clone(). Method in class [Link]
Overrides Cloneable
clone(). Method in class [Link]
o
Creates a new object of the same class as this object.
clone(). Method in class [Link]
Standard override; no change in semantics.
clone(). Method in class [Link]
Returns a clone if the implementation is cloneable.
i.c
clone(). Method in class [Link]
Overrides Cloneable
clone(). Method in class [Link]
Overrides Cloneable
clone(). Method in class [Link]
Create a copy of this boundary
clone(). Method in class [Link]
Overrides Cloneable
clone(). Method in class [Link]
Returns a clone of the remote object that is distinct from the original.
dil
clone(). Method in class [Link]
Returns a clone of this vector.
CloneNotSupportedException(). Constructor for class [Link]
Constructs a CloneNotSupportedException with no detail message.
CloneNotSupportedException(String). Constructor for class [Link]
Constructs a CloneNotSupportedException with the specified detail message.
close(). Method in class [Link]
Close the stream.
close(). Method in class [Link]
Close the stream.
close(). Method in class [Link]
va
Close the stream.
close(). Method in class [Link]
Close the stream.
close(). Method in interface [Link]
In some cases, it is desirable to immediately release a Connection's database and JDBC resources instead of waiting for them
to be automatically released; the close method provides this immediate release.
close(). Method in class [Link]
Closes this datagram socket.
close(). Method in class [Link]
Close the socket.
ja
Closes this input stream and releases any system resources associated with the stream.
close(). Method in class [Link]
Closes this output stream and releases any system resources associated with the stream.
close(). Method in class [Link]
Close the stream.
close(). Method in class [Link]
Close the stream.
close(). Method in class [Link]
Closes the input stream.
close(). Method in class [Link]
ww
Writes remaining compressed data to the output stream and closes the underlying stream.
close(). Method in class [Link]
Closes this input stream and releases any system resources associated with the stream.
close(). Method in class [Link]
Close the stream.
close(). Method in interface [Link]
Closes the input stream.
close(). Method in class [Link]
Closes the input stream.
close(). Method in interface [Link]
Closes the stream.
close(). Method in class [Link]
305
306
m
close(). Method in class [Link]
Close the stream.
close(). Method in class [Link]
Closes this piped input stream and releases any system resources associated with the stream.
close(). Method in class [Link]
Closes this piped output stream and releases any system resources associated with this stream.
close(). Method in class [Link]
Close the stream.
o
close(). Method in class [Link]
Close the stream.
close(). Method in class [Link]
Closes this print stream and releases any resources associated with the underlying output stream.
close(). Method in class [Link]
i.c
Close the stream.
close(). Method in class [Link]
Close the stream.
close(). Method in class [Link]
Closes this random access file stream and releases any system resources associated with the stream.
close(). Method in class [Link]
Close the stream.
close(). Method in class [Link]
Close the connection to the remote debugging agent.
close(). Method in interface [Link]
dil
In some cases, it is desirable to immediately release a ResultSet's database and JDBC resources instead of waiting for this to
happen when it is automatically closed; the close method provides this immediate release.
close(). Method in class [Link]
Closes this input stream and releases any system resources associated with the stream.
close(). Method in class [Link]
Closes this socket.
close(). Method in class [Link]
Closes this socket.
close(). Method in class [Link]
Closes this socket.
close(). Method in interface [Link]
va
In many cases, it is desirable to immediately release a Statements's database and JDBC resources instead of waiting for this to
happen when it is automatically closed; the close method provides this immediate release.
close(). Method in class [Link]
Close the stream.
close(). Method in class [Link]
Close the stream.
close(). Method in class [Link]
Close the stream, flushing it first.
close(). Method in class [Link]
Closes the ZIP file.
ja
Closes the current ZIP entry and positions the stream for writing the next entry.
Collator(). Constructor for class [Link]
Default constructor.
Color(float, float, float). Constructor for class [Link]
Creates a color with the specified red, green, and blue values in the range (0.0 - 1.0).
Color(int). Constructor for class [Link]
Creates a color with the specified combined RGB value consisting of the red component in bits 16-23, the green component
in bits 8-15, and the blue component in bits 0-7.
Color(int, int, int). Constructor for class [Link]
Creates a color with the specified red, green, and blue values in the range (0 - 255).
ww
306
307
m
columnWidths. Variable in class [Link]
COMBINING_SPACING_MARK. Static variable in class [Link]
command(Object). Static method in class [Link]
Examines the argument type and its fields and perform some documented operation.
commentChar(int). Method in class [Link]
Specified that the character argument starts a single-line comment.
commit(). Method in interface [Link]
Commit makes all changes made since the previous commit/rollback permanent and releases any database locks currently
o
held by the Connection.
compare(String, String). Method in class [Link]
Compares the source string to the target string according to the collation rules for this Collator.
compare(String, String). Method in class [Link]
Compares the character data stored in two different strings based on the collation rules.
i.c
compareTo(BigDecimal). Method in class [Link]
Returns -1, 0 or 1 as this number is less than, equal to, or greater than val.
compareTo(BigInteger). Method in class [Link]
Returns -1, 0 or 1 as this number is less than, equal to, or greater than val.
compareTo(CollationKey). Method in class [Link]
Compare this CollationKey to the target CollationKey.
compareTo(String). Method in class [Link]
Compares two strings lexicographically.
compileClass(Class). Static method in class [Link]
Compiles the specified class.
dil
compileClasses(String). Static method in class [Link]
Compiles all classes whose name matches the specified string.
COMPLETE. Static variable in class [Link]
Flag indicating the download of media completed successfully.
complete(). Method in class [Link]
Fills in any unset fields in the time field list.
COMPLETESCANLINES. Static variable in interface [Link]
The pixels will be delivered in (multiples of) complete scanlines at a time.
Component(). Constructor for class [Link]
Constructs a new Component.
COMPONENT_ADDED. Static variable in class [Link]
va
The component moved event type.
COMPONENT_EVENT_MASK. Static variable in class [Link]
The event mask for selecting component events.
COMPONENT_FIRST. Static variable in class [Link]
Marks the first integer id for the range of component event ids.
COMPONENT_HIDDEN. Static variable in class [Link]
The component hidden event type.
COMPONENT_LAST. Static variable in class [Link]
Marks the last integer id for the range of component event ids.
COMPONENT_MOVED. Static variable in class [Link]
ja
307
308
m
componentResized(ComponentEvent). Method in class [Link]
componentResized(ComponentEvent). Method in interface [Link]
Invoked when component has been resized.
componentShown(ComponentEvent). Method in class [Link]
Handles the componentShown event by invoking the componentShown methods on listener-a and listener-b.
componentShown(ComponentEvent). Method in class [Link]
componentShown(ComponentEvent). Method in interface [Link]
Invoked when component has been shown.
o
comptable. Variable in class [Link]
computeFields(). Method in class [Link]
Converts UTC as milliseconds to time field values.
computeFields(). Method in class [Link]
Overrides Calendar Converts UTC as milliseconds to time field values.
i.c
computeTime(). Method in class [Link]
Converts Calendar's time field values to UTC as milliseconds.
computeTime(). Method in class [Link]
Overrides Calendar Converts time field values to UTC as milliseconds.
concat(String). Method in class [Link]
Concatenates the specified string to the end of this string.
connect(). Method in class [Link]
Opens a communications link to the resource referenced by this URL, if such a connection has not already been established.
connect(InetAddress, int). Method in class [Link]
Connects this socket to the specified port number on the specified host.
dil
connect(PipedInputStream). Method in class [Link]
Connects this piped output stream to a receiver.
connect(PipedOutputStream). Method in class [Link]
Connects this piped input stream to a sender.
connect(PipedReader). Method in class [Link]
Connect the specified piped reader to this writer.
connect(PipedWriter). Method in class [Link]
Connect the specified piped writer to this reader.
connect(String, int). Method in class [Link]
Connects this socket to the specified port on the named host.
connect(String, Properties). Method in interface [Link]
va
Try to make a database connection to the given URL.
connected. Variable in class [Link]
If false, this connection object has not created a communications link to the specified URL.
ConnectException(). Constructor for class [Link]
Construct a new ConnectException with no detailed message.
ConnectException(String). Constructor for class [Link]
Constructs a new ConnectException with the specified detail message as to why the connect error occurred.
ConnectException(String). Constructor for class [Link]
Create A remote exception with the specified string
ConnectException(String, Exception). Constructor for class [Link]
ja
Create A remote exception with the specified string, and the exception specified.
ConnectIOException(String). Constructor for class [Link]
Create A remote exception with the specified string
ConnectIOException(String, Exception). Constructor for class [Link]
Create A remote exception with the specified string, and the exception specified.
CONNECTOR_PUNCTUATION. Static variable in class [Link]
consume(). Method in class [Link]
w.
308
309
m
contains(Object). Method in class [Link]
Tests if some key maps into the specified value in this hashtable.
contains(Object). Method in class [Link]
Tests if the specified object is a component in this vector.
contains(Point). Method in class [Link]
Checks whether this component "contains" the specified point, where x and y in the point are defined to be relative to the
coordinate system of this component.
contains(Point). Method in class [Link]
o
Determines whether the specified point is inside the Polygon.
contains(Point). Method in class [Link]
Checks whether this rectangle contains the specified point.
containsKey(Object). Method in class [Link]
Tests if the specified object is a key in this hashtable.
i.c
ContentHandler(). Constructor for class [Link]
contents. Variable in class [Link]
CONTROL. Static variable in class [Link]
control. Static variable in class [Link]
The background color for control objects.
CONTROL. Static variable in class [Link]
The array index for the control background color.
CONTROL_DK_SHADOW. Static variable in class [Link]
The array index for the control dark shadow color.
CONTROL_HIGHLIGHT. Static variable in class [Link]
dil
The array index for the control highlight color.
CONTROL_LT_HIGHLIGHT. Static variable in class [Link]
The array index for the control light highlight color.
CONTROL_SHADOW. Static variable in class [Link]
The array index for the control shadow color.
CONTROL_TEXT. Static variable in class [Link]
The array index for the control text color.
controlDkShadow. Static variable in class [Link]
The dark shadow color for control objects.
controlDown(). Method in class [Link]
Checks if the control key is down.
va
controlHighlight. Static variable in class [Link]
The light highlight color for control objects.
controlLtHighlight. Static variable in class [Link]
The regular highlight color for control objects.
controlShadow. Static variable in class [Link]
The regular shadow color for control objects.
controlText. Static variable in class [Link]
The text color for control objects.
copyArea(int, int, int, int, int, int). Method in class [Link]
Copies an area of the Component by a distance specified by dx and dy to the right and down.
ja
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 [Link]
CRC-32 for uncompressed data.
crc. Variable in class [Link]
CRC-32 of uncompressed data.
CRC32(). Constructor for class [Link].CRC32
create(). Method in class [Link]
Creates a datagram socket
o
create(). Method in class [Link]
Creates a new Graphics object that is a copy of this Graphics object.
create(boolean). Method in class [Link]
Creates either a stream or a datagram socket.
create(int, int, int, int). Method in class [Link]
i.c
Creates a new Graphics object based on this Graphics object, but with a new translation and clip area.
createButton(Button). Method in class [Link]
Uses the specified Peer interface to create a new Button.
createCanvas(Canvas). Method in class [Link]
Uses the specified Peer interface to create a new Canvas.
createCheckbox(Checkbox). Method in class [Link]
Uses the specified Peer interface to create a new Checkbox.
createCheckboxMenuItem(CheckboxMenuItem). Method in class [Link]
Uses the specified Peer interface to create a new CheckboxMenuItem.
createChoice(Choice). Method in class [Link]
dil
Uses the specified Peer interface to create a new Choice.
createComponent(Component). Method in class [Link]
Creates a peer for a component or container.
createContentHandler(String). Method in interface [Link]
Creates a new ContentHandler to read an object from a URLStreamHandler.
createDialog(Dialog). Method in class [Link]
Uses the specified Peer interface to create a new Dialog.
createFileDialog(FileDialog). Method in class [Link]
Uses the specified Peer interface to create a new FileDialog.
createFrame(Frame). Method in class [Link]
Uses the specified Peer interface to create a new Frame.
va
createImage(byte[]). Method in class [Link]
Creates an image which decodes the image stored in the specified byte array.
createImage(byte[], int, int). Method in class [Link]
Creates an image which decodes the image stored in the specified byte array at the specified offset and length.
createImage(ImageProducer). Method in class [Link]
Creates an image from the specified image producer.
createImage(ImageProducer). Method in interface [Link]
createImage(ImageProducer). Method in class [Link]
Creates an image with the specified image producer.
createImage(int, int). Method in class [Link]
ja
310
311
SQL statements without parameters are normally executed using Statement objects.
createTextArea(TextArea). Method in class [Link]
Uses the specified Peer interface to create a new TextArea.
m
createTextField(TextField). Method in class [Link]
Uses the specified Peer interface to create a new TextField.
createURLStreamHandler(String). Method in interface [Link]
Creates a new URLStreamHandler instance with the specified protocol.
createWindow(Window). Method in class [Link]
Uses the specified Peer interface to create a new Window.
CropImageFilter(int, int, int, int). Constructor for class [Link]
Constructs a CropImageFilter that extracts the absolute rectangular region of pixels from its source Image as specified by the
o
x, y, w, and h parameters.
CROSSHAIR_CURSOR. Static variable in class [Link]
The crosshair cursor type.
CROSSHAIR_CURSOR. Static variable in class [Link]
CTRL_MASK. Static variable in class [Link]
i.c
The control modifier constant.
CTRL_MASK. Static variable in class [Link]
The control modifier constant.
CTRL_MASK. Static variable in class [Link]
The control key modifier constant.
CURRENCY_SYMBOL. Static variable in class [Link]
current(). Method in class [Link]
Return character index of the text boundary that was most recently returned by next(), previous(), first(), or last()
current(). Method in interface [Link]
Get the character at the current position (as returned by getIndex()).
dil
current(). Method in class [Link]
Get the character at the current position (as returned by getIndex()).
currentClassLoader(). Method in class [Link]
Returns an object describing the most recent class loader executing on the stack.
currentLoadedClass(). Method in class [Link]
Returns the current Class with a ClassLoader on the execution stack.
currentThread(). Static method in class [Link]
Returns a reference to the currently executing thread object.
currentTimeMillis(). Static method in class [Link]
Returns the current time in milliseconds.
Cursor(int). Constructor for class [Link]
va
Creates a new cursor object with the specified type.
cyan. Static variable in class [Link]
The color cyan.
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 [Link]
Constructs a DatagramPacket for receiving packets of length ilength.
DatagramPacket(byte[], int, InetAddress, int). Constructor for class [Link]
Constructs a datagram packet for sending packets of length ilength to the specified port number on the specified host.
DatagramSocket(). Constructor for class [Link]
Constructs a datagram socket and binds it to any available port on the local host machine.
DatagramSocket(int). Constructor for class [Link]
Constructs a datagram socket and binds it to the specified port on the local host machine.
o
DatagramSocket(int, InetAddress). Constructor for class [Link]
Creates a datagram socket, bound to the specified local address.
DatagramSocketImpl(). Constructor for class [Link]
DataInputStream(InputStream). Constructor for class [Link]
Creates a new data input stream to read data from the specified input stream.
i.c
DataOutputStream(OutputStream). Constructor for class [Link]
Creates a new data output stream to write data to the specified underlying output stream.
DataTruncation(int, boolean, boolean, int, int). Constructor for class [Link]
dil
millisecond.
Date(int, int, int). Constructor for class [Link]
Construct a Date
Date(int, int, int). Constructor for class [Link]
Allocates a Date object and initializes it so that it represents midnight, local time, at the beginning of the day specified by the
year, month, and date arguments.
Date(int, int, int, int, int). Constructor for class [Link]
Allocates a Date object and initializes it so that it represents the specified hour and minute, local time, of the date specified by
the year, month, date, hrs, and min arguments.
Date(int, int, int, int, int, int). Constructor for class [Link]
Allocates a Date object and initializes it so that it represents the specified hour, minute, and second, local time of the date
va
specified by the year, month, date, hrs, min, and sec arguments.
Date(long). Constructor for class [Link]
Construct a Date using a milliseconds time value
Date(long). Constructor for class [Link]
Allocates a Date object and initializes it to represent the specified number of milliseconds since January 1, 1970, 00:00:00
GMT.
Date(String). Constructor for class [Link]
Allocates a Date object and initializes it so that it represents the date and time indicated by the string s, which is interpreted as
if by the parse method.
DATE_FIELD. Static variable in class [Link]
ja
312
313
Create a DecimalFormat from the given pattern and the symbols for the default locale.
DecimalFormat(String, DecimalFormatSymbols). Constructor for class [Link]
Create a DecimalFormat from the given pattern and symbols.
m
DecimalFormatSymbols(). Constructor for class [Link]
Create a DecimalFormatSymbols object for the default locale.
DecimalFormatSymbols(Locale). Constructor for class [Link]
Create a DecimalFormatSymbols object for the given locale.
DECLARED. Static variable in interface [Link]
Identifies the set of declared members of a class or interface.
decode(InputStream). Method in interface [Link]
Decodes a certificate from an input stream.
o
decode(String). Static method in class [Link]
Decodes a String into a Byte.
decode(String). Static method in class [Link]
Gets the specified Color.
decode(String). Static method in class [Link]
i.c
Gets the specified font using the name passed in.
decode(String). Static method in class [Link]
Decodes a string into an Integer.
decode(String). Static method in class [Link]
Decodes a String into a Short.
def. Variable in class [Link]
Compressor for this stream.
DEFAULT. Static variable in class [Link]
Constant for default style pattern.
DEFAULT_COMPRESSION. Static variable in class [Link]
dil
Default compression level.
DEFAULT_CURSOR. Static variable in class [Link]
The default cursor type (gets set if no cursor is defined).
DEFAULT_CURSOR. Static variable in class [Link]
DEFAULT_STRATEGY. Static variable in class [Link]
Default compression strategy.
defaultConstraints. Variable in class [Link]
defaultReadObject(). Method in class [Link]
Read the non-static and non-transient fields of the current class from this stream.
defaults. Variable in class [Link]
A property list that contains default values for any keys not found in this property list.
va
defaultWriteObject(). Method in class [Link]
Write the non-static and non-transient fields of the current class to this stream.
defineClass(byte[], int, int). Method in class [Link]
Converts an array of bytes into an instance of class Class.
defineClass(String, byte[], int, int). Method in class [Link]
Converts an array of bytes to an instance of class Class.
deflate(). Method in class [Link]
Writes next block of compressed data to the output stream.
deflate(byte[]). Method in class [Link]
Fills specified buffer with compressed data.
ja
Creates a new output stream with the specified compressor and a default buffer size.
DeflaterOutputStream(OutputStream, Deflater, int). Constructor for class [Link]
Creates a new output stream with the specified compressor and buffer size.
DELETE. Static variable in class [Link]
The Delete key.
delete(). Method in class [Link]
Deletes the file specified by this object.
deleteObserver(Observer). Method in class [Link]
Deletes an observer from the set of observers of this object.
deleteObservers(). Method in class [Link]
Clears the observer list so that this object no longer has any observers.
deleteOwner(Principal, Principal). Method in interface [Link]
313
314
Deletes an owner.
deleteShortcut(). Method in class [Link]
Delete any MenuShortcut associated with this MenuItem.
m
deleteShortcut(MenuShortcut). Method in class [Link]
Delete the specified MenuShortcut.
delItem(int). Method in class [Link]
Removes an item from the list.
delItem(int). Method in interface [Link]
delItems(int, int). Method in class [Link]
delItems(int, int). Method in interface [Link]
deliverEvent(Event). Method in class [Link]
o
deliverEvent(Event). Method in class [Link]
delMenu(int). Method in interface [Link]
deregisterDriver(Driver). Static method in class [Link]
Drop a Driver from the DriverManager's list.
description. Variable in class [Link]
i.c
A brief description of the property.
description(). Method in class [Link]
Return a description of the array.
description(). Method in class [Link]
Return a (somewhat verbose) description.
description(). Method in class [Link]
Return a description of the object.
description(). Method in class [Link]
Return the string value, or "null"
description(). Method in class [Link]
dil
Return a description of the RemoteValue.
deselect(int). Method in class [Link]
Deselects the item at the specified index.
deselect(int). Method in interface [Link]
DESELECTED. Static variable in class [Link]
The item de-selected state change type.
DESKTOP. Static variable in class [Link]
The array index for the desktop background color.
desktop. Static variable in class [Link]
The color of the desktop background.
destHeight. Variable in class [Link]
va
destroy(). Method in class [Link]
Called by the browser or applet viewer to inform this applet that it is being reclaimed and that it should destroy any resources
that it has allocated.
destroy(). Method in class [Link]
Kills the subprocess.
destroy(). Method in class [Link]
Destroys this thread, without any cleanup.
destroy(). Method in class [Link]
Destroys this thread group and all of its subgroups.
destWidth. Variable in class [Link]
ja
314
315
Creates a digest output stream, using the specified output stream and message digest.
digit(char, int). Static method in class [Link]
Returns the numeric value of the character ch in the specified radix.
m
Dimension(). Constructor for class [Link]
Constructs a Dimension object with 0 width and 0 height.
Dimension(Dimension). Constructor for class [Link]
Constructs a Dimension and initializes it to the specified value.
Dimension(int, int). Constructor for class [Link]
Constructs a Dimension and initializes it to the specified width and specified height.
DirectColorModel(int, int, int, int). Constructor for class [Link]
Constructs a DirectColorModel from the given masks specifying which bits in the pixel contain the red, green and blue color
o
components.
DirectColorModel(int, int, int, int, int). Constructor for class [Link]
Constructs a DirectColorModel from the given masks specifying which bits in the pixel contain the alhpa, red, green and blue
color components.
dirty(ObjID[], long, Lease). Method in interface [Link]
i.c
The dirty call requests leases for the remote object references associated with the object identifiers contained in the array 'ids'.
disable(). Static method in class [Link]
Cause the Compiler to cease operation.
disable(). Method in class [Link]
disable(). Method in interface [Link]
DEPRECATED: Replaced by setEnabled(boolean).
disable(). Method in class [Link]
disable(). Method in interface [Link]
DEPRECATED: Replaced by setEnabled(boolean).
disableEvents(long). Method in class [Link]
dil
Disables the events defined by the specified event mask parameter from being delivered to this component.
disableEvents(long). Method in class [Link]
Disables the events defined by the specified event mask parameter from being delivered to this menu item.
disconnect(). Method in class [Link]
Close the connection to the server.
dispatch(Remote, RemoteCall, int, long). Method in interface [Link]
Unmarshals arguments, calls the actual remote object implementation, and marshals the return value or any exception.
dispatchEvent(AWTEvent). Method in class [Link]
Dispatches an event to this component or one of its sub components.
dispatchEvent(AWTEvent). Method in class [Link]
dispose(). Method in interface [Link]
va
dispose(). Method in class [Link]
Disposes of the Frame.
dispose(). Method in class [Link]
Dispose of the system resources used by this graphics context.
dispose(). Method in interface [Link]
dispose(). Method in class [Link]
Disposes of the Window.
divide(BigDecimal, int). Method in class [Link]
Returns a BigDecimal whose value is (this / val), and whose scale is [Link]().
divide(BigDecimal, int, int). Method in class [Link]
ja
Returns a BigDecimal whose value is (this / val), and whose scale is as specified.
divide(BigInteger). Method in class [Link]
Returns a BigInteger whose value is (this / val).
divideAndRemainder(BigInteger). Method in class [Link]
Returns an array of two BigIntegers.
doesMaxRowSizeIncludeBlobs(). Method in interface [Link]
Did getMaxRowSize() include LONGVARCHAR and LONGVARBINARY blobs?
w.
315
316
Constructs a newly allocated Double object that represents the primitive double argument.
Double(String). Constructor for class [Link]
Constructs a newly allocated Double object that represents the floating- point value of type double represented by the
m
string.
doubleToLongBits(double). Static method in class [Link]
Returns a representation of the specified floating-point value according to the IEEE 754 floating-point "double format" bit
layout.
doubleValue(). Method in class [Link]
Converts the number to a double.
doubleValue(). Method in class [Link]
Converts the number to a double.
o
doubleValue(). Method in class [Link]
Returns the value of this Byte as a double.
doubleValue(). Method in class [Link]
Returns the double value of this Double.
doubleValue(). Method in class [Link]
i.c
Returns the double value of this Float.
doubleValue(). Method in class [Link]
Returns the value of this Integer as a double.
doubleValue(). Method in class [Link]
Returns the value of this Long as a double.
doubleValue(). Method in class [Link]
Returns the value of the specified number as a double.
doubleValue(). Method in class [Link]
Returns the value of this Short as a double.
DOWN. Static variable in class [Link]
dil
The down arrow action-key.
down(int). Method in class [Link]
Change the current stackframe to be one or more frames lower (as in, toward the current program counter).
drain(). Method in class [Link]
Drain any buffered data in ObjectOutputStream.
draw3DRect(int, int, int, int, boolean). Method in class [Link]
Draws a 3-D highlighted outline of the specified rectangle.
drawArc(int, int, int, int, int, int). Method in class [Link]
Draws the outline of an arc covering the specified rectangle, starting at startAngle and extending for arcAngle degrees, using
the current color.
drawBytes(byte[], int, int, int, int). Method in class [Link]
va
Draws the specified bytes using the current font and color.
drawChars(char[], int, int, int, int). Method in class [Link]
Draws the specified characters using the current font and color.
drawImage(Image, int, int, Color, ImageObserver). Method in class [Link]
Draws as much of the specified image as is currently available at the specified coordinate (x, y) with the given solid
background color.
drawImage(Image, int, int, ImageObserver). Method in class [Link]
Draws as much of the specified image as is currently available at the specified coordinate (x, y).
drawImage(Image, int, int, int, int, Color, ImageObserver). Method in class [Link]
Draws as much of the specified image as has already been scaled to fit inside the specified rectangle with the given solid
ja
background color.
drawImage(Image, int, int, int, int, ImageObserver). Method in class [Link]
Draws as much of the specified image as has already been scaled to fit inside the specified rectangle.
drawImage(Image, int, int, int, int, int, int, int, int, Color, ImageObserver). Method in class [Link]
Draws as much of the specified area of the specified image as is currently available, scaling it on the fly to fit inside the
specified area of the destination drawable surface with the given solid background color.
drawImage(Image, int, int, int, int, int, int, int, int, ImageObserver). Method in class [Link]
w.
Draws as much of the specified area of the specified image as is currently available, scaling it on the fly to fit inside the
specified area of the destination drawable surface.
drawLine(int, int, int, int). Method in class [Link]
Draws a line between the coordinates (x1,y1) and (x2,y2) using the current color.
drawOval(int, int, int, int). Method in class [Link]
Draws the outline of an oval covering the specified rectangle using the current color.
drawPolygon(int[], int[], int). Method in class [Link]
Draws the outline of a polygon defined by arrays of x coordinates and y coordinates using the current color.
drawPolygon(Polygon). Method in class [Link]
Draws the outline of a polygon defined by the specified Polygon object using the current color.
ww
316
317
m
Prints a stack trace of the current thread.
o
E_RESIZE_CURSOR. Static variable in class [Link]
The east-resize cursor type.
E_RESIZE_CURSOR. Static variable in class [Link]
EAST. Static variable in class [Link]
The east layout constraint.
i.c
EAST. Static variable in class [Link]
echoCharIsSet(). Method in class [Link]
Returns true if this TextField has a character set for echoing.
elementAt(int). Method in class [Link]
Returns the component at the specified index.
elementCount. Variable in class [Link]
The number of valid components in the vector.
elementData. Variable in class [Link]
The array buffer into which the components of the vector are stored.
elements(). Method in class [Link]
dil
Returns an enumeration of the values in this dictionary.
elements(). Method in class [Link]
Returns an enumeration of the values in this hashtable.
elements(). Method in class [Link]
Returns an enumeration of the components of this vector.
empty(). Method in class [Link]
Tests if this stack is empty.
EmptyStackException(). Constructor for class [Link]
Constructs a new EmptyStackException with no detail message.
enable(). Static method in class [Link]
Cause the Compiler to resume operation.
va
enable(). Method in class [Link]
enable(). Method in interface [Link]
DEPRECATED: Replaced by setEnabled(boolean).
enable(). Method in class [Link]
enable(). Method in interface [Link]
DEPRECATED: Replaced by setEnabled(boolean).
enable(boolean). Method in class [Link]
enable(boolean). Method in class [Link]
enableEvents(long). Method in class [Link]
Enables the events defined by the specified event mask parameter to be delivered to this component.
ja
317
318
m
SPI: Resets the digest for further use.
engineSetParameter(String, Object). Method in class [Link]
SPI: Sets the specified algorithm parameter to the specified value.
engineSign(). Method in class [Link]
SPI: Returns the signature bytes of all the data updated so far.
engineUpdate(byte). Method in class [Link]
SPI: Updates the digest using the specified byte.
engineUpdate(byte). Method in class [Link]
o
SPI: Updates the data to be signed or verified using the specified byte.
engineUpdate(byte[], int, int). Method in class [Link]
SPI: Updates the digest using the specified array of bytes, starting at the specified offset.
engineUpdate(byte[], int, int). Method in class [Link]
SPI: Updates the data to be signed or verified, using the specified array of bytes, starting at the specified offset.
i.c
engineVerify(byte[]). Method in class [Link]
SPI: Verifies the passed-in signature.
ENGLISH. Static variable in class [Link]
Useful constant for language.
ensureCapacity(int). Method in class [Link]
Ensures that the capacity of the buffer is at least equal to the specified minimum.
ensureCapacity(int). Method in class [Link]
Increases the capacity of this vector, if necessary, to ensure that it can hold at least the number of components specified by
the minimum capacity argument.
ENTER. Static variable in class [Link]
dil
The Enter key.
entries(). Method in interface [Link]
Returns an enumeration of the entries in this ACL.
entries(). Method in class [Link]
Returns an enumeration of the ZIP file entries.
enumerate(Thread[]). Static method in class [Link]
Copies into the specified array every active thread in this thread group and its subgroups.
enumerate(Thread[]). Method in class [Link]
Copies into the specified array every active thread in this thread group and its subgroups.
enumerate(Thread[], boolean). Method in class [Link]
Copies into the specified array every active thread in this thread group.
va
enumerate(ThreadGroup[]). Method in class [Link]
Copies into the specified array references to every active subgroup in this thread group.
enumerate(ThreadGroup[], boolean). Method in class [Link]
Copies into the specified array references to every active subgroup in this thread group.
eof. Variable in class [Link]
True if there is not more data in the buffered part of the stream.
EOFException(). Constructor for class [Link]
Constructs an EOFException with no detail message.
EOFException(String). Constructor for class [Link]
Constructs an EOFException with the specified detail message.
ja
key and both either use or don't use the SHIFT key.
equals(Object). Method in class [Link]
Returns true iff x is a BigDecimal whose value is equal to this number.
equals(Object). Method in class [Link]
Returns true iff x is a BigInteger whose value is equal to this number.
equals(Object). Method in class [Link]
Compares this object against the specified object.
equals(Object). Method in class [Link]
Returns true if and only if the argument is not null and is a Boolean object that contains the same boolean value as this
object.
ww
318
319
m
Compares this Constructor against the specified object.
equals(Object). Method in class [Link]
Compares two dates.
equals(Object). Method in class [Link]
Overrides equals
equals(Object). Method in class [Link]
Override equals
equals(Object). Method in class [Link]
o
Overrides equals
equals(Object). Method in class [Link]
Override equals
equals(Object). Method in class [Link]
Checks whether two dimension objects have equal values.
i.c
equals(Object). Method in class [Link]
Compares this object against the specified object.
equals(Object). Method in class [Link]
Compares this Field against the specified object.
equals(Object). Method in class [Link]
Compares this object against the specified object.
equals(Object). Method in class [Link]
Compares this object against some other object.
equals(Object). Method in class [Link]
Compares this object to the specifed object.
dil
equals(Object). Method in class [Link]
Overrides Calendar Compares the time field records.
equals(Object). Method in class [Link]
Tests for equality between the specified object and this identity.
equals(Object). Method in class [Link]
Compares this object against the specified object.
equals(Object). Method in class [Link]
Checks whether two insets objects are equal.
equals(Object). Method in class [Link]
Compares this object to the specified object.
equals(Object). Method in class [Link]
va
Compares two Objects for equality.
equals(Object). Method in class [Link]
Compares this object against the specified object.
equals(Object). Method in class [Link]
Equality comparision between two message format objects
equals(Object). Method in class [Link]
Compares this Method against the specified object.
equals(Object). Method in class [Link]
Overrides equals
equals(Object). Method in class [Link]
ja
319
320
m
Convenience method for comparing the equality of two strings based on this Collator's collation rules.
equals(Timestamp). Method in class [Link]
Test Timestamp values for equality
equalsIgnoreCase(String). Method in class [Link]
Compares this String to another object.
ERA. Static variable in class [Link]
Useful constant for date and time.
ERA_FIELD. Static variable in class [Link]
o
Useful constant for ERA field alignment.
err. Static variable in class [Link]
A handle to the standard error stream.
err. Static variable in class [Link]
The "standard" error output stream.
i.c
ERROR. Static variable in interface [Link]
An image which was being tracked asynchronously has encountered an error.
Error(). Constructor for class [Link]
Constructs an Error with no specified detail message.
Error(String). Constructor for class [Link]
Constructs an Error with the specified detail message.
ERRORED. Static variable in class [Link]
Flag indicating the download of some media encountered an error.
ESCAPE. Static variable in class [Link]
The Escape key.
dil
Event(Object, int, Object). Constructor for class [Link]
Constructs an event with the specified target component, event type, and argument.
Event(Object, long, int, int, int, int, int). Constructor for class [Link]
Constructs an event with the specified target component, time stamp, event type, x and y coordinates, keyboard key, state of
the modifier keys and an argument set to null.
Event(Object, long, int, int, int, int, int, Object). Constructor for class [Link]
Constructs an event with the specified target component, time stamp, event type, x and y coordinates, keyboard key, state of
the modifier keys and argument.
EventObject(Object). Constructor for class [Link]
EventObject(Object). Constructor for class [Link]
EventQueue(). Constructor for class [Link]
va
EventSetDescriptor(Class, String, Class, String). Constructor for class [Link]
This constructor creates an EventSetDescriptor assuming that you are following the most simple standard design pattern
where a named event "fred" is (1) delivered as a call on the single method of interface FredListener, (2) has a single argument
of type FredEvent, and (3) where the FredListener may be registered with a call on an addFredListener method of the source
component and removed with a call on a removeFredListener method.
EventSetDescriptor(Class, String, Class, String[], String, String). Constructor for class [Link]
This constructor creates an EventSetDescriptor from scratch using string names.
EventSetDescriptor(String, Class, Method[], Method, Method). Constructor for class [Link]
This constructor creates an EventSetDescriptor from scratch using [Link] and [Link] objects.
EventSetDescriptor(String, Class, MethodDescriptor[], Method, Method). Constructor for class [Link]
ja
This constructor creates an EventSetDescriptor from scratch using [Link] and [Link]
objects.
evt. Variable in class [Link]
The next event.
Exception(). Constructor for class [Link]
Constructs an Exception with no specified detail message.
Exception(String). Constructor for class [Link]
w.
320
321
m
A prepared SQL query is executed and its ResultSet is returned.
executeQuery(String). Method in interface [Link]
Execute a SQL statement that returns a single ResultSet.
executeUpdate(). Method in interface [Link]
Execute a SQL INSERT, UPDATE or DELETE statement.
executeUpdate(String). Method in interface [Link]
Execute a SQL INSERT, UPDATE or DELETE statement.
exists(). Method in class [Link]
o
Tests if this File exists.
exit(int). Method in class [Link]
Terminates the currently running Java Virtual Machine.
exit(int). Static method in class [Link]
Terminates the currently running Java Virtual Machine.
i.c
exitValue(). Method in class [Link]
Returns the exit value for the subprocess.
exp(double). Static method in class [Link]
Returns the exponential number e (i.e., 2.718...) raised to the power of a double value.
ExportException(String). Constructor for class [Link]
Create A remote exception with the specified string
ExportException(String, Exception). Constructor for class [Link]
Create A remote exception with the specified string, and the exception specified.
exportObject(Remote). Static method in class [Link]
Export the remote object to make it available to receive incoming calls.
dil
exportObject(Remote, Object). Method in interface [Link]
Find or create a client stub object for the supplied Remote.
321
322
Creates a File instance that represents the file with the specified name in the specified directory.
File(String). Constructor for class [Link]
Creates a File instance that represents the file whose pathname is the given path argument.
m
File(String, String). Constructor for class [Link]
Creates a File instance whose pathname is the pathname of the specified directory, followed by the separator character,
followed by the name argument.
FileDescriptor(). Constructor for class [Link]
FileDialog(Frame). Constructor for class [Link]
Creates a file dialog for loading a file.
FileDialog(Frame, String). Constructor for class [Link]
Creates a file dialog for loading a file.
o
FileDialog(Frame, String, int). Constructor for class [Link]
Creates a file dialog with the specified title and mode.
FileInputStream(File). Constructor for class [Link]
Creates an input file stream to read from the specified File object.
FileInputStream(FileDescriptor). Constructor for class [Link]
i.c
Creates an input file stream to read from the specified file descriptor.
FileInputStream(String). Constructor for class [Link]
Creates an input file stream to read from a file with the specified name.
fileNameMap. Static variable in class [Link]
FileNotFoundException(). Constructor for class [Link]
Constructs a FileNotFoundException with no detail message.
FileNotFoundException(String). Constructor for class [Link]
Constructs a FileNotFoundException with the specified detail message.
FileOutputStream(File). Constructor for class [Link]
Creates a file output stream to write to the specified File object.
dil
FileOutputStream(FileDescriptor). Constructor for class [Link]
Creates an output file stream to write to the specified file descriptor.
FileOutputStream(String). Constructor for class [Link]
Creates an output file stream to write to the file with the specified name.
FileOutputStream(String, boolean). Constructor for class [Link]
Creates an output file with the specified system dependent file name.
FileReader(File). Constructor for class [Link]
FileReader(FileDescriptor). Constructor for class [Link]
FileReader(String). Constructor for class [Link]
FileWriter(File). Constructor for class [Link]
FileWriter(FileDescriptor). Constructor for class [Link]
va
FileWriter(String). Constructor for class [Link]
FileWriter(String, boolean). Constructor for class [Link]
fill. Variable in class [Link]
fill(). Method in class [Link]
Fills input buffer with more data to decompress.
fill3DRect(int, int, int, int, boolean). Method in class [Link]
Paints a 3-D highlighted rectangle filled with the current color.
fillArc(int, int, int, int, int, int). Method in class [Link]
Fills an arc bounded by the specified rectangle, starting at startAngle and extending for arcAngle degrees, with the current
color.
ja
322
323
filterRGBPixels(int, int, int, int, int[], int, int). Method in class [Link]
Filters a buffer of pixels in the default RGB ColorModel by passing them one by one through the filterRGB method.
FilterWriter(Writer). Constructor for class [Link]
m
Create a new filtered writer.
FINAL. Static variable in class [Link]
finalize(). Method in class [Link]
Called by the garbage collector on an object when garbage collection determines that there are no more references to the
object.
finalize(). Method in class [Link]
Frees the compressor when garbage is collected.
finalize(). Method in class [Link]
o
Ensures that the close method of this file input stream is called when there are no more references to it.
finalize(). Method in class [Link]
Ensures that the close method of this file output stream is called when there are no more references to this stream.
finalize(). Method in class [Link]
Disposes of this graphics context once it is no longer referenced.
i.c
finalize(). Method in class [Link]
Frees the decompressor when garbage is collected.
finalize(). Method in class [Link]
Called by the garbage collector on an object when garbage collection determines that there are no more references to the
object.
finalize(). Method in class [Link]
Ends this print job once it is no longer referenced.
finalize(). Method in class [Link]
findClass(String). Method in class [Link]
Find a specified class.
dil
findColumn(String). Method in interface [Link]
Map a Resultset column name to a ResultSet column index.
findEditor(Class). Static method in class [Link]
Locate a value editor for a given target type.
findLoadedClass(String). Method in class [Link]
findSystemClass(String). Method in class [Link]
Finds the system class with the specified name, loading it in if necessary.
finish(). Method in class [Link]
When called, indicates that compression should end with the current contents of the input buffer.
finish(). Method in class [Link]
Finishes writing compressed data to the output stream without closing the underlying stream.
va
finish(). Method in class [Link]
Finishes writing compressed data to the output stream without closing the underlying stream.
finish(). Method in class [Link]
Finishes writing the contents of the ZIP output stream without closing the underlying stream.
finished(). Method in class [Link]
Returns true if the end of the compressed data output stream has been reached.
finished(). Method in class [Link]
Return true if the end of the compressed data stream has been reached.
firePropertyChange(). Method in class [Link]
Report that we have been modified to any interested listeners.
ja
Set the position to getBeginIndex() and return the character at that position.
first(). Method in class [Link]
Set the position to getBeginIndex() and return the character at that position.
first(Container). Method in class [Link]
Flip to the first card.
firstElement(). Method in class [Link]
Returns the first component of this vector.
flipBit(int). Method in class [Link]
Returns a BigInteger whose value is equivalent to this number with the designated bit flipped.
FLOAT. Static variable in class [Link]
ww
323
324
m
Returns the float value of this Double.
floatValue(). Method in class [Link]
Returns the float value of this Float object.
floatValue(). Method in class [Link]
Returns the value of this Integer as a float.
floatValue(). Method in class [Link]
Returns the value of this Long as a float.
floatValue(). Method in class [Link]
o
Returns the value of the specified number as a float.
floatValue(). Method in class [Link]
Returns the value of this Short as a float.
floor(double). Static method in class [Link]
Returns the largest (closest to positive infinity) double value that is not greater than the argument and is equal to a
i.c
mathematical integer.
FlowLayout(). Constructor for class [Link]
Constructs a new Flow Layout with a centered alignment and a default 5-unit horizontal and vertical gap.
FlowLayout(int). Constructor for class [Link]
Constructs a new Flow Layout with the specified alignment and a default 5-unit horizontal and vertical gap.
FlowLayout(int, int, int). Constructor for class [Link]
Constructs a new Flow Layout with the specified alignment and gap values.
flush(). Method in class [Link]
Flushes this buffered output stream.
flush(). Method in class [Link]
dil
Flush the stream.
flush(). Method in class [Link]
Flush the stream.
flush(). Method in class [Link]
Flushes this data output stream.
flush(). Method in class [Link]
Flushes this output stream and forces any buffered output bytes to be written out to the stream.
flush(). Method in class [Link]
Flush the stream.
flush(). Method in class [Link]
Flushes all resources being used by this Image object.
va
flush(). Method in interface [Link]
Flushes the stream.
flush(). Method in class [Link]
Flushes the stream.
flush(). Method in class [Link]
Flushes this output stream and forces any buffered output bytes to be written out.
flush(). Method in class [Link]
Flush the stream.
flush(). Method in class [Link]
Flushes this output stream and forces any buffered output bytes to be written out.
ja
Marks the last integer id for the range of focus event ids.
FOCUS_LOST. Static variable in class [Link]
The focus lost event type.
FocusAdapter(). Constructor for class [Link]
FocusEvent(Component, int). Constructor for class [Link]
Constructs a permanent-level FocusEvent object with the specified source component and type.
FocusEvent(Component, int, boolean). Constructor for class [Link]
Constructs a FocusEvent object with the specified source component, type, and whether or not the focus event is a
temporary level event.
focusGained(FocusEvent). Method in class [Link]
Handles the focusGained event by invoking the focusGained methods on listener-a and listener-b.
focusGained(FocusEvent). Method in class [Link]
324
325
m
Handles the focusLost event by invoking the focusLost methods on listener-a and listener-b.
focusLost(FocusEvent). Method in class [Link]
focusLost(FocusEvent). Method in interface [Link]
Invoked when a component loses the keyboard focus.
following(int). Method in class [Link]
Return the first boundary following the specified offset.
font. Variable in class [Link]
The actual font.
o
Font(String, int, int). Constructor for class [Link]
Creates a new font with the specified name, style and point size.
FontMetrics(Font). Constructor for class [Link]
Creates a new FontMetrics object with the specified font.
forClass(). Method in class [Link]
i.c
Return the class in the local VM that this version is mapped to.
forDigit(int, int). Static method in class [Link]
Determines the character representation for a specific digit in the specified radix.
FORMAT. Static variable in class [Link]
Format(). Constructor for class [Link]
format(Date). Method in class [Link]
Formats a Date into a date/time string.
format(Date, StringBuffer, FieldPosition). Method in class [Link]
Formats a Date into a date/time string.
format(Date, StringBuffer, FieldPosition). Method in class [Link]
dil
Overrides DateFormat
Formats a date or time, which is the standard millis since 24:00 GMT, Jan 1, 1970.
format(double). Method in class [Link]
Specialization of format.
format(double, StringBuffer, FieldPosition). Method in class [Link]
Specialization of format.
format(double, StringBuffer, FieldPosition). Method in class [Link]
Specialization of format.
format(double, StringBuffer, FieldPosition). Method in class [Link]
Specialization of format.
va
format(long). Method in class [Link]
Specialization of format.
format(long, StringBuffer, FieldPosition). Method in class [Link]
Specialization of format.
format(long, StringBuffer, FieldPosition). Method in class [Link]
Specialization of format.
format(long, StringBuffer, FieldPosition). Method in class [Link]
Specialization of format.
format(Object). Method in class [Link]
Formats an object to produce a string.
ja
325
326
m
FRIDAY. Static variable in class [Link]
Useful constant for days of week.
fromHex(String). Static method in class [Link]
Convert hexadecimal strings to ints.
FULL. Static variable in class [Link]
Constant for full style pattern.
FULL_DECOMPOSITION. Static variable in class [Link]
Decomposition mode value.
o
G
i.c
gc(). Method in class [Link]
Runs the garbage collector.
gc(). Static method in class [Link]
Runs the garbage collector.
gc(RemoteObject[]). Method in class [Link]
Free all objects referenced by the debugger.
gcd(BigInteger). Method in class [Link]
Returns a BigInteger whose value is the greatest common denominator of abs(this) and abs(val).
generateKeyPair(). Method in class [Link]
Generates a key pair.
dil
GERMAN. Static variable in class [Link]
Useful constant for language.
GERMANY. Static variable in class [Link]
Useful constant for country.
get(). Method in class [Link]
Return the boolean's value.
get(). Method in class [Link]
Return the byte's value.
get(). Method in class [Link]
Return the char's value.
get(). Method in class [Link]
va
Return the double's value.
get(). Method in class [Link]
Return the float's value.
get(). Method in class [Link]
Return the int's value.
get(). Method in class [Link]
Return the long's value.
get(). Method in class [Link]
Return the short's value.
get(int). Method in class [Link]
ja
326
327
m
Returns the Adjustable object where this event originated.
getAdjustmentType(). Method in class [Link]
Returns the type of adjustment which caused the value changed event.
getAdler(). Method in class [Link]
Returns the ADLER-32 value of the uncompressed data.
getAdler(). Method in class [Link]
Returns the ADLER-32 value of the uncompressed data.
getAlgorithm(). Method in interface [Link]
o
Returns the standard algorithm name this key is for.
getAlgorithm(). Method in class [Link]
Returns the standard name of the algorithm for this key generator.
getAlgorithm(). Method in class [Link]
Returns a string that identifies the algorithm, independent of implementation details.
i.c
getAlgorithm(). Method in class [Link]
Returns the name of the algorithm for this signature object.
getAlgorithmProperty(String, String). Static method in class [Link]
Gets a specified property for an algorithm.
getAlignment(). Method in class [Link]
Returns the alignment value for this layout, one of LEFT, CENTER, or RIGHT.
getAlignment(). Method in class [Link]
Gets the current alignment of this label.
getAlignmentX(). Method in class [Link]
Returns the alignment along the x axis.
dil
getAlignmentX(). Method in class [Link]
Returns the alignment along the x axis.
getAlignmentY(). Method in class [Link]
Returns the alignment along the y axis.
getAlignmentY(). Method in class [Link]
Returns the alignment along the y axis.
getAllByName(String). Static method in class [Link]
Determines all the IP addresses of a host, given the host's name.
getAllowUserInteraction(). Method in class [Link]
Returns the value of the allowUserInteraction field for this object.
getAlpha(int). Method in class [Link]
va
The subclass must provide a function which provides the alpha color compoment for the specified pixel.
getAlpha(int). Method in class [Link]
Return the alpha transparency value for the specified pixel in the range 0-255.
getAlpha(int). Method in class [Link]
Returns the alpha transparency value for the specified pixel in the range 0-255.
getAlphaMask(). Method in class [Link]
Returns the mask indicating which bits in a pixel contain the alpha transparency component.
getAlphas(byte[]). Method in class [Link]
Copies the array of alpha transparency values into the given array.
getAmPmStrings(). Method in class [Link]
ja
327
328
m
Get the set of Locales for which TextBoundaries are installed
getAvailableLocales(). Static method in class [Link]
Gets the set of locales for which Calendars are installed.
getAvailableLocales(). Static method in class [Link]
Get the set of Locales for which Collators are installed.
getAvailableLocales(). Static method in class [Link]
Gets the set of locales for which DateFormats are installed.
getAvailableLocales(). Static method in class [Link]
o
Get the set of Locales for which NumberFormats are installed
getBackground(). Method in class [Link]
Gets the background color.
getBeanClass(). Method in class [Link]
getBeanDescriptor(). Method in interface [Link]
i.c
getBeanDescriptor(). Method in class [Link]
Deny knowledge about the class and customizer of the bean.
getBeanInfo(Class). Static method in class [Link]
Introspect on a Java bean and learn about all its properties, exposed methods, and events.
getBeanInfo(Class, Class). Static method in class [Link]
Introspect on a Java bean and learn all about its properties, exposed methods, below a given "stop" point.
getBeanInfoSearchPath(). Static method in class [Link]
getBeginIndex(). Method in interface [Link]
Return the start index of the text.
getBeginIndex(). Method in class [Link]
dil
Retrieve the index of the first character in the requested field.
getBeginIndex(). Method in class [Link]
Return the start index of the text.
getBestRowIdentifier(String, String, String, int, boolean). Method in interface [Link]
Get a description of a table's optimal set of columns that uniquely identifies a row.
getBigDecimal(int, int). Method in interface [Link]
Get the value of a NUMERIC parameter as a [Link] object.
getBigDecimal(int, int). Method in interface [Link]
Get the value of a column in the current row as a [Link] object.
getBigDecimal(String, int). Method in interface [Link]
Get the value of a column in the current row as a [Link] object.
va
getBinaryStream(int). Method in interface [Link]
A column value can be retrieved as a stream of uninterpreted bytes and then read in chunks from the stream.
getBinaryStream(String). Method in interface [Link]
A column value can be retrieved as a stream of uninterpreted bytes and then read in chunks from the stream.
getBlockIncrement(). Method in interface [Link]
Gets the block value increment for the adjustable object.
getBlockIncrement(). Method in class [Link]
Gets the block increment for this scrollbar.
getBlue(). Method in class [Link]
Gets the blue component.
ja
Returns the mask indicating which bits in a pixel contain the blue color component.
getBlues(byte[]). Method in class [Link]
Copies the array of blue color components into the given array.
getBoolean(int). Method in interface [Link]
Get the value of a BIT parameter as a Java boolean.
getBoolean(int). Method in interface [Link]
Get the value of a column in the current row as a Java boolean.
getBoolean(Object). Method in class [Link]
Get the value of a field as a boolean on specified object.
getBoolean(Object, int). Static method in class [Link]
ww
Returns the value of the indexed component in the specified array object, as a boolean.
getBoolean(String). Static method in class [Link]
Returns is true if and only if the system property named by the argument exists and is equal to the string "true".
getBoolean(String). Method in interface [Link]
Get the value of a column in the current row as a Java boolean.
getBoundingBox(). Method in class [Link]
getBounds(). Method in class [Link]
Returns the current bounds of this component.
getBounds(). Method in class [Link]
Returns the bounding box of the shape.
getBounds(). Method in class [Link]
Returns the bounds of this rectangle.
328
329
m
Return the string buffer itself.
getBundle(String). Static method in class [Link]
Get the appropriate ResourceBundle subclass.
getBundle(String, Locale). Static method in class [Link]
Get the appropriate ResourceBundle subclass.
getByName(String). Static method in class [Link]
Determines the IP address of a host, given the host's name.
getByte(int). Method in interface [Link]
o
Get the value of a TINYINT parameter as a Java byte.
getByte(int). Method in interface [Link]
Get the value of a column in the current row as a Java byte.
getByte(Object). Method in class [Link]
Get the value of a field as a byte on specified object.
i.c
getByte(Object, int). Static method in class [Link]
Returns the value of the indexed component in the specified array object, as a byte.
getByte(String). Method in interface [Link]
Get the value of a column in the current row as a Java byte.
getBytes(). Method in class [Link]
Convert this String into bytes according to the platform's default character encoding, storing the result into a new byte array.
getBytes(int). Method in interface [Link]
Get the value of a SQL BINARY or VARBINARY parameter as a Java byte[]
getBytes(int). Method in interface [Link]
Get the value of a column in the current row as a Java byte array.
dil
getBytes(int, int, byte[], int). Method in class [Link]
Copies characters from this string into the destination byte array.
getBytes(String). Method in interface [Link]
Get the value of a column in the current row as a Java byte array.
getBytes(String). Method in class [Link]
Convert this String into bytes according to the specified character encoding, storing the result into a new byte array.
getCalendar(). Method in class [Link]
Gets the calendar associated with this date/time formatter.
getCanonicalPath(). Method in class [Link]
Gets the official, canonical path of the File.
getCaretPosition(). Method in class [Link]
va
Returns the position of the text insertion caret for the text component.
getCaretPosition(). Method in interface [Link]
getCatalog(). Method in interface [Link]
Return the Connection's current catalog name.
getCatalogName(int). Method in interface [Link]
What's a column's table's catalog name?
getCatalogs(). Method in interface [Link]
Get the catalog names available in this database.
getCatalogSeparator(). Method in interface [Link]
What's the separator between catalog and table name?
ja
Create BreakIterator for character-breaks using default locale Returns an instance of a BreakIterator implementing character
breaks.
getCharacterInstance(Locale). Static method in class [Link]
Create BreakIterator for character-breaks using specified locale Returns an instance of a BreakIterator implementing
character breaks.
getChars(int, int, char[], int). Method in class [Link]
Copies characters from this string into the destination character array.
getChars(int, int, char[], int). Method in class [Link]
Characters are copied from this string buffer into the destination character array dst.
getCheckboxGroup(). Method in class [Link]
ww
329
330
Returns an array containing Class objects representing all the public classes and interfaces that are members of the class
represented by this Class object.
getClassLoader(). Method in class [Link]
m
Determines the class loader for the class.
getClassLoader(). Method in class [Link]
Return the classloader for this class.
getClassName(). Method in class [Link]
Gets parameter passed by constructor.
getClazz(). Method in class [Link]
Returns the object's class.
getClickCount(). Method in class [Link]
o
Return the number of mouse clicks associated with this event.
getClientHost(). Static method in class [Link]
Return the hostname of the current client.
getClientHost(). Method in interface [Link]
Return the hostname of the current client.
i.c
getClip(). Method in class [Link]
Return a Shape object representing the current clipping area.
getClipBounds(). Method in class [Link]
Returns the bounding rectangle of the current clipping area.
getClipRect(). Method in class [Link]
getCodeBase(). Method in class [Link]
Gets the base URL.
getCodeBase(). Method in interface [Link]
Gets the base URL.
getCollationElementIterator(String). Method in class [Link]
dil
Return a CollationElementIterator for the given String.
getCollationKey(String). Method in class [Link]
Transforms the String into a series of bits that can be compared bitwise to other CollationKeys.
getCollationKey(String). Method in class [Link]
Transforms the string into a series of characters that can be compared with [Link].
getColor(). Method in class [Link]
Gets the current color.
getColor(String). Static method in class [Link]
Gets the specified Color property.
getColor(String, Color). Static method in class [Link]
Gets the specified Color property of the specified Color.
va
getColor(String, int). Static method in class [Link]
Gets the specified Color property of the color value.
getColorModel(). Method in class [Link]
Gets the ColorModel used to display the component on the output device.
getColorModel(). Method in interface [Link]
getColorModel(). Method in class [Link]
Get the ColorModel for the pixels stored in the array.
getColorModel(). Method in class [Link]
Returns the ColorModel of the screen.
getColumnCount(). Method in interface [Link]
ja
330
331
m
Returns the component or subcomponent that contains the specified point.
getComponentAt(Point). Method in class [Link]
Locates the component that contains the specified point.
getComponentCount(). Method in class [Link]
Returns the number of components in this panel.
getComponents(). Method in class [Link]
Gets all the components in this container.
getComponentType(). Method in class [Link]
o
If this class represents an array type, returns the Class object representing the component type of the array; otherwise returns
null.
getCompressedSize(). Method in class [Link]
Returns the compressed size of the entry data, or -1 if not known.
getConnection(String). Static method in class [Link]
i.c
Attempt to establish a connection to the given database URL.
getConnection(String, Properties). Static method in class [Link]
Attempt to establish a connection to the given database URL.
getConnection(String, String, String). Static method in class [Link]
Attempt to establish a connection to the given database URL.
getConstraints(Component). Method in class [Link]
Retrieves the constraints for the specified component.
getConstructor(Class[]). Method in class [Link]
Returns a Constructor object that reflects the specified public constructor of the class represented by this Class object.
getConstructors(). Method in class [Link]
dil
Returns an array containing Constructor objects reflecting all the public constructors of the class represented by this Class
object.
getContainer(). Method in class [Link]
Returns the container where this event originated.
getContent(). Method in class [Link]
Returns the contents of this URL.
getContent(). Method in class [Link]
Retrieves the contents of this URL connection.
getContent(URLConnection). Method in class [Link]
Given a URL connect stream positioned at the beginning of the representation of an object, this method reads that stream and
creates an object from it.
va
getContentEncoding(). Method in class [Link]
Returns the value of the content-encoding header field.
getContentLength(). Method in class [Link]
Returns the value of the content-length header field.
getContents(). Method in class [Link]
See class description.
getContents(Object). Method in class [Link]
Returns a transferable object representing the current contents of the clipboard.
getContentType(). Method in class [Link]
Returns the value of the content-type header field.
ja
key table (describe how one table imports another's key.) This should normally return a single foreign key/primary key pair
(most tables only import a foreign key from a table once.) They are ordered by FKTABLE_CAT, FKTABLE_SCHEM,
FKTABLE_NAME, and KEY_SEQ.
getCurrencyInstance(). Static method in class [Link]
Returns a currency format for the current default locale.
getCurrencyInstance(Locale). Static method in class [Link]
Returns a currency format for the specified locale.
getCurrent(). Method in class [Link]
getCurrentFrame(). Method in class [Link]
Get the current stack frame.
ww
331
332
m
What's the name of this database product?
getDatabaseProductVersion(). Method in interface [Link]
What's the version of this database product?
getDataSize(). Method in class [Link]
Get the number of bytes of data that should have been transferred.
getDate(). Method in class [Link]
Returns the day of the month represented by this date.
getDate(). Method in class [Link]
o
Returns the day of the month represented by this date.
getDate(). Method in class [Link]
Returns the value of the date header field.
getDate(int). Method in interface [Link]
Get the value of a SQL DATE parameter as a [Link] object
i.c
getDate(int). Method in interface [Link]
Get the value of a column in the current row as a [Link] object.
getDate(String). Method in interface [Link]
Get the value of a column in the current row as a [Link] object.
getDateFormatSymbols(). Method in class [Link]
Gets the date/time formatting data.
getDateInstance(). Static method in class [Link]
Gets the date formatter with the default formatting style for the default locale.
getDateInstance(int). Static method in class [Link]
Gets the date formatter with the given formatting style for the default locale.
dil
getDateInstance(int, Locale). Static method in class [Link]
Gets the date formatter with the given formatting style for the given locale.
getDateTimeInstance(). Static method in class [Link]
Gets the date/time formatter with the default formatting style for the default locale.
getDateTimeInstance(int, int). Static method in class [Link]
Gets the date/time formatter with the given date and time formatting styles for the default locale.
getDateTimeInstance(int, int, Locale). Static method in class [Link]
Gets the date/time formatter with the given formatting styles for the given locale.
getDay(). Method in class [Link]
Returns the day of the week represented by this date.
getDay(). Method in class [Link]
va
Returns the day of the week represented by this date.
getDecimalFormatSymbols(). Method in class [Link]
Returns the decimal format symbols, which is generally not changed by the programmer or user.
getDecimalSeparator(). Method in class [Link]
character used for decimal sign.
getDeclaredClasses(). Method in class [Link]
Returns an array of Class objects reflecting all the classes and interfaces declared as members of the class represented by this
Class object.
getDeclaredConstructor(Class[]). Method in class [Link]
Returns a Constructor object that reflects the specified declared constructor of the class or interface represented by this Class
ja
object.
getDeclaredConstructors(). Method in class [Link]
Returns an array of Constructor objects reflecting all the constructors declared by the class represented by this Class object.
getDeclaredField(String). Method in class [Link]
Returns a Field object that reflects the specified declared field of the class or interface represented by this Class object.
getDeclaredFields(). Method in class [Link]
Returns an array of Field objects reflecting all the fields declared by the class or interface represented by this Class object.
w.
332
333
m
getDefaultCursor(). Static method in class [Link]
Return the system default cursor.
getDefaultEventIndex(). Method in interface [Link]
A bean may have a "default" event that is the event that will mostly commonly be used by human's when using the bean.
getDefaultEventIndex(). Method in class [Link]
Deny knowledge of a default event.
getDefaultPropertyIndex(). Method in interface [Link]
A bean may have a "default" property that is the property that will mostly commonly be initially chosen for update by human's
o
who are customizing the bean.
getDefaultPropertyIndex(). Method in class [Link]
Deny knowledge of a default property.
getDefaultRequestProperty(String). Static method in class [Link]
Returns the value of the default request property.
i.c
getDefaultStream(). Static method in class [Link]
Return the current default stream for new logs.
getDefaultToolkit(). Static method in class [Link]
Returns the default toolkit.
getDefaultTransactionIsolation(). Method in interface [Link]
What's the database's default transaction isolation level? The values are defined in [Link].
getDefaultUseCaches(). Method in class [Link]
Returns the default value of a URLConnection's useCaches flag.
getDescent(). Method in class [Link]
Gets the font descent.
dil
getDigit(). Method in class [Link]
character used for a digit in a pattern.
getDirectory(). Method in class [Link]
Gets the directory of the Dialog.
getDisplayCountry(). Method in class [Link]
Getter for display of field to user.
getDisplayCountry(Locale). Method in class [Link]
Getter for display of field to user.
getDisplayLanguage(). Method in class [Link]
Getter for display of field to user.
getDisplayLanguage(Locale). Method in class [Link]
va
Getter for display of field to user.
getDisplayName(). Method in class [Link]
getDisplayName(). Method in class [Link]
Getter for display of the entire locale to user.
getDisplayName(Locale). Method in class [Link]
Getter for display of the entire locale to user.
getDisplayVariant(). Method in class [Link]
Getter for display of field to user.
getDisplayVariant(Locale). Method in class [Link]
Getter for display of field to user If the localized name is not found, returns the variant code.
ja
333
334
m
getEditorSearchPath(). Static method in class [Link]
getElement(int). Method in class [Link]
Return an array element.
getElements(). Method in class [Link]
Returns a copy of the array as instances of RemoteValue.
getElements(int, int). Method in class [Link]
Returns a copy of a portion of the array as instances of RemoteValue.
getElementType(). Method in class [Link]
o
Return the element type as a "TC_" constant, such as "TC_CHAR".
getEncoded(). Method in interface [Link]
Returns the encoded key.
getEncoding(). Method in class [Link]
Return the name of the encoding being used by this stream.
i.c
getEncoding(). Method in class [Link]
Return the name of the encoding being used by this stream.
getEndIndex(). Method in interface [Link]
Return the end index of the text.
getEndIndex(). Method in class [Link]
Retrieve the index of the character following the last character in the requested field.
getEndIndex(). Method in class [Link]
Return the end index of the text.
getEntry(String). Method in class [Link]
Returns the ZIP file entry for the given path name.
dil
getenv(String). Static method in class [Link]
Gets an environment variable.
getEras(). Method in class [Link]
Gets era strings.
getErrorCode(). Method in class [Link]
Get the vendor specific exception code
getErrorOffset(). Method in class [Link]
Returns the position where the error was found.
getErrorOffset(). Method in class [Link]
Returns the position where the error was found.
getErrorsAny(). Method in class [Link]
va
Returns a list of all media that have encountered an error.
getErrorsID(int). Method in class [Link]
Returns a list of media with the specified ID that have encountered an error.
getErrorStream(). Method in class [Link]
Gets the error stream of the subprocess.
getEventSetDescriptors(). Method in interface [Link]
getEventSetDescriptors(). Method in class [Link]
Deny knowledge of event sets.
getException(). Method in class [Link]
Returns the exception that occurred during a static initialization that caused this Error to be created.
ja
334
335
m
Return an instance variable, specified by slot number.
getField(String). Method in class [Link]
Returns a Field object that reflects the specified public member field of the class or interface represented by this Class object.
getField(String). Method in class [Link]
Return the static field, specified by name.
getField(String). Method in class [Link]
Return an instance variable, specified by name.
getFields(). Method in class [Link]
o
Returns an array containing Field objects reflecting all the accessible public fields of the class or interface represented by this
Class object.
getFields(). Method in class [Link]
Return all the static fields for this class.
getFields(). Method in class [Link]
i.c
Return the instance (non-static) fields of an object.
getFieldValue(int). Method in class [Link]
Return the value of a static field, specified by its index.
getFieldValue(int). Method in class [Link]
Returns the value of an object's instance variable.
getFieldValue(String). Method in class [Link]
Return the value of a static field, specified by name.
getFieldValue(String). Method in class [Link]
Returns the value of an object's instance variable.
getFile(). Method in class [Link]
dil
Gets the file of the Dialog.
getFile(). Method in class [Link]
Returns the file name of this URL.
getFileDescriptor(). Method in class [Link]
Get the datagram socket file descriptor
getFileDescriptor(). Method in class [Link]
Returns the value of this socket's fd field.
getFilenameFilter(). Method in class [Link]
Gets the filter.
getFilePointer(). Method in class [Link]
Returns the current offset in this file.
va
getFilterInstance(ImageConsumer). Method in class [Link]
Returns a unique instance of an ImageFilter object which will actually perform the filtering for the specified ImageConsumer.
getFirstDayOfWeek(). Method in class [Link]
Gets what the first day of the week is; e.g., Sunday in US, Monday in France.
getFloat(int). Method in interface [Link]
Get the value of a FLOAT parameter as a Java float.
getFloat(int). Method in interface [Link]
Get the value of a column in the current row as a Java float.
getFloat(Object). Method in class [Link]
Get the value of a field as a float on specified object.
ja
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 [Link]
getFontMetrics(Font). Method in class [Link]
Gets the font metrics for the specified font.
getFontMetrics(Font). Method in class [Link]
Returns the screen metrics of the font.
getFontPeer(String, int). Method in class [Link]
Uses the specified Peer interface to create a new Font.
o
getForeground(). Method in class [Link]
Gets the foreground color.
getFormat(). Method in interface [Link]
Returns the name of the coding format.
getFormat(). Method in interface [Link]
i.c
Returns the format used to encode the key or null if the key does not support encoding.
getFormats(). Method in class [Link]
Get the formats passed in the constructor.
getFormats(). Method in class [Link]
Gets formats that were set with setFormats.
getG(). Method in interface [Link]
Returns the base, g.
getGraphics(). Method in class [Link]
Gets a Graphics context for this component.
getGraphics(). Method in interface [Link]
dil
getGraphics(). Method in class [Link]
Gets a graphics object to draw into this image.
getGraphics(). Method in class [Link]
Gets a Graphics object that will draw to the next page.
getGreatestMinimum(int). Method in class [Link]
Gets the highest minimum value for the given field if varies.
getGreatestMinimum(int). Method in class [Link]
Returns highest minimum value for the given field if varies.
getGreen(). Method in class [Link]
Gets the green component.
getGreen(int). Method in class [Link]
va
The subclass must provide a function which provides the green color compoment for the specified pixel.
getGreen(int). Method in class [Link]
Returns the green color compoment for the specified pixel in the range 0-255.
getGreen(int). Method in class [Link]
Returns the green color compoment for the specified pixel in the range 0-255.
getGreenMask(). Method in class [Link]
Returns the mask indicating which bits in a pixel contain the green color component.
getGreens(byte[]). Method in class [Link]
Copies the array of green color components into the given array.
getGregorianChange(). Method in class [Link]
ja
336
337
m
getHgap(). Method in class [Link]
Returns the horizontal gap between components.
getHgap(). Method in class [Link]
Returns the horizontal gap between components.
getHost(). Method in class [Link]
Returns the host name of this URL, if applicable.
getHostAddress(). Method in class [Link]
Returns the IP address string "%d.%d.%d.%d"
o
getHostName(). Method in class [Link]
Returns the hostname for this address.
getHours(). Method in class [Link]
Returns the hour represented by this date.
getHours(). Method in class [Link]
i.c
Returns the hour represented by this date.
getHSBColor(float, float, float). Static method in class [Link]
A static Color factory for generating a Color object from HSB values.
getHScrollbarHeight(). Method in class [Link]
Returns the height that would be occupied by a horizontal scrollbar, which is independent of whether it is currently displayed
by the scroll pane or not.
getHScrollbarHeight(). Method in interface [Link]
getHumanPresentableName(). Method in class [Link]
Returns the human presentable name for the data foramt that this DataFlavor represents.
getIcon(int). Method in interface [Link]
dil
This method returns an image object that can be used to represent the bean in toolboxes, toolbars, etc.
getIcon(int). Method in class [Link]
Claim there are no icons available.
getIconImage(). Method in class [Link]
Returns the icon image for this Frame.
getID(). Method in class [Link]
Returns the event type.
getId(). Method in class [Link]
Returns the id of the object.
getID(). Method in class [Link]
Gets the ID of this time zone.
va
getIdentifierQuoteString(). Method in interface [Link]
What's the string used to quote SQL identifiers? This returns a space " " if identifier quoting isn't supported.
getIdentity(Principal). Method in class [Link]
Retrieves the identity whose name is the same as that of the specified principal.
getIdentity(PublicKey). Method in class [Link]
Retrieves the identity with the specified public key.
getIdentity(String). Method in class [Link]
Returns the identity in this scope with the specified name (if any).
getIfModifiedSince(). Method in class [Link]
Returns the value of this object's ifModifiedSince field.
ja
Returns an image which gets pixel data from the specified URL.
getImage(URL, String). Method in class [Link]
Returns an Image object that can then be painted on the screen.
getImportedKeys(String, String, String). Method in interface [Link]
Get a description of the primary key columns that are referenced by a table's foreign key columns (the primary keys imported
by a table).
getInCheck(). Method in class [Link]
Tests if there is a security check in progress.
getIndex(). Method in interface [Link]
Return the current index.
ww
337
338
m
getInetAddress(). Method in class [Link]
Returns the value of this socket's address field.
getInfinity(). Method in class [Link]
character used to represent infinity.
getInfo(). Method in class [Link]
Returns general information previously specified for this identity.
getInfo(). Method in class [Link]
Returns a human-readable description of the provider and its services.
o
getInputStream(). Method in class [Link]
Gets the input stream of the subprocess.
getInputStream(). Method in interface [Link]
Get the InputStream that the stub/skeleton should get results/arguments from.
getInputStream(). Method in class [Link]
i.c
Returns an input stream for this socket.
getInputStream(). Method in class [Link]
Returns an input stream for this socket.
getInputStream(). Method in class [Link]
Returns an input stream that reads from this open connection.
getInputStream(ZipEntry). Method in class [Link]
Returns an input stream for reading the contents of the specified ZIP file entry.
getInsets(). Method in class [Link]
Returns the insets of the container.
getInsets(). Method in interface [Link]
dil
getInstance(). Static method in class [Link]
Gets a Calendar using the default timezone and locale.
getInstance(). Static method in class [Link]
Gets the Collator for the current default locale.
getInstance(). Static method in class [Link]
Get a default date/time formatter that uses the SHORT style for both the date and the time.
getInstance(). Static method in class [Link]
Returns the default number format for the current default locale.
getInstance(Locale). Static method in class [Link]
Gets a Calendar using the default timezone and given locale.
getInstance(Locale). Static method in class [Link]
va
Gets the Collator for the desired locale.
getInstance(Locale). Static method in class [Link]
Returns the default number format for the specified locale.
getInstance(String). Static method in class [Link]
Generates a KeyPairGenerator object that implements the algorithm requested, as available in the environment.
getInstance(String). Static method in class [Link]
Generates a MessageDigest object that implements the specified digest algorithm.
getInstance(String). Static method in class [Link]
Generates a Signature object that implements the specified algorithm.
getInstance(String, String). Static method in class [Link]
ja
Generates a KeyPairGenerator object implementing the specified algorithm, as supplied from the specified provider, if such an
algorithm is available from the provider.
getInstance(String, String). Static method in class [Link]
Generates a MessageDigest object implementing the specified algorithm, as supplied from the specified provider, if such an
algorithm is available from the provider.
getInstance(String, String). Static method in class [Link]
Generates a Signature object implementing the specified algorithm, as supplied from the specified provider, if such an
w.
From a given bean, obtain an object representing a specified type view of that source object.
getInt(int). Method in interface [Link]
Get the value of an INTEGER parameter as a Java int.
getInt(int). Method in interface [Link]
Get the value of a column in the current row as a Java int.
getInt(Object). Method in class [Link]
Get the value of a field as a int on specified object.
getInt(Object, int). Static method in class [Link]
Returns the value of the indexed component in the specified array object, as an int.
getInt(String). Method in interface [Link]
Get the value of a column in the current row as a Java int.
getInteger(String). Static method in class [Link]
338
339
Determines the integer value of the system property with the specified name.
getInteger(String, int). Static method in class [Link]
Determines the integer value of the system property with the specified name.
m
getInteger(String, Integer). Static method in class [Link]
Determines the integer value of the system property with the specified name.
getInterface(). Method in class [Link]
Retrieve the address of the network interface used for multicast packets.
getInterfaces(). Method in class [Link]
Determines the interfaces implemented by the class or interface represented by this object.
getInterfaces(). Method in class [Link]
Return the interfaces for this class.
o
getISO3Country(). Method in class [Link]
Getter for the three-letter ISO country abbreviation of the locale.
getISO3Language(). Method in class [Link]
Getter for the three-letter ISO language abbreviation of the locale.
getItem(). Method in class [Link]
i.c
Returns the item where the event occurred.
getItem(int). Method in class [Link]
Returns the String at the specified index in the Choice.
getItem(int). Method in class [Link]
Gets the item associated with the specified index.
getItem(int). Method in class [Link]
Returns the item located at the specified index of this menu.
getItemCount(). Method in class [Link]
Returns the number of items in this Choice.
getItemCount(). Method in class [Link]
dil
Returns the number of items in the list.
getItemCount(). Method in class [Link]
Returns the number of elements in this menu.
getItems(). Method in class [Link]
Returns the items in the list.
getItemSelectable(). Method in class [Link]
Returns the ItemSelectable object where this event originated.
getJavaInitializationString(). Method in interface [Link]
This method is intended for use when generating Java code to set the value of the property.
getJavaInitializationString(). Method in class [Link]
This method is intended for use when generating Java code to set the value of the property.
va
getKey(). Method in class [Link]
Return the raw keycode of this MenuShortcut.
getKey(). Method in class [Link]
Gets parameter passed by constructor.
getKeyChar(). Method in class [Link]
Returns the character associated with the key in this event.
getKeyCode(). Method in class [Link]
Returns the integer key-code associated with the key in this event.
getKeyModifiersText(int). Static method in class [Link]
Returns a String describing the modifier key(s), such as "Shift", or "Ctrl+Shift".
ja
339
340
m
getLayoutAlignmentY(Container). Method in class [Link]
Returns the alignment along the y axis.
getLayoutAlignmentY(Container). Method in interface [Link].LayoutManager2
Returns the alignment along the y axis.
getLayoutDimensions(). Method in class [Link]
GetLayoutInfo(Container, int). Method in class [Link]
Print the layout constraints.
getLayoutOrigin(). Method in class [Link]
o
getLayoutWeights(). Method in class [Link]
getLeading(). Method in class [Link]
Gets the standard leading, or line spacing, for the font.
getLeastMaximum(int). Method in class [Link]
Gets the lowest maximum value for the given field if varies.
i.c
getLeastMaximum(int). Method in class [Link]
Returns lowest maximum value for the given field if varies.
getLength(). Method in class [Link]
Returns the length of the data to be sent or the length of the data received.
getLength(Object). Static method in class [Link]
Returns the length of the specified array object, as an int.
getLimits(). Method in class [Link]
Get the limits passed in the constructor.
getLineIncrement(). Method in class [Link]
getLineInstance(). Static method in class [Link]
dil
Create BreakIterator for line-breaks using default locale.
getLineInstance(Locale). Static method in class [Link]
Create BreakIterator for line-breaks using default locale.
getLineNumber(). Method in class [Link]
Returns the current line number.
getLineNumber(). Method in class [Link]
Get the current line number.
getLineNumber(). Method in class [Link]
Return the source file line number.
getLineNumbers(). Method in class [Link]
Return an array of all the class's source file line numbers which have code associated with them.
va
getListenerMethodDescriptors(). Method in class [Link]
getListenerMethods(). Method in class [Link]
getListenerType(). Method in class [Link]
getLocalAddress(). Method in class [Link]
Gets the local address to which the socket is bound.
getLocalAddress(). Method in class [Link]
Gets the local address to which the socket is bound.
getLocale(). Method in class [Link]
Gets the Locale for the applet, if it has been set.
getLocale(). Method in class [Link]
ja
340
341
m
Returns the location of this point.
getLocation(). Method in class [Link]
Returns the location of this rectangle.
getLocationOnScreen(). Method in class [Link]
Returns the current location of this component in the screen's coordinate space.
getLocationOnScreen(). Method in interface [Link]
getLog(). Static method in class [Link]
Returns stream for the RMI call log.
o
getLoginTimeout(). Static method in class [Link]
Get the maximum time in seconds that all drivers can wait when attempting to log in to a database.
getLogStream(). Static method in class [Link]
Get the logging/tracing PrintStream that is used by the DriverManager and all drivers.
getLong(int). Method in interface [Link]
i.c
Get the value of a BIGINT parameter as a Java long.
getLong(int). Method in interface [Link]
Get the value of a column in the current row as a Java long.
getLong(Object). Method in class [Link]
Get the value of a field as a long on specified object.
getLong(Object, int). Static method in class [Link]
Returns the value of the indexed component in the specified array object, as a long.
getLong(String). Static method in class [Link]
Determines the long value of the system property with the specified name.
getLong(String). Method in interface [Link]
dil
Get the value of a column in the current row as a Java long.
getLong(String, Long). Static method in class [Link]
Determines the long value of the system property with the specified name.
getLong(String, long). Static method in class [Link]
Determines the long value of the system property with the specified name.
getLowestSetBit(). Method in class [Link]
Returns the index of the rightmost (lowest-order) one bit in this number (i.e., the number of zero bits to the right of the
rightmost one bit).
getMajorVersion(). Method in interface [Link]
Get the driver's major version number.
getMapSize(). Method in class [Link]
va
Returns the size of the color component arrays in this IndexColorModel.
getMaxAdvance(). Method in class [Link]
Gets the maximum advance width of any character in this Font.
getMaxAscent(). Method in class [Link]
Gets the maximum ascent of all characters in this Font.
getMaxBinaryLiteralLength(). Method in interface [Link]
How many hex characters can you have in an inline binary literal?
getMaxCatalogNameLength(). Method in interface [Link]
What's the maximum length of a catalog name?
getMaxCharLiteralLength(). Method in interface [Link]
ja
341
342
m
getMaximumFractionDigits(). Method in class [Link]
Returns the maximum number of digits allowed in the fraction portion of a number.
getMaximumIntegerDigits(). Method in class [Link]
Returns the maximum number of digits allowed in the integer portion of a number.
getMaximumSize(). Method in class [Link]
Returns the maximum size of this component.
getMaximumSize(). Method in class [Link]
Returns the maximum size of this container.
o
getMaxIndexLength(). Method in interface [Link]
What's the maximum length of an index (in bytes)?
getMaxPriority(). Method in class [Link]
Returns the maximum priority of this thread group.
getMaxProcedureNameLength(). Method in interface [Link]
i.c
What's the maximum length of a procedure name?
getMaxRows(). Method in interface [Link]
The maxRows limit is the maximum number of rows that a ResultSet can contain.
getMaxRowSize(). Method in interface [Link]
What's the maximum length of a single row?
getMaxSchemaNameLength(). Method in interface [Link]
What's the maximum length allowed for a schema name?
getMaxStatementLength(). Method in interface [Link]
What's the maximum length of a SQL statement?
getMaxStatements(). Method in interface [Link]
dil
How many active statements can we have open at one time to this database?
getMaxTableNameLength(). Method in interface [Link]
What's the maximum length of a table name?
getMaxTablesInSelect(). Method in interface [Link]
What's the maximum number of tables in a SELECT?
getMaxUserNameLength(). Method in interface [Link]
What's the maximum length of a user name?
getMenu(int). Method in class [Link]
Gets the specified menu.
getMenu(String). Method in class [Link]
Get an object from a ResourceBundle.
va
getMenuBar(). Method in class [Link]
Gets the menu bar for this Frame.
getMenuBar(String). Method in class [Link]
Get an object from a ResourceBundle.
getMenuCount(). Method in class [Link]
Counts the number of menus on the menu bar.
getMenuShortcutKeyMask(). Method in class [Link]
Return the Event modifier mask appropriate for shortcuts.
getMessage(). Method in class [Link]
Produce the message, include the classname if present.
ja
Produce the message, include the message from the nested exception if there is one.
getMessageDigest(). Method in class [Link]
Returns the message digest associated with this stream.
getMessageDigest(). Method in class [Link]
Returns the message digest associated with this stream.
getMetaData(). Method in interface [Link]
A Connection's database is able to provide information describing its tables, its supported SQL grammar, its stored
procedures, the capabilities of this connection, etc.
getMetaData(). Method in interface [Link]
The number, types and properties of a ResultSet's columns are provided by the getMetaData method.
ww
342
343
Return the first line number of the specified method, or throws NoSuchLineNumber exception.
getMethodLineNumber(String). Method in class [Link]
Return the first line number of the specified method, or throws NoSuchLineNumber exception.
m
getMethodName(). Method in class [Link]
Get the method name referenced by this stackframe.
getMethodNames(). Method in class [Link]
Return the names of all methods supported by this class.
getMethods(). Method in class [Link]
Returns an array containing Method objects reflecting all the public member methods of the class or interface represented by
this Class object, including those declared by the class or interface and and those inherited from superclasses and
superinterfaces.
o
getMethods(). Method in class [Link]
Return the class's methods.
getMimeType(). Method in class [Link]
Returns the MIME type string for this DataFlavor
getMinimalDaysInFirstWeek(). Method in class [Link]
i.c
Gets what the minimal days required in the first week of the year are; e.g., if the first week is defined as one that contains the
first day of the first month of a year, getMinimalDaysInFirstWeek returns 1.
getMinimum(). Method in interface [Link]
Gets the minimum value of the adjustable object.
getMinimum(). Method in class [Link]
Returns the minimum value of this Scrollbar.
getMinimum(int). Method in class [Link]
Gets the minimum value for the given time field.
getMinimum(int). Method in class [Link]
Returns minimum value for the given field.
dil
getMinimumFractionDigits(). Method in class [Link]
Returns the minimum number of digits allowed in the fraction portion of a number.
getMinimumIntegerDigits(). Method in class [Link]
Returns the minimum number of digits allowed in the integer portion of a number.
getMinimumSize(). Method in class [Link]
Returns the mininimum size of this component.
getMinimumSize(). Method in interface [Link]
getMinimumSize(). Method in class [Link]
Returns the minimum size of this container.
getMinimumSize(). Method in class [Link]
Returns the minimum dimensions needed for the list.
va
getMinimumSize(). Method in class [Link]
Returns the minimum size Dimensions of the TextArea.
getMinimumSize(). Method in class [Link]
Returns the minimum size Dimensions needed for this TextField.
getMinimumSize(int). Method in class [Link]
Returns the minimum dimensions needed for the amount of rows in the list.
getMinimumSize(int). Method in interface [Link]
getMinimumSize(int). Method in class [Link]
Returns the minimum size Dimensions needed for this TextField with the specified amount of columns.
getMinimumSize(int). Method in interface [Link]
ja
Returns the Java language modifiers for this class or interface, encoded in an integer.
getModifiers(). Method in class [Link]
Returns the Java language modifiers for the constructor represented by this Constructor object, as an integer.
getModifiers(). Method in class [Link]
Returns the Java language modifiers for the field represented by this Field object, as an integer.
getModifiers(). Method in class [Link]
Returns the modifiers flag for this event.
getModifiers(). Method in interface [Link]
Returns the Java language modifiers for the member or constructor represented by this Member, as an integer.
getModifiers(). Method in class [Link]
Returns the Java language modifiers for the method represented by this Method object, as an integer.
getModifiers(). Method in class [Link]
343
344
Returns a string with the field's modifiers, such as "public", "static", "final", etc.
getMonth(). Method in class [Link]
Returns the month represented by this date.
m
getMonth(). Method in class [Link]
Returns the month represented by this date.
getMonths(). Method in class [Link]
Gets month strings.
getMoreResults(). Method in interface [Link]
getMoreResults moves to a Statement's next result.
getMultiplier(). Method in class [Link]
Get the multiplier for use in percent, permill, etc.
o
getName(). Method in interface [Link]
Returns the name of this ACL.
getName(). Method in class [Link]
Returns the fully-qualified name of the type (class, interface, array, or primitive) represented by this Class object, as a String.
getName(). Method in class [Link]
i.c
Returns the name of this clipboard object.
getName(). Method in class [Link]
Gets the name of the component.
getName(). Method in class [Link]
Returns the name of this constructor, as a string.
getName(). Method in class [Link]
getName(). Method in class [Link]
Returns the name of the field represented by this Field object.
getName(). Method in class [Link]
Returns the name of the file represented by this object.
dil
getName(). Method in class [Link]
Gets the logical name of the font.
getName(). Method in class [Link]
Returns this identity's name.
getName(). Method in interface [Link]
Returns the simple name of the underlying member or constructor represented by this Member.
getName(). Method in class [Link]
Gets the name of the menu component.
getName(). Method in class [Link]
Returns the name of the method represented by this Method object, as a String.
getName(). Method in class [Link]
va
The name of the class described by this descriptor.
getName(). Method in interface [Link]
Returns the name of this principal.
getName(). Method in class [Link]
Returns the name of this provider.
getName(). Method in class [Link]
Returns the name of the class.
getName(). Method in class [Link]
Returns the name of the field.
getName(). Method in class [Link]
ja
344
345
m
getNumberInstance(). Method in class [Link]
Gets the number formatter which this date/time formatter uses to format and parse a time.
getNumberInstance(). Static method in class [Link]
Returns a general-purpose number format for the current default locale.
getNumberInstance(Locale). Static method in class [Link]
Returns a general-purpose number format for the specified locale.
getNumericFunctions(). Method in interface [Link]
Get a comma separated list of math functions.
o
getNumericValue(char). Static method in class [Link]
Returns the Unicode numeric value of the character as a nonnegative integer.
getObject(int). Method in interface [Link]
Get the value of a parameter as a Java object.
getObject(int). Method in interface [Link]
i.c
Get the value of a column in the current row as a Java object.
getObject(String). Method in class [Link]
Get an object from a ResourceBundle.
getObject(String). Method in interface [Link]
dil
Gets the time zone offset, for current date, modified in case of daylight savings.
getOldValue(). Method in class [Link]
getOperation(). Method in class [Link]
Returns the name of the method.
getOperations(). Method in interface [Link]
getOrientation(). Method in interface [Link]
Gets the orientation of the adjustable object.
getOrientation(). Method in class [Link]
Returns the orientation for this Scrollbar.
getOutputStream(). Method in class [Link]
Return the current stream to which output from this log is sent.
va
getOutputStream(). Method in class [Link]
Gets the output stream of the subprocess.
getOutputStream(). Method in interface [Link]
Return the output stream the stub/skeleton should put arguments/results into.
getOutputStream(). Method in class [Link]
Returns an output stream for this socket.
getOutputStream(). Method in class [Link]
Returns an output stream for this socket.
getOutputStream(). Method in class [Link]
Returns an output stream that writes to this connection.
ja
Returns information about the parameters than are understood by this applet.
getParameterTypes(). Method in class [Link]
Returns an array of Class objects that represent the formal parameter types, in declaration order, of the constructor
represented by this Constructor object.
getParameterTypes(). Method in class [Link]
Returns an array of Class objects that represent the formal parameter types, in declaration order, of the method represented
by this Method object.
getParams(). Method in interface [Link]
Returns the DSA-specific key parameters.
getParent(). Method in class [Link]
Gets the parent of the component.
getParent(). Method in class [Link]
345
346
m
getParent(). Method in class [Link]
Returns the parent of this thread group.
getPath(). Method in class [Link]
Returns the pathname of the file represented by this object.
getPatternSeparator(). Method in class [Link]
character used to separate positive and negative subpatterns in a pattern.
getPC(). Method in class [Link]
Get the program counter referenced by this stackframe.
o
getPeer(). Method in class [Link]
getPeer(). Method in class [Link]
Gets the peer of the font.
getPeer(). Method in class [Link]
getPercent(). Method in class [Link]
i.c
character used for percent sign.
getPercentInstance(). Static method in class [Link]
Returns a percentage format for the current default locale.
getPercentInstance(Locale). Static method in class [Link]
Returns a percentage format for the specified locale.
getPerMill(). Method in class [Link]
character used for mille percent sign.
getPermissions(Principal). Method in interface [Link]
Returns an enumeration for the set of allowed permissions for the specified principal (representing an entity such as an
individual or a group).
dil
getPixels(). Method in class [Link]
Get the pixel buffer.
getPixelSize(). Method in class [Link]
Returns the number of bits per pixel described by this ColorModel.
getPoint(). Method in class [Link]
Returns the x,y position of the event relative to the source component.
getPort(). Method in class [Link]
Returns the port number on the remote host to which this datagram is being sent or from which the datagram was received.
getPort(). Method in class [Link]
Returns the remote port to which this socket is connected.
getPort(). Method in class [Link]
va
Returns the value of this socket's port field.
getPort(). Method in class [Link]
Returns the port number of this URL.
getPositivePrefix(). Method in class [Link]
Get the positive prefix.
getPositiveSuffix(). Method in class [Link]
Get the positive suffix.
getPrecision(int). Method in interface [Link]
What's a column's number of decimal digits?
getPredefinedCursor(int). Static method in class [Link]
ja
346
347
m
Returns this thread's priority.
getPrivate(). Method in class [Link]
Returns the private key from this key pair.
getPrivateKey(). Method in class [Link]
Returns this signer's private key.
getProcedureColumns(String, String, String, String). Method in interface [Link]
Get a description of a catalog's stored procedure parameters and result columns.
getProcedures(String, String, String). Method in interface [Link]
o
Get a description of stored procedures available in a catalog.
getProcedureTerm(). Method in interface [Link]
What's the database vendor's preferred term for "procedure"?
getPropagationId(). Method in class [Link]
The "propagationId" field is reserved for future use.
i.c
getProperties(). Static method in class [Link]
Determines the current system properties.
getProperty(String). Method in class [Link]
Searches for the property with the specified key in this property list.
getProperty(String). Static method in class [Link]
Gets a security property.
getProperty(String). Static method in class [Link]
Gets the system property indicated by the specified key.
getProperty(String, ImageObserver). Method in class [Link]
Gets a property of the image by name.
dil
getProperty(String, String). Method in class [Link]
Searches for the property with the specified key in this property list.
getProperty(String, String). Static method in class [Link]
Gets the system property indicated by the specified key.
getProperty(String, String). Static method in class [Link]
Gets a property with the specified key and default.
getPropertyChangeEvent(). Method in class [Link]
getPropertyDescriptors(). Method in interface [Link]
getPropertyDescriptors(). Method in class [Link]
Deny knowledge of properties.
getPropertyEditorClass(). Method in class [Link]
va
getPropertyInfo(String, Properties). Method in interface [Link]
The getPropertyInfo method is intended to allow a generic GUI tool to discover what properties it should prompt a human for
in order to get enough information to connect to a database.
getPropertyName(). Method in class [Link]
getPropertyType(). Method in class [Link]
getProtocol(). Method in class [Link]
Returns the protocol name this URL.
getProvider(String). Static method in class [Link]
Returns the provider installed with the specified name, if any.
ja
347
348
m
Returns the anchor (also known as the "reference") of this URL.
getRefClass(ObjectOutput). Method in interface [Link]
Returns the class name of the ref type to be serialized onto the stream 'out'.
getRegistry(). Static method in class [Link]
Returns the remote object Registry for the local host.
getRegistry(int). Static method in class [Link]
Returns the remote object Registry on the current host at the specified port.
getRegistry(String). Static method in class [Link]
o
Returns the remote object Registry on the specified host at a default (i.e., well-known) port number.
getRegistry(String, int). Static method in class [Link]
Returns the remote object Registry on the specified host at the specified port.
getRemaining(). Method in class [Link]
Returns the total number of bytes remaining in the input buffer.
i.c
getRemoteClass(). Method in class [Link]
Get the class this stackframe references.
getRemoveListenerMethod(). Method in class [Link]
getRepresentationClass(). Method in class [Link]
Returns the Class which objects supporting this DataFlavor will return when this DataFlavor is requested.
getRequestMethod(). Method in class [Link]
Get the request method.
getRequestProperty(String). Method in class [Link]
Returns the value of the named general request property for this connection.
getResource(String). Method in class [Link]
dil
getResource(String). Method in class [Link]
Find a resource with a given name.
getResourceAsStream(String). Method in class [Link]
Find a resource with a given name.
getResourceAsStream(String). Method in class [Link]
Get an InputStream on a given resource.
getResponseCode(). Method in class [Link]
Gets HTTP response status.
getResponseMessage(). Method in class [Link]
Gets the HTTP response message, if any, returned along with the response code from a server.
getResultSet(). Method in interface [Link]
va
getResultSet returns the current result as a ResultSet.
getResultStream(boolean). Method in interface [Link]
Returns an output stream (may put out header information relating to the success of the call).
getReturnType(). Method in class [Link]
Returns a Class object that represents the formal return type of the method represented by this Method object.
getRGB(). Method in class [Link]
Gets the RGB value representing the color in the default RGB ColorModel.
getRGB(). Method in class [Link]
Gets the "current" RGB value representing the symbolic color.
getRGB(int). Method in class [Link]
ja
Returns the color of the pixel in the default RGB color model.
getRGB(int). Method in class [Link]
Returns the color of the pixel in the default RGB color model.
getRGB(int). Method in class [Link]
Returns the color of the pixel in the default RGB color model.
getRGBdefault(). Static method in class [Link]
Return a ColorModel which describes the default format for integer RGB values used throughout the AWT image interfaces.
w.
348
349
m
Gets the size of the screen.
getScrollbarDisplayPolicy(). Method in class [Link]
Returns the display policy for the scrollbars.
getScrollbarVisibility(). Method in class [Link]
Returns the enumerated value describing which scrollbars the text area has.
getScrollPosition(). Method in class [Link]
Returns the current x,y position within the child which is displayed at the 0,0 location of the scrolled panel's view port.
getSearchStringEscape(). Method in interface [Link]
o
This is the string that can be used to escape '_' or '%' in the string pattern style catalog search parameters.
getSeconds(). Method in class [Link]
Returns the number of seconds past the minute represented by this date.
getSeconds(). Method in class [Link]
Returns the number of seconds past the minute represented by this date.
i.c
getSecurityContext(). Method in class [Link]
Returns the security context (e.g., a URL).
getSecurityContext(). Method in class [Link]
Creates an object that encapsulates the current execution environment.
getSecurityContext(ClassLoader). Method in interface [Link]
Returns the security context of the given class loader (e.g., a URL)
getSecurityContext(ClassLoader). Static method in class [Link]
Returns the security context of the given class loader
getSecurityManager(). Static method in class [Link]
Gets the system security interface.
dil
getSeed(int). Static method in class [Link]
Returns the given number of seed bytes, computed using the seed generation algorithm that this class uses to seed itself.
getSelectedCheckbox(). Method in class [Link]
Gets the current choice.
getSelectedIndex(). Method in class [Link]
Returns the index of the currently selected item.
getSelectedIndex(). Method in class [Link]
Get the selected item on the list or -1 if no item is selected.
getSelectedIndexes(). Method in class [Link]
Returns the selected indexes on the list.
getSelectedIndexes(). Method in interface [Link]
va
getSelectedItem(). Method in class [Link]
Returns a String representation of the current choice.
getSelectedItem(). Method in class [Link]
Returns the selected item on the list or null if no item is selected.
getSelectedItems(). Method in class [Link]
Returns the selected items on the list in an array of Strings.
getSelectedObjects(). Method in class [Link]
Returns the an array (length 1) containing the checkbox label or null if the checkbox is not selected.
getSelectedObjects(). Method in class [Link]
Returns the an array (length 1) containing the checkbox menu item label or null if the checkbox is not selected.
ja
349
350
Returns the value of the indexed component in the specified array object, as a short.
getShort(String). Method in interface [Link]
Get the value of a column in the current row as a Java short.
m
getShortcut(). Method in class [Link]
Return the MenuShortcut associated with this MenuItem, or null if none has been specified.
getShortcutMenuItem(MenuShortcut). Method in class [Link]
Return the MenuItem associated with a MenuShortcut, or null if none has been specified.
getShortDescription(). Method in class [Link]
getShortMonths(). Method in class [Link]
Gets short month strings.
getShortWeekdays(). Method in class [Link]
o
Gets short weekday strings.
getSigners(). Method in class [Link]
Get the signers of this class.
getSize(). Method in class [Link]
Returns the current size of this component.
i.c
getSize(). Method in class [Link]
Returns the size of this Dimension object.
getSize(). Method in class [Link]
Gets the point size of the font.
getSize(). Method in class [Link]
Returns the size (width by height) of this rectangle.
getSize(). Method in class [Link]
Return the number of elements in the array.
getSize(). Method in class [Link]
Returns the uncompressed size of the entry data, or -1 if not known.
dil
getSocketFactory(). Static method in class [Link]
Returns the socket factory used by RMI.
getSoLinger(). Method in class [Link]
Returns setting for SO_LINGER.
getSoTimeout(). Method in class [Link]
Retrive setting for SO_TIMEOUT.
getSoTimeout(). Method in class [Link]
Retrive setting for SO_TIMEOUT.
getSoTimeout(). Method in class [Link]
Returns setting for SO_TIMEOUT.
getSource(). Method in class [Link]
va
getSource(). Method in class [Link]
Gets the object that produces the pixels for the image.
getSourceFile(). Method in class [Link]
Get the source file referenced by this stackframe.
getSourceFileName(). Method in class [Link]
Get the name of the source file referenced by this stackframe.
getSourcePath(). Method in class [Link]
Return the source file path the Agent is currently using.
getSourceString(). Method in class [Link]
Returns the String that this CollationKey represents.
ja
Return the arguments and local variable from the current stackframe.
getState(). Method in class [Link]
Returns the boolean state of the Checkbox.
getState(). Method in class [Link]
Returns the state of this MenuItem.
getStateChange(). Method in class [Link]
Returns the state change type which generated the event.
getStaticFields(). Method in class [Link]
Return all the static fields for this class.
getStatus(). Method in class [Link]
ww
350
351
m
getStringFunctions(). Method in interface [Link]
Get a comma separated list of string functions.
getStyle(). Method in class [Link]
Gets the style of the font.
getSuperclass(). Method in class [Link]
If this object represents any class other than the class Object, then the object that represents the superclass of that class is
returned.
getSuperclass(). Method in class [Link]
o
Return the superclass for this class.
getSystemClipboard(). Method in class [Link]
Returns an instance of the "system" clipboard which interfaces with the clipboard facilities on the native platform.
getSystemEventQueue(). Method in class [Link]
Get the application's or applet's EventQueue instance.
i.c
getSystemEventQueueImpl(). Method in class [Link]
getSystemFunctions(). Method in interface [Link]
Get a comma separated list of system functions.
getSystemResource(String). Static method in class [Link]
Find a resource with a given name.
getSystemResourceAsStream(String). Static method in class [Link]
Get an InputStream on a given resource..
getSystemScope(). Static method in class [Link]
Returns the system's identity scope.
getTableName(int). Method in interface [Link]
dil
What's a column's table name?
getTablePrivileges(String, String, String). Method in interface [Link]
Get a description of the access rights for each table available in a catalog.
getTables(String, String, String, String[]). Method in interface [Link]
Get a description of tables available in a catalog.
getTableTypes(). Method in interface [Link]
Get the table types available in this database.
getTags(). Method in interface [Link]
If the property value must be one of a set of known tagged values, then this method should return an array of the tags.
getTags(). Method in class [Link]
If the property value must be one of a set of known tagged values, then this method should return an array of the tag values.
va
getTargetException(). Method in class [Link]
Get the thrown target exception.
getTcpNoDelay(). Method in class [Link]
Tests if TCP_NODELAY is enabled.
getText(). Method in class [Link]
Get the text being scanned
getText(). Method in class [Link]
Gets the text of this label.
getText(). Method in class [Link]
Returns the text contained in this TextComponent.
ja
351
352
m
Get the value of a column in the current row as a [Link] object.
getTimeZone(). Method in class [Link]
Gets the time zone.
getTimeZone(). Method in class [Link]
Gets the time zone.
getTimeZone(String). Static method in class [Link]
Gets the TimeZone for the given ID.
getTimezoneOffset(). Method in class [Link]
o
Returns the local time-zone offset.
getTitle(). Method in class [Link]
Gets the title of the Dialog.
getTitle(). Method in class [Link]
Gets the title of the Frame.
i.c
getToolkit(). Method in class [Link]
Gets the toolkit of the component.
getToolkit(). Method in interface [Link]
getToolkit(). Method in class [Link]
Returns the toolkit of this frame.
getTotalIn(). Method in class [Link]
Returns the total number of bytes input so far.
getTotalIn(). Method in class [Link]
Returns the total number of bytes input so far.
getTotalOut(). Method in class [Link]
dil
Returns the total number of bytes output so far.
getTotalOut(). Method in class [Link]
Returns the total number of bytes output so far.
getTransactionIsolation(). Method in interface [Link]
Get this Connection's current transaction isolation mode.
getTransferData(DataFlavor). Method in class [Link]
If the data was requested in the "[Link]" flavor, return the String representing the selection.
getTransferData(DataFlavor). Method in interface [Link]
Returns an object which represents the data to be transferred.
getTransferDataFlavors(). Method in class [Link]
Returns the array of flavors in which it can provide the data.
va
getTransferDataFlavors(). Method in interface [Link]
Returns an array of DataFlavor objects indicating the flavors the data can be provided in.
getTransferSize(). Method in class [Link]
Get the number of bytes of data actually transferred.
getTransparentPixel(). Method in class [Link]
Returns the index of the transparent pixel in this IndexColorModel or -1 if there is no transparent pixel.
getTreeLock(). Method in class [Link]
Gets the locking object for AWT component-tree and layout operations.
getTTL(). Method in class [Link]
Retrieve the TTL (time-to-live) option.
ja
Get a description of all the standard SQL types supported by this database.
getUnicodeStream(int). Method in interface [Link]
A column value can be retrieved as a stream of Unicode characters and then read in chunks from the stream.
getUnicodeStream(String). Method in interface [Link]
A column value can be retrieved as a stream of Unicode characters and then read in chunks from the stream.
getUnitIncrement(). Method in interface [Link]
Gets the unit value increment for the adjustable object.
getUnitIncrement(). Method in class [Link]
Gets the unit increment for this scrollbar.
getUpdateCount(). Method in interface [Link]
getUpdateCount returns the current result as an update count; if the result is a ResultSet or there are no more results, -1 is
returned.
352
353
m
What's the url for this database?
getURL(). Method in class [Link]
Returns the value of this URLConnection's URL field.
getUseCaches(). Method in class [Link]
Returns the value of this URLConnection's useCaches field.
getUserName(). Method in interface [Link]
What's our user name as known to the database?
getVAdjustable(). Method in class [Link]
o
Returns the Adjustable object which represents the state of the vertical scrollbar.
getValue(). Method in interface [Link]
Gets the current value of the adjustable object.
getValue(). Method in class [Link]
Returns the current value in the adjustment event.
i.c
getValue(). Method in class [Link].Adler32
Returns checksum value.
getValue(). Method in interface [Link]
Returns the current checksum value.
getValue(). Method in class [Link].CRC32
Returns CRC-32 value.
getValue(). Method in class [Link]
Returns the lease duration.
getValue(). Method in interface [Link]
getValue(). Method in class [Link]
dil
getValue(). Method in class [Link]
Return the value of a stack variable or argument.
getValue(). Method in class [Link]
Returns the current value of this Scrollbar.
getValue(String). Method in class [Link]
Retrieve a named attribute with this feature.
getVariant(). Method in class [Link]
Getter for programmatic name of field.
getVersion(). Method in class [Link]
Returns the version number for this provider.
getVersionColumns(String, String, String). Method in interface [Link]
va
Get a description of a table's columns that are automatically updated when any value in a row is updated.
getVgap(). Method in class [Link]
Returns the vertical gap between components.
getVgap(). Method in class [Link]
Returns the vertical gap between components.
getVgap(). Method in class [Link]
Returns the vertical gap between components.
getVgap(). Method in class [Link]
Returns the vertical gap between components.
getViewportSize(). Method in class [Link]
ja
Gets the index of the item that was last made visible by the method makeVisible.
getVMID(). Method in class [Link]
Returns the client VMID associated with the lease.
getVScrollbarWidth(). Method in class [Link]
Returns the width that would be occupied by a vertical scrollbar, which is independent of whether it is currently displayed by
the scroll pane or not.
getVScrollbarWidth(). Method in interface [Link]
getWarnings(). Method in interface [Link]
The first warning reported by calls on this Connection is returned.
getWarnings(). Method in interface [Link]
ww
353
354
m
Gets the advance widths of the first 256 characters in the Font.
getWindow(). Method in class [Link]
Returns the window where this event originated.
getWordInstance(). Static method in class [Link]
Create BreakIterator for word-breaks using default locale.
getWordInstance(Locale). Static method in class [Link]
Create BreakIterator for word-breaks using default locale.
getWriteMethod(). Method in class [Link]
o
getX(). Method in interface [Link]
Returns the value of the private key, x.
getX(). Method in class [Link]
Returns the x position of the event relative to the source component.
getY(). Method in interface [Link]
i.c
Returns the value of the public key, y.
getY(). Method in class [Link]
Returns the y position of the event relative to the source component.
getYear(). Method in class [Link]
Returns the year represented by this date, minus 1900.
getYear(). Method in class [Link]
Returns the year represented by this date, minus 1900.
getZeroDigit(). Method in class [Link]
character used for zero.
getZoneStrings(). Method in class [Link]
dil
Gets timezone strings.
GOT_FOCUS. Static variable in class [Link]
A component gained the focus.
gotFocus(Event, Object). Method in class [Link]
grabPixels(). Method in class [Link]
Request the Image or ImageProducer to start delivering pixels and wait for all of the pixels in the rectangle of interest to be
delivered.
grabPixels(long). Method in class [Link]
Request the Image or ImageProducer to start delivering pixels and wait for all of the pixels in the rectangle of interest to be
delivered or until the specified timeout has elapsed.
Graphics(). Constructor for class [Link]
va
Constructs a new Graphics object.
gray. Static variable in class [Link]
The color gray.
green. Static variable in class [Link]
The color green.
GregorianCalendar(). Constructor for class [Link]
Constructs a default GregorianCalendar using the current time in the default time zone with the default locale.
GregorianCalendar(int, int, int). Constructor for class [Link]
Constructs a GregorianCalendar with the given date set in the default time zone with the default locale.
GregorianCalendar(int, int, int, int, int). Constructor for class [Link]
ja
Constructs a GregorianCalendar with the given date and time set for the default time zone with the default locale.
GregorianCalendar(int, int, int, int, int, int). Constructor for class [Link]
Constructs a GregorianCalendar with the given date and time set for the default time zone with the default locale.
GregorianCalendar(Locale). Constructor for class [Link]
Constructs a GregorianCalendar based on the current time in the default time zone with the given locale.
GregorianCalendar(TimeZone). Constructor for class [Link]
Constructs a GregorianCalendar based on the current time in the given time zone with the default locale.
w.
354
355
m
GZIPInputStream(InputStream, int). Constructor for class [Link]
Creates a new input stream with the specified buffer size.
GZIPOutputStream(OutputStream). Constructor for class [Link]
Creates a new output stream with a default buffer size.
GZIPOutputStream(OutputStream, int). Constructor for class [Link]
Creates a new output stream with the specified buffer size.
o
H
i.c
HAND_CURSOR. Static variable in class [Link]
handleEvent(AWTEvent). Method in interface [Link]
handleEvent(Event). Method in class [Link]
handleGetObject(String). Method in class [Link]
Override of ResourceBundle, same semantics
handleGetObject(String). Method in class [Link]
Override of ResourceBundle, same semantics
handleGetObject(String). Method in class [Link]
Get an object from a ResourceBundle.
hasChanged(). Method in class [Link]
dil
Tests if this object has changed.
hashCode(). Method in class [Link]
Computes a hash code for this object.
hashCode(). Method in class [Link]
Computes a hash code for this object.
hashCode(). Method in class [Link]
Returns a hash code value for this bit set.
hashCode(). Method in class [Link]
Returns a hash code for this Boolean.
hashCode(). Method in class [Link]
Returns a hashcode for this Byte.
va
hashCode(). Method in class [Link]
Returns a hash code for this Character.
hashCode(). Method in class [Link]
Generates a hash code for the message format object.
hashCode(). Method in class [Link]
Creates a hash code for this CollationKey.
hashCode(). Method in class [Link]
Generates the hash code for this Collator.
hashCode(). Method in class [Link]
Computes the hash code.
ja
Override hashCode.
hashCode(). Method in class [Link]
Overrides hashCode
hashCode(). Method in class [Link]
Override hashCode
hashCode(). Method in class [Link]
Returns a hashcode for this Double.
hashCode(). Method in class [Link]
Returns a hashcode for this Field.
hashCode(). Method in class [Link]
ww
355
356
m
hashCode(). Method in class [Link]
Computes a hashcode for this Long.
hashCode(). Method in class [Link]
Generates a hash code for the message format object.
hashCode(). Method in class [Link]
Returns a hashcode for this Method.
hashCode(). Method in class [Link]
Overrides hashCode
o
hashCode(). Method in class [Link]
Returns a hash code value for the object.
hashCode(). Method in class [Link]
The hashcode is the object number.
hashCode(). Method in class [Link]
i.c
Returns the hashcode for this Point.
hashCode(). Method in interface [Link]
Returns a hashcode for this principal.
hashCode(). Method in class [Link]
Returns the hashcode for this Rectangle.
hashCode(). Method in class [Link]
Returns a hashcode for a remote object.
hashCode(). Method in class [Link]
Generates the hash code for the table-based collation object
hashCode(). Method in class [Link]
dil
Returns a hashcode for this Short.
hashCode(). Method in class [Link]
Override hashCode.
hashCode(). Method in class [Link]
Override hashCode.
hashCode(). Method in class [Link]
Returns a hashcode for this string.
hashCode(). Method in class [Link]
Compute a hashcode for this enumeration
hashCode(). Method in class [Link]
Returns a hash code value for the object.
va
hashCode(). Method in class [Link]
Creates an integer suitable for hash table indexing.
hashCode(). Method in class [Link]
Compute hash code for this VMID.
Hashtable(). Constructor for class [Link]
Constructs a new, empty hashtable with a default capacity and load factor.
Hashtable(int). Constructor for class [Link]
Constructs a new, empty hashtable with the specified initial capacity and default load factor.
Hashtable(int, float). Constructor for class [Link]
Constructs a new, empty hashtable with the specified initial capacity and the specified load factor.
ja
356
357
m
Useful constant for zero-based HOUR_OF_DAY field alignment.
HOUR_OF_DAY1_FIELD. Static variable in class [Link]
Useful constant for one-based HOUR_OF_DAY field alignment.
HSBtoRGB(float, float, float). Static method in class [Link]
Returns the RGB value defined by the default RGB ColorModel, of the color corresponding to the given HSB color
components.
HTTP_ACCEPTED. Static variable in class [Link]
HTTP_BAD_GATEWAY. Static variable in class [Link]
o
HTTP_BAD_METHOD. Static variable in class [Link]
HTTP_BAD_REQUEST. Static variable in class [Link]
4XX: client error
HTTP_CLIENT_TIMEOUT. Static variable in class [Link]
HTTP_CONFLICT. Static variable in class [Link]
i.c
HTTP_CREATED. Static variable in class [Link]
HTTP_ENTITY_TOO_LARGE. Static variable in class [Link]
HTTP_FORBIDDEN. Static variable in class [Link]
HTTP_GATEWAY_TIMEOUT. Static variable in class [Link]
HTTP_GONE. Static variable in class [Link]
HTTP_INTERNAL_ERROR. Static variable in class [Link]
HTTP_LENGTH_REQUIRED. Static variable in class [Link]
HTTP_MOVED_PERM. Static variable in class [Link]
HTTP_MOVED_TEMP. Static variable in class [Link]
HTTP_MULT_CHOICE. Static variable in class [Link]
dil
3XX: relocation/redirect
HTTP_NO_CONTENT. Static variable in class [Link]
HTTP_NOT_ACCEPTABLE. Static variable in class [Link]
HTTP_NOT_AUTHORITATIVE. Static variable in class [Link]
HTTP_NOT_FOUND. Static variable in class [Link]
HTTP_NOT_MODIFIED. Static variable in class [Link]
HTTP_OK. Static variable in class [Link]
2XX: generally "OK"
HTTP_PARTIAL. Static variable in class [Link]
HTTP_PAYMENT_REQUIRED. Static variable in class [Link]
HTTP_PRECON_FAILED. Static variable in class [Link]
va
HTTP_PROXY_AUTH. Static variable in class [Link]
HTTP_REQ_TOO_LONG. Static variable in class [Link]
HTTP_RESET. Static variable in class [Link]
HTTP_SEE_OTHER. Static variable in class [Link]
HTTP_SERVER_ERROR. Static variable in class [Link]
5XX: server error
HTTP_UNAUTHORIZED. Static variable in class [Link]
HTTP_UNAVAILABLE. Static variable in class [Link]
HTTP_UNSUPPORTED_TYPE. Static variable in class [Link]
HTTP_USE_PROXY. Static variable in class [Link]
ja
357
358
m
Tests for equality between the specified identity and this identity.
identityHashCode(Object). Static method in class [Link]
Returns the same hashcode for the given object as would be returned by the default method hashCode(), whether or not the
given object's class overrides hashCode().
IdentityScope(). Constructor for class [Link]
This constructor is used for serialization only and should not be used by subclasses.
IdentityScope(String). Constructor for class [Link]
Constructs a new identity scope with the specified name.
o
IdentityScope(String, IdentityScope). Constructor for class [Link]
Constructs a new identity scope with the specified name and scope.
IEEEremainder(double, double). Static method in class [Link]
Computes the remainder operation on two arguments as prescribed by the IEEE 754 standard.
ifModifiedSince. Variable in class [Link]
i.c
Some protocols support skipping the fetching of the object unless the object has been modified more recently than a certain
time.
ignoreExceptions(). Method in class [Link]
Don't enter the debugger when an instance of this class is thrown.
IllegalAccessError(). Constructor for class [Link]
Constructs an IllegalAccessError with no detail message.
IllegalAccessError(String). Constructor for class [Link]
Constructs an IllegalAccessError with the specified detail message.
IllegalAccessException(). Constructor for class [Link]
Constructs an IllegalAccessException without a detail message.
dil
IllegalAccessException(String). Constructor for class [Link]
Constructs an IllegalAccessException with a detail message.
IllegalArgumentException(). Constructor for class [Link]
Constructs an IllegalArgumentException with no detail message.
IllegalArgumentException(String). Constructor for class [Link]
Constructs an IllegalArgumentException with the specified detail message.
IllegalComponentStateException(). Constructor for class [Link]
Constructs an IllegalComponentStateException with no detail message.
IllegalComponentStateException(String). Constructor for class [Link]
Constructs an IllegalComponentStateException with the specified detail message.
IllegalMonitorStateException(). Constructor for class [Link]
va
Constructs an IllegalMonitorStateException with no detail message.
IllegalMonitorStateException(String). Constructor for class [Link]
Constructs an IllegalMonitorStateException with the specified detail message.
IllegalStateException(). Constructor for class [Link]
Constructs an IllegalStateException with no detail message.
IllegalStateException(String). Constructor for class [Link]
Constructs an IllegalStateException with the specified detail message.
IllegalThreadStateException(). Constructor for class [Link]
Constructs an IllegalThreadStateException with no detail message.
IllegalThreadStateException(String). Constructor for class [Link]
ja
358
359
m
importedKeyNotDeferrable. Static variable in interface [Link]
IMPORT KEY DEFERRABILITY - see SQL92 for definition
importedKeyRestrict. Static variable in interface [Link]
IMPORT KEY UPDATE_RULE and DELETE_RULE - do not allow update or delete of primary key if it has been
imported.
importedKeySetDefault. Static variable in interface [Link]
IMPORT KEY UPDATE_RULE and DELETE_RULE - change imported key to default values if its primary key has been
updated or deleted.
o
importedKeySetNull. Static variable in interface [Link]
IMPORT KEY UPDATE_RULE and DELETE_RULE - change imported key to NULL if its primary key has been updated
or deleted.
in. Static variable in class [Link]
A handle to the standard input stream.
i.c
in. Variable in class [Link]
The underlying input stream.
in. Variable in class [Link]
The underlying character-input stream, or null if the stream has been closed
in. Variable in class [Link]
in. Static variable in class [Link]
The "standard" input stream.
INACTIVE_CAPTION. Static variable in class [Link]
The array index for the inactive caption background color.
INACTIVE_CAPTION_BORDER. Static variable in class [Link]
dil
The array index for the inactive caption border color.
INACTIVE_CAPTION_TEXT. Static variable in class [Link]
The array index for the inactive caption text color.
inactiveCaption. Static variable in class [Link]
The background color for inactive captions in window borders.
inactiveCaptionBorder. Static variable in class [Link]
The border color for inactive captios in window borders.
inactiveCaptionText. Static variable in class [Link]
The text color for inactive captions in window borders.
inCheck. Variable in class [Link]
This field is true if there is a security check in progress; false otherwise.
va
inClass(String). Method in class [Link]
Tests if the specified String is in this Class.
inClassLoader(). Method in class [Link]
Tests if the current ClassLoader is equal to null.
IncompatibleClassChangeError(). Constructor for class [Link]
Constructs an IncompatibleClassChangeError with no detail message.
IncompatibleClassChangeError(String). Constructor for class [Link]
Constructs an IncompatibleClassChangeError with the specified detail message.
inDaylightTime(Date). Method in class [Link]
Overrides TimeZone Queries if the given date is in Daylight Savings Time.
ja
Constructs an IndexColorModel from the given arrays of red, green, and blue components.
IndexColorModel(int, int, byte[], int, boolean). Constructor for class [Link]
Constructs an IndexColorModel from a single arrays of packed red, green, blue and optional alpha components.
IndexColorModel(int, int, byte[], int, boolean, int). Constructor for class [Link]
Constructs an IndexColorModel from a single arrays of packed red, green, blue and optional alpha components.
IndexedPropertyDescriptor(String, Class). Constructor for class [Link]
This constructor constructs an IndexedPropertyDescriptor for a property that follows the standard Java conventions by
having getFoo and setFoo accessor methods, for both indexed access and array access.
IndexedPropertyDescriptor(String, Class, String, String, String, String). Constructor for class
[Link]
ww
This constructor takes the name of a simple property, and method names for reading and writing the property, both indexed
and non-indexed.
IndexedPropertyDescriptor(String, Method, Method, Method, Method). Constructor for class
[Link]
This constructor takes the name of a simple property, and Method objects for reading and writing the property.
indexOf(int). Method in class [Link]
Returns the index within this string of the first occurrence of the specified character.
indexOf(int, int). Method in class [Link]
Returns the index within this string of the first occurrence of the specified character, starting the search at the specified index.
indexOf(Object). Method in class [Link]
Searches for the first occurence of the given argument, testing for equality using the equals method.
indexOf(Object, int). Method in class [Link]
359
360
Searches for the first occurence of the given argument, beginning the search at index, and testing for equality using the
equals method.
indexOf(String). Method in class [Link]
m
Returns the index within this string of the first occurrence of the specified substring.
indexOf(String, int). Method in class [Link]
Returns the index within this string of the first occurrence of the specified substring, starting at the specified index.
IndexOutOfBoundsException(). Constructor for class [Link]
Constructs an IndexOutOfBoundsException with no detail message.
IndexOutOfBoundsException(String). Constructor for class [Link]
Constructs an IndexOutOfBoundsException with the specified detail message.
inf. Variable in class [Link]
o
Decompressor for this stream.
inflate(byte[]). Method in class [Link]
Uncompresses bytes into specified buffer.
inflate(byte[], int, int). Method in class [Link]
Uncompresses bytes into specified buffer.
i.c
Inflater(). Constructor for class [Link]
Creates a new decompressor.
Inflater(boolean). Constructor for class [Link]
Creates a new decompressor.
InflaterInputStream(InputStream). Constructor for class [Link]
Creates a new input stream with a default decompressor and buffer size.
InflaterInputStream(InputStream, Inflater). Constructor for class [Link]
Creates a new input stream with the specified decompressor and a default buffer size.
InflaterInputStream(InputStream, Inflater, int). Constructor for class [Link]
Creates a new input stream with the specified decompressor and buffer size.
dil
info. Static variable in class [Link]
The background color for info(help) text.
INFO. Static variable in class [Link]
The array index for the info background color.
INFO_TEXT. Static variable in class [Link]
The array index for the info text color.
infoText. Static variable in class [Link]
The text color for info(help) text.
init(). Method in class [Link]
Called by the browser or applet viewer to inform this applet that it has been loaded into the system.
initialize(DSAParams, SecureRandom). Method in interface [Link]
va
Initializes the key pair generator using p, q and g, the DSA family parameters.
initialize(int). Method in class [Link]
Initializes the key pair generator for a certain strength using a system-provided source of randomness.
initialize(int, boolean, SecureRandom). Method in interface [Link]
Initializes the key pair generator for a given modulus length, without parameters.
initialize(int, SecureRandom). Method in class [Link]
Initializes the key pair generator for a certain strength.
initSign(PrivateKey). Method in class [Link]
Initialize this object for signing.
initVerify(PublicKey). Method in class [Link]
ja
Inserts the string representation of the double argument into this string buffer.
insert(int, float). Method in class [Link]
Inserts the string representation of the float argument into this string buffer.
insert(int, int). Method in class [Link]
Inserts the string representation of the second int argument into this string buffer.
insert(int, long). Method in class [Link]
Inserts the string representation of the long argument into this string buffer.
insert(int, Object). Method in class [Link]
Inserts the string representation of the Object argument into this string buffer.
insert(int, String). Method in class [Link]
Inserts the string into this string buffer.
insert(MenuItem, int). Method in class [Link]
360
361
m
insert(String, int). Method in class [Link]
Inserts an item with the specified label to this menu at the specified position.
insert(String, int). Method in class [Link]
Inserts the specified text at the specified position.
insert(String, int). Method in interface [Link]
insertElementAt(Object, int). Method in class [Link]
Inserts the specified object as a component in this vector at the specified index.
insertProviderAt(Provider, int). Static method in class [Link]
o
Adds a new provider, at a specified position.
insertSeparator(int). Method in class [Link]
Inserts a separator at the specified position
insertText(String, int). Method in class [Link]
insertText(String, int). Method in interface [Link]
i.c
DEPRECATED: Replaced by insert(String, int).
insets. Variable in class [Link]
insets(). Method in class [Link]
insets(). Method in interface [Link]
DEPRECATED: Replaced by getInsets().
Insets(int, int, int, int). Constructor for class [Link]
Constructs and initializes a new Inset with the specified top, left, bottom, and right insets.
inside(int, int). Method in class [Link]
inside(int, int). Method in class [Link]
inside(int, int). Method in class [Link]
dil
instantiate(ClassLoader, String). Static method in class [Link]
Instantiate a bean.
InstantiationError(). Constructor for class [Link]
Constructs an InstantiationError with no detail message.
InstantiationError(String). Constructor for class [Link]
Constructs an InstantiationError with the specified detail message.
InstantiationException(). Constructor for class [Link]
Constructs an InstantiationException with no detail message.
InstantiationException(String). Constructor for class [Link]
Constructs an InstantiationException with the specified detail message.
intBitsToFloat(int). Static method in class [Link]
va
Returns the single-float corresponding to a given bit represention.
INTEGER. Static variable in class [Link]
Integer(int). Constructor for class [Link]
Constructs a newly allocated Integer object that represents the primitive int argument.
Integer(String). Constructor for class [Link]
Constructs a newly allocated Integer object that represents the value represented by the string.
INTEGER_FIELD. Static variable in class [Link]
Field constant used to construct a FieldPosition object.
INTERFACE. Static variable in class [Link]
intern(). Method in class [Link]
ja
361
362
m
intValue(). Method in class [Link]
Returns the integer value of this Float (by casting to an int).
intValue(). Method in class [Link]
Returns the value of this Integer as an int.
intValue(). Method in class [Link]
Returns the value of this Long as an int.
intValue(). Method in class [Link]
Returns the value of the specified number as an int.
o
intValue(). Method in class [Link]
Returns the value of this Short as an int.
invalidate(). Method in class [Link]
Invalidates the component.
invalidate(). Method in class [Link]
i.c
Invalidates the container.
invalidateLayout(Container). Method in class [Link]
Invalidates the layout, indicating that if the layout manager has cached information it should be discarded.
invalidateLayout(Container). Method in class [Link]
Invalidates the layout, indicating that if the layout manager has cached information it should be discarded.
invalidateLayout(Container). Method in class [Link]
Invalidates the layout, indicating that if the layout manager has cached information it should be discarded.
invalidateLayout(Container). Method in interface [Link].LayoutManager2
Invalidates the layout, indicating that if the layout manager has cached information it should be discarded.
InvalidClassException(String). Constructor for class [Link]
dil
Report a InvalidClassException for the specified reason.
InvalidClassException(String, String). Constructor for class [Link]
InvalidKeyException(). Constructor for class [Link]
Constructs an InvalidKeyException with no detail message.
InvalidKeyException(String). Constructor for class [Link]
Constructs an InvalidKeyException with the specified detail message.
InvalidObjectException(String). Constructor for class [Link]
Raised by a class when it is explicitly disallowing itself to be serialized.
InvalidParameterException(). Constructor for class [Link]
Constructs an InvalidParameterException with no detail message.
InvalidParameterException(String). Constructor for class [Link]
va
Constructs an InvalidParameterException with the specified detail message.
InvocationTargetException(). Constructor for class [Link]
InvocationTargetException(Throwable). Constructor for class [Link]
Constructs a InvocationTargetException with a target exception.
InvocationTargetException(Throwable, String). Constructor for class [Link]
Constructs a InvocationTargetException with a target exception and a detail message.
invoke(Object, Object[]). Method in class [Link]
Invokes the underlying method represented by this Method object, on the specified object with the specified parameters.
invoke(RemoteCall). Method in interface [Link]
Executes the remote call.
ja
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 [Link]
Does a column's case matter?
isCatalogAtStart(). Method in interface [Link]
Does a catalog appear at the start of a qualified table name? (Otherwise it appears at the end)
isClosed(). Method in interface [Link]
Tests to see if a Connection is closed.
isConstrained(). Method in class [Link]
o
Attempted updates to "Constrained" properties will cause a "VetoableChange" event to get fired when the property is
changed.
isConsumed(). Method in class [Link]
isConsumed(). Method in class [Link]
Returns whether or not this event has been consumed.
i.c
isConsumer(ImageConsumer). Method in class [Link]
Determines whether an ImageConsumer is on the list of consumers currently interested in data for this image.
isConsumer(ImageConsumer). Method in interface [Link]
This method determines if a given ImageConsumer object is currently registered with this ImageProducer as one of its
consumers.
isConsumer(ImageConsumer). Method in class [Link]
Determine if an ImageConsumer is on the list of consumers currently interested in data for this image.
isControlDown(). Method in class [Link]
Returns whether or not the Control modifier is down on this event.
isCurrency(int). Method in interface [Link]
dil
Is the column a cash value?
isDaemon(). Method in class [Link]
Tests if this thread is a daemon thread.
isDaemon(). Method in class [Link]
Tests if this thread group is a daemon thread group.
isDataFlavorSupported(DataFlavor). Method in class [Link]
Returns whether the requested flavor is supported by this object.
isDataFlavorSupported(DataFlavor). Method in interface [Link]
Returns whether or not the specified data flavor is supported for this object.
isDecimalSeparatorAlwaysShown(). Method in class [Link]
Allows you to get the behavior of the decimal separator with integers.
va
isDefined(char). Static method in class [Link]
Determines if a character has a defined meaning in Unicode.
isDefinitelyWritable(int). Method in interface [Link]
Will a write on the column definitely succeed?
isDesignTime(). Static method in class [Link]
Test if we are in design-mode.
isDestroyed(). Method in class [Link]
Tests if this thread group has not been destroyed.
isDigit(char). Static method in class [Link]
Determines if the specified character is a digit.
ja
363
364
m
Returns whether this component can be traversed using Tab or Shift-Tab keyboard focus traversal.
isFocusTraversable(). Method in interface [Link]
isGroupingUsed(). Method in class [Link]
Returns true if grouping is used in this format.
isGuiAvailable(). Static method in class [Link]
isHidden(). Method in class [Link]
The "hidden" flag is used to identify features that are intended only for tool use, and which should not be exposed to humans.
isIdentifierIgnorable(char). Static method in class [Link]
o
Determines if the specified character should be regarded as an ignorable character in a Java identifier or a Unicode identifier.
isInDefaultEventSet(). Method in class [Link]
Report if an event set is in the "default set".
isIndexSelected(int). Method in class [Link]
Returns true if the item at the specified index has been selected; false otherwise.
i.c
isInfinite(). Method in class [Link]
Returns true if this Double value is infinitely large in magnitude.
isInfinite(). Method in class [Link]
Returns true if this Float value is infinitely large in magnitude.
isInfinite(double). Static method in class [Link]
Returns true if the specified number is infinitely large in magnitude.
isInfinite(float). Static method in class [Link]
Returns true if the specified number is infinitely large in magnitude.
isInstance(Object). Method in class [Link]
This method is the dynamic equivalent of the Java language instanceof operator.
dil
isInstanceOf(Object, Class). Static method in class [Link]
Check if a bean can be viewed as a given target type.
isInterface(). Method in class [Link]
Determines if the specified Class object represents an interface type.
isInterface(). Method in class [Link]
Is this RemoteClass an interface?
isInterface(int). Static method in class [Link]
Return true if the specifier integer includes the interface modifier.
isInterrupted(). Method in class [Link]
Tests if the current thread has been interrupted.
isISOControl(char). Static method in class [Link]
va
Determines if the specified character is an ISO control character.
isItalic(). Method in class [Link]
Returns true if the font is italic.
isJavaIdentifierPart(char). Static method in class [Link]
Determines if the specified character may be part of a Java identifier as other than the first character.
isJavaIdentifierStart(char). Static method in class [Link]
Determines if the specified character is permissible as the first character in a Java identifier.
isJavaLetter(char). Static method in class [Link]
Determines if the specified character is a "Java" letter, that is, the character is permissible as the first character in an identifier
in the Java language.
ja
364
365
m
Returns true if this Float value is Not-a-Number (NaN).
isNaN(double). Static method in class [Link]
Returns true if the specified number is the special Not-a-Number (NaN) value.
isNaN(float). Static method in class [Link]
Returns true if the specified number is the special Not-a-Number (NaN) value.
isNative(int). Static method in class [Link]
Return true if the specifier integer includes the native modifier.
isNegative(). Method in interface [Link]
o
Returns true if this is a negative ACL entry (one denying the associated principal the set of permissions in the entry), false
otherwise.
isNullable(int). Method in interface [Link]
Can you put a NULL in this column?
isObject(). Method in class [Link]
i.c
Returns whether the RemoteValue is an Object (as opposed to a primitive type, such as int).
isOwner(Principal). Method in interface [Link]
Returns true if the given principal is an owner of the ACL.
isPaintable(). Method in interface [Link]
isPaintable(). Method in class [Link]
isParseIntegerOnly(). Method in class [Link]
Returns true if this format will parse numbers as integers only.
isPlain(). Method in class [Link]
Returns true if the font is plain.
isPopupTrigger(). Method in class [Link]
dil
Returns whether or not this mouse event is the popup-menu trigger event for the platform.
isPrimitive(). Method in class [Link]
Determines if the specified Class object represents a primitive Java type.
isPrivate(int). Static method in class [Link]
Return true if the specifier integer includes the private modifier.
isProbablePrime(int). Method in class [Link]
Returns true if this BigInteger is probably prime, false if it's definitely composite.
isProtected(int). Static method in class [Link]
Return true if the specifier integer includes the protected modifier.
isPublic(int). Static method in class [Link]
Return true if the specified integer includes the public modifier.
va
isReadOnly(). Method in interface [Link]
Tests to see if the connection is in read-only mode.
isReadOnly(). Method in interface [Link]
Is the database in read-only mode?
isReadOnly(int). Method in interface [Link]
Is a column definitely not writable?
isResizable(). Method in class [Link]
Returns true if the user can resize the dialog.
isResizable(). Method in class [Link]
Returns true if the user can resize the Frame.
ja
365
366
m
Returns whether or not this focus change event is a temporary change.
isTimeSet. Variable in class [Link]
The flag which indicates if the current time is set for the calendar.
isTitleCase(char). Static method in class [Link]
Determines if the specified character is a titlecase character.
isTransient(int). Static method in class [Link]
Return true if the specifier integer includes the transient modifier.
isUnicast(). Method in class [Link]
o
Normally event sources are multicast.
isUnicodeIdentifierPart(char). Static method in class [Link]
Determines if the specified character may be part of a Unicode identifier as other than the first character.
isUnicodeIdentifierStart(char). Static method in class [Link]
Determines if the specified character is permissible as the first character in a Unicode identifier.
i.c
isUnique(). Static method in class [Link]
Return true if an accurate address can be determined for this host.
isUpperCase(char). Static method in class [Link]
Determines if the specified character is an uppercase character.
isValid(). Method in class [Link]
Checks if this Component is valid.
isVisible(). Method in class [Link]
Checks if this Component is visible.
isVolatile(int). Static method in class [Link]
Return true if the specifier integer includes the volatile modifier.
dil
isWhitespace(char). Static method in class [Link]
Determines if the specified character is white space according to Java.
isWritable(int). Method in interface [Link]
Is it possible for a write on the column to succeed?
ITALIAN. Static variable in class [Link]
Useful constant for language.
ITALIC. Static variable in class [Link]
The italicized style constant.
ITALY. Static variable in class [Link]
Useful constant for country.
ITEM_EVENT_MASK. Static variable in class [Link]
va
The event mask for selecting item events.
ITEM_FIRST. Static variable in class [Link]
Marks the first integer id for the range of item event ids.
ITEM_LAST. Static variable in class [Link]
Marks the last integer id for the range of item event ids.
ITEM_STATE_CHANGED. Static variable in class [Link]
The item state changed event type.
ItemEvent(ItemSelectable, int, Object, int). Constructor for class [Link]
Constructs a ItemSelectEvent object with the specified ItemSelectable source, type, item, and item select state.
itemStateChanged(ItemEvent). Method in class [Link]
ja
Handles the itemStateChanged event by invoking the itemStateChanged methods on listener-a and listener-b.
itemStateChanged(ItemEvent). Method in interface [Link]
Invoked when an item's state has been changed.
itrace(boolean). Method in class [Link]
Turn on/off instruction tracing.
w.
366
367
m
K
o
The action-key press keyboard event.
KEY_ACTION_RELEASE. Static variable in class [Link]
The action-key release keyboard event.
KEY_EVENT_MASK. Static variable in class [Link]
The event mask for selecting key events.
i.c
KEY_FIRST. Static variable in class [Link]
Marks the first integer id for the range of key event ids.
KEY_LAST. Static variable in class [Link]
Marks the last integer id for the range of key event ids.
KEY_PRESS. Static variable in class [Link]
The key press keyboard event.
KEY_PRESSED. Static variable in class [Link]
The key pressed event type.
KEY_RELEASE. Static variable in class [Link]
The key release keyboard event.
dil
KEY_RELEASED. Static variable in class [Link]
The key released event type.
KEY_TYPED. Static variable in class [Link]
The key typed event type.
KeyAdapter(). Constructor for class [Link]
keyDown(Event, int). Method in class [Link]
KeyEvent(Component, int, long, int, int). Constructor for class [Link]
KeyEvent(Component, int, long, int, int, char). Constructor for class [Link]
Constructs a KeyEvent object with the specified source component, type, modifiers, and key.
KeyException(). Constructor for class [Link]
Constructs a KeyException with no detail message.
va
KeyException(String). Constructor for class [Link]
Constructs a KeyException with the specified detail message.
KeyManagementException(). Constructor for class [Link]
Constructs a KeyManagementException with no detail message.
KeyManagementException(String). Constructor for class [Link]
Constructs a KeyManagementException with the specified detail message.
KeyPair(PublicKey, PrivateKey). Constructor for class [Link]
Constructs a key with the specified public key and private key.
KeyPairGenerator(String). Constructor for class [Link]
Creates a KeyPairGenerator object for the specified algorithm.
ja
367
368
m
Constructs a new label with the specified String of text.
Label(String, int). Constructor for class [Link]
Constructs a new label with the specified String of text and the specified alignment.
last(). Method in class [Link]
Return the last boundary.
last(). Method in interface [Link]
Set the position to getEndIndex()-1, return the character at that position.
last(). Method in class [Link]
o
Set the position to getEndIndex() and return the character at that position.
last(Container). Method in class [Link]
Flips to the last card of the specified container.
lastElement(). Method in class [Link]
Returns the last component of the vector.
i.c
lastIndexOf(int). Method in class [Link]
Returns the index within this string of the last occurrence of the specified character.
lastIndexOf(int, int). Method in class [Link]
Returns the index within this string of the last occurrence of the specified character, searching backward starting at the
specified index.
lastIndexOf(Object). Method in class [Link]
Returns the index of the last occurrence of the specified object in this vector.
lastIndexOf(Object, int). Method in class [Link]
Searches backwards for the specified object, starting from the specified index, and returns an index to it.
lastIndexOf(String). Method in class [Link]
dil
Returns the index within this string of the rightmost occurrence of the specified substring.
lastIndexOf(String, int). Method in class [Link]
Returns the index within this string of the last occurrence of the specified substring.
lastModified(). Method in class [Link]
Returns the time that the file represented by this File object was last modified.
LastOwnerException(). Constructor for class [Link]
Constructs a LastOwnerException.
lastPageFirst(). Method in class [Link]
Returns true if the last page will be printed first.
layout(). Method in class [Link]
layout(). Method in class [Link]
va
layout(). Method in class [Link]
layoutContainer(Container). Method in class [Link]
Lays out the specified container.
layoutContainer(Container). Method in class [Link]
Performs a layout in the specified panel.
layoutContainer(Container). Method in class [Link]
Lays out the container.
layoutContainer(Container). Method in class [Link]
Lays out the container in the specified panel.
layoutContainer(Container). Method in class [Link]
ja
368
369
m
LETTER_NUMBER. Static variable in class [Link]
lightGray. Static variable in class [Link]
The color light gray.
LINE_SEPARATOR. Static variable in class [Link]
lineno(). Method in class [Link]
Return the current line number.
LineNumberInputStream(InputStream). Constructor for class [Link]
Constructs a newline number input stream that reads its input from the specified input stream.
o
LineNumberReader(Reader). Constructor for class [Link]
Create a new line-numbering reader, using the default input-buffer size.
LineNumberReader(Reader, int). Constructor for class [Link]
Create a new line-numbering reader, reading characters into a buffer of the given size.
LinkageError(). Constructor for class [Link]
i.c
Constructs a LinkageError with no detail message.
LinkageError(String). Constructor for class [Link]
Constructs a LinkageError with the specified detail message.
list(). Method in class [Link]
Prints a listing to [Link].
list(). Method in class [Link]
Returns a list of the files in the directory specified by this File object.
List(). Constructor for class [Link]
Creates a new scrolling list initialized with no visible Lines or multiple selections.
list(). Method in interface [Link]
dil
Returns an array of the names in the registry.
list(). Method in class [Link]
Prints information about this thread group to the standard output.
list(FilenameFilter). Method in class [Link]
Returns a list of the files in the directory specified by this File that satisfy the specified filter.
List(int). Constructor for class [Link]
Creates a new scrolling list initialized with the specified number of visible lines and a boolean stating whether multiple
selections are allowed or not.
List(int, boolean). Constructor for class [Link]
Creates a new scrolling list initialized with the specified number of visible lines and a boolean stating whether multiple
selections are allowed or not.
va
list(PrintStream). Method in class [Link]
Prints a listing to the specified print stream.
list(PrintStream). Method in class [Link]
Prints this property list out to the specified output stream.
list(PrintStream, int). Method in class [Link]
Prints out a list, starting at the specified indention, to the specified print stream.
list(PrintStream, int). Method in class [Link]
Prints out a list, starting at the specified indention, to the specified out stream.
list(PrintWriter). Method in class [Link]
Prints a listing to the specified print writer.
ja
369
370
m
Requests the class loader to load a class with the specified name.
loadClass(String). Method in interface [Link]
Load class using [Link] property.
loadClass(String). Static method in class [Link]
Load a class from the URL specified in the [Link] property.
loadClass(String, boolean). Method in class [Link]
Resolves the specified name to a Class.
loadClass(URL, String). Method in interface [Link]
o
Load class from codebase URL specified.
loadClass(URL, String). Static method in class [Link]
Load a class from a URL.
loadImage(String). Method in class [Link]
This is a utility method to help in loading icon images.
i.c
LOADING. Static variable in class [Link]
Flag indicating some media is currently being loaded.
loadLibrary(String). Method in class [Link]
Loads the dynamic library with the specified library name.
loadLibrary(String). Static method in class [Link]
Loads the system library specified by the libname argument.
loadSystemColors(int[]). Method in class [Link]
Fills in the provided int array with the current system color values
locale. Variable in class [Link]
The locale for the component.
dil
Locale(String, String). Constructor for class [Link]
Construct a locale from language, country.
Locale(String, String, String). Constructor for class [Link]
Construct a locale from language, country, variant.
localPort. Variable in class [Link]
localport. Variable in class [Link]
The local port number to which this socket is connected.
locate(int, int). Method in class [Link]
locate(int, int). Method in class [Link]
location(). Method in class [Link]
location(int, int). Method in class [Link]
va
lock. Variable in class [Link]
The object used to synchronize operations on this stream.
lock. Variable in class [Link]
The object used to synchronize operations on this stream.
log(double). Static method in class [Link]
Returns the natural logarithm (base e) of a double value.
log(String). Static method in class [Link]
Return the LogStream identified by the given name.
LONG. Static variable in class [Link]
Constant for long style pattern.
ja
370
371
m
lookupConstraints(Component). Method in class [Link]
Retrieves the constraints for the specified component.
loop(). Method in interface [Link]
Starts playing this audio clip in a loop.
LOST_FOCUS. Static variable in class [Link]
A component lost the focus.
lostFocus(Event, Object). Method in class [Link]
lostOwnership(Clipboard, Transferable). Method in interface [Link]
o
Notifies this object that it is no longer the owner of the contents of the clipboard.
lostOwnership(Clipboard, Transferable). Method in class [Link]
LOWERCASE_LETTER. Static variable in class [Link]
lowerCaseMode(boolean). Method in class [Link]
Determines whether or not word token are automatically lowercased.
i.c
M
dil
MalformedURLException(). Constructor for class [Link]
Constructs a MalformedURLException with no detail message.
MalformedURLException(String). Constructor for class [Link]
Constructs a MalformedURLException with the specified detail message.
MARCH. Static variable in class [Link]
Useful constant for month.
mark. Variable in class [Link]
The currently marked position in the stream.
mark(int). Method in class [Link]
Marks the current position in this input stream.
mark(int). Method in class [Link]
va
Mark the present position in the stream.
mark(int). Method in class [Link]
Set the current marked position in the stream.
mark(int). Method in class [Link]
Mark the present position in the stream.
mark(int). Method in class [Link]
Marks the current position in this input stream.
mark(int). Method in class [Link]
Mark the present position in the stream.
mark(int). Method in class [Link]
ja
371
372
m
Tell whether this stream supports the mark() operation, which it does not.
markSupported(). Method in class [Link]
Tell whether this stream supports the mark() operation.
markSupported(). Method in class [Link]
Tell whether this stream supports the mark() operation, which it does.
MarshalException(String). Constructor for class [Link]
Create a new marshal exception with a descriptive string.
MarshalException(String, Exception). Constructor for class [Link]
o
Create a new marshal exception with a descriptive string and an exception.
MATH_SYMBOL. Static variable in class [Link]
max(BigDecimal). Method in class [Link]
Returns the BigDecimal whose value is the greater of this and val.
max(BigInteger). Method in class [Link]
i.c
Returns the BigInteger whose value is the greater of this and val.
max(double, double). Static method in class [Link]
Returns the greater of two double values.
max(float, float). Static method in class [Link]
Returns the greater of two float values.
max(int, int). Static method in class [Link]
Returns the greater of two int values.
max(long, long). Static method in class [Link]
Returns the greater of two long values.
MAX_PRIORITY. Static variable in class [Link]
dil
The maximum priority that a thread can have.
MAX_RADIX. Static variable in class [Link]
The maximum radix available for conversion to and from Strings.
MAX_VALUE. Static variable in class [Link]
The maximum value a Byte can have.
MAX_VALUE. Static variable in class [Link]
The constant value of this field is the largest value of type char.
MAX_VALUE. Static variable in class [Link]
The largest positive value of type double.
MAX_VALUE. Static variable in class [Link]
The largest positive value of type float.
va
MAX_VALUE. Static variable in class [Link]
The largest value of type int.
MAX_VALUE. Static variable in class [Link]
The largest value of type long.
MAX_VALUE. Static variable in class [Link]
The maximum value a Short can have.
MAXGRIDSIZE. Static variable in class [Link]
maximumLayoutSize(Container). Method in class [Link]
Returns the maximum dimensions for this layout given the components in the specified target container.
maximumLayoutSize(Container). Method in class [Link]
ja
Returns the maximum dimensions for this layout given the components in the specified target container.
maximumLayoutSize(Container). Method in class [Link]
Returns the maximum dimensions for this layout given the components in the specified target container.
maximumLayoutSize(Container). Method in interface [Link].LayoutManager2
Returns the maximum size of this component.
MAY. Static variable in class [Link]
Useful constant for month.
w.
MemoryImageSource(int, int, ColorModel, int[], int, int). Constructor for class [Link]
Constructs an ImageProducer object which uses an array of integers to produce data for an Image object.
MemoryImageSource(int, int, ColorModel, int[], int, int, Hashtable). Constructor for class [Link]
Constructs an ImageProducer object which uses an array of integers to produce data for an Image object.
MemoryImageSource(int, int, int[], int, int). Constructor for class [Link]
Constructs an ImageProducer object which uses an array of integers in the default RGB ColorModel to produce data for an
Image object.
MemoryImageSource(int, int, int[], int, int, Hashtable). Constructor for class [Link]
Constructs an ImageProducer object which uses an array of integers in the default RGB ColorModel to produce data for an
Image object.
MENU. Static variable in class [Link]
The array index for the menu background color.
372
373
m
Constructs a new Menu with an empty label.
Menu(String). Constructor for class [Link]
Constructs a new Menu with the specified label.
Menu(String, boolean). Constructor for class [Link]
Constructs a new Menu with the specified label.
MENU_TEXT. Static variable in class [Link]
The array index for the menu text color.
MenuBar(). Constructor for class [Link]
o
Creates a new menu bar.
MenuComponent(). Constructor for class [Link]
MenuItem(). Constructor for class [Link]
Constructs a new MenuItem with an empty label and no keyboard shortcut.
MenuItem(String). Constructor for class [Link]
i.c
Constructs a new MenuItem with the specified label and no keyboard shortcut.
MenuItem(String, MenuShortcut). Constructor for class [Link]
Create a MenuItem with an associated keyboard shortcut.
MenuShortcut(int). Constructor for class [Link]
Constructs a new MenuShortcut for the specified key.
MenuShortcut(int, boolean). Constructor for class [Link]
Constructs a new MenuShortcut for the specified key.
menuText. Static variable in class [Link]
The text color for menus.
MessageDigest(String). Constructor for class [Link]
dil
Creates a message digest with the specified algorithm name.
MessageFormat(String). Constructor for class [Link]
Constructs with the specified pattern.
META_MASK. Static variable in class [Link]
The meta modifier constant.
META_MASK. Static variable in class [Link]
The meta modifier constant.
META_MASK. Static variable in class [Link]
The meta key modifier constant.
metaDown(). Method in class [Link]
Checks if the meta key is down.
va
method. Variable in class [Link]
methodArgument(). Method in class [Link]
Return whether variable is a method argument.
MethodDescriptor(Method). Constructor for class [Link]
MethodDescriptor(Method, ParameterDescriptor[]). Constructor for class [Link]
MILLISECOND. Static variable in class [Link]
Useful constant for date and time.
MILLISECOND_FIELD. Static variable in class [Link]
Useful constant for MILLISECOND field alignment.
min(BigDecimal). Method in class [Link]
ja
Returns the BigDecimal whose value is the lesser of this and val.
min(BigInteger). Method in class [Link]
Returns the BigInteger whose value is the lesser of this and val.
min(double, double). Static method in class [Link]
Returns the smaller of two double values.
min(float, float). Static method in class [Link]
Returns the smaller of two float values.
w.
373
374
m
Calculates the minimum size for the specified panel.
minimumLayoutSize(Container). Method in class [Link]
Returns the minimum dimensions needed to layout the components contained in the specified target container.
minimumLayoutSize(Container). Method in class [Link]
Returns the minimum dimensions needed to layout the components contained in the specified panel.
minimumLayoutSize(Container). Method in class [Link]
Returns the minimum dimensions needed to layout the components contained in the specified panel.
minimumLayoutSize(Container). Method in interface [Link]
o
Calculates the minimum size dimensions for the specified panel given the components in the specified parent container.
minimumSize(). Method in class [Link]
minimumSize(). Method in interface [Link]
DEPRECATED: Replaced by getMinimumSize().
minimumSize(). Method in class [Link]
i.c
minimumSize(). Method in class [Link]
minimumSize(). Method in class [Link]
minimumSize(). Method in class [Link]
minimumSize(int). Method in class [Link]
minimumSize(int). Method in interface [Link]
DEPRECATED: Replaced by getMinimumSize(int).
minimumSize(int). Method in class [Link]
minimumSize(int). Method in interface [Link]
DEPRECATED: Replaced by getMinimumSize(int).
minimumSize(int, int). Method in class [Link]
dil
minimumSize(int, int). Method in interface [Link]
DEPRECATED: Replaced by getMinimumSize(int, int).
MINSIZE. Static variable in class [Link]
MINUTE. Static variable in class [Link]
Useful constant for date and time.
MINUTE_FIELD. Static variable in class [Link]
Useful constant for MINUTE field alignment.
MissingResourceException(String, String, String). Constructor for class [Link]
Constructs a MissingResourceException with the specified information.
mkdir(). Method in class [Link]
Creates a directory whose pathname is specified by this File object.
va
mkdirs(). Method in class [Link]
Creates a directory whose pathname is specified by this File object, including any necessary parent directories.
mod(BigInteger). Method in class [Link]
Returns a BigInteger whose value is this mod m.
Modifier(). Constructor for class [Link]
MODIFIER_LETTER. Static variable in class [Link]
MODIFIER_SYMBOL. Static variable in class [Link]
modifiers. Variable in class [Link]
The state of the modifier keys.
modInverse(BigInteger). Method in class [Link]
ja
374
375
m
The event mask for selecting mouse motion events.
MOUSE_MOVE. Static variable in class [Link]
The mouse move event.
MOUSE_MOVED. Static variable in class [Link]
The mouse moved event type.
MOUSE_PRESSED. Static variable in class [Link]
The mouse pressed event type.
MOUSE_RELEASED. Static variable in class [Link]
o
The mouse released event type.
MOUSE_UP. Static variable in class [Link]
The mouse up event.
MouseAdapter(). Constructor for class [Link]
mouseClicked(MouseEvent). Method in class [Link]
i.c
Handles the mouseClicked event by invoking the mouseClicked methods on listener-a and listener-b.
mouseClicked(MouseEvent). Method in class [Link]
mouseClicked(MouseEvent). Method in interface [Link]
Invoked when the mouse has been clicked on a component.
mouseDown(Event, int, int). Method in class [Link]
mouseDrag(Event, int, int). Method in class [Link]
mouseDragged(MouseEvent). Method in class [Link]
Handles the mouseDragged event by invoking the mouseDragged methods on listener-a and listener-b.
mouseDragged(MouseEvent). Method in class [Link]
mouseDragged(MouseEvent). Method in interface [Link]
dil
Invoked when a mouse button is pressed on a component and then dragged.
mouseEnter(Event, int, int). Method in class [Link]
mouseEntered(MouseEvent). Method in class [Link]
Handles the mouseEntered event by invoking the mouseEntered methods on listener-a and listener-b.
mouseEntered(MouseEvent). Method in class [Link]
mouseEntered(MouseEvent). Method in interface [Link]
Invoked when the mouse enters a component.
MouseEvent(Component, int, long, int, int, int, int, boolean). Constructor for class [Link]
Constructs a MouseEvent object with the specified source component, type, modifiers, coordinates, and click count.
mouseExit(Event, int, int). Method in class [Link]
mouseExited(MouseEvent). Method in class [Link]
va
Handles the mouseExited event by invoking the mouseExited methods on listener-a and listener-b.
mouseExited(MouseEvent). Method in class [Link]
mouseExited(MouseEvent). Method in interface [Link]
Invoked when the mouse exits a component.
MouseMotionAdapter(). Constructor for class [Link]
mouseMove(Event, int, int). Method in class [Link]
mouseMoved(MouseEvent). Method in class [Link]
Handles the mouseMoved event by invoking the mouseMoved methods on listener-a and listener-b.
mouseMoved(MouseEvent). Method in class [Link]
mouseMoved(MouseEvent). Method in interface [Link]
ja
Invoked when the mouse button has been moved on a component (with no buttons no down).
mousePressed(MouseEvent). Method in class [Link]
Handles the mousePressed event by invoking the mousePressed methods on listener-a and listener-b.
mousePressed(MouseEvent). Method in class [Link]
mousePressed(MouseEvent). Method in interface [Link]
Invoked when a mouse button has been pressed on a component.
mouseReleased(MouseEvent). Method in class [Link]
w.
Handles the mouseReleased event by invoking the mouseReleased methods on listener-a and listener-b.
mouseReleased(MouseEvent). Method in class [Link]
mouseReleased(MouseEvent). Method in interface [Link]
Invoked when a mouse button has been released on a component.
mouseUp(Event, int, int). Method in class [Link]
move(int, int). Method in class [Link]
move(int, int). Method in class [Link]
Changes the point to have the specified location.
move(int, int). Method in class [Link]
MOVE_CURSOR. Static variable in class [Link]
ww
375
376
m
N
o
The name of the property.
name. Variable in class [Link]
The logical name of this font.
NaN. Static variable in class [Link]
A NaN value of type double.
i.c
NaN. Static variable in class [Link]
The NaN value of type float.
NATIVE. Static variable in class [Link]
nativeSQL(String). Method in interface [Link]
A driver may convert the JDBC sql grammar into its system's native SQL grammar prior to sending it; nativeSQL returns the
native form of the statement that the driver would have sent.
NE_RESIZE_CURSOR. Static variable in class [Link]
The north-east-resize cursor type.
NE_RESIZE_CURSOR. Static variable in class [Link]
needsDictionary(). Method in class [Link]
dil
Returns true if a preset dictionary is needed for decompression.
needsGui(). Method in interface [Link]
needsInput(). Method in class [Link]
Returns true if the input data buffer is empty and setInput() should be called in order to provide more input.
needsInput(). Method in class [Link]
Returns true if no data remains in the input buffer.
negate(). Method in class [Link]
Returns a BigDecimal whose value is -1 * this, and whose scale is [Link]().
negate(). Method in class [Link]
Returns a BigInteger whose value is (-1 * this).
NEGATIVE_INFINITY. Static variable in class [Link]
va
The negative infinity of type double.
NEGATIVE_INFINITY. Static variable in class [Link]
The negative infinity of type float.
NegativeArraySizeException(). Constructor for class [Link]
Constructs a NegativeArraySizeException with no detail message.
NegativeArraySizeException(String). Constructor for class [Link]
Constructs a NegativeArraySizeException with the specified detail message.
newCall(RemoteObject, Operation[], int, long). Method in interface [Link]
Creates an appropriate call object for a new remote method invocation on this object.
newInstance(). Method in class [Link]
ja
Send a rectangular region of the buffer of pixels to any ImageConsumers that are currently interested in the data for this image
and notify them that an animation frame is complete.
newPixels(int, int, int, int, boolean). Method in class [Link]
Send a rectangular region of the buffer of pixels to any ImageConsumers that are currently interested in the data for this image.
newPixels(int[], ColorModel, int, int). Method in class [Link]
Change to a new int array to hold the pixels for this image.
next(). Method in class [Link]
Return the boundary following the current boundary.
next(). Method in interface [Link]
Increment the iterator's index by one and return the character at the new index.
next(). Method in class [Link]
Get the ordering priority of the next character in the string.
376
377
m
A ResultSet is initially positioned before its first row; the first call to next makes the first row the current row; the second call
makes the second row the current row, etc.
next(). Method in class [Link]
Increment the iterator's index by one and return the character at the new index.
next(Container). Method in class [Link]
Flips to the next card of the specified container.
next(int). Method in class [Link]
Return the nth boundary from the current boundary
o
next(int). Method in class [Link]
Generates the next pseudorandom number.
next(int). Method in class [Link]
Generates an integer containing the user-specified number of pseudo-random bits (right justified, with leading zeros).
nextBytes(byte[]). Method in class [Link]
i.c
Generates a user specified number of random bytes.
nextBytes(byte[]). Method in class [Link]
Generates a user-specified number of random bytes.
nextDouble(). Method in class [Link]
Returns the next pseudorandom, uniformly distributed double value between 0.0 and 1.0 from this random number
generator's sequence.
nextDouble(double). Static method in class [Link]
Finds the least double greater than d.
nextDouble(double, boolean). Static method in class [Link]
nextElement(). Method in interface [Link]
dil
Returns the next element of this enumeration.
nextElement(). Method in class [Link]
Returns the same value as the nextToken method, except that its declared return value is Object rather than String.
nextFloat(). Method in class [Link]
Returns the next pseudorandom, uniformly distributed float value between 0.0 and 1.0 from this random number
generator's sequence.
nextFocus(). Method in class [Link]
nextGaussian(). Method in class [Link]
Returns the next pseudorandom, Gaussian ("normally") distributed double value with mean 0.0 and standard deviation 1.0
from this random number generator's sequence.
nextInt(). Method in class [Link]
va
Returns the next pseudorandom, uniformly distributed int value from this random number generator's sequence.
nextLong(). Method in class [Link]
Returns the next pseudorandom, uniformly distributed long value from this random number generator's sequence.
nextToken(). Method in class [Link]
Parses the next token from the input stream of this tokenizer.
nextToken(). Method in class [Link]
Returns the next token from this string tokenizer.
nextToken(String). Method in class [Link]
Returns the next token in this string tokenizer's string.
NO_COMPRESSION. Static variable in class [Link]
ja
377
378
m
NoSuchAlgorithmException(String). Constructor for class [Link]
Constructs a NoSuchAlgorithmException with the specified detail message.
NoSuchElementException(). Constructor for class [Link]
Constructs a NoSuchElementException with no detail message.
NoSuchElementException(String). Constructor for class [Link]
Constructs a NoSuchElementException with the specified detail message.
NoSuchFieldError(). Constructor for class [Link]
Constructs a NoSuchFieldException with no detail message.
o
NoSuchFieldError(String). Constructor for class [Link]
Constructs a NoSuchFieldException with the specified detail message.
NoSuchFieldException(). Constructor for class [Link]
Constructor.
NoSuchFieldException(String). Constructor for class [Link]
i.c
Constructor with a detail message.
NoSuchLineNumberException(). Constructor for class [Link]
Constructor.
NoSuchLineNumberException(String). Constructor for class [Link]
Constructor with a detail message.
NoSuchMethodError(). Constructor for class [Link]
NoSuchMethodError(String). Constructor for class [Link]
Constructs a NoSuchMethodException with the specified detail message.
NoSuchMethodException(). Constructor for class [Link]
Constructs a NoSuchMethodException without a detail message.
dil
NoSuchMethodException(String). Constructor for class [Link]
Constructs a NoSuchMethodException with a detail message.
NoSuchObjectException(String). Constructor for class [Link]
Create a new NoSuchObjectException with a description.
NoSuchProviderException(). Constructor for class [Link]
Constructs a NoSuchProviderException with no detail message.
NoSuchProviderException(String). Constructor for class [Link]
Constructs a NoSuchProviderException with the specified detail message.
not(). Method in class [Link]
Returns a BigInteger whose value is (~this).
NotActiveException(). Constructor for class [Link]
va
Constructor to create a new NotActiveException with no reason.
NotActiveException(String). Constructor for class [Link]
Constructor to create a new NotActiveException with the reason given.
NotBoundException(). Constructor for class [Link]
NotBoundException(String). Constructor for class [Link]
notify(). Method in class [Link]
Wakes up a single thread that is waiting on this object's monitor.
notifyAll(). Method in class [Link]
Wakes up all threads that are waiting on this object's monitor.
notifyObservers(). Method in class [Link]
ja
If this object has changed, as indicated by the hasChanged method, then notify all of its observers and then call the
clearChanged method to indicate that this object has no longer changed.
notifyObservers(Object). Method in class [Link]
If this object has changed, as indicated by the hasChanged method, then notify all of its observers and then call the
clearChanged method to indicate that this object has no longer changed.
NotOwnerException(). Constructor for class [Link]
Constructs a NotOwnerException.
w.
Are concatenations between NULL and non-NULL values NULL? A JDBC-Compliant driver always returns true.
NullPointerException(). Constructor for class [Link]
Constructs a NullPointerException with no detail message.
NullPointerException(String). Constructor for class [Link]
Constructs a NullPointerException with the specified detail message.
nullsAreSortedAtEnd(). Method in interface [Link]
Are NULL values sorted at the end regardless of sort order?
nullsAreSortedAtStart(). Method in interface [Link]
Are NULL values sorted at the start regardless of sort order?
nullsAreSortedHigh(). Method in interface [Link]
Are NULL values sorted high?
nullsAreSortedLow(). Method in interface [Link]
378
379
m
NUM_LOCK. Static variable in class [Link]
The NumLock action-key.
Number(). Constructor for class [Link]
numberFormat. Variable in class [Link]
The number formatter that DateFormat uses to format numbers in dates and times.
NumberFormat(). Constructor for class [Link]
NumberFormatException(). Constructor for class [Link]
Constructs a NumberFormatException with no detail message.
o
NumberFormatException(String). Constructor for class [Link]
Constructs a NumberFormatException with the specified detail message.
NUMERIC. Static variable in class [Link]
nval. Variable in class [Link]
If the current token is a number, this field contains the value of that number.
i.c
NW_RESIZE_CURSOR. Static variable in class [Link]
The north-west-resize cursor type.
NW_RESIZE_CURSOR. Static variable in class [Link]
dil
Create an ObjectInputStream that reads from the specified InputStream.
ObjectOutputStream(OutputStream). Constructor for class [Link]
Creates an ObjectOutputStream that writes to the specified OutputStream.
ObjectStreamException(). Constructor for class [Link]
Create an ObjectStreamException.
ObjectStreamException(String). Constructor for class [Link]
Create an ObjectStreamException with the specified argument.
ObjID(). Constructor for class [Link]
Generate unique object identifier.
ObjID(int). Constructor for class [Link]
Generate a "well-known" object ID.
va
Observable(). Constructor for class [Link]
Creates an observable object with no observers.
OCTOBER. Static variable in class [Link]
Useful constant for month.
okToUseGui(). Method in interface [Link]
This method instructs the bean that it is OK to use the Gui.
on(boolean). Method in class [Link]
Turns the digest function on or off.
on(boolean). Method in class [Link]
Turns the digest function on or off.
ja
Specifies that all characters c in the range low <= c <= high are "ordinary" in this tokenizer.
origmodel. Variable in class [Link]
OTHER. Static variable in class [Link]
OTHER indicates that the SQL type is database specific and gets mapped to a Java object which can be accessed via
getObject and setObject.
OTHER_LETTER. Static variable in class [Link]
OTHER_NUMBER. Static variable in class [Link]
OTHER_PUNCTUATION. Static variable in class [Link]
OTHER_SYMBOL. Static variable in class [Link]
out. Static variable in class [Link]
A handle to the standard output stream.
out. Variable in class [Link]
379
380
m
out. Variable in class [Link]
out. Static variable in class [Link]
The "standard" output stream.
OutOfMemoryError(). Constructor for class [Link]
Constructs an OutOfMemoryError with no detail message.
OutOfMemoryError(String). Constructor for class [Link]
Constructs an OutOfMemoryError with the specified detail message.
outpixbuf. Variable in class [Link]
o
OutputStream(). Constructor for class [Link]
OutputStreamWriter(OutputStream). Constructor for class [Link]
Create an OutputStreamWriter that uses the default character encoding.
OutputStreamWriter(OutputStream, String). Constructor for class [Link]
Create an OutputStreamWriter that uses the named character encoding.
i.c
owner. Variable in class [Link]
dil
defined by the prefix.
packagePrefix. Static variable in interface [Link]
Find server package prefix: assumes that the implementation of server ref classes (e.g., UnicastRef, UnicastServerRef) are
located in the package defined by the prefix.
PAINT. Static variable in class [Link]
The paint event type.
paint(Graphics). Method in class [Link]
Paints the canvas in the default background color.
paint(Graphics). Method in class [Link]
Paints the component.
paint(Graphics). Method in interface [Link]
va
paint(Graphics). Method in class [Link]
Paints the container.
PAINT_FIRST. Static variable in class [Link]
Marks the first integer id for the range of paint event ids.
PAINT_LAST. Static variable in class [Link]
Marks the last integer id for the range of paint event ids.
paintAll(Graphics). Method in class [Link]
Paints the component and its subcomponents.
paintComponents(Graphics). Method in class [Link]
Paints the components in this container.
ja
380
381
m
Returns the parameter String of this Event.
paramString(). Method in class [Link]
Returns the parameter String of this file dialog.
paramString(). Method in class [Link]
paramString(). Method in class [Link]
Returns the parameter String of this Frame.
paramString(). Method in class [Link]
paramString(). Method in class [Link]
o
paramString(). Method in class [Link]
Returns the parameter String of this label.
paramString(). Method in class [Link]
Returns the parameter String of this list.
paramString(). Method in class [Link]
i.c
Returns the String parameter of the menu.
paramString(). Method in class [Link]
Returns the String parameter of this MenuComponent.
paramString(). Method in class [Link]
Returns the String parameter of the menu item.
paramString(). Method in class [Link]
paramString(). Method in class [Link]
paramString(). Method in class [Link]
paramString(). Method in class [Link]
Returns the String parameters for this Scrollbar.
dil
paramString(). Method in class [Link]
Returns the parameter String of this Container.
paramString(). Method in class [Link]
Returns the String of parameters for this TextArea.
paramString(). Method in class [Link]
Returns the String of parameters for this TextComponent.
paramString(). Method in class [Link]
paramString(). Method in class [Link]
Returns the String of parameters for this TextField.
paramString(). Method in class [Link]
parent. Variable in class [Link]
va
The parent bundle is consulted by getObject when this bundle does not contain a particular resource.
parentOf(ThreadGroup). Method in class [Link]
Tests if this thread group is either the thread group argument or one of its ancestor thread groups.
parse(String). Static method in class [Link]
Given a string representing a time, parse it and return the time value.
parse(String). Method in class [Link]
Parse a date/time string.
parse(String). Method in class [Link]
Parses the string.
parse(String). Method in class [Link]
ja
Convenience method.
parse(String, ParsePosition). Method in class [Link]
Returns a Long if possible (e.g.
parse(String, ParsePosition). Method in class [Link]
Parse a date/time string according to the given parse position.
parse(String, ParsePosition). Method in class [Link]
Returns a Long if possible (e.g.
w.
381
382
m
Parses a string to produce an object.
parseObject(String, ParsePosition). Method in class [Link]
Parse a date/time string into an Object.
parseObject(String, ParsePosition). Method in class [Link]
Parses a string to produce an object.
parseObject(String, ParsePosition). Method in class [Link]
Parses the string.
parseObject(String, ParsePosition). Method in class [Link]
o
Parses a string to produce an object.
ParsePosition(int). Constructor for class [Link]
Create a new ParsePosition with the given initial index.
parseShort(String). Static method in class [Link]
Assuming the specified String represents a short, returns that short's value.
i.c
parseShort(String, int). Static method in class [Link]
Assuming the specified String represents a short, returns that short's value.
parseURL(URL, String, int, int). Method in class [Link]
Parses the string representation of a URL into a URL object.
pathSeparator. Static variable in class [Link]
The system-dependent path separator string.
pathSeparatorChar. Static variable in class [Link]
The system-dependent path separator character.
PAUSE. Static variable in class [Link]
The Pause action-key.
dil
peek(). Method in class [Link]
Looks at the object at the top of this stack without removing it from the stack.
peek(InetAddress). Method in class [Link]
Peek at the packet to see who it is from.
peekEvent(). Method in class [Link]
Return the first event without removing it.
peekEvent(int). Method in class [Link]
permissions(). Method in interface [Link]
Returns an enumeration of the permissions in this ACL entry.
PGDN. Static variable in class [Link]
The page down action-key.
va
PGUP. Static variable in class [Link]
The page up action-key.
PI. Static variable in class [Link]
The double value that is closer than any other to pi, the ratio of the circumference of a circle to its diameter.
pink. Static variable in class [Link]
The color pink.
PIPE_SIZE. Static variable in class [Link]
PipedInputStream(). Constructor for class [Link]
Creates a piped input stream that is not yet connected to a piped output stream.
PipedInputStream(PipedOutputStream). Constructor for class [Link]
ja
Creates a piped input stream connected to the specified piped output stream.
PipedOutputStream(). Constructor for class [Link]
Creates a piped output stream that is not yet connected to a piped input stream.
PipedOutputStream(PipedInputStream). Constructor for class [Link]
Creates a piped output stream connected to the specified piped input stream.
PipedReader(). Constructor for class [Link]
Create a reader that is not yet connected to a piped writer.
w.
Create a PixelGrabber object to grab the (x, y, w, h) rectangular section of pixels from the specified image into the given
array.
PixelGrabber(ImageProducer, int, int, int, int, int[], int, int). Constructor for class [Link]
Create a PixelGrabber object to grab the (x, y, w, h) rectangular section of pixels from the image produced by the specified
ImageProducer into the given array.
PLAIN. Static variable in class [Link]
The plain style constant.
plainTextFlavor. Static variable in class [Link]
The DataFlavor representing plain text with unicode encoding, where:
representationClass = InputStream
mimeType = "text/plain; charset=unicode"
382
383
m
play(URL). Method in class [Link]
Plays the audio clip at the specified absolute URL.
play(URL, String). Method in class [Link]
Plays the audio clip given the URL and a specifier that is relative to it.
PM. Static variable in class [Link]
Useful constant for hour in 12-hour clock.
Point(). Constructor for class [Link]
Constructs and initializes a Point initialized with (0, 0).
o
Point(int, int). Constructor for class [Link]
Constructs and initializes a Point from the specified x and y coordinates.
Point(Point). Constructor for class [Link]
Constructs and initializes a Point with the same location as the specified Point.
Polygon(). Constructor for class [Link]
i.c
Creates an empty polygon.
Polygon(int[], int[], int). Constructor for class [Link]
Constructs and initializes a Polygon from the specified parameters.
pop(). Method in class [Link]
Removes the object at the top of this stack and returns that object as the value of this function.
PopupMenu(). Constructor for class [Link]
Creates a new popup menu.
PopupMenu(String). Constructor for class [Link]
Creates a new popup menu with the specified name.
port. Variable in class [Link]
dil
The port number on the remote host to which this socket is connected.
pos. Variable in class [Link]
The current position in the buffer.
pos. Variable in class [Link]
The index of the next character to read from the input stream buffer.
pos. Variable in class [Link]
Current buffer position
pos. Variable in class [Link]
The current position within the buffer.
pos. Variable in class [Link]
The index of the next character to read from the input stream buffer.
va
POSITIVE_INFINITY. Static variable in class [Link]
The positive infinity of type double.
POSITIVE_INFINITY. Static variable in class [Link]
The positive infinity of type float.
postEvent(AWTEvent). Method in class [Link]
Post a 1.1-style event to the EventQueue.
postEvent(Event). Method in class [Link]
postEvent(Event). Method in class [Link]
Posts the specified event to the menu.
postEvent(Event). Method in interface [Link]
ja
Returns the preferred dimensions for this layout given the components int the specified panel.
preferredLayoutSize(Container). Method in interface [Link]
Calculates the preferred size dimensions for the specified panel given the components in the specified parent container.
PREFERREDSIZE. Static variable in class [Link]
preferredSize(). Method in class [Link]
preferredSize(). Method in interface [Link]
DEPRECATED: Replaced by getPreferredSize().
preferredSize(). Method in class [Link]
preferredSize(). Method in class [Link]
preferredSize(). Method in class [Link]
preferredSize(). Method in class [Link]
preferredSize(int). Method in class [Link]
383
384
m
preferredSize(int). Method in interface [Link]
DEPRECATED: Replaced by getPreferredSize(int).
preferredSize(int, int). Method in class [Link]
preferredSize(int, int). Method in interface [Link]
DEPRECATED: Replaced by getPreferredSize(int, int).
prepareCall(String). Method in interface [Link]
A SQL stored procedure call statement is handled by creating a CallableStatement for it.
prepareImage(Image, ImageObserver). Method in class [Link]
o
Prepares an image for rendering on this Component.
prepareImage(Image, int, int, ImageObserver). Method in class [Link]
Prepares an image for rendering on this Component at the specified width and height.
prepareImage(Image, int, int, ImageObserver). Method in interface [Link]
prepareImage(Image, int, int, ImageObserver). Method in class [Link]
i.c
Prepares an image for rendering on the default screen at the specified width and height.
prepareStatement(String). Method in interface [Link]
A SQL statement with or without IN parameters can be pre-compiled and stored in a PreparedStatement object.
previous(). Method in class [Link]
Return the boundary preceding the current boundary.
previous(). Method in interface [Link]
Decrement the iterator's index by one and return the character at the new index.
previous(). Method in class [Link]
Decrement the iterator's index by one and return the character at the new index.
previous(Container). Method in class [Link]
dil
Flips to the previous card of the specified container.
previousDouble(double). Static method in class [Link]
Finds the greatest double less than d.
PRIMARY. Static variable in class [Link]
Collator strength value.
primaryOrder(int). Static method in class [Link]
Get the primary order of a collation order.
print(boolean). Method in class [Link]
Prints the string "true" to the underlying output stream if the value of the boolean argument is true; otherwise, prints the
string "false" to the underlying output stream.
print(boolean). Method in class [Link]
va
Print a boolean.
print(char). Method in class [Link]
Prints the low eight bits of the character argument to this print stream's underlying output stream.
print(char). Method in class [Link]
Print a character.
print(char[]). Method in class [Link]
Prints the low eight bits of each of the characters in the character array to this print stream's underlying output stream.
print(char[]). Method in class [Link]
Print an array of chracters.
print(double). Method in class [Link]
ja
Prints the string representation of the double to this print stream's underlying output stream.
print(double). Method in class [Link]
Print a double.
print(float). Method in class [Link]
Prints the string representation of the float to this print stream's underlying output stream.
print(float). Method in class [Link]
Print a float.
w.
Prints the string representation of the long to this print stream's underlying output stream.
print(long). Method in class [Link]
Print a long.
print(Object). Method in class [Link]
Prints the string representation of the Object to this print stream's underlying output stream.
print(Object). Method in class [Link]
Print an object.
print(String). Method in class [Link]
If the string argument is null, the string "null" is printed to this print stream's underlying output stream.
print(String). Method in class [Link]
Print a String.
PRINT_SCREEN. Static variable in class [Link]
384
385
m
printComponents(Graphics). Method in class [Link]
Prints the components in this container.
printComponents(Graphics). Method in class [Link]
Prints the component in this scroll pane.
PrintJob(). Constructor for class [Link]
println(). Method in class [Link]
Prints a newline character to this print stream's underlying output stream.
println(). Method in class [Link]
o
Finish the line.
println(boolean). Method in class [Link]
Prints the string "true" followed by a newline character to this print stream's underlying output stream if the value of the
boolean argument is true; otherwise prints the string "false" followed by a newline character to the underlying output
stream.
i.c
println(boolean). Method in class [Link]
Print a boolean, and then finish the line.
println(char). Method in class [Link]
Prints the low eight bits of the character argument followed by a newline character to this print stream's underlying output
stream.
println(char). Method in class [Link]
Print a character, and then finish the line.
println(char[]). Method in class [Link]
Prints the low eight bits of each of the characters in the character array, followed by a newline character, to this print stream's
underlying output stream.
dil
println(char[]). Method in class [Link]
Print an array of characters, and then finish the line.
println(double). Method in class [Link]
Prints the string representation of the double followed by a newline to this print stream's underlying output stream.
println(double). Method in class [Link]
Print a double, and then finish the line.
println(float). Method in class [Link]
Prints the string representation of the float followed by a newline to this print stream's underlying output stream.
println(float). Method in class [Link]
Print a float, and then finish the line.
println(int). Method in class [Link]
va
Prints the string representation of the int followed by a newline to this print stream's underlying output stream.
println(int). Method in class [Link]
Print an integer, and then finish the line.
println(long). Method in class [Link]
Prints the string representation of the long followed by a newline to this print stream's underlying output stream.
println(long). Method in class [Link]
Print a long, and then finish the line.
println(Object). Method in class [Link]
Prints the string representation of the Object followed by a newline to this print stream's underlying output stream.
println(Object). Method in class [Link]
ja
Constructs a new print stream that writes its output to the specified underlying output stream.
printToConsole(String). Method in interface [Link]
Print text to the debugger's console window.
PrintWriter(OutputStream). Constructor for class [Link]
Create a new PrintWriter, without automatic line flushing, from an existing OutputStream.
PrintWriter(OutputStream, boolean). Constructor for class [Link]
Create a new PrintWriter from an existing OutputStream.
PrintWriter(Writer). Constructor for class [Link]
Create a new PrintWriter, without automatic line flushing.
PrintWriter(Writer, boolean). Constructor for class [Link]
Create a new PrintWriter.
PRIVATE. Static variable in class [Link]
385
386
m
procedureColumnInOut. Static variable in interface [Link]
COLUMN_TYPE - INOUT parameter.
procedureColumnOut. Static variable in interface [Link]
COLUMN_TYPE - OUT parameter.
procedureColumnResult. Static variable in interface [Link]
COLUMN_TYPE - result column in ResultSet.
procedureColumnReturn. Static variable in interface [Link]
COLUMN_TYPE - procedure return value.
o
procedureColumnUnknown. Static variable in interface [Link]
COLUMN_TYPE - nobody knows.
procedureNoNulls. Static variable in interface [Link]
TYPE NULLABLE - does not allow NULL values.
procedureNoResult. Static variable in interface [Link]
i.c
PROCEDURE_TYPE - Does not return a result.
procedureNullable. Static variable in interface [Link]
TYPE NULLABLE - allows NULL values.
procedureNullableUnknown. Static variable in interface [Link]
TYPE NULLABLE - nullability unknown.
procedureResultUnknown. Static variable in interface [Link]
PROCEDURE_TYPE - May return a result.
procedureReturnsResult. Static variable in interface [Link]
PROCEDURE_TYPE - Returns a result.
Process(). Constructor for class [Link]
dil
processActionEvent(ActionEvent). Method in class [Link]
Processes action events occurring on this button by dispatching them to any registered ActionListener objects.
processActionEvent(ActionEvent). Method in class [Link]
Processes action events occurring on this component by dispatching them to any registered ActionListener objects.
processActionEvent(ActionEvent). Method in class [Link]
Processes action events occurring on this menu item by dispatching them to any registered ActionListener objects.
processActionEvent(ActionEvent). Method in class [Link]
Processes action events occurring on this textfield by dispatching them to any registered ActionListener objects.
processAdjustmentEvent(AdjustmentEvent). Method in class [Link]
Processes adjustment events occurring on this scrollbar by dispatching them to any registered AdjustmentListener objects.
processComponentEvent(ComponentEvent). Method in class [Link]
va
Processes component events occurring on this component by dispatching them to any registered ComponentListener objects.
processContainerEvent(ContainerEvent). Method in class [Link]
Processes container events occurring on this container by dispatching them to any registered ContainerListener objects.
processEvent(AWTEvent). Method in class [Link]
Processes events on this button.
processEvent(AWTEvent). Method in class [Link]
Processes events on this checkbox.
processEvent(AWTEvent). Method in class [Link]
Processes events on this checkbox menu item.
processEvent(AWTEvent). Method in class [Link]
ja
386
387
m
Processes mouse events occurring on this component by dispatching them to any registered MouseListener objects.
processMouseMotionEvent(MouseEvent). Method in class [Link]
Processes mouse motion events occurring on this component by dispatching them to any registered MouseMotionListener
objects.
processTextEvent(TextEvent). Method in class [Link]
Processes text events occurring on this text component by dispatching them to any registered TextListener objects.
processWindowEvent(WindowEvent). Method in class [Link]
Processes window events occurring on this window by dispatching them to any registered WindowListener objects.
o
PROPERTIES. Static variable in interface [Link]
The properties of the image are now available.
Properties(). Constructor for class [Link]
Creates an empty property list with no default values.
Properties(Properties). Constructor for class [Link]
i.c
Creates an empty property list with the specified defaults.
propertyChange(PropertyChangeEvent). Method in interface [Link]
This method gets called when a bound property is changed.
PropertyChangeEvent(Object, String, Object, Object). Constructor for class [Link]
PropertyChangeSupport(Object). Constructor for class [Link]
PropertyDescriptor(String, Class). Constructor for class [Link]
Constructs a PropertyDescriptor for a property that follows the standard Java convention by having getFoo and setFoo
accessor methods.
PropertyDescriptor(String, Class, String, String). Constructor for class [Link]
This constructor takes the name of a simple property, and method names for reading and writing the property.
dil
PropertyDescriptor(String, Method, Method). Constructor for class [Link]
This constructor takes the name of a simple property, and Method objects for reading and writing the property.
PropertyEditorManager(). Constructor for class [Link]
PropertyEditorSupport(). Constructor for class [Link]
Constructor for use by derived PropertyEditor classes.
PropertyEditorSupport(Object). Constructor for class [Link]
Constructor for use when a PropertyEditor is delegating to us.
propertyNames(). Method in class [Link]
Returns an enumeration of all the keys in this property list, including the keys in the default property list.
PropertyResourceBundle(InputStream). Constructor for class [Link]
Creates a property resource
va
PropertyVetoException(String, PropertyChangeEvent). Constructor for class [Link]
PROTECTED. Static variable in class [Link]
ProtocolException(). Constructor for class [Link]
Constructs a new ProtocolException with no detail message.
ProtocolException(String). Constructor for class [Link]
Constructs a new ProtocolException with the specified detail message.
Provider(String, double, String). Constructor for class [Link]
Constructs a provider with the specified name, version number, and information.
ProviderException(). Constructor for class [Link]
Constructs a ProviderException with no detail message.
ja
Create a new pushback reader with a pushback buffer of the given size.
put(Object, Object). Method in class [Link]
Maps the specified key to the specified value in this dictionary.
put(Object, Object). Method in class [Link]
Maps the specified key to the specified value in this hashtable.
putNextEntry(ZipEntry). Method in class [Link]
Begins writing a new ZIP file entry and positions the stream to the start of the entry data.
387
388
m
Specifies that matching pairs of this character delimit string constants in this tokenizer.
o
Random(). Constructor for class [Link]
Creates a new random number generator.
Random(long). Constructor for class [Link]
Creates a new random number generator using a single long seed.
RandomAccessFile(File, String). Constructor for class [Link]
i.c
Creates a random access file stream to read from, and optionally to write to, the file specified by the File argument.
RandomAccessFile(String, String). Constructor for class [Link]
Creates a random access file stream to read from, and optionally to write to, a file with the specified name.
RANDOMPIXELORDER. Static variable in interface [Link]
The pixels will be delivered in a random order.
read(). Method in class [Link]
Reads the next byte of data from this buffered input stream.
read(). Method in class [Link]
Read a single character.
read(). Method in class [Link]
dil
Reads the next byte of data from this input stream.
read(). Method in class [Link]
Read a single character.
read(). Method in class [Link]
Reads a byte.
read(). Method in class [Link]
Reads a byte, and updates the message digest (if the digest function is on).
read(). Method in class [Link]
Reads a byte of data from this input stream.
read(). Method in class [Link]
Reads the next byte of data from this input stream.
va
read(). Method in class [Link]
Read a single character.
read(). Method in class [Link]
Reads a byte of uncompressed data.
read(). Method in class [Link]
Reads the next byte of data from this input stream.
read(). Method in class [Link]
Read a single character.
read(). Method in class [Link]
Reads the next byte of data from this input stream.
ja
Reads the next byte of data from this piped input stream.
read(). Method in class [Link]
Reads the next byte of data from this input stream.
read(). Method in class [Link]
Read a single character.
read(). Method in class [Link]
Reads a byte of data from this file.
read(). Method in class [Link]
Read a single character.
read(). Method in class [Link]
ww
388
389
Reads up to [Link] bytes of data from this input stream into an array of bytes.
read(byte[]). Method in interface [Link]
Reads into an array of bytes.
m
read(byte[]). Method in class [Link]
Reads up to [Link] bytes of data from this file into an array of bytes.
read(byte[], int, int). Method in class [Link]
Reads up to len bytes of data from this buffered input stream into an array of bytes.
read(byte[], int, int). Method in class [Link]
Reads up to len bytes of data into an array of bytes from this input stream.
read(byte[], int, int). Method in class [Link]
Reads into an array of bytes.
o
read(byte[], int, int). Method in class [Link]
Reads up to len bytes of data from this data input stream into an array of bytes.
read(byte[], int, int). Method in class [Link]
Reads into a byte array, and updates the message digest (if the digest function is on).
read(byte[], int, int). Method in class [Link]
i.c
Reads up to len bytes of data from this input stream into an array of bytes.
read(byte[], int, int). Method in class [Link]
Reads up to len bytes of data from this input stream into an array of bytes.
read(byte[], int, int). Method in class [Link]
Reads uncompressed data into an array of bytes.
read(byte[], int, int). Method in class [Link]
Reads uncompressed data into an array of bytes.
read(byte[], int, int). Method in class [Link]
Reads up to len bytes of data from this input stream into an array of bytes.
read(byte[], int, int). Method in class [Link]
dil
Reads up to len bytes of data from this input stream into an array of bytes.
read(byte[], int, int). Method in interface [Link]
Reads into an array of bytes.
read(byte[], int, int). Method in class [Link]
Reads into an array of bytes.
read(byte[], int, int). Method in class [Link]
Reads up to len bytes of data from this piped input stream into an array of bytes.
read(byte[], int, int). Method in class [Link]
Reads up to len bytes of data from this input stream into an array of bytes.
read(byte[], int, int). Method in class [Link]
Reads up to len bytes of data from this file into an array of bytes.
va
read(byte[], int, int). Method in class [Link]
Reads up to len bytes of data from this input stream into an array of bytes.
read(byte[], int, int). Method in class [Link]
Reads up to len bytes of data from this input stream into an array of bytes.
read(byte[], int, int). Method in class [Link]
Reads from the current ZIP entry into an array of bytes.
read(char[]). Method in class [Link]
Read characters into an array.
read(char[], int, int). Method in class [Link]
Read characters into a portion of an array.
ja
389
390
m
readByte(). Method in class [Link]
Reads an 8 bit byte.
readByte(). Method in class [Link]
Reads a signed 8-bit value from this file.
readChar(). Method in interface [Link]
Reads a Unicode char value from the input stream.
readChar(). Method in class [Link]
Reads a Unicode character from this data input stream.
o
readChar(). Method in class [Link]
Reads a 16 bit char.
readChar(). Method in class [Link]
Reads a Unicode character from this file.
readDouble(). Method in interface [Link]
i.c
Reads a double value from the input stream.
readDouble(). Method in class [Link]
Reads a double from this data input stream.
readDouble(). Method in class [Link]
Reads a 64 bit double.
readDouble(). Method in class [Link]
Reads a double from this file.
Reader(). Constructor for class [Link]
Create a new character-stream reader whose critical sections will synchronize on the reader itself.
Reader(Object). Constructor for class [Link]
dil
Create a new character-stream reader whose critical sections will synchronize on the given object.
readExternal(ObjectInput). Method in interface [Link]
The object implements the readExternal method to restore its contents by calling the methods of DataInput for primitive types
and readObject for objects, strings and arrays.
readFloat(). Method in interface [Link]
Reads a float value from the input stream.
readFloat(). Method in class [Link]
Reads a float from this data input stream.
readFloat(). Method in class [Link]
Reads a 32 bit float.
readFloat(). Method in class [Link]
va
Reads a float from this file.
readFully(byte[]). Method in interface [Link]
Reads [Link] bytes into the byte array.
readFully(byte[]). Method in class [Link]
Reads [Link] bytes from this data input stream into the byte array.
readFully(byte[]). Method in class [Link]
Reads bytes, blocking until all bytes are read.
readFully(byte[]). Method in class [Link]
Reads [Link] bytes from this file into the byte array.
readFully(byte[], int, int). Method in interface [Link]
ja
390
391
m
Reads a 64 bit long.
readLong(). Method in class [Link]
Reads a signed 64-bit integer from this file.
readObject(). Method in interface [Link]
Read and return an object.
readObject(). Method in class [Link]
Read an object from the ObjectInputStream.
readShort(). Method in interface [Link]
o
Reads a 16-bit value from the input stream.
readShort(). Method in class [Link]
Reads a signed 16-bit number from this data input stream.
readShort(). Method in class [Link]
Reads a 16 bit short.
i.c
readShort(). Method in class [Link]
Reads a signed 16-bit number from this file.
readStreamHeader(). Method in class [Link]
The readStreamHeader method is provided to allow subclasses to read and verify their own stream headers.
readUnsignedByte(). Method in interface [Link]
Reads an unsigned 8-bit value from the input stream.
readUnsignedByte(). Method in class [Link]
Reads an unsigned 8-bit number from this data input stream.
readUnsignedByte(). Method in class [Link]
Reads an unsigned 8 bit byte.
dil
readUnsignedByte(). Method in class [Link]
Reads an unsigned 8-bit number from this file.
readUnsignedShort(). Method in interface [Link]
Reads an unsigned 16-bit value from the input stream.
readUnsignedShort(). Method in class [Link]
Reads an unsigned 16-bit number from this data input stream.
readUnsignedShort(). Method in class [Link]
Reads an unsigned 16 bit short.
readUnsignedShort(). Method in class [Link]
Reads an unsigned 16-bit number from this file.
readUTF(). Method in interface [Link]
va
Reads in a string that has been encoded using a modified UTF-8 format.
readUTF(). Method in class [Link]
Reads in a string that has been encoded using a modified UTF-8 format from this data input stream.
readUTF(). Method in class [Link]
Reads a UTF format String.
readUTF(). Method in class [Link]
Reads in a string from this file.
readUTF(DataInput). Static method in class [Link]
Reads in a string from the specified data input stream.
ready(). Method in class [Link]
ja
391
392
Constructs a rectangle and initializes it with the specified width and height parameters.
Rectangle(int, int, int, int). Constructor for class [Link]
Constructs and initializes a rectangle with the specified parameters.
m
Rectangle(Point). Constructor for class [Link]
Constructs a rectangle and initializes it to the specified point.
Rectangle(Point, Dimension). Constructor for class [Link]
Constructs a rectangle and initializes it to a specified point and dimension.
Rectangle(Rectangle). Constructor for class [Link]
Constructs a new rectangle, initialized to match the values of the specificed rectangle.
red. Static variable in class [Link]
The color red.
o
ref. Variable in class [Link]
regionMatches(boolean, int, String, int, int). Method in class [Link]
Tests if two string regions are equal.
regionMatches(int, String, int, int). Method in class [Link]
Tests if two string regions are equal.
i.c
registerDriver(Driver). Static method in class [Link]
A newly loaded driver class should call registerDriver to make itself known to the DriverManager.
registerEditor(Class, Class). Static method in class [Link]
Register an editor class to be used to editor values of a given target class.
registerOutParameter(int, int). Method in interface [Link]
Before executing a stored procedure call, you must explicitly call registerOutParameter to register the [Link] of each
out parameter.
registerOutParameter(int, int, int). Method in interface [Link]
Use this version of registerOutParameter for registering Numeric or Decimal out parameters.
registerValidation(ObjectInputValidation, int). Method in class [Link]
dil
Register an object to be validated before the graph is returned.
REGISTRY_ID. Static variable in class [Link]
well-known id for the registry
REGISTRY_PORT. Static variable in interface [Link]
Well known port for registry
registryImpl(int). Method in interface [Link]
Constructs and exports a Registry on the specified port.
registryStub(String, int). Method in interface [Link]
Returns a "stub" for contacting a remote registry on the specified host and port.
rehash(). Method in class [Link]
Rehashes the contents of the hashtable into a hashtable with a larger capacity.
va
RELATIVE. Static variable in class [Link]
releaseInputStream(). Method in interface [Link]
Release the input stream.
releaseOutputStream(). Method in interface [Link]
Release the output stream; in some transports this would release the stream.
REMAINDER. Static variable in class [Link]
remainder(BigInteger). Method in class [Link]
Returns a BigInteger whose value is (this % val).
RemoteDebugger(String, DebuggerCallback, boolean). Constructor for class [Link]
Create a remote debugger.
ja
To connect to a running interpreter, it must be started with the "-debug" option, whereupon it will print out the password for
that debugging session.
remoteEquals(RemoteRef). Method in interface [Link]
w.
392
393
m
Removes the old adjustment-listener from adjustment-listener-l and returns the resulting multicast listener.
remove(Component). Method in class [Link]
Removes the specified component from this container.
remove(ComponentListener, ComponentListener). Static method in class [Link]
Removes the old component-listener from component-listener-l and returns the resulting multicast listener.
remove(ContainerListener, ContainerListener). Static method in class [Link]
Removes the old container-listener from container-listener-l and returns the resulting multicast listener.
remove(EventListener). Method in class [Link]
o
Removes a listener from this multicaster and returns the resulting multicast listener.
remove(FocusListener, FocusListener). Static method in class [Link]
Removes the old focus-listener from focus-listener-l and returns the resulting multicast listener.
remove(int). Method in class [Link]
Removes an item from the choice menu.
i.c
remove(int). Method in interface [Link]
remove(int). Method in class [Link]
Removes the component at the specified index from this container.
remove(int). Method in class [Link]
Removes an item from the list.
remove(int). Method in class [Link]
Deletes the item from this menu at the specified index.
remove(int). Method in class [Link]
Removes the menu located at the specified index from the menu bar.
remove(ItemListener, ItemListener). Static method in class [Link]
dil
Removes the old item-listener from item-listener-l and returns the resulting multicast listener.
remove(KeyListener, KeyListener). Static method in class [Link]
Removes the old key-listener from key-listener-l and returns the resulting multicast listener.
remove(MenuComponent). Method in class [Link]
Removes the specified popup menu from the component.
remove(MenuComponent). Method in class [Link]
Removes the specified menu bar from this Frame.
remove(MenuComponent). Method in class [Link]
Deletes the specified item from this menu.
remove(MenuComponent). Method in class [Link]
Removes the specified menu from the menu bar.
va
remove(MenuComponent). Method in interface [Link]
remove(MouseListener, MouseListener). Static method in class [Link]
Removes the old mouse-listener from mouse-listener-l and returns the resulting multicast listener.
remove(MouseMotionListener, MouseMotionListener). Static method in class [Link]
Removes the old mouse-motion-listener from mouse-motion-listener-l and returns the resulting multicast listener.
remove(Object). Method in class [Link]
Removes the key (and its corresponding value) from this dictionary.
remove(Object). Method in class [Link]
Removes the key (and its corresponding value) from this hashtable.
remove(String). Method in class [Link]
ja
Removes the specified action listener so it no longer receives action events from this button.
removeActionListener(ActionListener). Method in class [Link]
Removes the specified action listener so it no longer receives action events from this list.
removeActionListener(ActionListener). Method in class [Link]
Removes the specified action listener so it no longer receives action events from this menu item.
removeActionListener(ActionListener). Method in class [Link]
Removes the specified action listener so that it no longer receives action events from this textfield.
removeAdjustmentListener(AdjustmentListener). Method in interface [Link]
Removes an adjustment listener.
removeAdjustmentListener(AdjustmentListener). Method in class [Link]
ww
Removes the specified adjustment listener so that it no longer receives adjustment events from this scrollbar..
removeAll(). Method in class [Link]
Removes all items from the choice menu.
removeAll(). Method in class [Link]
Removes all the components from this container.
removeAll(). Method in class [Link]
Removes all items from the list.
removeAll(). Method in interface [Link]
removeAll(). Method in class [Link]
Deletes all items from this menu.
removeAllElements(). Method in class [Link]
Removes all components from this vector and sets its size to zero.
393
394
m
Removes the specified listener so it no longer receives component events from this component.
removeConsumer(ImageConsumer). Method in class [Link]
Removes an ImageConsumer from the list of consumers interested in data for this image.
removeConsumer(ImageConsumer). Method in interface [Link]
This method removes the given ImageConsumer object from the list of consumers currently registered to receive image data.
removeConsumer(ImageConsumer). Method in class [Link]
Remove an ImageConsumer from the list of consumers interested in data for this image.
removeContainerListener(ContainerListener). Method in class [Link]
o
Removes the specified container listener so it no longer receives container events from this container.
removeElement(Object). Method in class [Link]
Removes the first occurrence of the argument from this vector.
removeElementAt(int). Method in class [Link]
Deletes the component at the specified index.
i.c
removeEntry(Principal, AclEntry). Method in interface [Link]
Removes an ACL entry from this ACL.
removeFocusListener(FocusListener). Method in class [Link]
Removes the specified focus listener so it no longer receives focus events from this component.
removeIdentity(Identity). Method in class [Link]
Removes an identity from this identity scope.
removeImage(Image). Method in class [Link]
Remove the specified Image from this MediaTracker.
removeImage(Image, int). Method in class [Link]
Remove the specified Image from the specified ID of this MediaTracker.
dil
removeImage(Image, int, int, int). Method in class [Link]
Remove the specified image with the specified size and ID from this MediaTracker.
removeInternal(EventListener, EventListener). Static method in class [Link]
Returns the resulting multicast listener after removing the old listener from listener-l.
removeItemListener(ItemListener). Method in class [Link]
Removes the specified item listener so that it no longer receives item events from this checkbox.
removeItemListener(ItemListener). Method in class [Link]
Removes the specified item listener so it no longer receives item events from this checkbox menu item.
removeItemListener(ItemListener). Method in class [Link]
Removes the specified item listener so that it no longer receives item events from this choice.
removeItemListener(ItemListener). Method in interface [Link]
va
Removes an item listener.
removeItemListener(ItemListener). Method in class [Link]
Removes the specified item listener so it no longer receives item events from this list.
removeKeyListener(KeyListener). Method in class [Link]
Removes the specified key listener so it no longer receives key events from this component.
removeLayoutComponent(Component). Method in class [Link]
Removes the specified component from the layout.
removeLayoutComponent(Component). Method in class [Link]
Removes the specified component from the layout.
removeLayoutComponent(Component). Method in class [Link]
ja
394
395
m
Remove a PropertyChangeListener from the listener list.
removePropertyChangeListener(PropertyChangeListener). Method in interface [Link]
Remove a listener for the PropertyChange event.
removePropertyChangeListener(PropertyChangeListener). Method in class [Link]
Remove a listener for the PropertyChange event.
removeProvider(String). Static method in class [Link]
Removes the provider with the specified name.
removeTextListener(TextListener). Method in class [Link]
o
Removes the specified text event listener so that it no longer receives text events from this textcomponent
removeVetoableChangeListener(VetoableChangeListener). Method in class [Link]
Remove a VetoableChangeListener from the listener list.
removeWindowListener(WindowListener). Method in class [Link]
Removes the specified window listener so that it no longer receives window events from this window.
i.c
renameTo(File). Method in class [Link]
Renames the file specified by this File object to have the pathname given by the File argument.
repaint(). Method in class [Link]
Repaints the component.
repaint(int, int, int, int). Method in class [Link]
Repaints part of the component.
repaint(long). Method in class [Link]
Repaints the component.
repaint(long, int, int, int, int). Method in class [Link]
Repaints part of the component.
dil
repaint(long, int, int, int, int). Method in interface [Link]
replace(char, char). Method in class [Link]
Returns a new string resulting from replacing all occurrences of oldChar in this string with newChar.
replaceItem(String, int). Method in class [Link]
Replaces the item at the given index.
replaceObject(Object). Method in class [Link]
This method will allow trusted subclasses of ObjectOutputStream to substitute one object for another during serialization.
replaceRange(String, int, int). Method in class [Link]
Replaces text from the indicated start to end position with the new text specified.
replaceRange(String, int, int). Method in interface [Link]
replaceText(String, int, int). Method in class [Link]
va
replaceText(String, int, int). Method in interface [Link]
DEPRECATED: Replaced by ReplaceRange(String, int, int).
ReplicateScaleFilter(int, int). Constructor for class [Link]
Constructs a ReplicateScaleFilter that scales the pixels from its source Image as specified by the width and height parameters.
requestFocus(). Method in class [Link]
Requests the input focus.
requestFocus(). Method in interface [Link]
requestTopDownLeftRightResend(ImageConsumer). Method in class [Link]
Requests that a given ImageConsumer have the image data delivered one more time in top-down, left-right order.
requestTopDownLeftRightResend(ImageConsumer). Method in interface [Link]
ja
This method is used by an ImageConsumer to request that the ImageProducer attempt to resend the image data one more
time in TOPDOWNLEFTRIGHT order so that higher quality conversion algorithms which depend on receiving pixels in
order can be used to produce a better output version of the image.
requestTopDownLeftRightResend(ImageConsumer). Method in class [Link]
Requests that a given ImageConsumer have the image data delivered one more time in top-down, left-right order.
required. Variable in class [Link]
"required" is true if a value must be supplied for this property during [Link].
w.
395
396
m
reset(). Method in class [Link]
Repositions this stream to the position at the time the mark method was last called on this input stream.
reset(). Method in class [Link]
Reset the stream.
reset(). Method in class [Link]
Resets inflater so that a new set of input data can be processed.
reset(). Method in class [Link]
Repositions this stream to the position at the time the mark method was last called on this input stream.
o
reset(). Method in class [Link]
Repositions this stream to the position at the time the mark method was last called on this input stream.
reset(). Method in class [Link]
Reset the stream to the most recent mark.
reset(). Method in class [Link]
i.c
Resets the digest for further use.
reset(). Method in class [Link]
Reset will disregard the state of any objects already written to the stream.
reset(). Method in class [Link]
Reset the stream.
reset(). Method in class [Link]
Resets the input stream to begin reading from the first character of this input stream's underlying buffer.
reset(). Method in class [Link]
Reset the stream to the most recent mark, or to the beginning of the string if it has never been marked.
resetCurrentFrameIndex(). Method in class [Link]
dil
Reset the current stackframe
resetSyntax(). Method in class [Link]
Resets this tokenizer's syntax table so that all characters are "ordinary." See the ordinaryChar method for more information
on a character being ordinary.
reshape(int, int, int, int). Method in class [Link]
reshape(int, int, int, int). Method in interface [Link]
DEPRECATED: Replaced by setBounds(int, int, int, int).
reshape(int, int, int, int). Method in class [Link]
resize(Dimension). Method in class [Link]
Requests that this applet be resized.
resize(Dimension). Method in class [Link]
va
resize(int, int). Method in class [Link]
Requests that this applet be resized.
resize(int, int). Method in class [Link]
resize(int, int). Method in class [Link]
resolveClass(Class). Method in class [Link]
Resolves the class so that an instance of the class can be created, or so that one of its methods can be called.
resolveClass(ObjectStreamClass). Method in class [Link]
Subclasses may implement this method to allow classes to be fetched from an alternate source.
resolveObject(Object). Method in class [Link]
This method will allow trusted subclasses of ObjectInputStream to substitute one object for another during deserialization.
ja
396
397
m
RMISocketFactory(). Constructor for class [Link]
roll(int, boolean). Method in class [Link]
Time Field Rolling function.
roll(int, boolean). Method in class [Link]
Overrides Calendar Time Field Rolling function.
rollback(). Method in interface [Link]
Rollback drops all changes made since the previous commit/rollback and releases any database locks currently held by the
Connection.
o
round(double). Static method in class [Link]
Returns the closest long to the argument.
round(float). Static method in class [Link]
Returns the closest int to the argument.
ROUND_CEILING. Static variable in class [Link]
i.c
If the BigDecimal is positive, behave as for ROUND_UP; if negative, behave as for ROUND_DOWN.
ROUND_DOWN. Static variable in class [Link]
Never increment the digit prior to a discarded fraction (i.e., truncate).
ROUND_FLOOR. Static variable in class [Link]
If the BigDecimal is positive, behave as for ROUND_DOWN; if negative behave as for ROUND_UP.
ROUND_HALF_DOWN. Static variable in class [Link]
Behave as for ROUND_UP if the discarded fraction is > .5; otherwise, behave as for ROUND_DOWN.
ROUND_HALF_EVEN. Static variable in class [Link]
Behave as for ROUND_HALF_UP if the digit to the left of the discarded fraction is odd; behave as for
ROUND_HALF_DOWN if it's even.
dil
ROUND_HALF_UP. Static variable in class [Link]
Behave as for ROUND_UP if the discarded fraction is >= .5; otherwise, behave as for ROUND_DOWN.
ROUND_UNNECESSARY. Static variable in class [Link]
This "pseudo-rounding-mode" is actually an assertion that the requested operation has an exact result, hence no rounding is
necessary.
ROUND_UP. Static variable in class [Link]
Always increment the digit prior to a non-zero discarded fraction.
rowHeights. Variable in class [Link]
rowWeights. Variable in class [Link]
RuleBasedCollator(String). Constructor for class [Link]
RuleBasedCollator constructor.
va
run(). Method in interface [Link]
When an object implementing interface Runnable is used to create a thread, starting the thread causes the object's run
method to be called in that separately executing thread.
run(). Method in class [Link]
If this thread was constructed using a separate Runnable run object, then that Runnable object's run method is called;
otherwise, this method does nothing and returns.
run(int, String[]). Method in class [Link]
Load and run a runnable Java class, with any optional parameters.
runFinalization(). Method in class [Link]
Runs the finalization methods of any objects pending finalization.
ja
been automatically invoked are to be run before the Java runtime exits.
RuntimeException(). Constructor for class [Link]
Constructs a RuntimeException with no detail message.
RuntimeException(String). Constructor for class [Link]
Constructs a RuntimeException with the specified detail message.
S
ww
397
398
m
Returns the scale of this number.
SCALE_AREA_AVERAGING. Static variable in class [Link]
Use the Area Averaging image scaling algorithm.
SCALE_DEFAULT. Static variable in class [Link]
Use the default image scaling algorithm.
SCALE_FAST. Static variable in class [Link]
Choose an image scaling algorithm that gives higher priority to scaling speed than smoothness of the scaled image.
SCALE_REPLICATE. Static variable in class [Link]
o
Use the ReplicateScaleFilter image scaling algorithm.
SCALE_SMOOTH. Static variable in class [Link]
Choose an image scaling algorithm that gives higher priority to image smoothness than scaling speed.
SCROLL_ABSOLUTE. Static variable in class [Link]
The absolute scroll event.
i.c
SCROLL_BEGIN. Static variable in class [Link]
The scroll begin event.
SCROLL_END. Static variable in class [Link]
The scroll end event.
SCROLL_LINE_DOWN. Static variable in class [Link]
The line down scroll event.
SCROLL_LINE_UP. Static variable in class [Link]
The line up scroll event.
SCROLL_LOCK. Static variable in class [Link]
The ScrollLock action-key.
dil
SCROLL_PAGE_DOWN. Static variable in class [Link]
The page down scroll event.
SCROLL_PAGE_UP. Static variable in class [Link]
The page up scroll event.
scrollbar. Static variable in class [Link]
The background color for scrollbars.
SCROLLBAR. Static variable in class [Link]
The array index for the scrollbar background color.
Scrollbar(). Constructor for class [Link]
Constructs a new vertical Scrollbar.
Scrollbar(int). Constructor for class [Link]
va
Constructs a new Scrollbar with the specified orientation.
Scrollbar(int, int, int, int, int). Constructor for class [Link]
Constructs a new Scrollbar with the specified orientation, value, page size, and minumum and maximum values.
SCROLLBARS_ALWAYS. Static variable in class [Link]
Specifies that horizontal/vertical scrollbars should always be shown regardless of the respective sizes of the scrollpane and
child.
SCROLLBARS_AS_NEEDED. Static variable in class [Link]
Specifies that horizontal/vertical scrollbar should be shown only when the size of the child exceeds the size of the scrollpane in
the horizontal/vertical dimension.
SCROLLBARS_BOTH. Static variable in class [Link]
ja
398
399
m
SecurityException(). Constructor for class [Link]
Constructs a SecurityException with no detail message.
SecurityException(String). Constructor for class [Link]
Constructs a SecurityException with the specified detail message.
SecurityManager(). Constructor for class [Link]
Constructs a new SecurityManager.
seek(long). Method in class [Link]
Sets the offset from the beginning of this file at which the next read or write occurs.
o
select(int). Method in class [Link]
Selects the item with the specified postion.
select(int). Method in interface [Link]
select(int). Method in class [Link]
Selects the item at the specified index.
i.c
select(int). Method in interface [Link]
select(int, int). Method in class [Link]
Selects the text found between the specified start and end locations.
select(int, int). Method in interface [Link]
select(String). Method in class [Link]
Selects the item with the specified String.
selectAll(). Method in class [Link]
Selects all the text in the TextComponent.
SELECTED. Static variable in class [Link]
The item selected state change type.
dil
send(DatagramPacket). Method in class [Link]
Sends a datagram packet from this socket.
send(DatagramPacket). Method in class [Link]
Sends a datagram packet.
send(DatagramPacket, byte). Method in class [Link]
Sends a datagram packet to the destination, with a TTL (time- to-live) other than the default for the socket.
separator. Static variable in class [Link]
The system-dependent path separator character.
separatorChar. Static variable in class [Link]
The system-dependent path separator string.
SEPTEMBER. Static variable in class [Link]
va
Useful constant for month.
SequenceInputStream(Enumeration). Constructor for class [Link]
Constructs a new sequence input stream initialized to the specified enumeration of input streams.
SequenceInputStream(InputStream, InputStream). Constructor for class [Link]
Constructs a new sequence input stream initialized to read first from the input stream s1, and then from the input stream s2.
ServerCloneException(String). Constructor for class [Link]
Create A remote exception with the specified string
ServerCloneException(String, Exception). Constructor for class [Link]
Create A remote exception with the specified string, and the exception specified.
ServerError(String, Error). Constructor for class [Link]
ja
Create a new "server error" exception with the string and the specified exception.
ServerException(String). Constructor for class [Link]
Create a new server exception with a descriptive string.
ServerException(String, Exception). Constructor for class [Link]
Create a new server exception with a descriptive string and an exception.
ServerNotActiveException(). Constructor for class [Link]
Create a new exception.
w.
399
400
m
set(String, String, int, String, String). Method in class [Link]
Sets the fields of the URL.
setActionCommand(String). Method in class [Link]
Sets the command name of the action event fired by this button.
setActionCommand(String). Method in class [Link]
Sets the command name of the action event fired by this menu item.
setAddress(InetAddress). Method in class [Link]
setAlignment(int). Method in class [Link]
o
Sets the alignment value for this layout.
setAlignment(int). Method in class [Link]
Sets the alignment for this label to the specified alignment.
setAlignment(int). Method in interface [Link]
setAllowUserInteraction(boolean). Method in class [Link]
i.c
Set the value of the allowUserInteraction field of this URLConnection.
setAmPmStrings(String[]). Method in class [Link]
Sets ampm strings.
setAnimated(boolean). Method in class [Link]
Change this memory image into a multi-frame animation or a single-frame static image depending
on the animated parameter.
setAsciiStream(int, InputStream, int). Method in interface [Link]
When a very large ASCII value is input to a LONGVARCHAR parameter, it may be more practical to
send it via a [Link].
setAsText(String). Method in interface [Link]
dil
Set the property value by parsing a given String.
setAsText(String). Method in class [Link]
Set the property value by parsing a given String.
setAutoCommit(boolean). Method in interface [Link]
If a connection is in auto-commit mode, then all its SQL statements will be executed and
committed as individual transactions.
setBackground(Color). Method in class [Link]
Sets the background color.
setBackground(Color). Method in interface [Link]
setBeanInfoSearchPath(String[]). Static method in class [Link]
Change the list of package names that will be used for finding BeanInfo classes.
va
setBigDecimal(int, BigDecimal). Method in interface [Link]
Set a parameter to a [Link] value.
setBinaryStream(int, InputStream, int). Method in interface [Link]
When a very large binary value is input to a LONGVARBINARY parameter, it may be more practical
to send it via a [Link].
setBit(int). Method in class [Link]
Returns a BigInteger whose value is equivalent to this number with the designated bit set.
setBlockIncrement(int). Method in interface [Link]
Sets the block value increment for the adjustable object.
setBlockIncrement(int). Method in class [Link]
ja
value.
setBound(boolean). Method in class [Link]
Updates to "bound" properties will cause a "PropertyChange" event to get fired when the
property is changed.
setBounds(int, int, int, int). Method in class [Link]
Reshapes the Component to the specified bounding box.
setBounds(int, int, int, int). Method in interface [Link]
setBounds(int, int, int, int). Method in class [Link]
Set the bounds of this rectangle to the specified x, y, width, and height.
setBounds(Rectangle). Method in class [Link]
ww
400
401
Sets the value of the indexed component of the specified array object to the specified boolean
value.
setBytes(int, byte[]). Method in interface [Link]
m
Set a parameter to a Java array of bytes.
setCalendar(Calendar). Method in class [Link]
Set the calendar to be used by this date format.
setCaretPosition(int). Method in class [Link]
Sets the position of the text insertion caret for the TextComponent
setCaretPosition(int). Method in interface [Link]
setCatalog(String). Method in interface [Link]
A sub-space of this Connection's database may be selected by setting a catalog name.
o
setChanged(). Method in class [Link]
Indicates that this object has changed.
setChar(Object, char). Method in class [Link]
Set the value of a field as a char on specified object.
setChar(Object, int, char). Static method in class [Link]
i.c
Sets the value of the indexed component of the specified array object to the specified byte
value.
setCharAt(int, char). Method in class [Link]
The character at the specified index of this string buffer is set to ch.
setCheckboxGroup(CheckboxGroup). Method in class [Link]
Sets the CheckboxGroup to the specified group.
setCheckboxGroup(CheckboxGroup). Method in interface [Link]
setChoices(double[], String[]). Method in class [Link]
Set the choices to be used in formatting.
setClip(int, int, int, int). Method in class [Link]
dil
Sets the current clip to the rectangle specified by the given coordinates.
setClip(Shape). Method in class [Link]
Set the current clipping area to an arbitrary clip shape.
setColor(Color). Method in class [Link]
Sets the current color to the specified color.
setColorModel(ColorModel). Method in interface [Link]
The ColorModel object used for the majority of the pixels reported using the setPixels method
calls.
setColorModel(ColorModel). Method in class [Link]
Filter the information provided in the setColorModel method of the ImageConsumer interface.
setColorModel(ColorModel). Method in class [Link]
va
The setColorModel method is part of the ImageConsumer API which this class must implement to
retrieve the pixels.
setColorModel(ColorModel). Method in class [Link]
If the ColorModel is an IndexColorModel, and the subclass has set the canFilterIndexColorModel
flag to true, we substitute a filtered version of the color model here and wherever that
original ColorModel object appears in the setPixels methods.
setColumns(int). Method in class [Link]
Sets the number of columns in this layout.
setColumns(int). Method in class [Link]
Sets the number of columns for this TextArea.
ja
Attempted updates to "Constrained" properties will cause a "VetoableChange" event to get fired
when the property is changed.
setConstraints(Component, GridBagConstraints). Method in class [Link]
Sets the constraints for the specified component.
setContentHandlerFactory(ContentHandlerFactory). Static method in class [Link]
Sets the ContentHandlerFactory of an application.
setContents(Transferable, ClipboardOwner). Method in class [Link]
Sets the current contents of the clipboard to the specified transferable object and registers
the specified clipboard owner as the owner of the new contents.
setCrc(long). Method in class [Link]
ww
401
402
m
setData(byte[]). Method in class [Link]
setDate(int). Method in class [Link]
Sets the day of the month of this date to the specified value.
setDate(int). Method in class [Link]
Sets the day of the month of this date to the specified value.
setDate(int, Date). Method in interface [Link]
Set a parameter to a [Link] value.
setDateFormatSymbols(DateFormatSymbols). Method in class [Link]
o
Allows you to set the date/time formatting data.
setDecimalFormatSymbols(DecimalFormatSymbols). Method in class [Link]
Sets the decimal format symbols, which is generally not changed by the programmer or user.
setDecimalSeparator(char). Method in class [Link]
setDecimalSeparatorAlwaysShown(boolean). Method in class [Link]
i.c
Allows you to set the behavior of the decimal separator with integers.
setDecomposition(int). Method in class [Link]
Set the decomposition mode of this Collator.
setDefault(Locale). Static method in class [Link]
Sets the default.
setDefault(TimeZone). Static method in class [Link]
Sets time zone to using the given TimeZone.
setDefaultAllowUserInteraction(boolean). Static method in class [Link]
Sets the default value of the allowUserInteraction field for all future URLConnection objects
to the specified value.
dil
setDefaultRequestProperty(String, String). Static method in class [Link]
Sets the default value of a general request property.
setDefaultStream(PrintStream). Static method in class [Link]
Set the default stream for new logs.
setDefaultUseCaches(boolean). Method in class [Link]
Sets the default value of the useCaches field to the specified value.
setDesignTime(boolean). Static method in class [Link]
Used to indicate whether of not we are running in an application builder environment.
setDictionary(byte[]). Method in class [Link]
Sets preset dictionary for compression.
setDictionary(byte[]). Method in class [Link]
va
Sets the preset dictionary to the given array of bytes.
setDictionary(byte[], int, int). Method in class [Link]
Sets preset dictionary for compression.
setDictionary(byte[], int, int). Method in class [Link]
Sets the preset dictionary to the given array of bytes.
setDigit(char). Method in class [Link]
setDimensions(int, int). Method in class [Link]
Override the source image's dimensions and pass the dimensions of the rectangular cropped
region to the ImageConsumer.
setDimensions(int, int). Method in interface [Link]
ja
The dimensions of the source image are reported using the setDimensions method call.
setDimensions(int, int). Method in class [Link]
Filters the information provided in the setDimensions method of the ImageConsumer interface.
setDimensions(int, int). Method in class [Link]
The setDimensions method is part of the ImageConsumer API which this class must implement to
retrieve the pixels.
setDimensions(int, int). Method in class [Link]
w.
Override the dimensions of the source image and pass the dimensions of the new scaled size to
the ImageConsumer.
setDirectory(String). Method in class [Link]
Set the directory of the Dialog to the specified directory.
setDirectory(String). Method in interface [Link]
setDisplayName(String). Method in class [Link]
setDoInput(boolean). Method in class [Link]
Sets the value of the doInput field for this URLConnection to the specified value.
setDoOutput(boolean). Method in class [Link]
Sets the value of the doOutput field for this URLConnection to the specified value.
ww
402
403
m
setEditable(boolean). Method in interface [Link]
setEditorSearchPath(String[]). Static method in class [Link]
Change the list of package names that will be used for finding property editors.
setElementAt(Object, int). Method in class [Link]
Sets the component at the specified index of this vector to be the specified object.
setEnabled(boolean). Method in class [Link]
Enables a component.
setEnabled(boolean). Method in interface [Link]
o
setEnabled(boolean). Method in class [Link]
Sets whether or not this menu item can be chosen.
setEnabled(boolean). Method in interface [Link]
setEndRule(int, int, int, int). Method in class [Link]
Sets the daylight savings ending rule.
i.c
setEras(String[]). Method in class [Link]
Sets era strings.
setErr(PrintStream). Static method in class [Link]
Reassigns the "standard" error output stream.
setError(). Method in class [Link]
Indicates that an error has occurred.
setError(). Method in class [Link]
Indicate that an error has occurred.
setEscapeProcessing(boolean). Method in interface [Link]
If escape scanning is on (the default), the driver will do escape substitution before sending
dil
the SQL to the database.
setExpert(boolean). Method in class [Link]
The "expert" flag is used to distinguish between features that are intended for expert users
from those that are intended for normal users.
setExtra(byte[]). Method in class [Link]
Sets the optional extra field data for the entry.
setFailureHandler(RMIFailureHandler). Static method in class [Link]
Set the failure handler to be called by the RMI runtime if socket creation fails.
setField(int, boolean). Method in class [Link]
Set a boolean instance variable, specified by slot.
setField(int, char). Method in class [Link]
va
Set a char instance variable, specified by slot.
setField(int, double). Method in class [Link]
Set a double instance variable, specified by slot.
setField(int, float). Method in class [Link]
Set a float instance variable, specified by slot.
setField(int, int). Method in class [Link]
Set an int instance variable, specified by slot.
setField(int, long). Method in class [Link]
Set a long instance variable, specified by slot.
setField(int, RemoteObject). Method in class [Link]
ja
403
404
value.
setFollowRedirects(boolean). Static method in class [Link]
Sets whether HTTP redirects (requests with response code 3xx) should be automatically followed
m
by this class.
setFont(Font). Method in class [Link]
Sets the font of the component.
setFont(Font). Method in interface [Link]
setFont(Font). Method in class [Link]
Sets the font for all subsequent text rendering operations.
setFont(Font). Method in class [Link]
Sets the font to be used for this MenuItem to the specified font.
o
setForeground(Color). Method in class [Link]
Sets the foreground color.
setForeground(Color). Method in interface [Link]
setFormat(int, Format). Method in class [Link]
Sets formats individually to use on parameters.
i.c
setFormats(Format[]). Method in class [Link]
Sets formats to use on parameters.
setFullBufferUpdates(boolean). Method in class [Link]
Specify whether this animated memory image should always be updated by sending the complete
buffer of pixels whenever there is a change.
setGregorianChange(Date). Method in class [Link]
Sets the GregorianCalendar change date.
setGroupingSeparator(char). Method in class [Link]
setGroupingSize(int). Method in class [Link]
Set the grouping size.
dil
setGroupingUsed(boolean). Method in class [Link]
Set whether or not grouping will be used in this format.
setGuiAvailable(boolean). Static method in class [Link]
Used to indicate whether of not we are running in an environment where GUI interaction is
available.
setHelpMenu(Menu). Method in class [Link]
Sets the help menu to the specified menu on the menu bar.
setHgap(int). Method in class [Link]
Sets the horizontal gap between components.
setHgap(int). Method in class [Link]
Sets the horizontal gap between components.
va
setHgap(int). Method in class [Link]
Sets the horizontal gap between components.
setHgap(int). Method in class [Link]
Sets the horizontal gap between components.
setHidden(boolean). Method in class [Link]
The "hidden" flag is used to identify features that are intended only for tool use, and which
should not be exposed to humans.
setHints(int). Method in class [Link]
Detect if the data is being delivered with the necessary hints to allow the averaging
algorithm to do its work.
ja
The setHints method is part of the ImageConsumer API which this class must implement to
retrieve the pixels.
setHours(int). Method in class [Link]
Sets the hour of this date to the specified value.
setHours(int). Method in class [Link]
Sets the hour of this date to the specified value.
setHumanPresentableName(String). Method in class [Link]
Sets the human presentable name for the data format that this DataFlavor represents.
setIconImage(Image). Method in class [Link]
Sets the image to display when this Frame is iconized.
ww
404
405
m
setInfinity(String). Method in class [Link]
setInfo(String). Method in class [Link]
Specifies a general information string for this identity.
setInput(byte[]). Method in class [Link]
Sets input data for compression.
setInput(byte[]). Method in class [Link]
Sets input data for decompression.
setInput(byte[], int, int). Method in class [Link]
o
Sets input data for compression.
setInput(byte[], int, int). Method in class [Link]
Sets input data for decompression.
setInt(int, int). Method in interface [Link]
Set a parameter to a Java int value.
i.c
setInt(Object, int). Method in class [Link]
Set the value of a field as an int on specified object.
setInt(Object, int, int). Static method in class [Link]
Sets the value of the indexed component of the specified array object to the specified int
value.
setInterface(InetAddress). Method in class [Link]
Set the outgoing network interface for multicast packets on this socket, to other than the
system default.
setKeyChar(char). Method in class [Link]
setKeyCode(int). Method in class [Link]
dil
setKeyPair(KeyPair). Method in class [Link]
Sets the key pair (public key and private key) for this signer.
setLabel(String). Method in class [Link]
Sets the button with the specified label.
setLabel(String). Method in interface [Link]
setLabel(String). Method in class [Link]
Sets this check box's label to be the specified string.
setLabel(String). Method in interface [Link]
setLabel(String). Method in class [Link]
Sets the label to be the specified label.
setLabel(String). Method in interface [Link]
va
setLayout(LayoutManager). Method in class [Link]
Sets the layout manager for this container.
setLayout(LayoutManager). Method in class [Link]
Sets the layout manager for this container.
setLength(int). Method in class [Link]
setLength(int). Method in class [Link]
Sets the length of this String buffer.
setLenient(boolean). Method in class [Link]
Specify whether or not date/time interpretation is to be lenient.
setLenient(boolean). Method in class [Link]
ja
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 [Link]
Set the logging/tracing PrintStream that is used by the DriverManager and all drivers.
setLong(int, long). Method in interface [Link]
Set a parameter to a Java long value.
setLong(Object, int, long). Static method in class [Link]
Sets the value of the indexed component of the specified array object to the specified long
o
value.
setLong(Object, long). Method in class [Link]
Set the value of a field as a long on specified object.
setMaxFieldSize(int). Method in interface [Link]
The maxFieldSize limit (in bytes) is set to limit the size of data that can be returned for
i.c
any column value; it only applies to BINARY, VARBINARY, LONGVARBINARY, CHAR, VARCHAR, and
LONGVARCHAR fields.
setMaximum(int). Method in interface [Link]
Sets the maximum value of the adjustable object.
setMaximum(int). Method in class [Link]
Sets the maximum value for this Scrollbar.
setMaximumFractionDigits(int). Method in class [Link]
Sets the maximum number of digits allowed in the fraction portion of a number.
setMaximumIntegerDigits(int). Method in class [Link]
Sets the maximum number of digits allowed in the integer portion of a number.
dil
setMaxPriority(int). Method in class [Link]
Sets the maximum priority of the group.
setMaxRows(int). Method in interface [Link]
The maxRows limit is set to limit the number of rows that any ResultSet can contain.
setMenuBar(MenuBar). Method in class [Link]
Sets the menubar for this Frame to the specified menubar.
setMenuBar(MenuBar). Method in interface [Link]
setMessageDigest(MessageDigest). Method in class [Link]
Associates the specified message digest with this stream.
setMessageDigest(MessageDigest). Method in class [Link]
Associates the specified message digest with this stream.
va
setMethod(int). Method in class [Link]
Sets the compression method for the entry.
setMethod(int). Method in class [Link]
Sets the default compression method for subsequent entries.
setMinimalDaysInFirstWeek(int). Method in class [Link]
Sets what the minimal days required in the first week of the year are; For example, if the
first week is defined as one that contains the first day of the first month of a year, call
the method with value 1.
setMinimum(int). Method in interface [Link]
Sets the minimum value of the adjustable object.
ja
406
407
m
setName(String). Method in class [Link]
Sets the name of the component to the specified string.
setName(String). Method in class [Link]
setName(String). Method in class [Link]
Sets the name of the component to the specified string.
setName(String). Method in class [Link]
Changes the name of this thread to be equal to the argument name.
setNaN(String). Method in class [Link]
o
setNanos(int). Method in class [Link]
Set the Timestamp's nanos value
setNegativePermissions(). Method in interface [Link]
Sets this ACL entry to be a negative one.
setNegativePrefix(String). Method in class [Link]
i.c
Set the negative prefix.
setNegativeSuffix(String). Method in class [Link]
Set the positive suffix.
setNextException(SQLException). Method in class [Link]
Add an SQLException to the end of the chain.
setNextWarning(SQLWarning). Method in class [Link]
Add an SQLWarning to the end of the chain.
setNull(int, int). Method in interface [Link]
Set a parameter to SQL NULL.
setNumberFormat(NumberFormat). Method in class [Link]
dil
Allows you to set the number formatter.
setObject(int, Object). Method in interface [Link]
Set the value of a parameter using an object; use the [Link] equivalent objects for
integral values.
setObject(int, Object, int). Method in interface [Link]
This method is like setObject above, but assumes a scale of zero.
setObject(int, Object, int, int). Method in interface [Link]
Set the value of a parameter using an object; use the [Link] equivalent objects for
integral values.
va
setObject(Object). Method in interface [Link]
Set the object to be customized.
setOrientation(int). Method in class [Link]
Sets the orientation for this Scrollbar.
setOut(PrintStream). Static method in class [Link]
Reassigns the "standard" output stream.
setOutputStream(OutputStream). Method in class [Link]
Set the stream to which output from this log is sent.
setPageIncrement(int). Method in class [Link]
setPageIncrement(int). Method in interface [Link]
ja
Determine whether the delivered byte pixels intersect the region to be extracted and passes
through only that subset of pixels that appear in the output region.
setPixels(int, int, int, int, ColorModel, byte[], int, int). Method in interface
[Link]
The pixels of the image are delivered using one or more calls to the setPixels method.
setPixels(int, int, int, int, ColorModel, byte[], int, int). Method in class
[Link]
Filters the information provided in the setPixels method of the ImageConsumer interface which
takes an array of bytes.
setPixels(int, int, int, int, ColorModel, byte[], int, int). Method in class
[Link]
The setPixels method is part of the ImageConsumer API which this class must implement to
407
408
m
Choose which rows and columns of the delivered byte pixels are needed for the destination
scaled image and pass through just those rows and columns that are needed, replicated as
necessary.
setPixels(int, int, int, int, ColorModel, byte[], int, int). Method in class
[Link]
If the ColorModel object is the same one that has already been converted, then simply passes
the pixels through with the converted ColorModel.
setPixels(int, int, int, int, ColorModel, int[], int, int). Method in class
o
[Link]
Combine the components for the delivered int pixels into the accumulation arrays and send on
any averaged data for rows of pixels that are complete.
setPixels(int, int, int, int, ColorModel, int[], int, int). Method in class
[Link]
i.c
Determine if the delivered int pixels intersect the region to be extracted and pass through
only that subset of pixels that appear in the output region.
setPixels(int, int, int, int, ColorModel, int[], int, int). Method in interface
[Link]
The pixels of the image are delivered using one or more calls to the setPixels method.
setPixels(int, int, int, int, ColorModel, int[], int, int). Method in class
[Link]
Filters the information provided in the setPixels method of the ImageConsumer interface which
takes an array of integers.
setPixels(int, int, int, int, ColorModel, int[], int, int). Method in class
dil
[Link]
The setPixels method is part of the ImageConsumer API which this class must implement to
retrieve the pixels.
setPixels(int, int, int, int, ColorModel, int[], int, int). Method in class
[Link]
Choose which rows and columns of the delivered int pixels are needed for the destination
scaled image and pass through just those rows and columns that are needed, replicated as
necessary.
setPixels(int, int, int, int, ColorModel, int[], int, int). Method in class
[Link]
If the ColorModel object is the same one that has already been converted, then simply passes
va
the pixels through with the converted ColorModel, otherwise converts the buffer of integer
pixels to the default RGB ColorModel and passes the converted buffer to the filterRGBPixels
method to be converted one by one.
setPort(int). Method in class [Link]
setPositivePrefix(String). Method in class [Link]
Set the positive prefix.
setPositiveSuffix(String). Method in class [Link]
Set the positive suffix.
setPrincipal(Principal). Method in interface [Link]
Specifies the principal for which permissions are granted or denied by this ACL entry.
ja
408
409
m
setReadOnly(boolean). Method in interface [Link]
You can put a connection in read-only mode as a hint to enable database optimizations.
setRef(RemoteStub, RemoteRef). Static method in class [Link]
setRequestMethod(String). Method in class [Link]
Set the method for the URL request, one of:
GET
POST
HEAD
o
OPTIONS
PUT
DELETE
TRACE
are legal, subject to protocol restrictions.
i.c
setRequestProperty(String, String). Method in class [Link]
Sets the general request property.
setResizable(boolean). Method in class [Link]
Sets the resizable flag.
setResizable(boolean). Method in interface [Link]
setResizable(boolean). Method in class [Link]
Sets the resizable flag.
setResizable(boolean). Method in interface [Link]
setRows(int). Method in class [Link]
Sets the number of rows in this layout.
dil
setRows(int). Method in class [Link]
Sets the number of rows for this TextArea.
setScale(int). Method in class [Link]
Returns a BigDecimal whose scale is the specified value, and whose value is exactly equal to
this number's.
setScale(int, int). Method in class [Link]
Returns a BigDecimal whose scale is the specified value, and whose integer value is determined
by multiplying or dividing this BigDecimal's integer value by the appropriate power of ten to
maintain the overall value.
setScrollPosition(int, int). Method in class [Link]
Scrolls to the specified position within the child component.
va
setScrollPosition(int, int). Method in interface [Link]
setScrollPosition(Point). Method in class [Link]
Scrolls to the specified position within the child component.
setSeconds(int). Method in class [Link]
Sets the seconds of this date to the specified value.
setSeconds(int). Method in class [Link]
Sets the seconds of this date to the specified value.
setSecurityManager(SecurityManager). Static method in class [Link]
Sets the System security.
setSeed(byte[]). Method in class [Link]
ja
409
410
m
setSize(Dimension). Method in class [Link]
Set the size of this rectangle to match the specified size.
setSize(int). Method in class [Link]
Sets the size of this vector.
setSize(int, int). Method in class [Link]
Resizes the Component to the specified width and height.
setSize(int, int). Method in class [Link]
Set the size of this Dimension object to the specified width and height.
o
setSize(int, int). Method in class [Link]
Set the size of this rectangle to the specified width and height.
setSize(long). Method in class [Link]
Sets the uncompressed size of the entry data.
setSocketFactory(RMISocketFactory). Static method in class [Link]
i.c
Set the socket factory from which RMI gets sockets.
setSocketFactory(SocketImplFactory). Static method in class [Link]
Sets the server socket implementation factory for the application.
setSocketImplFactory(SocketImplFactory). Static method in class [Link]
Sets the client socket implementation factory for the application.
setSoLinger(boolean, int). Method in class [Link]
Enable/disable SO_LINGER with the specified linger time.
setSoTimeout(int). Method in class [Link]
Enable/disable SO_TIMEOUT with the specified timeout, in milliseconds.
setSoTimeout(int). Method in class [Link]
dil
Enable/disable SO_TIMEOUT with the specified timeout, in milliseconds.
setSoTimeout(int). Method in class [Link]
Enable/disable SO_TIMEOUT with the specified timeout, in milliseconds.
setSourcePath(String). Method in class [Link]
Specify the list of paths to use when searching for a source file.
setStartRule(int, int, int, int). Method in class [Link]
Sets the daylight savings starting rule.
setStartYear(int). Method in class [Link]
Sets the daylight savings starting year.
setState(boolean). Method in class [Link]
Sets the Checkbox to the specifed boolean state.
va
setState(boolean). Method in class [Link]
Sets the state of this MenuItem if it is a Checkbox.
setState(boolean). Method in interface [Link]
setState(boolean). Method in interface [Link]
setStrategy(int). Method in class [Link]
Sets the compression strategy to the specified value.
setStrength(int). Method in class [Link]
Sets this Collator's strength property.
setString(int, String). Method in interface [Link]
Set a parameter to a Java String value.
ja
410
411
m
Set a parameter to a [Link] value.
setTimeZone(TimeZone). Method in class [Link]
Sets the time zone with the given time zone value.
setTimeZone(TimeZone). Method in class [Link]
Sets the time zone for the calendar of this DateFormat object.
setTitle(String). Method in class [Link]
Sets the title of the Dialog.
setTitle(String). Method in interface [Link]
o
setTitle(String). Method in class [Link]
Sets the title for this Frame to the specified title.
setTitle(String). Method in interface [Link]
setTransactionIsolation(int). Method in interface [Link]
You can call this method to try to change the transaction isolation level using one of the
i.c
TRANSACTION_* values.
setTTL(byte). Method in class [Link]
Set the TTL (time-to-live) option.
setTTL(byte). Method in class [Link]
Set the default time-to-live for multicast packets sent out on this socket.
setUnicast(boolean). Method in class [Link]
Mark an event set as unicast (or not).
setUnicodeStream(int, InputStream, int). Method in interface [Link]
When a very large UNICODE value is input to a LONGVARCHAR parameter, it may be more practical
to send it via a [Link].
dil
setUnitIncrement(Adjustable, int). Method in interface [Link]
setUnitIncrement(int). Method in interface [Link]
Sets the unit value increment for the adjustable object.
setUnitIncrement(int). Method in class [Link]
Sets the unit increment for this scrollbar.
setUpdateRect(Rectangle). Method in class [Link]
Sets the rectangle representing the area which needs to be repainted in response to this
event.
setURL(URL, String, String, int, String, String). Method in class [Link]
Sets the fields of the URL argument to the indicated values.
setURLStreamHandlerFactory(URLStreamHandlerFactory). Static method in class [Link]
va
Sets an application's URLStreamHandlerFactory.
setUseCaches(boolean). Method in class [Link]
Sets the value of the useCaches field of this URLConnection to the specified value.
setValue(Adjustable, int). Method in interface [Link]
setValue(int). Method in interface [Link]
Sets the current value of the adjustable object.
setValue(int). Method in class [Link]
Sets the value of this Scrollbar to the specified value.
setValue(Object). Method in interface [Link]
Set (or change) the object that is to be edited.
ja
411
412
Sets the year of this date to be the specified value plus 1900.
setYear(int). Method in class [Link]
Sets the year of this date to be the specified value plus 1900.
m
setZeroDigit(char). Method in class [Link]
setZoneStrings(String[][]). Method in class [Link]
Sets timezone strings.
SHIFT_MASK. Static variable in class [Link]
The shift modifier constant.
SHIFT_MASK. Static variable in class [Link]
The shift modifier constant.
SHIFT_MASK. Static variable in class [Link]
o
The shift key modifier constant.
shiftDown(). Method in class [Link]
Checks if the shift key is down.
shiftLeft(int). Method in class [Link]
Returns a BigInteger whose value is (this << n).
i.c
shiftRight(int). Method in class [Link]
Returns a BigInteger whose value is (this >> n).
SHORT. Static variable in class [Link]
Constant for short style pattern.
Short(short). Constructor for class [Link]
Constructs a Short object initialized to the specified short value.
Short(String). Constructor for class [Link]
Constructs a Short object initialized to the value specified by the String parameter.
shortcuts(). Method in class [Link]
Get an Enumeration of all MenuShortcuts this MenuBar manages.
dil
shortValue(). Method in class [Link]
Returns the value of this Byte as a short.
shortValue(). Method in class [Link]
Returns the value of this Double as a short (by casting to a short).
shortValue(). Method in class [Link]
Returns the value of this Float as a short (by casting to a short).
shortValue(). Method in class [Link]
Returns the value of this Integer as a short.
shortValue(). Method in class [Link]
Returns the value of this Long as a short.
shortValue(). Method in class [Link]
va
Returns the value of the specified number as a short.
shortValue(). Method in class [Link]
Returns the value of this Short as a short.
show(). Method in class [Link]
show(). Method in interface [Link]
DEPRECATED: Replaced by setVisible(boolean).
show(). Method in class [Link]
Shows the dialog.
show(). Method in class [Link]
Shows the Window.
ja
Replaces the Web page currently being viewed with the given URL.
showDocument(URL, String). Method in interface [Link]
Requests that the browser or applet viewer show the Web page indicated by the url argument.
showStatus(String). Method in class [Link]
Requests that the argument string be displayed in the "status window".
showStatus(String). Method in interface [Link]
Requests that the argument string be displayed in the "status window".
SIGN. Static variable in class [Link]
Possible state value, signifying that this signature object has been initialized for signing.
sign(). Method in class [Link]
ww
412
413
m
negative, zero or positive).
signum(). Method in class [Link]
Returns the signum function of this number (i.e., -1, 0 or 1 as the value of this number is
negative, zero or positive).
SILENT. Static variable in class [Link]
constants for logging levels
SimpleBeanInfo(). Constructor for class [Link]
SimpleDateFormat(). Constructor for class [Link]
o
Construct a SimpleDateFormat using the default pattern for the default locale.
SimpleDateFormat(String). Constructor for class [Link]
Construct a SimpleDateFormat using the given pattern in the default locale.
SimpleDateFormat(String, DateFormatSymbols). Constructor for class [Link]
Construct a SimpleDateFormat using the given pattern and locale-specific symbol data.
i.c
SimpleDateFormat(String, Locale). Constructor for class [Link]
Construct a SimpleDateFormat using the given pattern and locale.
SimpleTimeZone(int, String). Constructor for class [Link]
Constructs a SimpleTimeZone with the given base time zone offset from GMT and time zone ID.
SimpleTimeZone(int, String, int, int, int, int, int, int, int, int). Constructor for class
[Link]
Constructs a SimpleTimeZone with the given base time zone offset from GMT, time zone ID, time
to start and end the daylight time.
SIMPLIFIED_CHINESE. Static variable in class [Link]
Useful constant for language.
dil
sin(double). Static method in class [Link]
Returns the trigonometric sine of an angle.
SINGLEFRAME. Static variable in interface [Link]
The image contain a single static image.
SINGLEFRAMEDONE. Static variable in interface [Link]
One frame of the image is complete but there are more frames to be delivered.
SINGLEPASS. Static variable in interface [Link]
The pixels will be delivered in a single pass.
size. Variable in class [Link]
The point size of this font.
size(). Method in class [Link]
va
Returns the number of bits currently in this bit set.
size(). Method in class [Link]
Returns the current size of the buffer.
size(). Method in class [Link]
Returns the current size of the buffer.
size(). Method in class [Link]
size(). Method in class [Link]
Returns the number of bytes written to this data output stream.
size(). Method in class [Link]
Returns the number of keys in this dictionary.
ja
413
414
m
Skips over and discards n bytes of data from this input stream.
skip(long). Method in class [Link]
Skips over and discards n bytes of data from the input stream.
skip(long). Method in class [Link]
Skip characters.
skip(long). Method in interface [Link]
Skips n bytes of input.
skip(long). Method in class [Link]
o
Skip characters.
skip(long). Method in class [Link]
Skips n bytes of input from this input stream.
skip(long). Method in class [Link]
Skip characters.
i.c
skip(long). Method in class [Link]
Skips specified number of bytes in the current ZIP entry.
skipBytes(int). Method in interface [Link]
Skips exactly n bytes of input.
skipBytes(int). Method in class [Link]
Skips exactly n bytes of input in the underlying input stream.
skipBytes(int). Method in class [Link]
Skips bytes, block until all bytes are skipped.
skipBytes(int). Method in class [Link]
Skips exactly n bytes of input.
dil
slashSlashComments(boolean). Method in class [Link]
Determines whether or not the tokenizer recognizes C++-style comments.
slashStarComments(boolean). Method in class [Link]
Determines whether or not the tokenizer recognizes C-style comments.
sleep(long). Static method in class [Link]
Causes the currently executing thread to sleep (temporarily cease execution) for the specified
number of milliseconds.
sleep(long, int). Static method in class [Link]
Causes the currently executing thread to sleep (cease execution) for the specified number of
milliseconds plus the specified number of nanoseconds.
SMALLINT. Static variable in class [Link]
va
Socket(). Constructor for class [Link]
Creates an unconnected socket, with the system-default type of SocketImpl.
Socket(InetAddress, int). Constructor for class [Link]
Creates a stream socket and connects it to the specified port number at the specified IP
address.
Socket(InetAddress, int, boolean). Constructor for class [Link]
Creates a socket and connects it to the specified port number at the specified IP address.
Socket(InetAddress, int, InetAddress, int). Constructor for class [Link]
Creates a socket and connects it to the specified remote address on the specified remote port.
Socket(SocketImpl). Constructor for class [Link]
ja
414
415
m
SQLException(String, String). Constructor for class [Link]
Construct an SQLException with a reason and SQLState; vendorCode defaults to 0.
SQLException(String, String, int). Constructor for class [Link]
Construct a fully-specified SQLException
SQLWarning(). Constructor for class [Link]
Construct an SQLWarning ; reason defaults to null, SQLState defaults to null and vendorCode
defaults to 0.
SQLWarning(String). Constructor for class [Link]
o
Construct an SQLWarning with a reason; SQLState defaults to null and vendorCode defaults to 0.
SQLWarning(String, String). Constructor for class [Link]
Construct an SQLWarning with a reason and SQLState; vendorCode defaults to 0.
SQLWarning(String, String, int). Constructor for class [Link]
Construct a fully specified SQLWarning.
i.c
sqrt(double). Static method in class [Link]
Returns the square root of a double value.
srccols. Variable in class [Link]
srcHeight. Variable in class [Link]
srcrows. Variable in class [Link]
srcWidth. Variable in class [Link]
Stack(). Constructor for class [Link]
StackFrame(). Constructor for class [Link]
StackOverflowError(). Constructor for class [Link]
Constructs a StackOverflowError with no detail message.
dil
StackOverflowError(String). Constructor for class [Link]
Constructs a StackOverflowError with the specified detail message.
start(). Method in class [Link]
Called by the browser or applet viewer to inform this applet that it should start its
execution.
start(). Method in class [Link]
Causes this thread to begin execution; the Java Virtual Machine calls the run method of this
thread.
START_PUNCTUATION. Static variable in class [Link]
startGrabbing(). Method in class [Link]
Request the PixelGrabber to start fetching the pixels.
va
startProduction(ImageConsumer). Method in class [Link]
Adds an ImageConsumer to the list of consumers interested in data for this image, and
immediately starts delivery of the image data through the ImageConsumer interface.
startProduction(ImageConsumer). Method in interface [Link]
This method both registers the given ImageConsumer object as a consumer and starts an
immediate reconstruction of the image data which will then be delivered to this consumer and
any other consumer which may have already been registered with the producer.
startProduction(ImageConsumer). Method in class [Link]
Adds an ImageConsumer to the list of consumers interested in data for this image, and
immediately start delivery of the image data through the ImageConsumer interface.
ja
415
416
m
STORED. Static variable in class [Link]
Compression method for uncompressed entries.
STORED. Static variable in class [Link]
Compression method for uncompressed (STORED) entries.
storesLowerCaseIdentifiers(). Method in interface [Link]
Does the database treat mixed case unquoted SQL identifiers as case insensitive and store them
in lower case?
storesLowerCaseQuotedIdentifiers(). Method in interface [Link]
o
Does the database treat mixed case quoted SQL identifiers as case insensitive and store them
in lower case?
storesMixedCaseIdentifiers(). Method in interface [Link]
Does the database treat mixed case unquoted SQL identifiers as case insensitive and store them
in mixed case?
i.c
storesMixedCaseQuotedIdentifiers(). Method in interface [Link]
Does the database treat mixed case quoted SQL identifiers as case insensitive and store them
in mixed case?
storesUpperCaseIdentifiers(). Method in interface [Link]
Does the database treat mixed case unquoted SQL identifiers as case insensitive and store them
in upper case?
storesUpperCaseQuotedIdentifiers(). Method in interface [Link]
Does the database treat mixed case quoted SQL identifiers as case insensitive and store them
in upper case?
StreamCorruptedException(). Constructor for class [Link]
dil
Create a StreamCorruptedException with no reason.
StreamCorruptedException(String). Constructor for class [Link]
Create a StreamCorruptedException with a reason.
StreamTokenizer(InputStream). Constructor for class [Link]
Creates a stream tokenizer that parses the specified input stream.
StreamTokenizer(Reader). Constructor for class [Link]
Create a tokenizer that parses the given character stream.
String(). Constructor for class [Link]
Allocates a new String containing no characters.
String(byte[]). Constructor for class [Link]
Construct a new String by converting the specified array of bytes using the platform's default
va
character encoding.
String(byte[], int). Constructor for class [Link]
Allocates a new String containing characters constructed from an array of 8-bit integer
values.
String(byte[], int, int). Constructor for class [Link]
Construct a new String by converting the specified subarray of bytes using the platform's
default character encoding.
String(byte[], int, int, int). Constructor for class [Link]
Allocates a new String constructed from a subarray of an array of 8-bit integer values.
String(byte[], int, int, String). Constructor for class [Link]
ja
Construct a new String by converting the specified subarray of bytes using the specified
character encoding.
String(byte[], String). Constructor for class [Link]
Construct a new String by converting the specified array of bytes using the specified
character encoding.
String(char[]). Constructor for class [Link]
Allocates a new String so that it represents the sequence of characters currently contained in
w.
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 [Link]
The DataFlavor representing a Java Unicode String class, where:
representationClass = [Link]
mimeType = "application/x-javaserializedobject"
o
StringIndexOutOfBoundsException(). Constructor for class [Link]
Constructs a StringIndexOutOfBoundsException with no detail message.
StringIndexOutOfBoundsException(int). Constructor for class
[Link]
Constructs a new StringIndexOutOfBoundsException class with an argument indicating the illegal
i.c
index.
StringIndexOutOfBoundsException(String). Constructor for class
[Link]
Constructs a StringIndexOutOfBoundsException with the specified detail message.
StringReader(String). Constructor for class [Link]
Create a new string reader.
StringSelection(String). Constructor for class [Link]
Creates a transferable object capable of transferring the specified string in plain text
format.
StringTokenizer(String). Constructor for class [Link]
dil
Constructs a string tokenizer for the specified string.
StringTokenizer(String, String). Constructor for class [Link]
Constructs a string tokenizer for the specified string.
StringTokenizer(String, String, boolean). Constructor for class [Link]
Constructs a string tokenizer for the specified string.
stringWidth(String). Method in class [Link]
Returns the total advance width for showing the specified String in this Font.
StringWriter(). Constructor for class [Link]
Create a new string writer, using the default initial string-buffer size.
StringWriter(int). Constructor for class [Link]
Create a new string writer, using the specified initial string-buffer size.
va
StubNotFoundException(String). Constructor for class [Link]
Create a new StubNotFoundException with a descriptive string.
StubNotFoundException(String, Exception). Constructor for class [Link]
Create a new StubNotFoundException with a descriptive string and an exception.
style. Variable in class [Link]
The style of the font.
substituteColorModel(ColorModel, ColorModel). Method in class [Link]
Registers two ColorModel objects for substitution.
substring(int). Method in class [Link]
Returns a new string that is a substring of this string.
ja
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 [Link]
Is the CONVERT function between SQL types supported?
supportsConvert(int, int). Method in interface [Link]
Is CONVERT between the given SQL types supported?
supportsCoreSQLGrammar(). Method in interface [Link]
Is the ODBC Core SQL grammar supported?
o
supportsCorrelatedSubqueries(). Method in interface [Link]
Are correlated subqueries supported? A JDBC-Compliant driver always returns true.
supportsCustomEditor(). Method in interface [Link]
supportsCustomEditor(). Method in class [Link]
supportsDataDefinitionAndDataManipulationTransactions(). Method in interface
i.c
[Link]
Are both data definition and data manipulation statements within a transaction supported?
supportsDataManipulationTransactionsOnly(). Method in interface [Link]
Are only data manipulation statements within a transaction supported?
supportsDifferentTableCorrelationNames(). Method in interface [Link]
If table correlation names are supported, are they restricted to be different from the names
of the tables?
supportsExpressionsInOrderBy(). Method in interface [Link]
Are expressions in "ORDER BY" lists supported?
supportsExtendedSQLGrammar(). Method in interface [Link]
dil
Is the ODBC Extended SQL grammar supported?
supportsFullOuterJoins(). Method in interface [Link]
Are full nested outer joins supported?
supportsGroupBy(). Method in interface [Link]
Is some form of "GROUP BY" clause supported?
supportsGroupByBeyondSelect(). Method in interface [Link]
Can a "GROUP BY" clause add columns not in the SELECT provided it specifies all the columns in
the SELECT?
supportsGroupByUnrelated(). Method in interface [Link]
Can a "GROUP BY" clause use columns not in the SELECT?
supportsIntegrityEnhancementFacility(). Method in interface [Link]
va
Is the SQL Integrity Enhancement Facility supported?
supportsLikeEscapeClause(). Method in interface [Link]
Is the escape character in "LIKE" clauses supported? A JDBC-Compliant driver always returns
true.
supportsLimitedOuterJoins(). Method in interface [Link]
Is there limited support for outer joins? (This will be true if supportFullOuterJoins is
true.)
supportsMinimumSQLGrammar(). Method in interface [Link]
Is the ODBC Minimum SQL grammar supported? All JDBC-Compliant drivers must return true.
supportsMixedCaseIdentifiers(). Method in interface [Link]
ja
Does the database treat mixed case unquoted SQL identifiers as case sensitive and as a result
store them in mixed case? A JDBC-Compliant driver will always return false.
supportsMixedCaseQuotedIdentifiers(). Method in interface [Link]
Does the database treat mixed case quoted SQL identifiers as case sensitive and as a result
store them in mixed case? A JDBC-Compliant driver will always return true.
supportsMultipleResultSets(). Method in interface [Link]
Are multiple ResultSets from a single execute supported?
w.
418
419
m
Can a schema name be used in a privilege definition statement?
supportsSchemasInProcedureCalls(). Method in interface [Link]
Can a schema name be used in a procedure call statement?
supportsSchemasInTableDefinitions(). Method in interface [Link]
Can a schema name be used in a table definition statement?
supportsSelectForUpdate(). Method in interface [Link]
Is SELECT for UPDATE supported?
supportsStoredProcedures(). Method in interface [Link]
o
Are stored procedure calls using the stored procedure escape syntax supported?
supportsSubqueriesInComparisons(). Method in interface [Link]
Are subqueries in comparison expressions supported? A JDBC-Compliant driver always returns
true.
supportsSubqueriesInExists(). Method in interface [Link]
i.c
Are subqueries in 'exists' expressions supported? A JDBC-Compliant driver always returns true.
supportsSubqueriesInIns(). Method in interface [Link]
Are subqueries in 'in' statements supported? A JDBC-Compliant driver always returns true.
supportsSubqueriesInQuantifieds(). Method in interface [Link]
Are subqueries in quantified expressions supported? A JDBC-Compliant driver always returns
true.
supportsTableCorrelationNames(). Method in interface [Link]
Are table correlation names supported? A JDBC-Compliant driver always returns true.
supportsTransactionIsolationLevel(int). Method in interface [Link]
Does the database support the given transaction isolation level?
dil
supportsTransactions(). Method in interface [Link]
Are transactions supported? If not, commit is a noop and the isolation level is
TRANSACTION_NONE.
supportsUnion(). Method in interface [Link]
Is SQL UNION supported?
supportsUnionAll(). Method in interface [Link]
Is SQL UNION ALL supported?
SURROGATE. Static variable in class [Link]
suspend(). Method in class [Link]
Suspend execution of this thread.
suspend(). Method in class [Link]
va
Suspends this thread.
suspend(). Method in class [Link]
Suspends all processes in this thread group.
sval. Variable in class [Link]
If the current token is a word token, this field contains a string giving the characters of
the word token.
SW_RESIZE_CURSOR. Static variable in class [Link]
The south-west-resize cursor type.
SW_RESIZE_CURSOR. Static variable in class [Link]
sync(). Method in class [Link]
ja
419
420
m
testBit(int). Method in class [Link]
Returns true iff the designated bit is set.
text. Static variable in class [Link]
The background color for text components.
TEXT. Static variable in class [Link]
The array index for the text background color.
TEXT_CURSOR. Static variable in class [Link]
The text cursor type.
o
TEXT_CURSOR. Static variable in class [Link]
TEXT_EVENT_MASK. Static variable in class [Link]
The event mask for selecting text events.
TEXT_FIRST. Static variable in class [Link]
Marks the first integer id for the range of adjustment event ids.
i.c
TEXT_HIGHLIGHT. Static variable in class [Link]
The array index for the text highlight color.
TEXT_HIGHLIGHT_TEXT. Static variable in class [Link]
The array index for the text highlight text color.
TEXT_INACTIVE_TEXT. Static variable in class [Link]
The array index for the text inactive text color.
TEXT_LAST. Static variable in class [Link]
Marks the last integer id for the range of adjustment event ids.
TEXT_TEXT. Static variable in class [Link]
The array index for the text text color.
dil
TEXT_VALUE_CHANGED. Static variable in class [Link]
The adjustment value changed event.
TextArea(). Constructor for class [Link]
Constructs a new TextArea.
TextArea(int, int). Constructor for class [Link]
Constructs a new empty TextArea with the specified number of rows and columns.
TextArea(String). Constructor for class [Link]
Constructs a new TextArea with the specified text displayed.
TextArea(String, int, int). Constructor for class [Link]
Constructs a new TextArea with the specified text and number of rows and columns.
TextArea(String, int, int, int). Constructor for class [Link]
va
Constructs a new TextArea with the specified text and number of rows, columns, and scrollbar
visibility.
TextEvent(Object, int). Constructor for class [Link]
Constructs a TextEvent object with the specified TextComponent source, and type.
TextField(). Constructor for class [Link]
Constructs a new TextField.
TextField(int). Constructor for class [Link]
Constructs a new empty TextField with the specified number of columns.
TextField(String). Constructor for class [Link]
Constructs a new TextField initialized with the specified text.
ja
420
421
m
ThreadGroup(String). Constructor for class [Link]
Constructs a new thread group.
ThreadGroup(ThreadGroup, String). Constructor for class [Link]
Creates a new thread group.
Throwable(). Constructor for class [Link]
Constructs a new Throwable with no detail message.
Throwable(String). Constructor for class [Link]
Constructs a new Throwable with the specified detail message.
o
THURSDAY. Static variable in class [Link]
Useful constant for days of week.
time. Variable in class [Link]
The current time set for the calendar.
TIME. Static variable in class [Link]
i.c
Time(int, int, int). Constructor for class [Link]
Construct a Time Object
Time(long). Constructor for class [Link]
Construct a Time using a milliseconds time value
TIMESTAMP. Static variable in class [Link]
Timestamp(int, int, int, int, int, int, int). Constructor for class [Link]
Construct a Timestamp Object
Timestamp(long). Constructor for class [Link]
Construct a Timestamp using a milliseconds time value.
TimeZone(). Constructor for class [Link]
dil
TIMEZONE_FIELD. Static variable in class [Link]
Useful constant for TIMEZONE field alignment.
TINYINT. Static variable in class [Link]
TITLECASE_LETTER. Static variable in class [Link]
toBack(). Method in class [Link]
Places this window at the bottom of the stacking order and makes the corresponding adjustment
to other visible windows.
toBack(). Method in interface [Link]
toBigInteger(). Method in class [Link]
Converts this number to a BigInteger.
toBinaryString(int). Static method in class [Link]
va
Creates a string representation of the integer argument as an unsigned integer in base 2.
toBinaryString(long). Static method in class [Link]
Creates a string representation of the long argument as an unsigned integer in base 2.
toByteArray(). Method in class [Link]
Returns the two's-complement representation of this number.
toByteArray(). Method in class [Link]
Creates a newly allocated byte array.
toByteArray(). Method in class [Link]
Converts the CollationKey to a sequence of bits.
toCharArray(). Method in class [Link]
ja
421
422
The given character is mapped to its lowercase equivalent; if the character has no lowercase
equivalent, the character itself is returned.
toLowerCase(Locale). Method in class [Link]
m
Converts all of the characters in this String to lower case using the rules of the given
locale.
toOctalString(int). Static method in class [Link]
Creates a string representation of the integer argument as an unsigned integer in base 8.
toOctalString(long). Static method in class [Link]
Creates a string representation of the long argument as an unsigned integer in base 8.
Toolkit(). Constructor for class [Link]
TooManyListenersException(). Constructor for class [Link]
o
Constructs a TooManyListenersException with no detail message.
TooManyListenersException(String). Constructor for class [Link]
Constructs a TooManyListenersException with the specified detail message.
top. Variable in class [Link]
The inset from the top.
i.c
TOP_ALIGNMENT. Static variable in class [Link]
Ease of use constant for getAlignmentY().
toPattern(). Method in class [Link]
Gets the pattern.
toPattern(). Method in class [Link]
Synthesizes a pattern string that represents the current state of this Format object.
toPattern(). Method in class [Link]
Gets the pattern.
toPattern(). Method in class [Link]
Return a pattern string describing this date format.
dil
TOPDOWNLEFTRIGHT. Static variable in interface [Link]
The pixels will be delivered in top-down, left-to-right order.
toString(). Method in interface [Link]
Returns a string representation of the ACL contents.
toString(). Method in interface [Link]
Returns a string representation of the contents of this ACL entry.
toString(). Method in class [Link]
Returns a string representation of the object.
toString(). Method in class [Link]
Returns the string representation of this number.
toString(). Method in class [Link]
va
Returns the string representation of this number, radix 10.
toString(). Method in class [Link]
Returns a string representation of this bit set.
toString(). Method in class [Link]
Returns a String object representing this Boolean's value.
toString(). Method in class [Link]
Returns the String representation of this BorderLayout's values.
toString(). Method in class [Link]
Returns a String object representing this Byte's value.
toString(). Method in class [Link]
ja
422
423
m
Returns the String representation of this Event's values.
toString(). Method in class [Link]
Returns a string representation of the object.
toString(). Method in class [Link]
Return a string describing this Field.
toString(). Method in class [Link]
Returns a string representation of this object.
toString(). Method in class [Link]
o
Returns a String representation of this Float object.
toString(). Method in class [Link]
Returns the String representation of this FlowLayout's values.
toString(). Method in class [Link]
Converts this object to a String representation.
i.c
toString(). Method in class [Link]
Returns the String representation of this FontMetric's values.
toString(). Method in class [Link]
Returns a String object representing this Graphics object's value.
toString(). Method in class [Link]
Returns the String representation of this GridLayout's values.
toString(). Method in class [Link]
Returns the String representation of this GridLayout's values.
toString(). Method in class [Link]
Returns a rather long string representation of this hashtable.
dil
toString(). Method in class [Link]
Returns a short string describing this identity, telling its name and its scope (if any).
toString(). Method in class [Link]
Returns a string representation of this identity scope, including its name, its scope name,
and the number of identities in this identity scope.
toString(). Method in class [Link]
Converts this IP address to a String.
toString(). Method in class [Link]
Returns a String object representing this Inset's values.
toString(). Method in class [Link]
Returns a String object representing this Integer's value.
va
toString(). Method in class [Link]
Getter for the programmatic name of the entire locale, with the language, country and variant
separated by underbars.
toString(). Method in class [Link]
Return log name as string representation
toString(). Method in class [Link]
Returns a String object representing this Long's value.
toString(). Method in class [Link]
Returns the String representation of this MenuComponent's values.
toString(). Method in class [Link]
ja
423
424
m
Return a (somewhat verbose) description.
toString(). Method in class [Link]
Return the double's value as a string.
toString(). Method in class [Link]
Returns a string representation of the object.
toString(). Method in class [Link]
Return the float's value as a string.
toString(). Method in class [Link]
o
Return the int's value as a string.
toString(). Method in class [Link]
Return the long's value as a string.
toString(). Method in class [Link]
Returns a String that represents the value of this remote object.
i.c
toString(). Method in class [Link]
Return object as a string.
toString(). Method in class [Link]
Return the short's value as a string.
toString(). Method in class [Link]
Return the string value, or "null"
toString(). Method in class [Link]
Returns the implementation address and implementation port of this socket as a String.
toString(). Method in class [Link]
Returns a String object representing this Short's value.
dil
toString(). Method in class [Link]
Returns a string representation of this signature object, providing information that includes
the state of the object and the name of the algorithm used.
toString(). Method in class [Link]
Returns a string of information about the signer.
toString(). Method in class [Link]
Converts this socket to a String.
toString(). Method in class [Link]
Returns the address and port of this socket as a String.
toString(). Method in class [Link]
Returns a string representation of the object.
va
toString(). Method in class [Link]
Returns the string representation of the current stream token.
toString(). Method in class [Link]
This object (which is already a string!) is itself returned.
toString(). Method in class [Link]
Converts to a string representing the data in this string buffer.
toString(). Method in class [Link]
Return the buffer's current value as a string.
toString(). Method in class [Link]
Returns the String representation of this Color's values.
ja
424
425
m
toString(float). Static method in class [Link]
Returns a String representation for the specified float value.
toString(int). Method in class [Link]
Returns the string representation of this number in the given radix.
toString(int). Method in class [Link]
Creates a newly allocated string.
toString(int). Static method in class [Link]
Returns a new String object representing the specified integer.
o
toString(int). Static method in class [Link]
Return a string describing the access modifier flags in the specified modifier.
toString(int, int). Static method in class [Link]
Creates a string representation of the first argument in the radix specified by the second
argument.
i.c
toString(long). Static method in class [Link]
Returns a new String object representing the specified integer.
toString(long, int). Static method in class [Link]
Creates a string representation of the first argument in the radix specified by the second
argument.
toString(short). Static method in class [Link]
Returns a new String object representing the specified Short.
toString(String). Method in class [Link]
Converts input data to a string, using the specified character encoding.
totalMemory(). Method in class [Link]
dil
Report the total memory usage of the Java interpreter being debugged.
totalMemory(). Method in class [Link]
Returns the total amount of memory in the Java Virtual Machine.
toTitleCase(char). Static method in class [Link]
Converts the character argument to titlecase.
toUpperCase(). Method in class [Link]
Converts this string to uppercase.
toUpperCase(char). Static method in class [Link]
Converts the character argument to uppercase.
toUpperCase(Locale). Method in class [Link]
Converts all of the characters in this String to upper case using the rules of the given
va
locale.
trace(boolean). Method in class [Link]
Turn on/off method call tracing.
traceInstructions(boolean). Method in class [Link]
Enables/Disables tracing of instructions.
traceMethodCalls(boolean). Method in class [Link]
Enables/Disables tracing of method calls.
TRACK. Static variable in class [Link]
The absolute tracking adjustment type.
TRADITIONAL_CHINESE. Static variable in class [Link]
ja
Translates the origin of the graphics context to the point (x, y) in the current coordinate
system.
translate(int, int). Method in class [Link]
Translates the point.
translate(int, int). Method in class [Link]
Translates the vertices by deltaX, deltaY.
translate(int, int). Method in class [Link]
Translates the rectangle.
translatePoint(int, int). Method in class [Link]
Translates the coordinate position of the event by x, y.
trim(). Method in class [Link]
Removes white space from both ends of this string.
425
426
m
The Boolean object corresponding to the primitive value true.
TT_EOF. Static variable in class [Link]
A constant indicating that the end of the stream has been read.
TT_EOL. Static variable in class [Link]
A constant indicating that the end of the line has been read.
TT_NUMBER. Static variable in class [Link]
A constant indicating that a number token has been read.
TT_WORD. Static variable in class [Link]
o
A constant indicating that a word token has been read.
ttype. Variable in class [Link]
After a call to the nextToken method, this field contains the type of the token just read.
TUESDAY. Static variable in class [Link]
Useful constant for days of week.
i.c
TYPE. Static variable in class [Link]
The Class object representing the primitive type boolean.
TYPE. Static variable in class [Link]
The Class object representing the primitive type byte.
TYPE. Static variable in class [Link]
The Class object representing the primitive type char.
TYPE. Static variable in class [Link]
The Class object representing the primitive type double.
TYPE. Static variable in class [Link]
The Class object representing the primitive type float.
dil
TYPE. Static variable in class [Link]
The Class object representing the primitive type int.
TYPE. Static variable in class [Link]
The Class object representing the primitive type long.
TYPE. Static variable in class [Link]
The Class object representing the primitive type short.
TYPE. Static variable in class [Link]
The Class object representing the primitive Java type void.
typeName(). Method in class [Link]
Return this RemoteValue's type ("array").
typeName(). Method in class [Link]
va
Print this RemoteValue's type ("boolean").
typeName(). Method in class [Link]
Print this RemoteValue's type ("byte").
typeName(). Method in class [Link]
Print this RemoteValue's type ("char").
typeName(). Method in class [Link]
Returns the name of the class as its type.
typeName(). Method in class [Link]
Print this RemoteValue's type ("double").
typeName(). Method in class [Link]
ja
426
427
m
UID(). Constructor for class [Link]
Create a pure identifier that is unique with respect to the host on which it is generated.
UID(short). Constructor for class [Link]
Create a "well-known" ID.
UK. Static variable in class [Link]
Useful constant for country.
UNASSIGNED. Static variable in class [Link]
unbind(String). Static method in class [Link]
o
Unbind the name.
unbind(String). Method in interface [Link]
Unbind the name.
uncaughtException(Thread, Throwable). Method in class [Link]
Called by the Java Virtual Machine when a thread in this thread group stops because of an
i.c
uncaught exception.
UNDECIMBER. Static variable in class [Link]
Useful constant for month.
UndefinedProperty. Static variable in class [Link]
The UndefinedProperty object should be returned whenever a property which was not defined for
a particular image is fetched.
UnexpectedException(String). Constructor for class [Link]
Create a new UnexpectedException with a description.
UnexpectedException(String, Exception). Constructor for class [Link]
Create a new UnexpectedException with a description, and detail exception.
dil
UnicastRemoteObject(). Constructor for class [Link]
Create and export a new UnicastRemoteObject object using an anonymous port.
UNINITIALIZED. Static variable in class [Link]
Possible state value, signifying that this signature object has not yet been initialized.
union(Rectangle). Method in class [Link]
Computes the union of two rectangles.
UNIT_DECREMENT. Static variable in class [Link]
The unit decrement adjustment type.
UNIT_INCREMENT. Static variable in class [Link]
The unit increment adjustment type.
UnknownError(). Constructor for class [Link]
va
Constructs an UnknownError with no detail message.
UnknownError(String). Constructor for class [Link]
Constructs an UnknownError with the specified detail message.
UnknownHostException(). Constructor for class [Link]
Constructs a new UnknownHostException with no detail message.
UnknownHostException(String). Constructor for class [Link]
Constructs a new UnknownHostException with the specified detail message.
UnknownHostException(String). Constructor for class [Link]
Create a new UnknownHostException with a description.
UnknownHostException(String, Exception). Constructor for class [Link]
ja
427
428
no detailed message
UnsupportedEncodingException(String). Constructor for class [Link]
detailed message
m
UnsupportedFlavorException(DataFlavor). Constructor for class
[Link]
Constructs an UnsupportedFlavorException.
UP. Static variable in class [Link]
The up arrow action-key.
up(int). Method in class [Link]
Change the current stackframe to be one or more frames higher (as in, away from the current
program counter).
o
UPDATE. Static variable in class [Link]
The update event type.
update(byte). Method in class [Link]
Updates the digest using the specified byte.
update(byte). Method in class [Link]
i.c
Updates the data to be signed or verified by a byte.
update(byte[]). Method in class [Link].Adler32
Updates checksum with specified array of bytes.
update(byte[]). Method in class [Link].CRC32
Updates CRC-32 with specified array of bytes.
update(byte[]). Method in class [Link]
Updates the digest using the specified array of bytes.
update(byte[]). Method in class [Link]
Updates the data to be signed or verified, using the specified array of bytes.
update(byte[], int, int). Method in class [Link].Adler32
dil
Updates checksum with specified array of bytes.
update(byte[], int, int). Method in interface [Link]
Updates the current checksum with the specified array of bytes.
update(byte[], int, int). Method in class [Link].CRC32
Updates CRC-32 with specified array of bytes.
update(byte[], int, int). Method in class [Link]
Updates the digest using the specified array of bytes, starting at the specified offset.
update(byte[], int, int). Method in class [Link]
Updates the data to be signed or verified, using the specified array of bytes, starting at the
specified offset.
update(Graphics). Method in class [Link]
va
Updates the component.
update(int). Method in class [Link].Adler32
Updates checksum with specified byte.
update(int). Method in interface [Link]
Updates the current checksum with the specified byte.
update(int). Method in class [Link].CRC32
Updates CRC-32 with specified byte.
update(Observable, Object). Method in interface [Link]
This method is called whenever the observed object is changed.
UPPERCASE_LETTER. Static variable in class [Link]
ja
Creates an absolute URL from the specified protocol name, host name, and file name.
URL(URL, String). Constructor for class [Link]
Creates a URL by parsing the specification spec within a specified context.
URLConnection(URL). Constructor for class [Link]
Constructs a URL connection to the specified URL.
URLStreamHandler(). Constructor for class [Link]
US. Static variable in class [Link]
Useful constant for country.
useCaches. Variable in class [Link]
If true, the protocol is allowed to use caching whenever it can.
ww
428
429
UTC(int, int, int, int, int, int). Static method in class [Link]
Determines the date and time based on the arguments.
UTFDataFormatException(). Constructor for class [Link]
m
Constructs a UTFDataFormatException with no detail message.
UTFDataFormatException(String). Constructor for class [Link]
Constructs a UTFDataFormatException with the specified detail message.
o
valid(). Method in class [Link]
Tests if this file descriptor object is valid.
validate(). Method in class [Link]
Ensures that a component has a valid layout.
validate(). Method in class [Link]
i.c
Validates this Container and all of the components contained within it.
validateObject(). Method in interface [Link]
Validates the object
validateTree(). Method in class [Link]
Recursively descends the container tree and recomputes the layout for any subtrees marked as
needing it (those marked as invalid).
value. Variable in class [Link]
"value" specifies the current value of the property, based on a combination of the information
supplied to getPropertyInfo, the Java environment, and driver supplied default values.
valueOf(boolean). Static method in class [Link]
dil
Returns the string representation of the boolean argument.
valueOf(char). Static method in class [Link]
Returns the string representation of the char * argument.
valueOf(char[]). Static method in class [Link]
Returns the string representation of the char array argument.
valueOf(char[], int, int). Static method in class [Link]
Returns the string representation of a specific subarray of the char array argument.
valueOf(double). Static method in class [Link]
Returns the string representation of the double argument.
valueOf(float). Static method in class [Link]
Returns the string representation of the float argument.
va
valueOf(int). Static method in class [Link]
Returns the string representation of the int argument.
valueOf(long). Static method in class [Link]
Returns a BigDecimal with the given value and a scale of zero.
valueOf(long). Static method in class [Link]
Returns a BigInteger with the specified value.
valueOf(long). Static method in class [Link]
Returns the string representation of the long argument.
valueOf(long, int). Static method in class [Link]
Returns a BigDecimal with a value of (val/10**scale).
ja
429
430
m
Assuming the specified String represents a short, returns a new Short object initialized to
that value.
VARBINARY. Static variable in class [Link]
VARCHAR. Static variable in class [Link]
Vector(). Constructor for class [Link]
Constructs an empty vector.
Vector(int). Constructor for class [Link]
Constructs an empty vector with the specified initial capacity.
o
Vector(int, int). Constructor for class [Link]
Constructs an empty vector with the specified initial capacity and capacity increment.
VERBOSE. Static variable in class [Link]
VERIFY. Static variable in class [Link]
Possible state value, signifying that this signature object has been initialized for
i.c
verification.
verify(byte[]). Method in class [Link]
Verifies the passed-in signature.
VerifyError(). Constructor for class [Link]
Constructs an VerifyError with no detail message.
VerifyError(String). Constructor for class [Link]
Constructs an VerifyError with the specified detail message.
versionColumnNotPseudo. Static variable in interface [Link]
VERSION COLUMNS PSEUDO_COLUMN - is NOT a pseudo column.
versionColumnPseudo. Static variable in interface [Link]
dil
VERSION COLUMNS PSEUDO_COLUMN - is a pseudo column.
versionColumnUnknown. Static variable in interface [Link]
VERSION COLUMNS PSEUDO_COLUMN - may or may not be pseudo column.
VERTICAL. Static variable in interface [Link]
The vertical orientation.
VERTICAL. Static variable in class [Link]
VERTICAL. Static variable in class [Link]
The vertical Scrollbar variable.
vetoableChange(PropertyChangeEvent). Method in interface [Link]
This method gets called when a constrained property is changed.
VetoableChangeSupport(Object). Constructor for class [Link]
va
VirtualMachineError(). Constructor for class [Link]
Constructs a VirtualMachineError with no detail message.
VirtualMachineError(String). Constructor for class [Link]
Constructs a VirtualMachineError with the specified detail message.
VK_0. Static variable in class [Link]
VK_0 thru VK_9 are the same as ASCII '0' thru '9' (0x30 - 0x39)
VK_1. Static variable in class [Link]
VK_2. Static variable in class [Link]
VK_3. Static variable in class [Link]
VK_4. Static variable in class [Link]
ja
430
431
m
VK_ESCAPE. Static variable in class [Link]
VK_F. Static variable in class [Link]
VK_F1. Static variable in class [Link]
VK_F10. Static variable in class [Link]
VK_F11. Static variable in class [Link]
VK_F12. Static variable in class [Link]
VK_F2. Static variable in class [Link]
VK_F3. Static variable in class [Link]
o
VK_F4. Static variable in class [Link]
VK_F5. Static variable in class [Link]
VK_F6. Static variable in class [Link]
VK_F7. Static variable in class [Link]
VK_F8. Static variable in class [Link]
i.c
VK_F9. Static variable in class [Link]
VK_FINAL. Static variable in class [Link]
for Asian Keyboard
VK_G. Static variable in class [Link]
VK_H. Static variable in class [Link]
VK_HELP. Static variable in class [Link]
VK_HOME. Static variable in class [Link]
VK_I. Static variable in class [Link]
VK_INSERT. Static variable in class [Link]
VK_J. Static variable in class [Link]
dil
VK_K. Static variable in class [Link]
VK_KANA. Static variable in class [Link]
VK_KANJI. Static variable in class [Link]
VK_L. Static variable in class [Link]
VK_LEFT. Static variable in class [Link]
VK_M. Static variable in class [Link]
VK_META. Static variable in class [Link]
VK_MODECHANGE. Static variable in class [Link]
VK_MULTIPLY. Static variable in class [Link]
VK_N. Static variable in class [Link]
VK_NONCONVERT. Static variable in class [Link]
va
VK_NUM_LOCK. Static variable in class [Link]
VK_NUMPAD0. Static variable in class [Link]
VK_NUMPAD1. Static variable in class [Link]
VK_NUMPAD2. Static variable in class [Link]
VK_NUMPAD3. Static variable in class [Link]
VK_NUMPAD4. Static variable in class [Link]
VK_NUMPAD5. Static variable in class [Link]
VK_NUMPAD6. Static variable in class [Link]
VK_NUMPAD7. Static variable in class [Link]
VK_NUMPAD8. Static variable in class [Link]
ja
431
432
m
VMID(). Constructor for class [Link]
Create a new VMID.
VOLATILE. Static variable in class [Link]
o
W_RESIZE_CURSOR. Static variable in class [Link]
The west-resize cursor type.
W_RESIZE_CURSOR. Static variable in class [Link]
wait(). Method in class [Link]
Waits to be notified by another thread of a change in this object.
i.c
wait(long). Method in class [Link]
Waits to be notified by another thread of a change in this object.
wait(long, int). Method in class [Link]
Waits to be notified by another thread of a change in this object.
WAIT_CURSOR. Static variable in class [Link]
The wait cursor type.
WAIT_CURSOR. Static variable in class [Link]
waitFor(). Method in class [Link]
Waits for the subprocess to complete.
waitForAll(). Method in class [Link]
dil
Starts loading all images.
waitForAll(long). Method in class [Link]
Starts loading all images.
waitForID(int). Method in class [Link]
Starts loading all images with the specified ID and waits until they have finished loading or
receive an error.
waitForID(int, long). Method in class [Link]
Starts loading all images with the specified ID.
wasNull(). Method in interface [Link]
An OUT parameter may have the value of SQL NULL; wasNull reports whether the last value read
has this special value.
va
wasNull(). Method in interface [Link]
A column may have the value of SQL NULL; wasNull reports whether the last column read had this
special value.
WEDNESDAY. Static variable in class [Link]
Useful constant for days of week.
WEEK_OF_MONTH. Static variable in class [Link]
Useful constant for date and time.
WEEK_OF_MONTH_FIELD. Static variable in class [Link]
Useful constant for WEEK_OF_MONTH field alignment.
WEEK_OF_YEAR. Static variable in class [Link]
ja
The width of the base image is now available and can be taken from the width argument to the
imageUpdate callback method.
width. Variable in class [Link]
The width of the rectangle.
window. Static variable in class [Link]
The background color for windows.
WINDOW. Static variable in class [Link]
The array index for the window background color.
Window(Frame). Constructor for class [Link]
Constructs a new Window initialized to an invisible state.
WINDOW_ACTIVATED. Static variable in class [Link]
The window activated event type.
432
433
m
The window closed event type.
WINDOW_CLOSING. Static variable in class [Link]
The window closing event type.
WINDOW_DEACTIVATED. Static variable in class [Link]
The window deactivated event type.
WINDOW_DEICONIFIED. Static variable in class [Link]
The window deiconified event type.
WINDOW_DEICONIFY. Static variable in class [Link]
o
The de-iconify window event.
WINDOW_DESTROY. Static variable in class [Link]
The destroy window event.
WINDOW_EVENT_MASK. Static variable in class [Link]
The event mask for selecting window events.
i.c
WINDOW_EXPOSE. Static variable in class [Link]
The expose window event.
WINDOW_FIRST. Static variable in class [Link]
Marks the first integer id for the range of window event ids.
WINDOW_ICONIFIED. Static variable in class [Link]
The window iconified event type.
WINDOW_ICONIFY. Static variable in class [Link]
The iconify window event.
WINDOW_LAST. Static variable in class [Link]
Marks the last integer id for the range of window event ids.
dil
WINDOW_MOVED. Static variable in class [Link]
The move window event.
WINDOW_OPENED. Static variable in class [Link]
The window opened event type.
WINDOW_TEXT. Static variable in class [Link]
The array index for the window text color.
windowActivated(WindowEvent). Method in class [Link]
Handles the windowActivated event by invoking the windowActivated methods on listener-a and
listener-b.
windowActivated(WindowEvent). Method in class [Link]
windowActivated(WindowEvent). Method in interface [Link]
va
Invoked when a window is activated.
WindowAdapter(). Constructor for class [Link]
windowBorder. Static variable in class [Link]
The border color for windows.
windowClosed(WindowEvent). Method in class [Link]
Handles the windowClosed event by invoking the windowClosed methods on listener-a and
listener-b.
windowClosed(WindowEvent). Method in class [Link]
windowClosed(WindowEvent). Method in interface [Link]
Invoked when a window has been closed.
ja
433
434
m
windowText. Static variable in class [Link]
The text color for windows.
wordChars(int, int). Method in class [Link]
Specifies that all characters c in the range low <= c <= high are word constituents.
write(byte[]). Method in interface [Link]
Writes [Link] bytes from the specified byte array to this output stream.
write(byte[]). Method in class [Link]
Writes [Link] bytes from the specified byte array to this file output stream.
o
write(byte[]). Method in class [Link]
Writes [Link] bytes to this output stream.
write(byte[]). Method in interface [Link]
Writes an array of bytes.
write(byte[]). Method in class [Link]
i.c
Writes an array of bytes.
write(byte[]). Method in class [Link]
Writes [Link] bytes from the specified byte array to this output stream.
write(byte[]). Method in class [Link]
Writes [Link] bytes from the specified byte array starting at offset off to this file.
write(byte[], int, int). Method in class [Link]
Writes len bytes from the specified byte array starting at offset off to this buffered output
stream.
write(byte[], int, int). Method in class [Link]
Writes len bytes from the specified byte array starting at offset off to this byte array
dil
output stream.
write(byte[], int, int). Method in class [Link]
Writes an array of bytes.
write(byte[], int, int). Method in interface [Link]
Writes len bytes from the specified byte array starting at offset off to this output stream.
write(byte[], int, int). Method in class [Link]
Writes len bytes from the specified byte array starting at offset off to the underlying output
stream.
write(byte[], int, int). Method in class [Link]
Writes an array of bytes to the compressed output stream.
write(byte[], int, int). Method in class [Link]
va
Updates the message digest (if the digest function is on) using the specified subarray, and in
any case writes the subarray to the output stream.
write(byte[], int, int). Method in class [Link]
Writes len bytes from the specified byte array starting at offset off to this file output
stream.
write(byte[], int, int). Method in class [Link]
Writes len bytes from the specified byte array starting at offset off to this output stream.
write(byte[], int, int). Method in class [Link]
Writes array of bytes to the compressed output stream.
write(byte[], int, int). Method in class [Link]
ja
434
435
m
write(char[], int, int). Method in class [Link]
Write a portion of an array of characters.
write(char[], int, int). Method in class [Link]
Write a portion of an array of characters.
write(DataOutput). Method in class [Link]
Write uid to output stream.
write(int). Method in class [Link]
Writes the specified byte to this buffered output stream.
o
write(int). Method in class [Link]
Write a single character.
write(int). Method in class [Link]
Writes the specified byte to this byte array output stream.
write(int). Method in class [Link]
i.c
Writes a character to the buffer.
write(int). Method in class [Link]
Writes a byte.
write(int). Method in interface [Link]
Writes the specified byte to this data output stream.
write(int). Method in class [Link]
Writes the specified byte to the underlying output stream.
write(int). Method in class [Link]
Writes a byte to the compressed output stream.
write(int). Method in class [Link]
dil
Updates the message digest (if the digest function is on) using the specified byte, and in any
case writes the byte to the output stream.
write(int). Method in class [Link]
Writes the specified byte to this file output stream.
write(int). Method in class [Link]
Writes the specified byte to this output stream.
write(int). Method in class [Link]
Write a single character.
write(int). Method in class [Link]
Write a byte of data to the stream.
write(int). Method in interface [Link]
va
Writes a byte.
write(int). Method in class [Link]
Writes a byte.
write(int). Method in class [Link]
Writes the specified byte to this output stream.
write(int). Method in class [Link]
Write a single character.
write(int). Method in class [Link]
Writes the specified byte to the piped output stream.
write(int). Method in class [Link]
ja
435
436
m
A WriteAbortedException is thrown during a read when one of the ObjectStreamExceptions was
thrown during writing.
writeBoolean(boolean). Method in interface [Link]
Writes a boolean value to this output stream.
writeBoolean(boolean). Method in class [Link]
Writes a boolean to the underlying output stream as a 1-byte value.
writeBoolean(boolean). Method in class [Link]
Writes a boolean.
o
writeBoolean(boolean). Method in class [Link]
Writes a boolean to the file as a 1-byte value.
writeByte(int). Method in interface [Link]
Writes an 8-bit value to this output stream.
writeByte(int). Method in class [Link]
i.c
Writes out a byte to the underlying output stream as a 1-byte value.
writeByte(int). Method in class [Link]
Writes an 8 bit byte.
writeByte(int). Method in class [Link]
Writes a byte to the file as a 1-byte value.
writeBytes(String). Method in interface [Link]
Writes a string to this output stream.
writeBytes(String). Method in class [Link]
Writes out the string to the underlying output stream as a sequence of bytes.
writeBytes(String). Method in class [Link]
dil
Writes a String as a sequence of bytes.
writeBytes(String). Method in class [Link]
Writes the string to the file as a sequence of bytes.
writeChar(int). Method in interface [Link]
Writes a char value to this output stream.
writeChar(int). Method in class [Link]
Writes a char to the underlying output stream as a 2-byte value, high byte first.
writeChar(int). Method in class [Link]
Writes a 16 bit char.
writeChar(int). Method in class [Link]
Writes a char to the file as a 2-byte value, high byte first.
va
writeChars(String). Method in interface [Link]
Writes a string to this output stream.
writeChars(String). Method in class [Link]
Writes a string to the underlying output stream as a sequence of characters.
writeChars(String). Method in class [Link]
Writes a String as a sequence of chars.
writeChars(String). Method in class [Link]
Writes a string to the file as a sequence of characters.
writeDouble(double). Method in interface [Link]
Writes a double value to this output stream.
ja
Converts the double argument to a long using the doubleToLongBits method in class Double, and
then writes that long value to the file as an 8-byte quantity, high byte first.
writeExternal(ObjectOutput). Method in interface [Link]
The object implements the writeExternal method to save its contents by calling the methods of
DataOutput for its primitive values or calling the writeObject method of ObjectOutput for
objects, strings and arrays.
writeFloat(float). Method in interface [Link]
Writes a float value to this output stream.
writeFloat(float). Method in class [Link]
Converts the float argument to an int using the floatToIntBits method in class Float, and then
ww
writes that int value to the underlying output stream as a 4-byte quantity, high byte first.
writeFloat(float). Method in class [Link]
Writes a 32 bit float.
writeFloat(float). Method in class [Link]
Converts the float argument to an int using the floatToIntBits method in class Float, and then
writes that int value to the file as a 4-byte quantity, high byte first.
writeInt(int). Method in interface [Link]
Writes an int value to this output stream.
writeInt(int). Method in class [Link]
Writes an int to the underlying output stream as four bytes, high byte first.
writeInt(int). Method in class [Link]
Writes a 32 bit int.
436
437
m
Writes a long value to this output stream.
writeLong(long). Method in class [Link]
Writes a long to the underlying output stream as eight bytes, high byte first.
writeLong(long). Method in class [Link]
Writes a 64 bit long.
writeLong(long). Method in class [Link]
Writes a long to the file as eight bytes, high byte first.
writeObject(Object). Method in interface [Link]
o
Write an object to the underlying storage or stream.
writeObject(Object). Method in class [Link]
Write the specified object to the ObjectOutputStream.
Writer(). Constructor for class [Link]
Create a new character-stream writer whose critical sections will synchronize on the writer
i.c
itself.
Writer(Object). Constructor for class [Link]
Create a new character-stream writer whose critical sections will synchronize on the given
object.
writeShort(int). Method in interface [Link]
Writes a 16-bit value to this output stream.
writeShort(int). Method in class [Link]
Writes a short to the underlying output stream as two bytes, high byte first.
writeShort(int). Method in class [Link]
Writes a 16 bit short.
dil
writeShort(int). Method in class [Link]
Writes a short to the file as two bytes, high byte first.
writeStreamHeader(). Method in class [Link]
The writeStreamHeader method is provided so subclasses can append or prepend their own header
to the stream.
writeTo(OutputStream). Method in class [Link]
Writes the complete contents of this byte array output stream to the specified output stream
argument, as if by calling the output stream's write method using [Link](buf, 0, count).
writeTo(Writer). Method in class [Link]
Writes the contents of the buffer to another character stream.
writeUTF(String). Method in interface [Link]
va
Writes a Unicode string by encoding it using modified UTF-8 format.
writeUTF(String). Method in class [Link]
Writes a string to the underlying output stream using UTF-8 encoding in a machine-independent
manner.
writeUTF(String). Method in class [Link]
Writes a String in UTF format.
writeUTF(String). Method in class [Link]
Writes a string to the file using UTF-8 encoding in a machine-independent manner.
written. Variable in class [Link]
The number of bytes written to the data output stream.
ja
437
438
m
yellow. Static variable in class [Link]
The color yellow.
yield(). Static method in class [Link]
Causes the currently executing thread object to temporarily pause and allow other threads to
execute.
ypoints. Variable in class [Link]
The array of y coordinates.
o
i.c
dil
ja va
w.
ww
438