📄 simplehtmltoken.java
字号:
package bplatt.spider;
/**
* SimpleHTMLToken - an HTML Token
* Copyright 2002, Robert L. Platt, All rights reserved
* @author Robert L. Platt
*
*/
import java.io.*;
public class SimpleHTMLToken {
public static final int TAG = 0;
public static final int ENDTAG = 1;
public static final int CONTENT = 2;
private static final int UNDEFINED = -1;
private int type;
private String content;
/**
* Constructor for SimpleHTMLToken.
*/
public SimpleHTMLToken() {
type = UNDEFINED;
content = null;
}
/**
* Constructor for SimpleHTMLToken.
*/
public SimpleHTMLToken(int type, String content) {
this.type = type;
this.content = content;
}
/**
* Returns the content.
* @return String
*/
public String getContent() {
return content;
}
/**
* Returns the type.
* @return int
*/
public int getType() {
return type;
}
/**
* Sets the content.
* @param content The content to set
*/
public void setContent(String content) {
this.content = content;
}
/**
* Sets the type.
* @param type The type to set
*/
public void setType(int type) {
this.type = type;
}
/**
* dump - used for debugging
*/
public void dump(PrintStream out)
{
switch(type) {
case UNDEFINED: out.println("Error!");
break;
case TAG: out.println("<" + content + ">");
break;
case ENDTAG: out.println("</"+ content + ">");
break;
case CONTENT: out.println("\"" + content + "\"");
break;
default: out.println("Error!");
break;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -