dataparser.java

来自「高质量Java程序设计 源代码」· Java 代码 · 共 49 行

JAVA
49
字号
package net.betterjava.sample.xml.bind;

/**
 * This interface allows an application to break string into tokens.
 * The set of delimiters (the characters that separate tokens) may 
 * be specified by the implementation
 */
public interface DataParser {
	/**
	 * use to clean any expensive resource .
	 */
	void cleanup();
	/**
	 * get the postfix, for example:
	 * the post fix of "logo01" is "01"	.
	 * If s is null, will throw NullPointerException.
	 * @return the postfix or "".
	 */
	public String getPostfix(String s);
	/**
	 * get the postfix, for example:
	 * the pre fix of "logo01" is "logo"
	 * If s is null, will throw NullPointerException.
	 * @return the prefix or "".
	 */
	public String getPrefix(String s);
	/**
	 * Tests if there are more tokens available from this 
	 * tokenizer's string. If this method returns true, then 
	 * a subsequent call to nextToken with no argument will 
	 * successfully return a token. 
		* @return true if and only if there is at least one token 
		* in the string after the current position; false otherwise.
		* @roseuid 3CE02C9501B4
		*/
	public boolean hasNextToken();
	/**
	 * Returns the next token 
		* @return the next token
		* @roseuid 3CE02CAD0136
		*/
	public String nextToken() throws WrongFormatException;
	/**
	 * set the data used to parse
	 * @roseuid 3CE02CAD0136
	*/
	void setData(String data);
}

⌨️ 快捷键说明

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