?? ternarytree.html
字號(hào):
The actual insertion function, recursive version.</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="../../../../../com/lowagie/text/pdf/hyphenation/TernaryTree.html#insert(java.lang.String, char)">insert</A></B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html">String</A> key, char val)</CODE>
<BR>
Branches are initially compressed, needing one node per key plus the size of the string key. </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/lowagie/text/pdf/hyphenation/TernaryTree.html#insertBalanced(java.lang.String[], char[], int, int)">insertBalanced</A></B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html">String</A>[] k, char[] v, int offset, int n)</CODE>
<BR>
Recursively insert the median first and then the median of the lower and upper halves, and so on in order to get a balanced tree. </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/Enumeration.html">Enumeration</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/lowagie/text/pdf/hyphenation/TernaryTree.html#keys()">keys</A></B>()</CODE>
<BR>
</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="../../../../../com/lowagie/text/pdf/hyphenation/TernaryTree.html#knows(java.lang.String)">knows</A></B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html">String</A> key)</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="../../../../../com/lowagie/text/pdf/hyphenation/TernaryTree.html#printStats()">printStats</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>private void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/lowagie/text/pdf/hyphenation/TernaryTree.html#redimNodeArrays(int)">redimNodeArrays</A></B>(int newsize)</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="../../../../../com/lowagie/text/pdf/hyphenation/TernaryTree.html#size()">size</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/lowagie/text/pdf/hyphenation/TernaryTree.html#strcmp(char[], int, char[], int)">strcmp</A></B>(char[] a, int startA, char[] b, int startB)</CODE>
<BR>
Compares 2 null terminated char arrays</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/lowagie/text/pdf/hyphenation/TernaryTree.html#strcmp(java.lang.String, char[], int)">strcmp</A></B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html">String</A> str, char[] a, int start)</CODE>
<BR>
Compares a string with null terminated char array</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/lowagie/text/pdf/hyphenation/TernaryTree.html#strcpy(char[], int, char[], int)">strcpy</A></B>(char[] dst, int di, char[] src, int si)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/lowagie/text/pdf/hyphenation/TernaryTree.html#strlen(char[])">strlen</A></B>(char[] a)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/lowagie/text/pdf/hyphenation/TernaryTree.html#strlen(char[], int)">strlen</A></B>(char[] a, int start)</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="../../../../../com/lowagie/text/pdf/hyphenation/TernaryTree.html#trimToSize()">trimToSize</A></B>()</CODE>
<BR>
Each node stores a character (splitchar) which is part of some key(s). </TD>
</TR>
</TABLE>
<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TD><B>Methods inherited from class java.lang.<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A></B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#equals(java.lang.Object)">equals</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#finalize()">finalize</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#getClass()">getClass</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#hashCode()">hashCode</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#notify()">notify</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#notifyAll()">notifyAll</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#toString()">toString</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#wait()">wait</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#wait(long)">wait</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#wait(long, int)">wait</A></CODE></TD>
</TR>
</TABLE>
<P>
<!-- ============ FIELD DETAIL =========== -->
<A NAME="field_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Field Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="lo"><!-- --></A><H3>
lo</H3>
<PRE>
protected char[] <B>lo</B></PRE>
<DL>
<DD>Pointer to low branch and to rest of the key when it is stored directly in this node, we don't have unions in java!
<P>
<DL>
</DL>
</DL>
<HR>
<A NAME="hi"><!-- --></A><H3>
hi</H3>
<PRE>
protected char[] <B>hi</B></PRE>
<DL>
<DD>Pointer to high branch.
<P>
<DL>
</DL>
</DL>
<HR>
<A NAME="eq"><!-- --></A><H3>
eq</H3>
<PRE>
protected char[] <B>eq</B></PRE>
<DL>
<DD>Pointer to equal branch and to data when this node is a string terminator.
<P>
<DL>
</DL>
</DL>
<HR>
<A NAME="sc"><!-- --></A><H3>
sc</H3>
<PRE>
protected char[] <B>sc</B></PRE>
<DL>
<DD><P>The character stored in this node: splitchar Two special values are reserved:</P> <ul><li>0x0000 as string terminator</li> <li>0xFFFF to indicate that the branch starting at this node is compressed</li></ul> <p>This shouldn't be a problem if we give the usual semantics to strings since 0xFFFF is garanteed not to be an Unicode character.</p>
<P>
<DL>
</DL>
</DL>
<HR>
<A NAME="kv"><!-- --></A><H3>
kv</H3>
<PRE>
protected <A HREF="../../../../../com/lowagie/text/pdf/hyphenation/CharVector.html">CharVector</A> <B>kv</B></PRE>
<DL>
<DD>This vector holds the trailing of the keys when the branch is compressed.
<P>
<DL>
</DL>
</DL>
<HR>
<A NAME="root"><!-- --></A><H3>
root</H3>
<PRE>
protected char <B>root</B></PRE>
<DL>
<DL>
</DL>
</DL>
<HR>
<A NAME="freenode"><!-- --></A><H3>
freenode</H3>
<PRE>
protected char <B>freenode</B></PRE>
<DL>
<DL>
</DL>
</DL>
<HR>
<A NAME="length"><!-- --></A><H3>
length</H3>
<PRE>
protected int <B>length</B></PRE>
<DL>
<DL>
</DL>
</DL>
<HR>
<A NAME="BLOCK_SIZE"><!-- --></A><H3>
BLOCK_SIZE</H3>
<PRE>
protected static final int <B>BLOCK_SIZE</B></PRE>
<DL>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#com.lowagie.text.pdf.hyphenation.TernaryTree.BLOCK_SIZE">Constant Field Values</A></DL>
</DL>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="TernaryTree()"><!-- --></A><H3>
TernaryTree</H3>
<PRE>
<B>TernaryTree</B>()</PRE>
<DL>
</DL>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Method Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="init()"><!-- --></A><H3>
init</H3>
<PRE>
protected void <B>init</B>()</PRE>
<DL>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="insert(java.lang.String, char)"><!-- --></A><H3>
insert</H3>
<PRE>
public void <B>insert</B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html">String</A> key, char val)</PRE>
<DL>
<DD>Branches are initially compressed, needing one node per key plus the size of the string key. They are decompressed as needed when another key with same prefix is inserted. This saves a lot of space, specially for long keys.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="insert(char[], int, char)"><!-- --></A><H3>
insert</H3>
<PRE>
public void <B>insert</B>(char[] key, int start, char val)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="insert(char, char[], int, char)"><!-- --></A><H3>
insert</H3>
<PRE>
private char <B>insert</B>(char p, char[] key, int start, char val)</PRE>
<DL>
<DD>The actual insertion function, recursive version.
<P>
<DD><DL>
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -