⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 parseargs.java

📁 无线通信的主要编程软件,是无线通信工作人员的必备工具,关天相关教程我会在后续传上.
💻 JAVA
字号:
    /**     * Parse a string into tokens based on a sequence of delimiters     * Given delimiters (single characters) d1, d2, ..., dn, this     * class recognises strings of the form s0[d1s1][d2s2]...[dnsn],     * where s<i-1> does not contain character di     * This is unambiguous if all di are distinct. If not, strings     * are attributed to the earliest possible si (so if the delimiters     * are : and :, and the input string is foo:bar, then s0 is foo,     * s1 is bar and s2 is null     */package net.tinyos.packet;class ParseArgs {	String tokens[];	int tokenIndex;	ParseArgs(String s, String delimiterSequence) {	    int count = delimiterSequence.length();	    tokens = new String[count + 1];	    tokenIndex = 0;	    // Fill in the tokens	    int i = 0, lastMatch = 0;	    while (i < count) {		int pos = s.indexOf(delimiterSequence.charAt(i++));		if (pos >= 0) {		    // When we finally find a delimiter, we know where		    // the last token ended		    tokens[lastMatch] = s.substring(0, pos);		    lastMatch = i;		    s = s.substring(pos + 1);		}	    }	    tokens[lastMatch] = s;	}	String next() {	    return tokens[tokenIndex++];	}}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -