/* Copyright @ 2003, The Institute for Genomic Research (TIGR). All rights reserved. This software is provided "AS IS". TIGR makes no warranties, express or implied, including no representation or warranty with respect to the performance of the software and derivatives or their safety, effectiveness, or commercial viability. TIGR does not warrant the merchantability or fitness of the software and derivatives for any particular purpose, or that they may be exploited without infringing the copyrights, patent rights or property rights of others. TIGR shall not be liable for any claim, demand or action for any loss, harm, illness or other damage or injury arising from access to or use of the software or associated information, including without limitation any direct, indirect, incidental, exemplary, special or consequential damages. This software program may not be sold, leased, transferred, exported or otherwise disclaimed to anyone, in whole or in part, without the prior written consent of TIGR. */ /* * $RCSfile: MyStringTokenizer.java,v $ * $Revision: 1.2 $ * $Date: 2005/01/12 21:09:39 $ * $Author: jli $ * $State: Exp $ */ package org.tigr.util; import java.util.StringTokenizer; import java.util.Vector; public class MyStringTokenizer { private boolean needDel; private String str; private char delimiter[]; private Vector tokens; private int nextTokenIndex; public MyStringTokenizer(String string, char[] del){ this(string, del, false); } public MyStringTokenizer(String string, char[] del, boolean includeDelimiter){ int numDel, i, j, first, last; char ch; Vector indxs = new Vector(5, 2); str = new String(string); tokens = new Vector(10, 3); delimiter = del; numDel = del.length; needDel = includeDelimiter; for(i=0; i tokens.size()) { return false; } else { return true; } } public String nextToken() { if (hasMoreTokens()) { String token = (String) tokens.elementAt(nextTokenIndex); nextTokenIndex++; return token; } else { throw new ArrayIndexOutOfBoundsException(); } } }