📄 readnode.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.4.2_04) on Wed Sep 08 18:10:24 IST 2004 -->
<TITLE>
ReadNode
</TITLE>
<META NAME="keywords" CONTENT="rtree.ReadNode class">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
parent.document.title="ReadNode";
}
</SCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A><A HREF="#skip-navbar_top" title="Skip navigation links"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/ReadNode.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../rtree/Point.html" title="class in rtree"><B>PREV CLASS</B></A>
<A HREF="../rtree/Rect.html" title="class in rtree"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../index.html" target="_top"><B>FRAMES</B></A>
<A HREF="ReadNode.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: NESTED | <A HREF="#fields_inherited_from_class_rtree.Node">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A><!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
rtree</FONT>
<BR>
Class ReadNode</H2>
<PRE>
java.lang.Object
<IMG SRC="../resources/inherit.gif" ALT="extended by"><A HREF="../rtree/Node.html" title="class in rtree">rtree.Node</A>
<IMG SRC="../resources/inherit.gif" ALT="extended by"><B>rtree.ReadNode</B>
</PRE>
<DL>
<DT><B>All Implemented Interfaces:</B> <DD>java.lang.Cloneable</DD>
</DL>
<HR>
<DL>
<DT> class <B>ReadNode</B><DT>extends <A HREF="../rtree/Node.html" title="class in rtree">Node</A></DL>
<P>
* * This is a special purpose class that is alowed read only operartion on tree. Any write operation * would give error. * This class was necessary to solve the following problem. Since none of the nodes are cloned when given * to the clients, they can become problematic when multiple reads on the same node is going on. * Because of the new buffer policy we do not clone node, it is like a single node in the whole system. * But the obvious problem is multiple read threads when reading nodes. * No though problem when writing as the whole tree is locked. What we can do is that clients themselves * tell the cache that they need a cloned node and that it willnot be used for write purpose. * This class does exactly that. *
<P>
<P>
<DL>
<DT><B>Author:</B></DT> <DD>Prachuryya Barua</DD></DL>
<HR>
<P>
<!-- ======== NESTED CLASS SUMMARY ======== -->
<!-- =========== FIELD SUMMARY =========== -->
<A NAME="field_summary"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Field Summary</B></FONT></TD>
</TR>
</TABLE>
<A NAME="fields_inherited_from_class_rtree.Node"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TD><B>Fields inherited from class rtree.<A HREF="../rtree/Node.html" title="class in rtree">Node</A></B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../rtree/Node.html#CACHE_SIZE">CACHE_SIZE</A>, <A HREF="../rtree/Node.html#dirty">dirty</A>, <A HREF="../rtree/Node.html#elements">elements</A>, <A HREF="../rtree/Node.html#elementSize">elementSize</A>, <A HREF="../rtree/Node.html#elementType">elementType</A>, <A HREF="../rtree/Node.html#file">file</A>, <A HREF="../rtree/Node.html#FILE_HDR_SIZE">FILE_HDR_SIZE</A>, <A HREF="../rtree/Node.html#fileHdr">fileHdr</A>, <A HREF="../rtree/Node.html#fileName">fileName</A>, <A HREF="../rtree/Node.html#FREE_LIST_LIMIT">FREE_LIST_LIMIT</A>, <A HREF="../rtree/Node.html#INTEGER_SIZE">INTEGER_SIZE</A>, <A HREF="../rtree/Node.html#LEAF_NODE">LEAF_NODE</A>, <A HREF="../rtree/Node.html#LONG_SIZE">LONG_SIZE</A>, <A HREF="../rtree/Node.html#MAX">MAX</A>, <A HREF="../rtree/Node.html#MIN">MIN</A>, <A HREF="../rtree/Node.html#NODE_BODY_SIZE">NODE_BODY_SIZE</A>, <A HREF="../rtree/Node.html#NODE_HDR_SIZE">NODE_HDR_SIZE</A>, <A HREF="../rtree/Node.html#NODE_SIZE">NODE_SIZE</A>, <A HREF="../rtree/Node.html#nodeIndex">nodeIndex</A>, <A HREF="../rtree/Node.html#nodeMBR">nodeMBR</A>, <A HREF="../rtree/Node.html#NONE">NONE</A>, <A HREF="../rtree/Node.html#NONLEAF_NODE">NONLEAF_NODE</A>, <A HREF="../rtree/Node.html#NOT_DEFINED">NOT_DEFINED</A>, <A HREF="../rtree/Node.html#NOT_DEFINED_LONG">NOT_DEFINED_LONG</A>, <A HREF="../rtree/Node.html#parent">parent</A>, <A HREF="../rtree/Node.html#READ">READ</A>, <A HREF="../rtree/Node.html#sorted">sorted</A>, <A HREF="../rtree/Node.html#totalElements">totalElements</A>, <A HREF="../rtree/Node.html#WRITE">WRITE</A></CODE></TD>
</TR>
</TABLE>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_summary"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>(package private)</CODE></FONT></TD>
<TD><CODE><B><A HREF="../rtree/ReadNode.html#ReadNode()">ReadNode</A></B>()</CODE>
<BR>
</TD>
</TR>
</TABLE>
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Method Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../rtree/ReadNode.html#deleteElement(int, boolean)">deleteElement</A></B>(int index, boolean force)</CODE>
<BR>
This method delets the element with the given index from the node.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../rtree/ReadNode.html#deleteNode()">deleteNode</A></B>()</CODE>
<BR>
Adds the node to the free stack.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../rtree/ReadNode.html#flush()">flush</A></B>()</CODE>
<BR>
This is a new methos that will help the phylosophy where one should write to tbe cache only when required.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../rtree/Element.html" title="class in rtree">Element</A>[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../rtree/ReadNode.html#getAllElements()">getAllElements</A></B>()</CODE>
<BR>
Although it returns all the elements but the total elements will not be equal to the length of the returned array.Therefore <br><b>Never Use <code>.length</code> field With the Returned Array </b>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>(package private) <A HREF="../rtree/Rect.html" title="class in rtree">Rect</A>[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../rtree/ReadNode.html#getAllRectangles()">getAllRectangles</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>(package private) <A HREF="../rtree/Element.html" title="class in rtree">Element</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../rtree/ReadNode.html#getElement(int)">getElement</A></B>(int index)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../rtree/ReadNode.html#getElementIndex(long)">getElementIndex</A></B>(long ptr)</CODE>
<BR>
returns index of the element with the pointer passed in the parameter</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../rtree/ReadNode.html#getElementType()">getElementType</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../rtree/Element.html" title="class in rtree">Element</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../rtree/ReadNode.html#getLeastEnlargement(rtree.Element)">getLeastEnlargement</A></B>(<A HREF="../rtree/Element.html" title="class in rtree">Element</A> elmt)</CODE>
<BR>
Returns the element(of the current node) whose rectangle needs the least enlargment to include <code>elmt</code>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> long</CODE></FONT></TD>
<TD><CODE><B><A HREF="../rtree/ReadNode.html#getNodeIndex()">getNodeIndex</A></B>()</CODE>
<BR>
will return the index of the node.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../rtree/Rect.html" title="class in rtree">Rect</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../rtree/ReadNode.html#getNodeMBR()">getNodeMBR</A></B>()</CODE>
<BR>
This function runs a loop on the elements to calculate the total MBR.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> long</CODE></FONT></TD>
<TD><CODE><B><A HREF="../rtree/ReadNode.html#getParent()">getParent</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../rtree/ReadNode.html#getTotalElements()">getTotalElements</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../rtree/ReadNode.html#insertElement(rtree.Element)">insertElement</A></B>(<A HREF="../rtree/Element.html" title="class in rtree">Element</A> elmt)</CODE>
<BR>
to add an element at the end As elements are allocated to this node, each allocated element's children node's parent are reset.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../rtree/ReadNode.html#insertElement(rtree.Element[], boolean)">insertElement</A></B>(<A HREF="../rtree/Element.html" title="class in rtree">Element</A>[] elmts, boolean updateChldrn)</CODE>
<BR>
to add more than onr element at the end.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../rtree/ReadNode.html#isDirty()">isDirty</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>(package private) boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../rtree/ReadNode.html#isInsertPossible()">isInsertPossible</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static <A HREF="../rtree/ReadNode.html" title="class in rtree">ReadNode</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../rtree/ReadNode.html#makeReadNode(rtree.Node)">makeReadNode</A></B>(<A HREF="../rtree/Node.html" title="class in rtree">Node</A> node)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../rtree/ReadNode.html#modifyElement(int, rtree.Element)">modifyElement</A></B>(int index, <A HREF="../rtree/Element.html" title="class in rtree">Element</A> elmt)</CODE>
<BR>
Used to overwrite the old Element with the new one.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -