background image
MANAGEMENT AND TECHNOLOGY SCHOOL OF THE POLYTECHNIC INSTITUTE OF BEJA (PORTUGAL), 31 OCTOBER OF 2007
4
Test
__static__main(instance_of_String[])
new Test()
obj49:Test
make(400,2100)
new Add(400,2100)
obj53:Add
new Add()


calc(400,2100,+)


2500


new Sub( obj53 ,1300)
obj54:Sub
new Sub()


calc(2500,1300,-)


1200


getResult()
1200
getResult()
1200
getResult()
1200
getResult()
1200
getResult()
1200
new Mul( obj54 ,1000)
obj56:Mul
new Mul()


calc(1200,1000,*)


1200000


new Div( obj56 ,100)
obj58:Div
new Div()


calc(1200000,100,/)


12000


new Add( obj58 ,1000)
obj59:Add
new Add()


calc(12000,1000,+)


13000


getResult()
1200
new Sub(1200,1000)
obj60:Sub
new Sub()


calc(1200,1000,-)


200


getResult()
200
200
Fig. 2. Included Test Example
17
p u b l i c c l a s s
T e s t
18
{
19
p u b l i c
T e s t ( )
20
{
21
}
22
23
24
p u b l i c
S t r i n g make (
i n t
n1 ,
i n t
n2 )
25
{
26
/ / i n t r e s ;
27
S t r i n g s =
""
;
28
i n t
[ ] subs =
new i n t
[ 5 ] ;
29
Sub sub =
new
Sub (
new
Add( 4 0 0 , 2 1 0 0 ) , 1300 ) ;
30
f o r
(
i n t
i = 0 ; i < subs . l e n g t h ; i ++)
31
subs [ i ] = sub . g e t R e s u l t ( ) ;
32
f o r
(
i n t
i = 0 ; i < subs . l e n g t h ; i ++)
33
s = s +
"
"
+ S t r i n g . valueOf ( subs [ i ] ) ;
34
Mul mul =
new
Mul ( sub , 1000 ) ;
35
Div div =
new
Div ( mul , 1 0 0 ) ;
36
Add add =
new
Add( div , 1000 ) ;
37
r e t u r n
S t r i n g . valueOf (
new
Sub ( sub . g e t R e s u l t ( ) , 1000 ) .
g e t R e s u l t ( ) ) ;
38
/ / r e t u r n 1 0 0 0 ;
39
}
40
41
42
p u b l i c s t a t i c void
main ( S t r i n g a r g s [ ] )
43
{
44
System . out . p r i n t l n (
"Test Program"
) ;
45
46
T e s t t e s t =
new
T e s t ( ) ;
47
/ / i n t r e s = t e s t . make ( 4 0 0 , 2 1 0 0 ) ;
48
System . out . p r i n t l n (
"(400 + 2100)-1300 * 1000 = "
+ t e s t . make ( 4 0 0 ,
2 1 0 0 ) ) ;
49
}
50
}
51
52
/ / d e b u g g i n g o p t i o n
53
/ / j a v a c -g
5
C
ONCLUSION
The Java
TM
development platform relies on a
complex library of classes. Moreover, the JDI
(Java Debug Interface) [15], makes a lot easier
the development of debuggers or applications
that need to monitor the various types of events
generated by the applications. we achieved the
desired objectives implemented on this project.
It is possible to generate the sequence diagram
of any Java
TM
application through the infor-
mation available at the time of the input and
output method events generated when running
the program. That knowledge, enabled better
understanding of the inner workings of the
platform and technology Java
TM
. Personally,
I hope to put in use the knowledge I have
achieved about the Java
TM
language, by devel-
opping other programming projects of interest
and use this technology in conjunction with
other languages, mainly in the development of
applications related to the Internet. About the
distribution of this project, in order to serve
as an example and usefulness to the general
public, it was decided to put the package of the
application available on the Internet for wide
spread, on the world's largest Open Source
software development web site which is Source-
forge dot Net
[10] with a GPL [3] license (GNU
General Public License
).
A
CKNOWLEDGMENTS
This document is part of the final project of
the Course of Computer Engineering. I want
to thank Professor Jo~ao Paulo Barros, the avail-
ability and the precise manner his guided me
during the various stages of development of
this Java
TM
project, without which it would not
be possible to complete this work.
R
EFERENCES
[1]
Encapsulated Postscript. http://en.wikipedia.org/wiki/
Encapsulated PostScript,
http://en.wikipedia.org/wiki/
PostScript.
Reviewed in 2007.
[2]
eXtensible Markup Language. http://pt.wikipedia.org/
wiki/XML.
Reviewed in 2007.
[3]
GNU General Public License. http://pt.wikipedia.org/
wiki/GNU General Public License.
Reviewed in 2007.
[4]
JPEG Image Format.
http://en.wikipedia.org/wiki/
JPEG. Reviewed in 2007.
[5]
Message Sequence Charts. http://www.sdl-forum.org/
MSC2000/index.htm.
Reviewed in 2007.