亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? htmltree.java

?? java html 解析小程序,文件包很小
?? JAVA
字號:
/* * HTML Parser * Copyright (C) 1997 David McNicol * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * file COPYING for more details. */package cvu.html;import java.util.Enumeration;/** * This class stores an HTML file in tree format. It can be constructed * from an HTMLTokenizer or a file name, in which case it will create its * own tokenizer. <p> * Once the HTML file has been parsed a number of search operations can * be performed. The nature of the searches are described below, but some * of their uses are highlighted here: <p> * <ul> * <li>Subtree - Finding all of the FORM elements within a BODY element. * <li>Sibling - Finding all the LI elements within the same UL element. * <li>All - Finding every occurence of the A element. * </ul> * There is also a context search, which performs a subtree search on the * specified element's parent. This can be thought of as a combination * between as sibling search and a subtree search. * @see HTMLTokenizer * @author <a href="http://www.strath.ac.uk/~ras97108/">David McNicol</a> */public class HTMLTree {	private HTMLNode root; // The root of the HTML tree.	/**	 * Constructs a new HTMLTree using the tokens from the	 * specified Enumeration.	 */	public HTMLTree (Enumeration e) {		// Create the root element from the enumeration of tokens.		root = new HTMLNode(null, null, e);	}	/**	 * Constructs a new HTMLTree using the tokens from the	 * specified HTMLTokenizer.	 * @param ht the source of the HTML tokens.	 */	public HTMLTree (HTMLTokenizer ht) {		// Create the root element from the tokens.		root = new HTMLNode(null, null, ht.getTokens());	}	/**	 * Constructs a new HTMLTree from the specified HTML file.	 * @param filename the name of the HTML file.	 */	public HTMLTree (String filename) {		// Tokenize the HTML file.		HTMLTokenizer ht = new HTMLTokenizer(filename);		// Create the root element from the tokens.		root = new HTMLNode(null, null, ht.getTokens());	}	/**	 * Finds the first element with the specified name in the specified	 * subtree.	 * @param name the name of the element to search for.	 * @param tree the subtree to search.	 */	public HTMLNode findInSubtree (String name, HTMLNode tree) {		return find(name, tree, null, true, false);	}	/**	 * Finds the next element after the specified one in the subtree.	 * If the previous element is not in the subtree then nothing will	 * be found.	 * @param tree the subtree to search.	 * @param prev a previously found element.	 */	public HTMLNode findNextInSubtree (HTMLNode tree,	  HTMLNode prev) {		// Return nothing if there is no previous element.		if (prev == null) return null;		// Search the subtree for the next element with the same name.		return find(prev.getName(), tree, prev, true, false);	}	/**	 * Finds the first element with the specified name in the entire	 * tree.	 * @param name the name of the element to search for.	 */	public HTMLNode findInAll (String name) {		return find(name, root, null, true, false);	}	/**	 * Finds the next element with the same name as the one specified	 * in the entire tree.	 * @param prev the previously found element.	 */	public HTMLNode findNextInAll (HTMLNode prev) {		// Return nothing if there is no previous element.		if (prev == null) return null;		// Search for the next element in the entire tree.		return find(prev.getName(), prev.getParent(), prev, true, true);	}	/**	 * Find the first element with the specified name in the specified	 * element's context (that is, the elements parent's subtree).	 * @param name the name of the element to search for.	 * @param el the element whose context is to be searched.	 */	public HTMLNode findInContext (String name, HTMLNode el) {		// Return nothing if the arguments are invalid.		if (el == null) return null;		// Search the elements parent's subtree.		return find(name, el.getParent(), null, true, false);	}	/**	 * Find the next element with the same name as the specified one	 * in the first element's context (that is, the first elements	 * parent's subtree).	 * If the previous element is not in the subtree then nothing	 * will be found.	 * @param el the element whose context is to be searched.	 * @param the previously found element.	 */	public HTMLNode findNextInContext (HTMLNode el,	  HTMLNode prev) {		// Return nothing if the arguments are invalid.		if (el == null) return null;		// Search the elements parent's subtree.		return find(el.getName(), el.getParent(), prev, true, false);	}	/**	 * Finds the next element with the same name as the specified	 * one amongst that elements siblings (that is, the elements	 * parent's children).	 * @param el the element whose siblings are to be searched.	 */	public HTMLNode findSibling (HTMLNode el) {		// Return nothing if the element is invalid.		if (el == null) return null;		// Search for a sibling in the elements parent's subtree.		return find(el.getName(), el.getParent(), el, false, false);	}	/**	 * Prints a string representation of the HTMLTree.	 */	public String toString () {		return "HTMLTree[" + root + "]";	}	/**	 * Generic find method which searches for a string in the given	 * tree's children. However, the search will not start until the	 * start element has been passed. The tree's grandchildren will	 * be searched recursively if the <code>recursive</code> argument	 * is true. The whole tree after the element will be searched	 * if the <code>searchParent</code> argument is true. In this	 * case the method will recurse back towards the root element.	 */	private HTMLNode find (String name, HTMLNode tree,	  HTMLNode start, boolean recursive, boolean searchParent) {		Enumeration children; // The immediate children of the subtree.		Object next;	      // The next object from the enumeration.		boolean searching;    // True if we are actively searching.		HTMLNode child;    // One of the subtree's children.		HTMLNode found;    // Result of a subtree search.		// Return nothing if the arguments are invalid.		if (name == null || tree == null) return null;		// Check if we should delay the search until we find the		// specified start element.		searching = (start == null);		// Get the subtree's children.		children = tree.getChildren();		// Return nothing if the subtree has no children.		if (children == null) return null;				// Loop through the subtree's children.		while (children.hasMoreElements()) {			// Get the next child from the enumeration.			next = children.nextElement();			// Check if this child is an HTMLNode.			if (! (next instanceof HTMLNode)) continue;			// Cast the child into type HTMLNode.			child = (HTMLNode) next;			if (searching) {				// Check if we have found the element.				if (name.equalsIgnoreCase(child.getName()))					return child;				// Check if we should search grandchildren.				if (recursive) {					// Search the child's subtree.					found = find(name, child, null, true,					  false);					// Return the element if we found one.					if (found != null) return found;				}			} else {				// Check if this element is the start element.				if (child == start) searching = true;			}		}		// Check if we should search the subtree's parent tree.		if (searchParent) {			HTMLNode parent = tree.getParent();			// Check if the subtree has a parent.			if (parent == null) return null;			// Otherwise search it, starting after the subtree.			return find(name, parent, tree, true, true);		}		return null;	}}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品小仙女| 日韩欧美一区在线观看| 成人深夜视频在线观看| 国产一区欧美二区| 国产麻豆精品久久一二三| 久久国产婷婷国产香蕉| 麻豆极品一区二区三区| 国产综合成人久久大片91| 国产在线观看一区二区| 国产精品456| 99久久99久久精品免费观看| 色婷婷综合久久久久中文一区二区 | 国产精品美女久久久久高潮| 国产精品久久二区二区| 中文字幕亚洲一区二区va在线| 国产精品久久久久久久久久免费看 | 久久婷婷综合激情| 久久久影院官网| 欧美高清一级片在线观看| 成人免费视频在线观看| 亚洲第一福利视频在线| 蜜桃传媒麻豆第一区在线观看| 国产一区二区三区免费看| 成人综合婷婷国产精品久久蜜臀| 久久视频一区二区| 欧美喷水一区二区| 精品久久久久99| 国产精品福利一区二区| 亚洲综合一区在线| 老司机一区二区| 成人免费毛片app| 一本久道久久综合中文字幕| 欧美日韩在线亚洲一区蜜芽| 精品国产免费一区二区三区四区| 国产亚洲精品7777| 一区二区三区四区在线播放 | 成人午夜激情视频| 日本乱人伦一区| 日韩一区二区视频| 国产精品麻豆久久久| 亚洲成年人网站在线观看| 国产麻豆精品95视频| 色偷偷88欧美精品久久久| 日韩欧美中文字幕公布| 国产精品久久久久影院色老大| 午夜精品久久久久影视| 国产精品亚洲成人| 欧美在线视频日韩| 久久久精品中文字幕麻豆发布| 一区二区三区高清在线| 狠狠色狠狠色综合| 色婷婷久久一区二区三区麻豆| 精品国产免费一区二区三区香蕉| 亚洲三级理论片| 黑人巨大精品欧美一区| 欧美亚洲综合色| 国产精品美女视频| 久久超级碰视频| 欧美丝袜丝nylons| 中文字幕乱码日本亚洲一区二区| 肉色丝袜一区二区| 99精品欧美一区| 久久精品亚洲一区二区三区浴池| 亚洲伊人色欲综合网| 成人在线综合网| 日韩一级欧美一级| 一区二区三区在线免费视频| 国产精品一二三四区| 欧美夫妻性生活| 夜夜嗨av一区二区三区中文字幕 | www.欧美精品一二区| 日韩免费电影网站| 首页综合国产亚洲丝袜| 91年精品国产| 国产婷婷色一区二区三区| 日本午夜一本久久久综合| 一本大道久久a久久综合| 日本一区二区三区在线观看| 另类综合日韩欧美亚洲| 欧美日韩精品欧美日韩精品一综合| 中文字幕av不卡| 国产精品影视天天线| 欧美成人激情免费网| 日韩国产欧美在线视频| 欧美性三三影院| 亚洲色图欧美激情| www.爱久久.com| 国产嫩草影院久久久久| 国产成人精品一区二区三区网站观看| 欧美成人女星排名| 蓝色福利精品导航| 欧美成人一级视频| 久草精品在线观看| 日韩午夜在线观看视频| 日韩电影在线观看电影| 欧美精品在线视频| 日本成人中文字幕在线视频| 欧美妇女性影城| 日本vs亚洲vs韩国一区三区二区 | 日本乱人伦一区| 日韩欧美一二三| 中文字幕第一页久久| 国产一区二区视频在线播放| 日韩美一区二区三区| 久久99久国产精品黄毛片色诱| 欧美一区午夜视频在线观看| 亚洲成人激情社区| 欧美丰满少妇xxxbbb| 青青草国产成人av片免费| 日韩欧美视频一区| 国产综合久久久久久鬼色 | 日韩精品色哟哟| 日韩久久免费av| 国产精品18久久久久久久网站| 久久久国产精品不卡| 国产精品一二一区| 国产精品国产馆在线真实露脸| 97久久超碰国产精品| 亚洲精品久久久蜜桃| 欧美日韩一区国产| 日本女优在线视频一区二区| 欧美成人一区二区三区片免费| 国产精一品亚洲二区在线视频| 国产亚洲欧洲一区高清在线观看| 成人精品国产福利| 亚洲精品国产品国语在线app| 欧美日韩日日摸| 麻豆久久久久久久| 国产精品色噜噜| 欧美丝袜丝交足nylons| 麻豆高清免费国产一区| 欧美经典一区二区三区| 色综合久久久网| 日韩高清在线一区| 国产日韩在线不卡| 欧美性生活大片视频| 蜜臀av在线播放一区二区三区| 26uuu色噜噜精品一区二区| a级精品国产片在线观看| 亚洲第一福利视频在线| 久久网站热最新地址| 日本精品一区二区三区四区的功能| 午夜伊人狠狠久久| 国产午夜亚洲精品理论片色戒| 日本高清视频一区二区| 久久99精品网久久| 亚洲少妇屁股交4| 91精品国产一区二区人妖| 国产精品一级黄| 婷婷综合五月天| 国产精品久久久久aaaa| 欧美一级视频精品观看| 成人国产在线观看| 蜜桃视频一区二区三区在线观看 | 精品一区二区三区视频在线观看| 《视频一区视频二区| 日韩一区二区不卡| 色婷婷综合久久久中文一区二区| 激情综合亚洲精品| 亚洲成人777| 最新国产精品久久精品| 日韩美女视频一区二区在线观看| 色8久久精品久久久久久蜜| 国产在线不卡一卡二卡三卡四卡| 亚洲国产你懂的| 国产精品国产自产拍高清av| 精品剧情在线观看| 欧美日韩视频在线观看一区二区三区 | 国产 欧美在线| 奇米精品一区二区三区在线观看一 | 91片在线免费观看| 精彩视频一区二区| 偷拍与自拍一区| 一区二区在线观看不卡| 国产日韩欧美不卡在线| 欧美一区二区三区视频免费播放| 色综合久久中文综合久久牛| 国产成人午夜高潮毛片| 久久精品国产免费看久久精品| 亚洲一区日韩精品中文字幕| 中文字幕五月欧美| 国产日产欧产精品推荐色| 日韩午夜激情电影| 欧美视频在线播放| 日本高清无吗v一区| 成人久久久精品乱码一区二区三区| 久草中文综合在线| 日本午夜一本久久久综合| 亚洲国产毛片aaaaa无费看| 亚洲三级在线免费| 国产精品毛片无遮挡高清| 日本一区二区三区免费乱视频| 欧美精品一区二区三区在线| 91精品国产色综合久久不卡电影| 在线视频综合导航| 91视频一区二区| av日韩在线网站| 成人免费黄色在线| 丁香婷婷综合色啪| 大美女一区二区三区|