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

📄 node.html

📁 本程序是由JAVA实现的R-树新建、结点增加、删除功能。
💻 HTML
📖 第 1 页 / 共 5 页
字号:
nodeMBR</H3>
<PRE>
protected <A HREF="../rtree/Rect.html" title="class in rtree">Rect</A> <B>nodeMBR</B></PRE>
<DL>
<DD>The cached Node MBR... no loops over the node Elements
<P>
<DL>
</DL>
</DL>
<HR>

<A NAME="totalElements"><!-- --></A><H3>
totalElements</H3>
<PRE>
protected int <B>totalElements</B></PRE>
<DL>
<DD>total no. of elements
<P>
<DL>
</DL>
</DL>
<HR>

<A NAME="parent"><!-- --></A><H3>
parent</H3>
<PRE>
protected long <B>parent</B></PRE>
<DL>
<DD>parent index - root's parent is not defined
<P>
<DL>
</DL>
</DL>
<HR>

<A NAME="elementSize"><!-- --></A><H3>
elementSize</H3>
<PRE>
protected int <B>elementSize</B></PRE>
<DL>
<DD>size of the element
<P>
<DL>
</DL>
</DL>
<HR>

<A NAME="elementType"><!-- --></A><H3>
elementType</H3>
<PRE>
protected int <B>elementType</B></PRE>
<DL>
<DD>type of the elements in the node
<P>
<DL>
</DL>
</DL>

<!-- ========= CONSTRUCTOR DETAIL ======== -->

<A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TD>
</TR>
</TABLE>

<A NAME="Node()"><!-- --></A><H3>
Node</H3>
<PRE>
protected <B>Node</B>()</PRE>
<DL>
<DD>This is only for subclasses
<P>
</DL>
<HR>

<A NAME="Node(java.io.RandomAccessFile, java.lang.String, long, int, rtree.FileHdr)"><!-- --></A><H3>
Node</H3>
<PRE>
protected <B>Node</B>(java.io.RandomAccessFile&nbsp;file,               java.lang.String&nbsp;fileName,               long&nbsp;prnt,               int&nbsp;elmtType,               <A HREF="../rtree/FileHdr.html" title="class in rtree">FileHdr</A>&nbsp;flHdr)        throws java.io.IOException,               <A HREF="../rtree/NodeWriteException.html" title="class in rtree">NodeWriteException</A></PRE>
<DL>
<DD>for a new node     Remember if the file is new this constructor will overwrite the      <code>parent</code> parameter with 'NOT_DEFINED' as it will be the root node.     If the <code>prnt</code> parameter is given as NOT_DEFINED then it is understood     that a new root is required.The file will then have a new root.
<P>
</DL>
<HR>

<A NAME="Node(java.io.RandomAccessFile, java.lang.String, long, rtree.FileHdr)"><!-- --></A><H3>
Node</H3>
<PRE>
protected <B>Node</B>(java.io.RandomAccessFile&nbsp;file,               java.lang.String&nbsp;fileName,               long&nbsp;ndIndex,               <A HREF="../rtree/FileHdr.html" title="class in rtree">FileHdr</A>&nbsp;flHdr)        throws java.io.FileNotFoundException,               java.io.IOException,               <A HREF="../rtree/NodeReadException.html" title="class in rtree">NodeReadException</A>,               <A HREF="../rtree/NodeWriteException.html" title="class in rtree">NodeWriteException</A></PRE>
<DL>
<DD>Reading existing nodes. But if this a new file then it will create the      file and make a new root node.
<P>
</DL>
<HR>

<A NAME="Node(java.io.RandomAccessFile, java.lang.String, long, boolean, rtree.Element[], rtree.FileHdr, int, long, int, int, boolean, rtree.Rect)"><!-- --></A><H3>
Node</H3>
<PRE>
protected <B>Node</B>(java.io.RandomAccessFile&nbsp;file,               java.lang.String&nbsp;fileName,               long&nbsp;nodeIndex,               boolean&nbsp;sorted,               <A HREF="../rtree/Element.html" title="class in rtree">Element</A>[]&nbsp;elmts,               <A HREF="../rtree/FileHdr.html" title="class in rtree">FileHdr</A>&nbsp;fileHdr,               int&nbsp;totalElements,               long&nbsp;parent,               int&nbsp;elmtSize,               int&nbsp;elmtType,               boolean&nbsp;dirty,               <A HREF="../rtree/Rect.html" title="class in rtree">Rect</A>&nbsp;nodeMBR)</PRE>
<DL>
<DD>A stupid internal constructor for the clone method.
<P>
</DL>

<!-- ============ METHOD DETAIL ========== -->

<A NAME="method_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Method Detail</B></FONT></TD>
</TR>
</TABLE>

<A NAME="clone()"><!-- --></A><H3>
clone</H3>
<PRE>
public java.lang.Object <B>clone</B>()</PRE>
<DL>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="readElement(long)"><!-- --></A><H3>
readElement</H3>
<PRE>
private <A HREF="../rtree/Element.html" title="class in rtree">Element</A> <B>readElement</B>(long&nbsp;index)                     throws <A HREF="../rtree/NodeReadException.html" title="class in rtree">NodeReadException</A></PRE>
<DL>
<DD><B>Deprecated.</B>&nbsp;<I>In-fact it has never been used except in early development days.</I>
<P>
<DD>read an element from the hard disk. Not used any more
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Throws:</B><DD><CODE><A HREF="../rtree/NodeReadException.html" title="class in rtree">NodeReadException</A></CODE></DL>
</DD>
</DL>
<HR>

<A NAME="deleteElement(int, boolean)"><!-- --></A><H3>
deleteElement</H3>
<PRE>
public void <B>deleteElement</B>(int&nbsp;index,                          boolean&nbsp;force)                   throws <A HREF="../rtree/IllegalValueException.html" title="class in rtree">IllegalValueException</A>,                          <A HREF="../rtree/NodeWriteException.html" title="class in rtree">NodeWriteException</A></PRE>
<DL>
<DD>This method delets the element with the given index from the node.     It rewrites the node.     This method now also being used to write the whole node to the file.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>index</CODE> - The element to delete. Give -1 if the whole node is to be flushed.<DD><CODE>force</CODE> - Whether to force IO. As this method is also used to write the whole node, this was      required.<DT><B>Returns:</B><DD>thengaa!     XXX : This is till not correct.<DT><B>Throws:</B><DD><CODE><A HREF="../rtree/IllegalValueException.html" title="class in rtree">IllegalValueException</A></CODE><DD><CODE><A HREF="../rtree/NodeWriteException.html" title="class in rtree">NodeWriteException</A></CODE></DL>
</DD>
</DL>
<HR>

<A NAME="insertElement(rtree.Element)"><!-- --></A><H3>
insertElement</H3>
<PRE>
public void <B>insertElement</B>(<A HREF="../rtree/Element.html" title="class in rtree">Element</A>&nbsp;elmt)                   throws <A HREF="../rtree/NodeWriteException.html" title="class in rtree">NodeWriteException</A>,                          <A HREF="../rtree/NodeFullException.html" title="class in rtree">NodeFullException</A></PRE>
<DL>
<DD>to add an element at the end     As elements are allocated to this node, each allocated      element's children node's parent are reset. This is simply because the     new node index(for <code>elmt</code>) would be different from the old     ones(if any).      <br>Note:-This again is for non leaf node only.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Throws:</B><DD><CODE><A HREF="../rtree/NodeWriteException.html" title="class in rtree">NodeWriteException</A></CODE><DD><CODE><A HREF="../rtree/NodeFullException.html" title="class in rtree">NodeFullException</A></CODE></DL>
</DD>
</DL>
<HR>

