Main Page | Packages | Class Hierarchy | Class List | Directories | File List | Class Members

Parse.java

Go to the documentation of this file.
00001 /*
00002  * Parse.java
00003  *
00004  * Created on den 26 oktober 2004, 10:37
00005  */
00006 /*
00007 Copyright (C) 2004  Anders Hedstrom
00008  
00009 This program is free software; you can redistribute it and/or
00010 modify it under the terms of the GNU General Public License
00011 as published by the Free Software Foundation; either version 2
00012 of the License, or (at your option) any later version.
00013  
00014 This program is distributed in the hope that it will be useful,
00015 but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017 GNU General Public License for more details.
00018  
00019 You should have received a copy of the GNU General Public License
00020 along with this program; if not, write to the Free Software
00021 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00022  */
00023 
00024 package net.alhem.jsockets;
00025 
00030 public class Parse extends java.util.StringTokenizer
00031 {
00032     
00034     public Parse(String str)
00035     {
00036         super(str);
00037     }
00038     public Parse(String str,String split)
00039     {
00040         super(str, split);
00041     }
00042     public int nextInt()
00043     {
00044         String str = this.nextToken();
00045         return Integer.valueOf(str).intValue();
00046     }
00047     public double nextDouble()
00048     {
00049         String str = this.nextToken();
00050         return Double.valueOf(str).doubleValue();
00051     }
00052     
00053     public String getword()
00054     {
00055         return this.nextToken();
00056     }
00057     
00058     public String getrest()
00059     {
00060         StringBuffer tmp = new StringBuffer(1024);
00061         while (this.hasMoreTokens())
00062         {
00063             if (!tmp.equals(""))
00064             {
00065                 tmp.append(" ");
00066             }
00067             tmp.append(nextToken());
00068         }
00069         return tmp.toString();
00070     }
00071 }

Generated on Fri Oct 29 14:11:17 2004 for Java Sockets by  doxygen 1.3.9.1