2 package org
.de
.metux
.ip
;
8 public boolean is_class
;
22 String str
= String(addr
[0])+"."+
28 str
+= "/"+String(mask
);
33 public boolean parseAddress
35 StringTokenizer tok
= new StringTokenizer(str
,".");
36 if (tok
.countTokens()!=4)
37 throw new RuntimeException("parse error 1");
39 addr
[0] = new Integer(tok
.nextToken()).byteValue();
40 addr
[1] = new Integer(tok
.nextToken()).byteValue();
41 addr
[2] = new Integer(tok
.nextToken()).byteValue();
42 addr
[3] = new Integer(tok
.nextToken()).byteValue();
47 public boolean parseAddress
49 StringTokenizer tok
= new StringTokenizer(str
,".");
50 if (tok
.countTokens()!=4)
51 throw new RuntimeException("parse error 1");
53 addr
[0] = new Integer(tok
.nextToken()).byteValue();
54 addr
[1] = new Integer(tok
.nextToken()).byteValue();
55 addr
[2] = new Integer(tok
.nextToken()).byteValue();
57 StringTokenzier tok2
= new StringTokenizer(tok
.nextToken(),"/");
58 if (tok2
.countTokens()!=2)
59 throw new RuntimeException("parse error 2");
61 addr
[3] = new Integer(tok
.nextToken()).byteValue();
62 mask
= new Integer(tok
.nextToken()).byteValue();
68 //public class StrSplit
70 // /* a little workaround against missing regex in current libgcj */
71 // public static String[] split(String str)
73 // StringTokenizer tok = new StringTokenizer(str);
74 // String[] list = new String[tok.countTokens()];
76 // for (int x=0; tok.hasMoreTokens(); x++)
77 // list[x] = tok.nextToken();
82 // public static String[] split(String str, String delimiter)