<A NAME="writeLastElement(rtree.Element)"><!-- --></A><H3>
writeLastElement</H3>
<PRE>
private void <B>writeLastElement</B>(<A HREF="../rtree/Element.html" title="class in rtree">Element</A>&nbsp;elmt)                       throws <A HREF="../rtree/NodeWriteException.html" title="class in rtree">NodeWriteException</A></PRE>
<DL>
<DD>This func. writes the element to the last position.     It also takes care of updating the node header.     Also updates the local variables.     Also takes care whether it is the first element in the node or not.     If it is the first element then it sets the node header accordingly.     Least error checking - use it with care.     If the node is old and the new element type is of different type then it     will change the node header to the new type - so be very very careful!     In short don't call this method to insert an element different from the     already present element type.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Throws:</B><DD><CODE><A HREF="../rtree/NodeWriteException.html" title="class in rtree">NodeWriteException</A></CODE></DL>
</DD>
</DL>
<HR>

<A NAME="insertElement(rtree.Element[], boolean)"><!-- --></A><H3>
insertElement</H3>
<PRE>
public void <B>insertElement</B>(<A HREF="../rtree/Element.html" title="class in rtree">Element</A>[]&nbsp;elmts,                          boolean&nbsp;updateChldrn)                   throws <A HREF="../rtree/NodeWriteException.html" title="class in rtree">NodeWriteException</A>,                          <A HREF="../rtree/NodeFullException.html" title="class in rtree">NodeFullException</A></PRE>
<DL>
<DD>to add more than onr element at the end.     As elements are allocated to this node, each allocated element's children node's parent are reset.     This is simply because the new node index(for <code>elmts</code>) would be different from the old     ones(if any). none of the element should be null.     <br><b>Note:-</b> Giving <code>updateChldrn</code> <code>true</code> will not update the parent from     cache, but would actually update the parent on disk.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>elmts</CODE> - The elements that are to be entered. None of them should be null.<DD><CODE>updateChldrn</CODE> - Whether to update the children. When we are moving from root to leaves,     this should be false.<DT><B>Throws:</B><DD><CODE><A HREF="../rtree/NodeWriteException.html" title="class in rtree">NodeWriteException</A></CODE><DD><CODE><A HREF="../rtree/NodeFullException.html" title="class in rtree">NodeFullException</A></CODE></DL>
</DD>
</DL>
<HR>

<A NAME="writeLastElements(rtree.Element[])"><!-- --></A><H3>
writeLastElements</H3>
<PRE>
private void <B>writeLastElements</B>(<A HREF="../rtree/Element.html" title="class in rtree">Element</A>[]&nbsp;elmts)                        throws <A HREF="../rtree/NodeWriteException.html" title="class in rtree">NodeWriteException</A></PRE>
<DL>
<DD>This method helps in bulk loading.     This func. writes the elements to the last position.     It also takes care of updating the node header.     Also updates the local variables.     Also takes care whether these are the first elements in the node or not.     If these <i>are</i> the first element then it sets the node header accordingly.     Least error checking - use it with care.     If the node is old and the new element type is of different type then it     will change the node header to the new type - so be very very careful!     In short don't call this method to insert an element different from the     already present element type.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Throws:</B><DD><CODE><A HREF="../rtree/NodeWriteException.html" title="class in rtree">NodeWriteException</A></CODE></DL>
</DD>
</DL>
<HR>

<A NAME="seekCurrNode()"><!-- --></A><H3>
seekCurrNode</H3>
<PRE>
private void <B>seekCurrNode</B>()                   throws java.io.IOException</PRE>
<DL>
<DD>this function simply places the file pointer, it does not check for any     condition like placing the pointer beyond the end of file
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Throws:</B><DD><CODE>java.io.IOException</CODE></DL>
</DD>
</DL>
<HR>

<A NAME="seekNode(long)"><!-- --></A><H3>
seekNode</H3>
<PRE>
private void <B>seekNode</B>(long&nbsp;nodeIdx)               throws java.io.IOException</PRE>
<DL>
<DD>seek the specified node
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Throws:</B><DD><CODE>java.io.IOException</CODE></DL>
</DD>
</DL>
<HR>

<A NAME="seekLastElement()"><!-- --></A><H3>
seekLastElement</H3>
<PRE>
private void <B>seekLastElement</B>()                      throws java.io.IOException</PRE>

⌨️ 快捷键说明

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