📄 sink - johnsdilon - blogjava.htm
字号:
id=Codehighlighter1_1290_9558_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG
alt="" src="SINK%20-%20johnsdilon%20-%20BlogJava_files/InBlock.gif"
align=top> </SPAN><SPAN style="COLOR: #000000">50</SPAN><SPAN
style="COLOR: #000000"> <BR><IMG
alt="" src="SINK%20-%20johnsdilon%20-%20BlogJava_files/InBlock.gif"
align=top> </SPAN><SPAN style="COLOR: #000000">51</SPAN><SPAN
style="COLOR: #000000"> </SPAN><SPAN
style="COLOR: #008000">//</SPAN><SPAN
style="COLOR: #008000"> 获取首点</SPAN><SPAN style="COLOR: #008000"><BR><IMG
alt="" src="SINK%20-%20johnsdilon%20-%20BlogJava_files/InBlock.gif"
align=top></SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN
style="COLOR: #000000">52</SPAN><SPAN
style="COLOR: #000000"> Integer headInteger </SPAN><SPAN
style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN
style="COLOR: #0000ff">new</SPAN><SPAN
style="COLOR: #000000"> Integer(lineHead);<BR><IMG alt=""
src="SINK%20-%20johnsdilon%20-%20BlogJava_files/InBlock.gif"
align=top> </SPAN><SPAN style="COLOR: #000000">53</SPAN><SPAN
style="COLOR: #000000"> </SPAN><SPAN
style="COLOR: #008000">//</SPAN><SPAN
style="COLOR: #008000"> 获取尾点</SPAN><SPAN style="COLOR: #008000"><BR><IMG
alt="" src="SINK%20-%20johnsdilon%20-%20BlogJava_files/InBlock.gif"
align=top></SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN
style="COLOR: #000000">54</SPAN><SPAN
style="COLOR: #000000"> Integer tailInteger </SPAN><SPAN
style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN
style="COLOR: #0000ff">new</SPAN><SPAN
style="COLOR: #000000"> Integer(lineTail);<BR><IMG alt=""
src="SINK%20-%20johnsdilon%20-%20BlogJava_files/InBlock.gif"
align=top> </SPAN><SPAN style="COLOR: #000000">55</SPAN><SPAN
style="COLOR: #000000"> <BR><IMG alt=""
src="SINK%20-%20johnsdilon%20-%20BlogJava_files/InBlock.gif"
align=top> </SPAN><SPAN style="COLOR: #000000">56</SPAN><SPAN
style="COLOR: #000000"> </SPAN><SPAN
style="COLOR: #008000">//</SPAN><SPAN
style="COLOR: #008000"> 若首点是第一次出现</SPAN><SPAN
style="COLOR: #008000"><BR><IMG id=Codehighlighter1_1545_1630_Open_Image
onclick="this.style.display='none'; Codehighlighter1_1545_1630_Open_Text.style.display='none'; Codehighlighter1_1545_1630_Closed_Image.style.display='inline'; Codehighlighter1_1545_1630_Closed_Text.style.display='inline';"
alt=""
src="SINK%20-%20johnsdilon%20-%20BlogJava_files/ExpandedSubBlockStart.gif"
align=top><IMG id=Codehighlighter1_1545_1630_Closed_Image style="DISPLAY: none"
onclick="this.style.display='none'; Codehighlighter1_1545_1630_Closed_Text.style.display='none'; Codehighlighter1_1545_1630_Open_Image.style.display='inline'; Codehighlighter1_1545_1630_Open_Text.style.display='inline';"
alt="" src="SINK%20-%20johnsdilon%20-%20BlogJava_files/ContractedSubBlock.gif"
align=top></SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN
style="COLOR: #000000">57</SPAN><SPAN
style="COLOR: #000000"> </SPAN><SPAN
style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000"> (</SPAN><SPAN
style="COLOR: #0000ff">false</SPAN><SPAN
style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #000000">==</SPAN><SPAN
style="COLOR: #000000"> allNodeS.contains(headInteger))</SPAN><SPAN
id=Codehighlighter1_1545_1630_Closed_Text
style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG
alt="" src="SINK%20-%20johnsdilon%20-%20BlogJava_files/dot.gif"></SPAN><SPAN
id=Codehighlighter1_1545_1630_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG
alt="" src="SINK%20-%20johnsdilon%20-%20BlogJava_files/InBlock.gif"
align=top> </SPAN><SPAN style="COLOR: #000000">58</SPAN><SPAN
style="COLOR: #000000"> </SPAN><SPAN
style="COLOR: #008000">//</SPAN><SPAN
style="COLOR: #008000"> 添加首點至點集中</SPAN><SPAN
style="COLOR: #008000"><BR><IMG alt=""
src="SINK%20-%20johnsdilon%20-%20BlogJava_files/InBlock.gif"
align=top></SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN
style="COLOR: #000000">59</SPAN><SPAN
style="COLOR: #000000"> allNodeS.add(headInteger);<BR><IMG
alt="" src="SINK%20-%20johnsdilon%20-%20BlogJava_files/ExpandedSubBlockEnd.gif"
align=top> </SPAN><SPAN style="COLOR: #000000">60</SPAN><SPAN
style="COLOR: #000000"> }</SPAN></SPAN><SPAN
style="COLOR: #000000"><BR><IMG alt=""
src="SINK%20-%20johnsdilon%20-%20BlogJava_files/InBlock.gif"
align=top> </SPAN><SPAN style="COLOR: #000000">61</SPAN><SPAN
style="COLOR: #000000"> </SPAN><SPAN
style="COLOR: #008000">//</SPAN><SPAN
style="COLOR: #008000"> 若尾点是第一次出现</SPAN><SPAN
style="COLOR: #008000"><BR><IMG id=Codehighlighter1_1713_1798_Open_Image
onclick="this.style.display='none'; Codehighlighter1_1713_1798_Open_Text.style.display='none'; Codehighlighter1_1713_1798_Closed_Image.style.display='inline'; Codehighlighter1_1713_1798_Closed_Text.style.display='inline';"
alt=""
src="SINK%20-%20johnsdilon%20-%20BlogJava_files/ExpandedSubBlockStart.gif"
align=top><IMG id=Codehighlighter1_1713_1798_Closed_Image style="DISPLAY: none"
onclick="this.style.display='none'; Codehighlighter1_1713_1798_Closed_Text.style.display='none'; Codehighlighter1_1713_1798_Open_Image.style.display='inline'; Codehighlighter1_1713_1798_Open_Text.style.display='inline';"
alt="" src="SINK%20-%20johnsdilon%20-%20BlogJava_files/ContractedSubBlock.gif"
align=top></SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN
style="COLOR: #000000">62</SPAN><SPAN
style="COLOR: #000000"> </SPAN><SPAN
style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000"> (</SPAN><SPAN
style="COLOR: #0000ff">false</SPAN><SPAN
style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #000000">==</SPAN><SPAN
style="COLOR: #000000"> allNodeS.contains(tailInteger))</SPAN><SPAN
id=Codehighlighter1_1713_1798_Closed_Text
style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG
alt="" src="SINK%20-%20johnsdilon%20-%20BlogJava_files/dot.gif"></SPAN><SPAN
id=Codehighlighter1_1713_1798_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG
alt="" src="SINK%20-%20johnsdilon%20-%20BlogJava_files/InBlock.gif"
align=top> </SPAN><SPAN style="COLOR: #000000">63</SPAN><SPAN
style="COLOR: #000000"> </SPAN><SPAN
style="COLOR: #008000">//</SPAN><SPAN
style="COLOR: #008000"> 添加尾點至點集中</SPAN><SPAN
style="COLOR: #008000"><BR><IMG alt=""
src="SINK%20-%20johnsdilon%20-%20BlogJava_files/InBlock.gif"
align=top></SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN
style="COLOR: #000000">64</SPAN><SPAN
style="COLOR: #000000"> allNodeS.add(tailInteger);<BR><IMG
alt="" src="SINK%20-%20johnsdilon%20-%20BlogJava_files/ExpandedSubBlockEnd.gif"
align=top> </SPAN><SPAN style="COLOR: #000000">65</SPAN><SPAN
style="COLOR: #000000"> }</SPAN></SPAN><SPAN
style="COLOR: #000000"> <BR><IMG
alt="" src="SINK%20-%20johnsdilon%20-%20BlogJava_files/InBlock.gif"
align=top> </SPAN><SPAN style="COLOR: #000000">66</SPAN><SPAN
style="COLOR: #000000"> </SPAN><SPAN
style="COLOR: #008000">//</SPAN><SPAN
style="COLOR: #008000"> 若首点、尾点均为第一次出现</SPAN><SPAN
style="COLOR: #008000"><BR><IMG alt=""
src="SINK%20-%20johnsdilon%20-%20BlogJava_files/InBlock.gif"
align=top></SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN
style="COLOR: #000000">67</SPAN><SPAN
style="COLOR: #000000"> </SPAN><SPAN
style="COLOR: #0000ff">if</SPAN><SPAN
style="COLOR: #000000"> ( (</SPAN><SPAN
style="COLOR: #0000ff">false</SPAN><SPAN
style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #000000">==</SPAN><SPAN
style="COLOR: #000000"> allNodeS.contains(headInteger))<BR><IMG
id=Codehighlighter1_1962_2276_Open_Image
onclick="this.style.display='none'; Codehighlighter1_1962_2276_Open_Text.style.display='none'; Codehighlighter1_1962_2276_Closed_Image.style.display='inline'; Codehighlighter1_1962_2276_Closed_Text.style.display='inline';"
alt=""
src="SINK%20-%20johnsdilon%20-%20BlogJava_files/ExpandedSubBlockStart.gif"
align=top><IMG id=Codehighlighter1_1962_2276_Closed_Image style="DISPLAY: none"
onclick="this.style.display='none'; Codehighlighter1_1962_2276_Closed_Text.style.display='none'; Codehighlighter1_1962_2276_Open_Image.style.display='inline'; Codehighlighter1_1962_2276_Open_Text.style.display='inline';"
alt="" src="SINK%20-%20johnsdilon%20-%20BlogJava_files/ContractedSubBlock.gif"
align=top> </SPAN><SPAN style="COLOR: #000000">68</SPAN><SPAN
style="COLOR: #000000"> </SPAN><SPAN
style="COLOR: #000000">&&</SPAN><SPAN
style="COLOR: #000000"> (</SPAN><SPAN
style="COLOR: #0000ff">false</SPAN><SPAN
style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #000000">==</SPAN><SPAN
style="COLOR: #000000"> allNodeS.contains(tailInteger)) )</SPAN><SPAN
id=Codehighlighter1_1962_2276_Closed_Text
style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG
alt="" src="SINK%20-%20johnsdilon%20-%20BlogJava_files/dot.gif"></SPAN><SPAN
id=Codehighlighter1_1962_2276_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG
alt="" src="SINK%20-%20johnsdilon%20-%20BlogJava_files/InBlock.gif"
align=top> </SPAN><SPAN style="COLOR: #000000">69</SPAN><SPAN
style="COLOR: #000000"> </SPAN><SPAN
style="COLOR: #008000">//</SPAN><SPAN
style="COLOR: #008000"> 构造一个新的线</SPAN><SPAN style="COLOR: #008000"><BR><IMG
alt="" src="SINK%20-%20johnsdilon%20-%20BlogJava_files/InBlock.gif"
align=top></SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN
style="COLOR: #000000">70</SPAN><SPAN
style="COLOR: #000000"> LinkedList waitLineNew </SPAN><SPAN
style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN
style="COLOR: #0000ff">new</SPAN><SPAN
style="COLOR: #000000"> LinkedList();<BR><IMG alt=""
src="SINK%20-%20johnsdilon%20-%20BlogJava_files/InBlock.gif"
align=top> </SPAN><SPAN style="COLOR: #000000">71</SPAN><SPAN
style="COLOR: #000000"> waitLineNew.add(headInteger);<BR><IMG
alt="" src="SINK%20-%20johnsdilon%20-%20BlogJava_files/InBlock.gif"
align=top> </SPAN><SPAN style="COLOR: #000000">72</SPAN><SPAN
style="COLOR: #000000"> waitLineNew.add(tailInteger);<BR><IMG
alt="" src="SINK%20-%20johnsdilon%20-%20BlogJava_files/InBlock.gif"
align=top> </SPAN><SPAN style="COLOR: #000000">73</SPAN><SPAN
style="COLOR: #000000"> </SPAN><SPAN
style="COLOR: #008000">//</SPAN><SPAN
style="COLOR: #008000"> 添加该新线至线集中</SPAN><SPAN
style="COLOR: #008000"><BR><IMG alt=""
src="SINK%20-%20johnsdilon%20-%20BlogJava_files/InBlock.gif"
align=top></SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN
style="COLOR: #000000">74</SPAN><SPAN
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -