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

📄 list.java

📁 关于R+树的java源码
💻 JAVA
字号:
/*
	COMP 630C project
	Re-implementation of R+ tree

	Group member:
	Cheng Wing Hang, Nelson
	Cheung Kwok Ho, Steven
	Ngai Ming Wai, Ryan
	Shiu Hoi Nam
	Tsui Chi Man
*/

import java.*;

public class LIST {

	CELL    head ;  // Head of a list of MBRs

   // constructor
	public LIST()
	{
		this.head = null ;
	}

   // constructor
	public LIST(CELL c) {
		CELL    ptr, temp_cell;
		MBR	temp_mbr;

		ptr = c;
		this.head = null;
		while (ptr != null) {
			temp_cell = new CELL(ptr.current);
		
			if (this.head == null) {
				this.head = temp_cell;
			}
			else {
				this.head.prev = temp_cell;
				temp_cell.next = this.head;
				this.head = temp_cell;
			}	

			ptr = ptr.next;
		}
	}

   // insert a cell into the list of MBR
	public void insertList(CELL newCell)
	{
                if (this.head!=null)
                {
                        this.head.prev = newCell ;
                }
		newCell.next = this.head ;
		this.head = newCell ;
	}

        // print the content of whole list
        public void print() {
                CELL curr_cell;

                for (curr_cell = this.head;
                     curr_cell != null;
                     curr_cell = curr_cell.next) {
                     curr_cell.current.print();
                }
        }

}

⌨️ 快捷键说明

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