您现在的位置: 无忧电子商务网 >> 信息学院 >> 程序开发 >> js >> 正文

FullStringTokenizer.java[抄袭自jive]

作者:作者:未…    信息学院来源:网络收集    点击数:    更新时间:2006-8-27 我要参与讨论

  /**
* $RCSfile: FullStringTokenizer.java,v $
* $Revision: 1.2 $
* $Date: 2001/07/31 05:38:29 $
*
* Copyright (C) 1999-2001 CoolServlets, Inc. All rights reserved.
*
* This software is the proprietary information of CoolServlets, Inc.
* Use is subject to license terms.
*/

package com.jivesoftware.util;

public class FullStringTokenizer {

    private String string;
    private String delimiter;

    private int index = 0;
    private int length = 0;
    private int delimiterLength;

    public FullStringTokenizer(String string, String delimiter) {
        this.string = string;
        this.delimiter = delimiter;
        delimiterLength = delimiter.length();
        length = string.length();
    }

   /**
    * Determine if there are more tokens available
    */
    public boolean hasMoreTokens() {
        return (index < length);
    }

   /**
    * Get the next token
    */
    public String nextToken() {
        String s = this.string;
        int nextToken = s.indexOf(delimiter, index);
        //Done finding tokens
        if (nextToken < 0) {
            // fixed to return whatever is left in the string (for the case
            // of "[tok]data[tok]data" <- no ending token)
            String tok = s.substring(index,length);
            index = length;
            return tok;
        }
        else if (nextToken == index) {
            //We found an empty token
            index += delimiterLength;
            return "";
        }
        else {
 &

[1] [2] 下一页

在google里搜索更多FullStringTokenizer.java[抄袭自jive]

Google
Web www.51ec.org
【字体: 】【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
我来说两句 对此文章发表了评论
  昵 称: *必填    ·注册用户·
  评 分: 1分 2分 3分 4分 5分     严禁发表危害国家安全、政治、黄色淫秽等内容的评论,用户需对自己在使用本网站服务过程中的行为承担法律责任。本站管理员有权保留或删除评论内容,评论内容只代表机友个人观点,与本网站立场无关。  
评 论
内 容

 
评论列表 (最新 评论仅限网友观点!)

推荐文章
  • 此栏目下没有推荐信息学院
  • 供求信息




    | 设为首页 | 加入收藏 | 关于我们 | 广告服务 | 联系方式 | 友情链接 | 版权申明