skip to main content

kiesler.at

eprog.jar
updated by rck, 2006-03-27

Die Eprog.jar ist eine Funktionsbibliothek, die Informatik-Studenten auf der TU Wien Einführung in die Programmierung erleichtern soll. Tatsache ist, dass es hier möglicherweise das eine oder andere Problem gibt. Dieser Artikel beleuchtet den "rückgewonnenen" Quellcode.

1 | 2 | 3 | 4 | 5 | 6 | 7 | 8

EprogIO.class

1 // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov.
2 // Jad home page: http://www.geocities.com/kpdus/jad.html
3 // Decompiler options: packimports(3) nonlb 
4 // Source File Name:   EprogIO.java
5 
6 package eprog;
7 
8 import java.io.*;
9 import java.text.DecimalFormat;
10 import java.text.DecimalFormatSymbols;
11 import java.util.Locale;
12 
13 // Referenced classes of package eprog:
14 //                      EprogException
15 
16 public class EprogIO {
17 
18         public EprogIO() {
19         }
20 
21         public static void println() {
22                 System.out.println();
23         }
24 
25         public static void println(String s) {
26                 System.out.println(s);
27         }
28 
29         public static void println(boolean flag) {
30                 System.out.println(flag);
31         }
32 
33         public static void println(byte byte0) {
34                 System.out.println(byte0);
35         }
36 
37         public static void println(short word0) {
38                 System.out.println(word0);
39         }
40 
41         public static void println(int i) {
42                 System.out.println(i);
43         }
44 
45         public static void println(long l) {
46                 System.out.println(l);
47         }
48 
49         public static void println(float f) {
50                 System.out.println(f);
51         }
52 
53         public static void println(double d) {
54                 System.out.println(d);
55         }
56 
57         public static void printFixedln(float f) {
58                 DecimalFormat decimalformat = new DecimalFormat("#0.000");
59                 DecimalFormatSymbols decimalformatsymbols = decimalformat.getDecimalFormatSymbols();
60                 decimalformatsymbols.setDecimalSeparator('.');
61                 decimalformat.setDecimalFormatSymbols(decimalformatsymbols);
62                 System.out.println(decimalformat.format(f));
63         }
64 
65         public static void printFixedln(double d) {
66                 DecimalFormat decimalformat = new DecimalFormat("#0.000");
67                 DecimalFormatSymbols decimalformatsymbols = decimalformat.getDecimalFormatSymbols();
68                 decimalformatsymbols.setDecimalSeparator('.');
69                 decimalformat.setDecimalFormatSymbols(decimalformatsymbols);
70                 System.out.println(decimalformat.format(d));
71         }
72 
73         public static void println(Object obj) {
74                 System.out.println(obj);
75         }
76 
77         public static void print(String s) {
78                 System.out.print(s);
79         }
80 
81         public static void print(boolean flag) {
82                 System.out.print(flag);
83         }
84 
85         public static void print(byte byte0) {
86                 System.out.print(byte0);
87         }
88 
89         public static void print(short word0) {
90                 System.out.print(word0);
91         }
92 
93         public static void print(int i) {
94                 System.out.print(i);
95         }
96 
97         public static void print(long l) {
98                 System.out.print(l);
99         }
100 
101         public static void print(float f) {
102                 System.out.print(f);
103         }
104 
105         public static void print(double d) {
106                 System.out.print(d);
107         }
108 
109         public static void printFixed(float f) {
110                 DecimalFormat decimalformat = new DecimalFormat("#0.000");
111                 DecimalFormatSymbols decimalformatsymbols = decimalformat.getDecimalFormatSymbols();
112                 decimalformatsymbols.setDecimalSeparator('.');
113                 decimalformat.setDecimalFormatSymbols(decimalformatsymbols);
114                 System.out.print(decimalformat.format(f));
115         }
116 
117         public static void printFixed(double d) {
118                 DecimalFormat decimalformat = new DecimalFormat("#0.000");
119                 DecimalFormatSymbols decimalformatsymbols = decimalformat.getDecimalFormatSymbols();
120                 decimalformatsymbols.setDecimalSeparator('.');
121                 decimalformat.setDecimalFormatSymbols(decimalformatsymbols);
122                 System.out.print(decimalformat.format(d));
123         }
124 
125         public static String toFixed(double d) {
126                 DecimalFormat decimalformat = new DecimalFormat("#0.000");
127                 DecimalFormatSymbols decimalformatsymbols = decimalformat.getDecimalFormatSymbols();
128                 decimalformatsymbols.setDecimalSeparator('.');
129                 decimalformat.setDecimalFormatSymbols(decimalformatsymbols);
130                 return decimalformat.format(d);
131         }
132 
133         public static String toFixed(float f) {
134                 DecimalFormat decimalformat = new DecimalFormat("#0.000");
135                 DecimalFormatSymbols decimalformatsymbols = decimalformat.getDecimalFormatSymbols();
136                 decimalformatsymbols.setDecimalSeparator('.');
137                 decimalformat.setDecimalFormatSymbols(decimalformatsymbols);
138                 return decimalformat.format(f);
139         }
140 
141         public static void print(Object obj) {
142                 System.out.print(obj);
143         }
144 
145         public static String readWord() {
146                 StringBuffer stringbuffer;
147                 boolean flag;
148                 stringbuffer = new StringBuffer();
149                 flag = false;
150                   goto _L1
151 _L3:
152                 char c;
153                 if(!Character.isWhitespace(c)) {
154                         flag = true;
155                         stringbuffer.append(c);
156                         continue; /* Loop/switch isn't completed */
157                 }
158                 if(flag)
159                         return stringbuffer.toString();
160 _L1:
161                 if((c = (char)is.read()) != '\uFFFF') goto _L3; else goto _L2
162 _L2:
163                 break MISSING_BLOCK_LABEL_64;
164                 IOException ioexception;
165                 ioexception;
166                 ioexception.printStackTrace();
167                 return stringbuffer.toString();
168         }
169 
170         public static boolean readBoolean() throws EprogException {
171                 boolean flag = true;
172                 try {
173                         flag = readByte() == 0;
174                 }
175                 catch(NumberFormatException numberformatexception) {
176                         throw new EprogException("Wrong Datatype: Not a Byte");
177                 }
178                 return flag;
179         }
180 
181         public static byte readByte() throws EprogException {
182                 byte byte0 = 0;
183                 try {
184                         byte0 = Byte.valueOf(readWord()).byteValue();
185                 }
186                 catch(NumberFormatException numberformatexception) {
187                         throw new EprogException("Wrong Datatype: Not a Byte");
188                 }
189                 return byte0;
190         }
191 
192         public static short readShort() throws EprogException {
193                 short word0 = 0;
194                 try {
195                         word0 = Short.valueOf(readWord()).shortValue();
196                 }
197                 catch(NumberFormatException numberformatexception) {
198                         throw new EprogException("Wrong Datatype: Not a Short");
199                 }
200                 return word0;
201         }
202 
203         public static int readInt() throws EprogException {
204                 int i = 0;
205                 try {
206                         i = Integer.valueOf(readWord()).intValue();
207                 }
208                 catch(NumberFormatException numberformatexception) {
209                         throw new EprogException("Wrong Datatype: Not an Integer");
210                 }
211                 return i;
212         }
213 
214         public static long readLong() throws EprogException {
215                 long l = 0L;
216                 try {
217                         l = Long.valueOf(readWord()).longValue();
218                 }
219                 catch(NumberFormatException numberformatexception) {
220                         throw new EprogException("Wrong Datatype: Not a Long");
221                 }
222                 return l;
223         }
224 
225         public static float readFloat() throws EprogException {
226                 float f = 0.0F;
227                 Locale.setDefault(new Locale("en", "US"));
228                 try {
229                         f = Float.valueOf(readWord()).floatValue();
230                 }
231                 catch(NumberFormatException numberformatexception) {
232                         throw new EprogException("Wrong Datatype: Not a Float");
233                 }
234                 return f;
235         }
236 
237         public static double readDouble() throws EprogException {
238                 Locale.setDefault(new Locale("en", "US"));
239                 double d = 0.0D;
240                 try {
241                         d = Double.valueOf(readWord()).doubleValue();
242                 }
243                 catch(NumberFormatException numberformatexception) {
244                         throw new EprogException("Wrong Datatype: Not a Double");
245                 }
246                 return d;
247         }
248 
249         static InputStreamReader is;
250 
251         static  {
252                 is = new InputStreamReader(System.in);
253         }
254 }

1 | 2 | 3 | 4 | 5 | 6 | 7 | 8



RSSComments - Make a comment
The comments are owned by the poster. We are not responsible for its content.
  • EOF

    Posted on 2004-06-10 01:58:11 By Anonymous

    Hab readWord jetzt mal zu einem alleinstehenden Programm abgeändert und ein paar Ausgaben reingetan. Und siehe da: bei EOF liefert println (c) ein Fragezeichen. Natürlich steht in c nicht wirklich ein Fragezeichen, das wird nur von println so gemacht. EOF ist nämlich in unicode nicht definiert!!! Ein einfaches Character.isDefined (c) löst das Problem!

    [Reply ]

    • Re: EOF

      Posted on 2004-06-10 17:20:47 By rck[110]

      changed On 2004-06-10 17:21:41 Edited By rck (reason: )

      Du meinst also, da gehört ein Check auf "?" (wobei für ? das EOF-Zeichen einzusetzen ist) und nicht auf -1?

      [Reply ]

RSSAll Articles
2008, 2007, 2006, 2005, 2004