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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? rtree.java

?? 一個(gè)java實(shí)現(xiàn)的R樹
?? JAVA
?? 第 1 頁 / 共 2 頁
字號(hào):
package rtree;import java.util.*;/** * To create a new RTree use the first two constructors. You must specify the dimension, the fill factor as * a float between 0 and 0.5 (0 to 50% capacity) and the variant of the RTree which is one of: * <ul> *  <li>RTREE_QUADRATIC</li> * </ul> * The first constructor creates by default a new memory resident page file. The second constructor takes * the page file as an argument. If the given page file is not empty, then all data are deleted. * <p> * The third constructor initializes the RTree from an already filled page file. Thus, you may store the * RTree into a persistent page file and recreate it again at any time. * <p> * Created: Tue May 18 12:57:35 1999 * <p> * @author Hadjieleftheriou Marios * @version 1.003 */public class RTree {    public final String version = "1.003";    public final String date = "December 7th 1999";    /** Page file where data is stored. */    protected PageFile file = null;    /** static identifier used for the parent of the root node. */    public static final int NIL = -1;    /** Available RTree variants. */    public static final int RTREE_LINEAR = 0;    public static final int RTREE_QUADRATIC = 1;    public static final int RTREE_EXPONENTIAL = 2;    public static final int RSTAR = 3;    /**      * Creates a memory resident RTree with an empty root node, which is stored in page 0 and has a      * parent identifier equal to NIL. A new memory page file is created and used as a storage manager     * by default.     *     * @param  dimension  The data dimension.     * @param  fillFactor A percentage between 0 and 0.5. Used to calculate minimum number of entries     *                    present in each node.     * @param  capacity   The maximun number of entries that each node can hold.     * @param  type       The RTree variant to use.     */    public RTree(int dimension, float fillFactor, int capacity, int type) {	this(dimension, fillFactor, capacity, new MemoryPageFile(), type);    }    /**      * Creates a new RTree with an empty root node, which is stored in page 0 and has     * a parent identifier equal to NIL. The given page file is used for storing the rtree nodes.     * If the page file is not empty, than all entries will be overwritten.     *     * @param  dimension  The data dimension.     * @param  fillFactor A percentage between 0 and 0.5. Used to calculate minimum number of entries     *                    present in each node.     * @param  capacity   The maximun number of entries that each node can hold.     * @param  file       The page file to use for storing the nodes of the rtree.     * @param  type       The RTree variant to use.     */    public RTree(int dimension, float fillFactor, int capacity, PageFile file, int type) {	if (dimension <= 1) {	    throw new IllegalArgumentException("Dimension must be larger than 1.");	}	if (fillFactor < 0 || fillFactor > 0.5) {	    throw new IllegalArgumentException("Fill factor must be between 0 and 0.5.");	}	if (capacity <= 1) {	    throw new IllegalArgumentException("Capacity must be larger than 1.");	}	if (type != RTREE_QUADRATIC /*&& type != RTREE_LINEAR && type != RTREE_EXPONENTIAL && type != RSTAR*/) {	    throw new IllegalArgumentException("Invalid tree type.");	}	if (file.tree != null) {	    throw new IllegalArgumentException("PageFile already in use by another rtree instance.");	}	file.initialize(this, dimension, fillFactor, capacity, type);	this.file = file;	Leaf root = new Leaf(this, NIL, 0);	file.writeNode(root);    }    /**     * Creates an rtree from an already initialized page file, probably stored into persistent storage.     */    public RTree(PageFile file) {	if (file.tree != null) {	    throw new IllegalArgumentException("PageFile already in use by another rtree instance.");	}	if (file.treeType == -1) {	    throw new IllegalArgumentException("PageFile is empty. Use some other RTree constructor.");	}	file.tree = this;	this.file = file;    }    /**     * Retruns the maximun capacity of each Node.     */    public int getNodeCapacity() {	return file.nodeCapacity;    }    /**      * Returns the percentage between 0 and 0.5, used to calculate minimum number of entries     * present in each node.     */    public float getFillFactor() {	return file.fillFactor;    }    /**      * Returns the data dimension.     */    public int getDimension() {	return file.dimension;    }    /**      * Returns the page length.     */    public int getPageSize() {	return file.pageSize;    }    /**      * Returns the level of the root Node, which signifies the level of the whole tree. Loads one     * page into main memory.     */    public int getTreeLevel() {	return  file.readNode(0).getLevel();    }    /**      * Returns the RTree variant used.      */    public int getTreeType() {	return file.treeType;    }    /**     * Inserts a HyperCube into the tree, pointing to the data stored at the given page number.     *     * @param h The hypercube to insert.     * @param page The page where the real data is stored.     * @return The page number of the Leaf where the hypercube was inserted (the parent of the     *         data entry.)     */    public int insert(HyperCube h, int page) {	if (h  == null) {	    throw new IllegalArgumentException("HyperCube cannot be null.");	}	if (h.getDimension() != file.dimension) {	    throw new IllegalArgumentException("HyperCube dimension different than RTree dimension.");	}	AbstractNode root = file.readNode(0);	Leaf l = root.chooseLeaf(h);	return l.insert(h, page);    }    /**     * Deletes a HyperCube from the leaf level of the tree. If there is no leaf containg a hypercube     * that matches the given hypercube, the tree is left intact.     *     * @param h The HyperCube to delete.     * @return The data pointer of the deleted entry, NIL if no matching entry was found.     */    public int delete(HyperCube h) {	if (h == null) {	    throw new IllegalArgumentException("HyperCube cannot be null.");	}	if (h.getDimension() != file.dimension) {	    throw new IllegalArgumentException("HyperCube dimension different than RTree dimension.");	}	AbstractNode root = file.readNode(0);	Leaf l = root.findLeaf(h);	if (l != null) {	    return l.delete(h);	}	return NIL;    }    /**     * Returns a Vector containing all tree nodes from bottom to top, left to right.     * CAUTION: If the tree is not memory resident, all nodes will be loaded into main memory.     *     * @param root The node from which the traverse should begin.     * @return A Vector containing all Nodes in the correct order.     */    public Vector traverseByLevel(AbstractNode root) {	if (root == null) {	    throw new IllegalArgumentException("Node cannot be null.");	}	Vector ret = new Vector();	Vector v = traversePostOrder(root);	for (int i = 0; i <= getTreeLevel(); i++) {	    Vector a = new Vector();	    for (int j = 0; j < v.size(); j++) {		Node n = (Node) v.elementAt(j);		if (n.getLevel() == i) {		    a.addElement(n);		}	    }	    for (int j = 0; j < a.size(); j++) {		ret.addElement(a.elementAt(j));	    }	}	return ret;    }    /**     * Returns an Enumeration containing all tree nodes from bottom to top, left to right.     *     * @return An Enumeration containing all Nodes in the correct order.     */    public Enumeration traverseByLevel() {	class ByLevelEnum implements Enumeration {	    // there is at least one node, the root node.	    private boolean hasNext = true;	    private Vector nodes;	    private int index = 0;	    public ByLevelEnum() {		AbstractNode root = file.readNode(0);		nodes = traverseByLevel(root);	    }	    public boolean hasMoreElements() {		return hasNext;	    }	    public Object nextElement() {		if (! hasNext) {		    throw new NoSuchElementException("traverseByLevel");		}		Object n = nodes.elementAt(index);		index++;		if (index == nodes.size()) {		    hasNext = false;		}		return n;	    }	};	return new ByLevelEnum();    }    /**     * Post order traverse of tree nodes.      * CAUTION: If the tree is not memory resident, all nodes will be loaded into main memory.     *     * @param root The node where the traversing should begin.     * @return A Vector containing all tree nodes in the correct order.     */    public Vector traversePostOrder(AbstractNode root) {	if (root == null) {	    throw new IllegalArgumentException("Node cannot be null.");	}	Vector v = new Vector();	v.addElement(root);	if (root.isLeaf()) {	} else {	    for (int i = 0; i < root.usedSpace; i++) {		Vector a = traversePostOrder(((Index) root).getChild(i));		for (int j = 0; j < a.size(); j++) {		    v.addElement(a.elementAt(j));		}	    }	}	return v;    }    /**     * Post order traverse of all tree nodes, begging with root.     * CAUTION: If the tree is not memory resident, all nodes will be loaded into main memory.     *     * @return An Enumeration containing all tree nodes in the correct order.     */    public Enumeration traversePostOrder() {	class PostOrderEnum implements Enumeration {	    private boolean hasNext = true;	    private Vector nodes;	    private int index = 0;	    public PostOrderEnum() {		AbstractNode root = file.readNode(0);		nodes = traversePostOrder(root);	    }	    public boolean hasMoreElements() {		return hasNext;	    }	    public Object nextElement() {		if (! hasNext) {		    throw new NoSuchElementException("traversePostOrder");		}		Object n = nodes.elementAt(index);		index++;		if (index == nodes.size()) {		    hasNext = false;		}		return n;	    }	};	return new PostOrderEnum();    }    /**     * Pre order traverse of tree nodes.     * CAUTION: If the tree is not memory resident, all nodes will be loaded into main memory.     *     * @param root The node where the traversing should begin.     * @return A Vector containing all tree nodes in the correct order.     */    public Vector traversePreOrder(AbstractNode root) {	if (root == null) {	    throw new IllegalArgumentException("Node cannot be null.");	}	Vector v = new Vector();	if (root.isLeaf()) {	    v.addElement(root);	} else {	    for (int i = 0; i < root.usedSpace; i++) {		Vector a = traversePreOrder(((Index) root).getChild(i));		for (int j = 0; j < a.size(); j++) {		    v.addElement(a.elementAt(j));		}	    }	    v.addElement(root);	}	return v;    }    /**     * Pre order traverse of all tree nodes, begging with root.     * CAUTION: If the tree is not memory resident, all nodes will be loaded into main memory.     *

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品国产三级国产普通话蜜臀 | 一区二区三国产精华液| 国产三级久久久| 欧美精品一区二区三区在线播放| 欧美一区二区三区四区视频 | 日韩美女视频一区| 欧美激情资源网| 欧美国产乱子伦| 国产精品国模大尺度视频| 国产精品久久久久一区| 中文字幕在线观看不卡| 日韩一区欧美小说| 亚洲欧美偷拍另类a∨色屁股| 一区在线中文字幕| 亚洲丝袜美腿综合| 亚洲综合一区二区三区| 亚洲国产你懂的| 日韩精品亚洲一区| 日韩精品午夜视频| 国内精品免费**视频| 成人爽a毛片一区二区免费| 久久伊99综合婷婷久久伊| 久久一二三国产| 中文字幕免费不卡| 亚洲精选视频免费看| 一区二区三区在线视频免费| 香蕉av福利精品导航| 美国十次了思思久久精品导航| 精品中文字幕一区二区| 国产成人在线网站| 一本大道av伊人久久综合| 欧美在线你懂得| 在线91免费看| 久久一留热品黄| 中文字幕一区二区三区四区不卡 | 99久精品国产| 欧美日韩一区二区三区在线看| 欧美一区二区免费视频| 国产日产亚洲精品系列| 亚洲激情在线激情| 日本中文一区二区三区| 国产一区视频在线看| 成人黄页在线观看| 欧美日韩性生活| 久久久亚洲欧洲日产国码αv| 国产精品第五页| 亚洲国产成人av| 韩国精品在线观看| 在线精品观看国产| 欧美哺乳videos| 日韩理论片中文av| 麻豆精品精品国产自在97香蕉| 成人综合婷婷国产精品久久| 欧美日韩成人在线一区| 国产日韩精品一区二区三区在线| 亚洲资源中文字幕| 国产精品一区久久久久| 色哟哟欧美精品| 26uuu亚洲综合色| 一区二区三区免费在线观看| 激情都市一区二区| 欧美曰成人黄网| 欧美国产丝袜视频| 日韩av成人高清| av一本久道久久综合久久鬼色| 91精品国产色综合久久久蜜香臀| 国产精品色一区二区三区| 日韩电影在线观看一区| 91丝袜美腿高跟国产极品老师 | 日本一区二区三区久久久久久久久不| 一区二区欧美在线观看| 国产精品456| 91精品免费在线观看| 91在线观看高清| 精品免费国产一区二区三区四区| 亚洲欧洲综合另类| 成人综合婷婷国产精品久久| 欧美成人性战久久| 亚洲gay无套男同| 91免费看`日韩一区二区| 久久亚洲精华国产精华液| 亚洲国产精品一区二区尤物区| www.在线欧美| 欧美韩日一区二区三区| 国内精品国产三级国产a久久| 制服丝袜亚洲色图| 亚洲一区av在线| 91免费看片在线观看| 国产精品黄色在线观看| 国产精品中文字幕一区二区三区| 日韩欧美一二三| 丝袜亚洲精品中文字幕一区| 一本大道久久a久久综合| 亚洲欧洲av在线| 国产a区久久久| 国产午夜精品理论片a级大结局| 蜜桃精品视频在线观看| 欧美一区二区观看视频| 五月婷婷综合激情| 欧美老人xxxx18| 香蕉久久夜色精品国产使用方法 | 综合久久给合久久狠狠狠97色| 国产成人午夜视频| 久久久久久久久久久99999| 久久99国产精品免费网站| 欧美一区二区福利在线| 久久国产精品99久久人人澡| 日韩一本二本av| 看电视剧不卡顿的网站| 26uuu国产日韩综合| 精品伊人久久久久7777人| 精品久久人人做人人爰| 精品制服美女久久| 精品国产区一区| 国产精品伊人色| 国产精品日韩成人| 成人免费va视频| 亚洲人成在线播放网站岛国| 色综合久久久久久久| 一区二区三区在线免费视频| 欧美日韩激情一区二区三区| 五月天亚洲婷婷| 欧美一区二区三区四区视频| 久久99久久99小草精品免视看| 精品国产乱码久久| 成人黄色大片在线观看| 亚洲一区二区三区四区在线观看 | 亚洲欧美日韩小说| 欧美性猛交xxxxxx富婆| 日韩影院免费视频| 26uuu精品一区二区三区四区在线 26uuu精品一区二区在线观看 | 亚洲成人www| 日韩一区二区高清| 国产精品一区免费在线观看| 综合色中文字幕| 欧美日韩精品专区| 国产综合成人久久大片91| 成人免费一区二区三区视频| 欧美三区免费完整视频在线观看| 婷婷一区二区三区| 精品国产伦一区二区三区观看方式 | 国产精品乡下勾搭老头1| 国产精品九色蝌蚪自拍| 欧美丰满少妇xxxxx高潮对白| 精品一区免费av| 亚洲人成7777| 日韩欧美激情在线| a美女胸又www黄视频久久| 亚洲午夜视频在线| 久久免费电影网| 色综合天天综合| 秋霞电影一区二区| 亚洲欧洲国产日本综合| 9191国产精品| 成人中文字幕电影| 五月天亚洲精品| 国产精品久久久久影院亚瑟 | 亚洲与欧洲av电影| 精品久久久久久无| 91国偷自产一区二区使用方法| 美国三级日本三级久久99| 日韩理论片在线| 精品蜜桃在线看| 欧洲国内综合视频| 国产精品996| 日韩精品一级中文字幕精品视频免费观看 | 国产一区二区成人久久免费影院 | 麻豆成人久久精品二区三区红 | 亚洲精品自拍动漫在线| 欧美成人官网二区| 欧美色网站导航| 国产91精品一区二区麻豆网站 | 国产麻豆9l精品三级站| 亚洲成人免费观看| 中文字幕日韩一区二区| 精品国产一区二区三区不卡| 欧美系列亚洲系列| 成人av手机在线观看| 韩国毛片一区二区三区| 视频一区二区三区入口| 亚洲精品乱码久久久久| 国产日本欧美一区二区| 日韩视频在线永久播放| 欧美午夜片在线看| 91免费在线播放| 国产99久久久精品| 国产又粗又猛又爽又黄91精品| 性做久久久久久久免费看| 亚洲乱码中文字幕| 中文字幕日韩av资源站| 日本一区二区三区高清不卡| 久久久久国产精品麻豆| 日韩女优av电影| 欧美一级一区二区| 欧美日本在线看| 一区二区三区精密机械公司| 国产精品人人做人人爽人人添| 国产欧美一区二区三区在线老狼| 91精品啪在线观看国产60岁| 欧美剧情电影在线观看完整版免费励志电影 |