KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > AssignOp


1 /* AssignOp Copyright (C) 1998-1999 Jochen Hoenicke.
2  *
3  * This program is free software; you can redistribute it and/or modify
4  * it under the terms of the GNU General Public License as published by
5  * the Free Software Foundation; either version 2, or (at your option)
6  * any later version.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program; see the file COPYING. If not, write to
15  * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
16  *
17  * $Id: AssignOp.java,v 1.5 1999/08/19 15:16:59 jochen Exp $
18  */

19
20
21 public class AssignOp {
22     static short static_short;
23     static int static_int;
24     static double static_double;
25     static String JavaDoc static_String;
26     static long static_long;
27
28     short obj_short;
29     int obj_int;
30     long obj_long;
31     double obj_double;
32     String JavaDoc obj_String;
33
34     short[] arr_short;
35     int [] arr_int;
36     long[] arr_long;
37     double[] arr_double;
38     String JavaDoc[] arr_String;
39
40     void assop() {
41     short local_short = 0;
42         int local_int = 0;
43         long local_long = 0;
44         double local_double = 1.0;
45         String JavaDoc local_String = null;
46
47         local_short -= 25 * local_int;
48     static_short += 100 - local_int;
49     obj_short /= 0.1;
50     arr_short[local_int] >>= 25;
51
52     local_long -= 15L;
53     static_long <<= local_int;
54     obj_long >>>= 3;
55     arr_long[4+local_int] *= obj_long - static_long;
56
57         local_int |= 25 | local_int;
58         static_int <<= 3;
59         obj_int *= 17 + obj_int;
60         arr_int[local_int] /= (obj_int+=7);
61
62         local_double /= 3.0;
63         static_double *= obj_int;
64         obj_double -= 25;
65         arr_double[local_int] /= (local_double+=7.0);
66
67         local_String += "Hallo";
68         static_String += "Hallo";
69         obj_String += "Hallo";
70         arr_String[0] += local_double + static_String + "Hallo" + obj_int;
71     }
72
73     void prepost() {
74         int local_int= -1;
75         long local_long= 4;
76         
77         local_long = local_int++;
78         obj_long = ++obj_int;
79         arr_long[static_int] = static_long = (arr_long[--static_int] = (static_int--))+1;
80     }
81
82     void iinc() {
83         int local_int = 0;
84         local_int += 5;
85         obj_int = (local_int -= 5);
86
87         static_int = local_int++;
88         obj_int = --local_int;
89     }
90 }
91
Popular Tags