??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲精品日产aⅴ,91蜜臀精品国产自偷在线,av在线电影网站http://www.aygfsteel.com/fidodido/category/2509.html子夜 ~程 代码与我同在zh-cnTue, 27 Feb 2007 10:47:35 GMTTue, 27 Feb 2007 10:47:35 GMT60~省适配器模式(Default AdapterQ?/title><link>http://www.aygfsteel.com/fidodido/archive/2005/09/06/12197.html</link><dc:creator>^ Mustang ^</dc:creator><author>^ Mustang ^</author><pubDate>Tue, 06 Sep 2005 04:01:00 GMT</pubDate><guid>http://www.aygfsteel.com/fidodido/archive/2005/09/06/12197.html</guid><wfw:comment>http://www.aygfsteel.com/fidodido/comments/12197.html</wfw:comment><comments>http://www.aygfsteel.com/fidodido/archive/2005/09/06/12197.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/fidodido/comments/commentRss/12197.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/fidodido/services/trackbacks/12197.html</trackback:ping><description><![CDATA[<H4>一、概q?/H4> <P>当不需要全部实现适配器接口提供的ҎӞ可先设计一个抽象类实现适配器接口,qؓ接口中每个方法提供一个默认实玎ͼI方法)。那么该抽象cȝ子类可有选择地覆盖父cȝ某些Ҏ来实现需求?/P> <H4>二、结?/H4> <P align=center><IMG height=243 alt=defaultadapter.png src="http://www.aygfsteel.com/images/blogjava_net/fidodido/2507/defaultadapter.png" width=138 border=0></P> <H4> </H4> <H4>三、动?/H4> <P>对于一个接口不想用其所有的Ҏ时?/P><img src ="http://www.aygfsteel.com/fidodido/aggbug/12197.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/fidodido/" target="_blank">^ Mustang ^</a> 2005-09-06 12:01 <a href="http://www.aygfsteel.com/fidodido/archive/2005/09/06/12197.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>A beginners guide to Dependency Injection [转蝲自TSS]http://www.aygfsteel.com/fidodido/archive/2005/08/08/9610.html^ Mustang ^^ Mustang ^Mon, 08 Aug 2005 14:30:00 GMThttp://www.aygfsteel.com/fidodido/archive/2005/08/08/9610.htmlhttp://www.aygfsteel.com/fidodido/comments/9610.htmlhttp://www.aygfsteel.com/fidodido/archive/2005/08/08/9610.html#Feedback0http://www.aygfsteel.com/fidodido/comments/commentRss/9610.htmlhttp://www.aygfsteel.com/fidodido/services/trackbacks/9610.html阅读全文

^ Mustang ^ 2005-08-08 22:30 发表评论
]]>
适配器模式(AdapterQ?/title><link>http://www.aygfsteel.com/fidodido/archive/2005/08/06/9484.html</link><dc:creator>^ Mustang ^</dc:creator><author>^ Mustang ^</author><pubDate>Sat, 06 Aug 2005 11:39:00 GMT</pubDate><guid>http://www.aygfsteel.com/fidodido/archive/2005/08/06/9484.html</guid><wfw:comment>http://www.aygfsteel.com/fidodido/comments/9484.html</wfw:comment><comments>http://www.aygfsteel.com/fidodido/archive/2005/08/06/9484.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/fidodido/comments/commentRss/9484.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/fidodido/services/trackbacks/9484.html</trackback:ping><description><![CDATA[<H3>一、概q?/H3> <P>cȝ适配器模式把被适配的类的API转换成ؓ目标cȝAPI</P> <P></P> <H3>二、结?/H3> <H4>1、类的适配器模?/H4> <P align=center><IMG height=187 alt=o_adapter1.gif src="http://www.aygfsteel.com/images/blogjava_net/fidodido/2507/o_adapter1.gif" width=257 border=0></P> <P>TargetQ所期待得到的接?/P> <P>AdapteeQ现有需要适配的类</P> <P>AdapterQ把源接口{化成目标接口的核心类</P> <P></P> <H4>2、对象的适配器模?/H4> <P align=center><IMG height=199 alt=o_adapter2.gif src="http://www.aygfsteel.com/images/blogjava_net/fidodido/2507/o_adapter2.gif" width=257 border=0></P> <P>i、同一个适配器可以把源和其子c都适配到目标接?/P> <P>ii、与cȝ适配器相比,要覆盖源cȝҎ不很ҎQ除非做一个源cȝ子类Q然后对子类适配</P> <P>iii、可以很方便地添加一个方?/P> <P></P> <H3>三、动?/H3> <P>1、系l需要用现有的c,而该cȝ接口不符合系l新的需?/P> <P>2、需要徏立一个可复用的类用于使一些彼此之间没有太大关pȝcM同工?/P> <P>3、需要改变多个已有的子类的接?/P><img src ="http://www.aygfsteel.com/fidodido/aggbug/9484.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/fidodido/" target="_blank">^ Mustang ^</a> 2005-08-06 19:39 <a href="http://www.aygfsteel.com/fidodido/archive/2005/08/06/9484.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>原型模式QPrototypeQ?/title><link>http://www.aygfsteel.com/fidodido/archive/2005/08/05/9376.html</link><dc:creator>^ Mustang ^</dc:creator><author>^ Mustang ^</author><pubDate>Fri, 05 Aug 2005 02:54:00 GMT</pubDate><guid>http://www.aygfsteel.com/fidodido/archive/2005/08/05/9376.html</guid><wfw:comment>http://www.aygfsteel.com/fidodido/comments/9376.html</wfw:comment><comments>http://www.aygfsteel.com/fidodido/archive/2005/08/05/9376.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/fidodido/comments/commentRss/9376.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/fidodido/services/trackbacks/9376.html</trackback:ping><description><![CDATA[<H3>一、概q?/H3> <P><FONT size=2>原型模式属于对象创徏模式Q通过l出一个原型对象来指明所要创建的对象cdQ然后用复制q个对象的方法创建出更多同类型的对象?BR></FONT></P> <P></P> <H4> </H4> <H3>二、结?/H3> <H4>1、简单Ş?/H4> <P align=center><IMG height=168 alt=o_prototype1.gif src="http://www.aygfsteel.com/images/blogjava_net/fidodido/2507/o_prototype1.gif" width=314 border=0></P> <P><FONT size=2>ClientQ提出创建对象的h</FONT></P> <P><FONT size=2>PrototypeQ抽象角Ԍl出所有具体原型类所需的接?/FONT></P> <P><FONT size=2>ConcretePrototypeQ被复制的对?BR></FONT></P> <P></P> <H4><BR>2、登记Ş?/H4> <P align=center><IMG height=227 alt=o_prototype2.gif src="http://www.aygfsteel.com/images/blogjava_net/fidodido/2507/o_prototype2.gif" width=326 border=0></P> <P><FONT size=2>PrototypeManagerQ创建ƈ记录具体对象<BR></FONT></P> <P></P> <H4> </H4> <H3>三、浅克隆与深克隆</H3> <P><FONT size=2>克隆:仅做refrence一U的克隆Qrefrence所指的对象不被克隆</FONT></P> <P><FONT size=2>深克隆:refrence所指的对象q行递归克隆Q需考虑克隆深度及@环克隆问?/FONT></P> <P></P> <H3><BR>四、动?/H3> <P><FONT size=2>替换较复杂的{l构的工厂方?/FONT></P> <P></P> <H3><BR>五、优~点</H3> <P><FONT color=#000000 size=2><FONT color=#9acd32>1?/FONT>允许动态地增加或减品类Q且Ҏ个现有的产品l构没有影响</FONT></P> <P><FONT color=#000000 size=2><FONT color=#9acd32>2?/FONT>提供化的创徏l构</FONT></P> <P><FONT color=#000000 size=2><FONT color=#9acd32>3?/FONT>h动态加载新功能的能?/FONT></P> <P><FONT color=#000000 size=2><FONT color=#9acd32>4?/FONT>产品cM需要有定的等U结?/FONT></P> <P><FONT color=#000000 size=2><FONT color=#ffa500>I?/FONT>每一个类必须配备一个克隆方?/FONT></P><img src ="http://www.aygfsteel.com/fidodido/aggbug/9376.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/fidodido/" target="_blank">^ Mustang ^</a> 2005-08-05 10:54 <a href="http://www.aygfsteel.com/fidodido/archive/2005/08/05/9376.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>使用{略模式QStrategyQ实现多关键字排?/title><link>http://www.aygfsteel.com/fidodido/archive/2005/08/04/9181.html</link><dc:creator>^ Mustang ^</dc:creator><author>^ Mustang ^</author><pubDate>Thu, 04 Aug 2005 04:37:00 GMT</pubDate><guid>http://www.aygfsteel.com/fidodido/archive/2005/08/04/9181.html</guid><wfw:comment>http://www.aygfsteel.com/fidodido/comments/9181.html</wfw:comment><comments>http://www.aygfsteel.com/fidodido/archive/2005/08/04/9181.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.aygfsteel.com/fidodido/comments/commentRss/9181.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/fidodido/services/trackbacks/9181.html</trackback:ping><description><![CDATA[<P class=MsoNormal style="MARGIN: 7.8pt 0cm 0pt; TEXT-INDENT: 21pt; mso-para-margin-top: .5gd; mso-char-indent-count: 2.0" align=center><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana"></P> <P class=MsoNormal style="MARGIN: 7.8pt 0cm 0pt; TEXT-INDENT: 21pt; mso-para-margin-top: .5gd; mso-char-indent-count: 2.0">“策略模式”的出现Q是Z提供一套相互之间可灉|替换的算法,在不影响上层接口的情况下Q用户可以自由选择不同的算法完成逻辑?/SPAN></P> <P class=MsoNormal style="MARGIN: 7.8pt 0cm 0pt; TEXT-INDENT: 21pt; mso-para-margin-top: .5gd; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">{略模式?/SPAN><SPAN lang=EN-US><FONT face=Verdana>UML</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">C意囑֦下:</SPAN><SPAN lang=EN-US><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p><FONT face=Verdana> </P> <P class=MsoNormal style="MARGIN: 7.8pt 0cm 0pt; TEXT-INDENT: 21pt; mso-para-margin-top: .5gd; mso-char-indent-count: 2.0" align=center></FONT></o:p></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana"><IMG height=228 alt=r_image002.jpg src="http://www.aygfsteel.com/images/blogjava_net/fidodido/2507/r_image002.jpg" width=521 border=0></SPAN> </P> <P class=MsoNormal style="MARGIN: 7.8pt 0cm 0pt; TEXT-INDENT: 21pt; TEXT-ALIGN: center; mso-para-margin-top: .5gd; mso-char-indent-count: 2.0" align=center><SPAN lang=EN-US><?xml:namespace prefix = v ns = "urn:schemas-microsoft-com:vml" /><v:shapetype id=_x0000_t75 coordsize="21600,21600" o:spt="75" o:preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f"><v:stroke joinstyle="miter"></v:stroke><v:formulas><v:f eqn="if lineDrawn pixelLineWidth 0"></v:f><v:f eqn="sum @0 1 0"></v:f><v:f eqn="sum 0 0 @1"></v:f><v:f eqn="prod @2 1 2"></v:f><v:f eqn="prod @3 21600 pixelWidth"></v:f><v:f eqn="prod @3 21600 pixelHeight"></v:f><v:f eqn="sum @0 0 1"></v:f><v:f eqn="prod @6 1 2"></v:f><v:f eqn="prod @7 21600 pixelWidth"></v:f><v:f eqn="sum @8 21600 0"></v:f><v:f eqn="prod @7 21600 pixelHeight"></v:f><v:f eqn="sum @10 21600 0"></v:f></v:formulas><v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect"></v:path><o:lock v:ext="edit" aspectratio="t"></o:lock></v:shapetype></SPAN></P> <P class=MsoNormal style="MARGIN: 7.8pt 0cm 0pt; TEXT-INDENT: 21pt; mso-para-margin-top: .5gd; mso-char-indent-count: 2.0"><SPAN lang=EN-US><o:p><FONT face=Verdana> </FONT></o:p></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">其中法的模型接口在“抽象策略”中定义Q各兯{略实现不同的策略。“消?/SPAN><SPAN lang=EN-US><FONT face=Verdana>API</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">”就是调用不同算法的c,在其内部Ҏ不同需要选择不同的算法。有旉要将兯{略实例化后再传l其它类Q这时可以?I style="mso-bidi-font-style: normal">“简单工厂”(</I></SPAN><I style="mso-bidi-font-style: normal"><SPAN lang=EN-US><FONT face=Verdana>Simple Factory</FONT></SPAN></I><I style="mso-bidi-font-style: normal"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">Q?/SPAN></I><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">?I style="mso-bidi-font-style: normal">“工厂方法”(</I></SPAN><I style="mso-bidi-font-style: normal"><SPAN lang=EN-US><FONT face=Verdana>Factory Method</FONT></SPAN></I><I style="mso-bidi-font-style: normal"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">Q?/SPAN></I><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">生成所需的具象策略。下面就以我正在做的一个项目,化一下后说明一下策略模式的使用?/SPAN></P> <P class=MsoNormal style="MARGIN: 7.8pt 0cm 0pt; TEXT-INDENT: 21pt; mso-para-margin-top: .5gd; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">该项目是一个小型的商业|站Q逻辑层由</SPAN><SPAN lang=EN-US><FONT face=Verdana>Servlet</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">实现。用h一个需求,需要从数据库调出商品信息后能够对记录按名称Q?/SPAN><SPAN lang=EN-US><FONT face=Verdana>name</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">Q、规|</SPAN><SPAN lang=EN-US><FONT face=Verdana>standard</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">Q、h|</SPAN><SPAN lang=EN-US><FONT face=Verdana>price</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">Q和注册日期Q?/SPAN><SPAN lang=EN-US><FONT face=Verdana>register date</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">Q进行排序。虽然可以考虑按不同的排序关键字用不同的</SPAN><SPAN lang=EN-US><FONT face=Verdana>sql</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">语句Q即不同?/SPAN><SPAN lang=EN-US><FONT face=Verdana>order by</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">Q查询数据库。但q样做的|络数据量太大Q每ơ需要从数据库完整地取回一个数据集Q?/SPAN><SPAN lang=EN-US><FONT face=Verdana>ResultSet</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">Q,所以我选择了将数据集一ơ取到客L的一?/SPAN><SPAN lang=EN-US><FONT face=Verdana>List</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">中,然后在客L按不同的关键字对</SPAN><SPAN lang=EN-US><FONT face=Verdana>List</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">q行排序?/SPAN></P> <P class=MsoNormal style="MARGIN: 7.8pt 0cm 0pt; TEXT-INDENT: 21pt; mso-para-margin-top: .5gd; mso-char-indent-count: 2.0"><SPAN lang=EN-US><FONT face=Verdana>java.util.Collections</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">cM有一?/SPAN><I style="mso-bidi-font-style: normal"><SPAN lang=EN-US><FONT face=Verdana>public static void sort(List list, Comparator comparator)</FONT></SPAN></I><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">的方法,可以按照不同?/SPAN><SPAN lang=EN-US><FONT face=Verdana>Comparator</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">对象?/SPAN><SPAN lang=EN-US><FONT face=Verdana>list</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">q行排序Q它使用的是快速排序,所以效率非帔R。?/SPAN><SPAN lang=EN-US><FONT face=Verdana>java.util.Comparator</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">是一个接口:</SPAN></P> <P class=MsoNormal style="MARGIN: 7.8pt 0cm 0pt; TEXT-INDENT: 21pt; mso-para-margin-top: .5gd; mso-char-indent-count: 2.0"><SPAN lang=EN-US><o:p><FONT face=Verdana> </FONT></o:p></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 18pt; mso-char-indent-count: 2.0"><I style="mso-bidi-font-style: normal"><SPAN lang=EN-US style="FONT-SIZE: 9pt"><FONT face=Verdana></P> <DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid"> <DIV><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">package java.util;<BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align=top><BR><IMG id=Codehighlighter1_57_139_Open_Image onclick="this.style.display='none'; Codehighlighter1_57_139_Open_Text.style.display='none'; Codehighlighter1_57_139_Closed_Image.style.display='inline'; Codehighlighter1_57_139_Closed_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_57_139_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_57_139_Closed_Text.style.display='none'; Codehighlighter1_57_139_Open_Image.style.display='inline'; Codehighlighter1_57_139_Open_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedBlock.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">abstract</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">interface</SPAN><SPAN style="COLOR: #000000"> Comparator </SPAN><SPAN id=Codehighlighter1_57_139_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 src="http://www.aygfsteel.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_57_139_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align=top>  boolean equals(Object </SPAN><SPAN style="COLOR: #0000ff">object</SPAN><SPAN style="COLOR: #000000">);<BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align=top>  </SPAN><SPAN style="COLOR: #0000ff">int</SPAN><SPAN style="COLOR: #000000"> compare(Object </SPAN><SPAN style="COLOR: #0000ff">object</SPAN><SPAN style="COLOR: #000000">, Object object1);<BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align=top><BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align=top></SPAN></DIV></DIV> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 18pt; mso-char-indent-count: 2.0"></FONT></SPAN></I><SPAN lang=EN-US><o:p><FONT face=Verdana> </FONT></o:p></SPAN></P> <P class=MsoNormal style="MARGIN: 7.8pt 0cm 0pt; TEXT-INDENT: 21pt; mso-para-margin-top: .5gd; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">其中和排序有关的?/SPAN><SPAN lang=EN-US><FONT face=Verdana>compare</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">ҎQ它q回一个整敎ͼ若第一个参数比W二个参数“大”,则返回一个正敎ͼ若“小”则q回一个负敎ͼ若“相{”则q回</SPAN><SPAN lang=EN-US><FONT face=Verdana>0</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">Q这里的“大”、“小”、“相{”是?/SPAN><SPAN lang=EN-US><FONT face=Verdana>compare</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">Ҏ具体实现定义的一U比较标准。由q个Ҏ不禁惛_</SPAN><SPAN lang=EN-US><FONT face=Verdana>C</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">语言?/SPAN><SPAN lang=EN-US><FONT face=Verdana>qsort</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">函数中用的函数指针</SPAN><I style="mso-bidi-font-style: normal"><SPAN lang=EN-US><FONT face=Verdana>int *compare(*,*)</FONT></SPAN></I><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">Q?/SPAN><SPAN lang=EN-US><FONT face=Verdana>JAVA</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">中之所以没有函数指针,是用接口取代了Q更详细的介l见?/SPAN><SPAN lang=EN-US><FONT face=Verdana>Effective Java</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">》中W?/SPAN><SPAN lang=EN-US><FONT face=Verdana>22</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">条“用cd接口来代替函数指针”)?/SPAN></P> <P class=MsoNormal style="MARGIN: 7.8pt 0cm 0pt; TEXT-INDENT: 21pt; mso-para-margin-top: .5gd; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">很明显,</SPAN><SPAN lang=EN-US><FONT face=Verdana>Comparator</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">接口是我们的“抽象策略”,</SPAN><SPAN lang=EN-US><FONT face=Verdana>sort</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">Ҏ是我们的“消?/SPAN><SPAN lang=EN-US><FONT face=Verdana>API</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">”,而不同的“具象策略”就是我们从</SPAN><SPAN lang=EN-US><FONT face=Verdana>Comparator</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">接口实现的根据不同关键字排序的类?/SPAN></P> <P class=MsoNormal style="MARGIN: 7.8pt 0cm 0pt; TEXT-INDENT: 21pt; mso-para-margin-top: .5gd; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">整个排序模型?/SPAN><SPAN lang=EN-US><FONT face=Verdana>UML</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">囑֦下,其中Z作图方便Q我?/SPAN><SPAN lang=EN-US><FONT face=Verdana>Comparator</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">l承了一个接?/SPAN><SPAN lang=EN-US><FONT face=Verdana>ItemComparator</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">Q根据不同的关键字从</SPAN><SPAN lang=EN-US><FONT face=Verdana>ItemComparator</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">接口泛化?/SPAN><SPAN lang=EN-US><FONT face=Verdana>NameComparator</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">c,</SPAN><SPAN lang=EN-US><FONT face=Verdana>PriceComparator</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">c,</SPAN><SPAN lang=EN-US><FONT face=Verdana>RegisterDateComparator</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">cd</SPAN><SPAN lang=EN-US><FONT face=Verdana>StandardComparator</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">cR实际运用中不需要这个接口,四个cd以直接从</SPAN><SPAN lang=EN-US><FONT face=Verdana>Comparator</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">泛化?/SPAN><SPAN lang=EN-US><FONT face=Verdana>ItemBean</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">是一个封装了商品信息?/SPAN><SPAN lang=EN-US><FONT face=Verdana>bean</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">Q?/SPAN><SPAN lang=EN-US><FONT face=Verdana>List</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">中存攄是q些</SPAN><SPAN lang=EN-US><FONT face=Verdana>bean</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">?/SPAN><SPAN lang=EN-US><FONT face=Verdana>ItemSort</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">?/SPAN><SPAN lang=EN-US><FONT face=Verdana>ItemComparator</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">以及四个具体cdC“简单工厂”模式,q封装了</SPAN><SPAN lang=EN-US><FONT face=Verdana>sort</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">Ҏ?/SPAN></P> <P class=MsoNormal style="MARGIN: 7.8pt 0cm 0pt; TEXT-INDENT: 21pt; mso-para-margin-top: .5gd; mso-char-indent-count: 2.0" align=center><SPAN lang=EN-US><o:p><FONT face=Verdana> <IMG height=663 alt=o_strategy.dfPackage.jpg src="http://www.aygfsteel.com/images/blogjava_net/fidodido/2507/o_strategy.dfPackage.jpg" width=590 border=0></FONT></o:p></SPAN><SPAN lang=EN-US><o:p><FONT face=Verdana> <BR></P></FONT></o:p></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana"> <P class=MsoNormal style="MARGIN: 7.8pt 0cm 0pt; TEXT-INDENT: 21pt; mso-para-margin-top: .5gd; mso-char-indent-count: 2.0"><BR>    下面是具体的代码Q?/SPAN><SPAN lang=EN-US><FONT face=Verdana>StandardComparator</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">cȝ代码?/SPAN><SPAN lang=EN-US><FONT face=Verdana>NameComparator</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">cȝ代码大同异Q在q里不列出)Q?/SPAN></P> <P class=MsoNormal style="MARGIN: 7.8pt 0cm 0pt; TEXT-INDENT: 21pt; mso-para-margin-top: .5gd; mso-char-indent-count: 2.0"><SPAN lang=EN-US><o:p><FONT face=Verdana> </FONT></o:p></SPAN></P> <P class=MsoNormal style="MARGIN: 7.8pt 0cm 0pt; TEXT-INDENT: 21.1pt; mso-para-margin-top: .5gd; mso-char-indent-count: 2.0"><B style="mso-bidi-font-weight: normal"><SPAN lang=EN-US><FONT face=Verdana>NameComparator</FONT></SPAN></B><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">c:</SPAN><SPAN lang=EN-US><o:p></o:p></SPAN></B></P> <P class=MsoNormal style="MARGIN: 7.8pt 0cm 0pt; TEXT-INDENT: 21pt; mso-para-margin-top: .5gd; mso-char-indent-count: 2.0"><SPAN lang=EN-US><o:p><FONT face=Verdana> </FONT></o:p></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 18pt; mso-char-indent-count: 2.0"><I style="mso-bidi-font-style: normal"><SPAN lang=EN-US style="FONT-SIZE: 9pt"><FONT face=Verdana></P> <DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid"> <DIV><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">package com.lim.designpatterns.strategy;<BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align=top><BR><IMG id=Codehighlighter1_95_352_Open_Image onclick="this.style.display='none'; Codehighlighter1_95_352_Open_Text.style.display='none'; Codehighlighter1_95_352_Closed_Image.style.display='inline'; Codehighlighter1_95_352_Closed_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_95_352_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_95_352_Closed_Text.style.display='none'; Codehighlighter1_95_352_Open_Image.style.display='inline'; Codehighlighter1_95_352_Open_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedBlock.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">class</SPAN><SPAN style="COLOR: #000000"> NameComparator implements ItemComparator</SPAN><SPAN id=Codehighlighter1_95_352_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 src="http://www.aygfsteel.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_95_352_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG id=Codehighlighter1_115_116_Open_Image onclick="this.style.display='none'; Codehighlighter1_115_116_Open_Text.style.display='none'; Codehighlighter1_115_116_Closed_Image.style.display='inline'; Codehighlighter1_115_116_Closed_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_115_116_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_115_116_Closed_Text.style.display='none'; Codehighlighter1_115_116_Open_Image.style.display='inline'; Codehighlighter1_115_116_Open_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>  NameComparator()</SPAN><SPAN id=Codehighlighter1_115_116_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 src="http://www.aygfsteel.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_115_116_Open_Text><SPAN style="COLOR: #000000">{}</SPAN></SPAN><SPAN style="COLOR: #000000">  </SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000"> 构造器装Q包外的cL得到Comparator实例只能通过单工?/SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #000000"><BR><IMG id=Codehighlighter1_199_350_Open_Image onclick="this.style.display='none'; Codehighlighter1_199_350_Open_Text.style.display='none'; Codehighlighter1_199_350_Closed_Image.style.display='inline'; Codehighlighter1_199_350_Closed_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_199_350_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_199_350_Closed_Text.style.display='none'; Codehighlighter1_199_350_Open_Image.style.display='inline'; Codehighlighter1_199_350_Open_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>  </SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">int</SPAN><SPAN style="COLOR: #000000"> compare(Object o1,Object o2)</SPAN><SPAN id=Codehighlighter1_199_350_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 src="http://www.aygfsteel.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_199_350_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align=top>    String name1</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">((ItemBean)o1).getName();<BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align=top>    String name2</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">((ItemBean)o2).getName();<BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align=top>    </SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000"> name1.compareTo(name2);  </SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000"> 调用String的CompareToҎ</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top></SPAN><SPAN style="COLOR: #000000">  }</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align=top></SPAN></DIV></DIV> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 18pt; mso-char-indent-count: 2.0"></FONT></SPAN></I></P> <P class=MsoNormal style="MARGIN: 7.8pt 0cm 0pt; TEXT-INDENT: 21pt; mso-para-margin-top: .5gd; mso-char-indent-count: 2.0"><SPAN lang=EN-US><o:p><FONT face=Verdana> </FONT></o:p></SPAN></P> <P class=MsoNormal style="MARGIN: 7.8pt 0cm 0pt; TEXT-INDENT: 21.1pt; mso-para-margin-top: .5gd; mso-char-indent-count: 2.0"><B style="mso-bidi-font-weight: normal"><SPAN lang=EN-US><FONT face=Verdana>PriceComparator</FONT></SPAN></B><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">c?/SPAN><SPAN lang=EN-US><o:p></o:p></SPAN></B></P> <P class=MsoNormal style="MARGIN: 7.8pt 0cm 0pt; TEXT-INDENT: 21pt; mso-para-margin-top: .5gd; mso-char-indent-count: 2.0"><SPAN lang=EN-US><o:p><FONT face=Verdana> </FONT></o:p></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 18pt; mso-char-indent-count: 2.0"><I style="mso-bidi-font-style: normal"><SPAN lang=EN-US style="FONT-SIZE: 9pt"><FONT face=Verdana></P> <DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid"> <DIV><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">package com.lim.designpatterns.strategy;<BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align=top><BR><IMG id=Codehighlighter1_96_345_Open_Image onclick="this.style.display='none'; Codehighlighter1_96_345_Open_Text.style.display='none'; Codehighlighter1_96_345_Closed_Image.style.display='inline'; Codehighlighter1_96_345_Closed_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_96_345_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_96_345_Closed_Text.style.display='none'; Codehighlighter1_96_345_Open_Image.style.display='inline'; Codehighlighter1_96_345_Open_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedBlock.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">class</SPAN><SPAN style="COLOR: #000000"> PriceComparator implements ItemComparator</SPAN><SPAN id=Codehighlighter1_96_345_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 src="http://www.aygfsteel.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_96_345_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG id=Codehighlighter1_117_118_Open_Image onclick="this.style.display='none'; Codehighlighter1_117_118_Open_Text.style.display='none'; Codehighlighter1_117_118_Closed_Image.style.display='inline'; Codehighlighter1_117_118_Closed_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_117_118_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_117_118_Closed_Text.style.display='none'; Codehighlighter1_117_118_Open_Image.style.display='inline'; Codehighlighter1_117_118_Open_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>  PriceComparator()</SPAN><SPAN id=Codehighlighter1_117_118_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 src="http://www.aygfsteel.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_117_118_Open_Text><SPAN style="COLOR: #000000">{}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG id=Codehighlighter1_162_343_Open_Image onclick="this.style.display='none'; Codehighlighter1_162_343_Open_Text.style.display='none'; Codehighlighter1_162_343_Closed_Image.style.display='inline'; Codehighlighter1_162_343_Closed_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_162_343_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_162_343_Closed_Text.style.display='none'; Codehighlighter1_162_343_Open_Image.style.display='inline'; Codehighlighter1_162_343_Open_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>  </SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">int</SPAN><SPAN style="COLOR: #000000"> compare(Object o1,Object o2)</SPAN><SPAN id=Codehighlighter1_162_343_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 src="http://www.aygfsteel.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_162_343_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align=top>    Double price1</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000"> Double(((ItemBean)o1).getPrice());<BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align=top>    Double price2</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000"> Double(((ItemBean)o2).getPrice());<BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align=top>    </SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000"> price1.compareTo(price2);  </SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000"> 调用Double的CompareToҎ</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top></SPAN><SPAN style="COLOR: #000000">  }</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</SPAN></SPAN></DIV></DIV> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 18pt; mso-char-indent-count: 2.0"></FONT></SPAN></I><SPAN lang=EN-US><o:p><FONT face=Verdana> </FONT></o:p></SPAN></P> <P class=MsoNormal style="MARGIN: 7.8pt 0cm 0pt; TEXT-INDENT: 21.1pt; mso-para-margin-top: .5gd; mso-char-indent-count: 2.0"><B style="mso-bidi-font-weight: normal"><SPAN lang=EN-US><FONT face=Verdana>RegisterDateComparator</FONT></SPAN></B><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">c?/SPAN><SPAN lang=EN-US><o:p></o:p></SPAN></B></P> <P class=MsoNormal style="MARGIN: 7.8pt 0cm 0pt; TEXT-INDENT: 21pt; mso-para-margin-top: .5gd; mso-char-indent-count: 2.0"><SPAN lang=EN-US><o:p><FONT face=Verdana> </FONT></o:p></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 18pt; mso-char-indent-count: 2.0"><I style="mso-bidi-font-style: normal"><SPAN lang=EN-US style="FONT-SIZE: 9pt"><FONT face=Verdana></P> <DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid"> <DIV><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">package com.lim.designpatterns.strategy;<BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align=top><BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align=top>import java.util.</SPAN><SPAN style="COLOR: #000000">*</SPAN><SPAN style="COLOR: #000000">;<BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align=top><BR><IMG id=Codehighlighter1_124_360_Open_Image onclick="this.style.display='none'; Codehighlighter1_124_360_Open_Text.style.display='none'; Codehighlighter1_124_360_Closed_Image.style.display='inline'; Codehighlighter1_124_360_Closed_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_124_360_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_124_360_Closed_Text.style.display='none'; Codehighlighter1_124_360_Open_Image.style.display='inline'; Codehighlighter1_124_360_Open_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedBlock.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">class</SPAN><SPAN style="COLOR: #000000"> RegisterDateComparator implements ItemComparator</SPAN><SPAN id=Codehighlighter1_124_360_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 src="http://www.aygfsteel.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_124_360_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG id=Codehighlighter1_152_153_Open_Image onclick="this.style.display='none'; Codehighlighter1_152_153_Open_Text.style.display='none'; Codehighlighter1_152_153_Closed_Image.style.display='inline'; Codehighlighter1_152_153_Closed_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_152_153_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_152_153_Closed_Text.style.display='none'; Codehighlighter1_152_153_Open_Image.style.display='inline'; Codehighlighter1_152_153_Open_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>  RegisterDateComparator()</SPAN><SPAN id=Codehighlighter1_152_153_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 src="http://www.aygfsteel.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_152_153_Open_Text><SPAN style="COLOR: #000000">{}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG id=Codehighlighter1_197_358_Open_Image onclick="this.style.display='none'; Codehighlighter1_197_358_Open_Text.style.display='none'; Codehighlighter1_197_358_Closed_Image.style.display='inline'; Codehighlighter1_197_358_Closed_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_197_358_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_197_358_Closed_Text.style.display='none'; Codehighlighter1_197_358_Open_Image.style.display='inline'; Codehighlighter1_197_358_Open_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>  </SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">int</SPAN><SPAN style="COLOR: #000000"> compare(Object o1,Object o2)</SPAN><SPAN id=Codehighlighter1_197_358_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 src="http://www.aygfsteel.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_197_358_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align=top>    Date date1</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">((ItemBean)o1).getRegisterDate();<BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align=top>    Date date2</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">((ItemBean)o2).getRegisterDate();<BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align=top>    </SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000"> date1.compareTo(date2);  </SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000"> 调用Date的CompareToҎ</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top></SPAN><SPAN style="COLOR: #000000">  }</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</SPAN></SPAN></DIV></DIV> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 18pt; mso-char-indent-count: 2.0"></FONT></SPAN></I><SPAN lang=EN-US><o:p><FONT face=Verdana> </FONT></o:p></SPAN></P> <P class=MsoNormal style="MARGIN: 7.8pt 0cm 0pt; TEXT-INDENT: 21.1pt; mso-para-margin-top: .5gd; mso-char-indent-count: 2.0"><B style="mso-bidi-font-weight: normal"><SPAN lang=EN-US><FONT face=Verdana>ItemSort</FONT></SPAN></B><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">c?/SPAN><SPAN lang=EN-US><o:p></o:p></SPAN></B></P> <P class=MsoNormal style="MARGIN: 7.8pt 0cm 0pt; TEXT-INDENT: 21pt; mso-para-margin-top: .5gd; mso-char-indent-count: 2.0"><SPAN lang=EN-US><o:p><FONT face=Verdana> </FONT></o:p></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 18pt; mso-char-indent-count: 2.0"><I style="mso-bidi-font-style: normal"><SPAN lang=EN-US style="FONT-SIZE: 9pt"><FONT face=Verdana></P> <DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid"> <DIV><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">package com.lim.designpatterns.strategy;<BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align=top><BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align=top>import java.util.</SPAN><SPAN style="COLOR: #000000">*</SPAN><SPAN style="COLOR: #000000">;<BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align=top><BR><IMG id=Codehighlighter1_84_486_Open_Image onclick="this.style.display='none'; Codehighlighter1_84_486_Open_Text.style.display='none'; Codehighlighter1_84_486_Closed_Image.style.display='inline'; Codehighlighter1_84_486_Closed_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_84_486_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_84_486_Closed_Text.style.display='none'; Codehighlighter1_84_486_Open_Image.style.display='inline'; Codehighlighter1_84_486_Open_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedBlock.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">class</SPAN><SPAN style="COLOR: #000000"> ItemSort</SPAN><SPAN id=Codehighlighter1_84_486_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 src="http://www.aygfsteel.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_84_486_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG id=Codehighlighter1_140_193_Open_Image onclick="this.style.display='none'; Codehighlighter1_140_193_Open_Text.style.display='none'; Codehighlighter1_140_193_Closed_Image.style.display='inline'; Codehighlighter1_140_193_Closed_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_140_193_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_140_193_Closed_Text.style.display='none'; Codehighlighter1_140_193_Open_Image.style.display='inline'; Codehighlighter1_140_193_Open_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>  </SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">static</SPAN><SPAN style="COLOR: #000000"> List sort(List items,ItemComparator c)</SPAN><SPAN id=Codehighlighter1_140_193_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 src="http://www.aygfsteel.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_140_193_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align=top>    Collections.sort(items,c);<BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align=top>    </SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000"> items;<BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>  }</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align=top>  </SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">static</SPAN><SPAN style="COLOR: #000000"> final ItemComparator NAME</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000"> NameComparator();  </SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000"> 单工?/SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align=top>  </SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">static</SPAN><SPAN style="COLOR: #000000"> final ItemComparator PRICE</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000"> PriceComparator();<BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align=top>  </SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">static</SPAN><SPAN style="COLOR: #000000"> final ItemComparator STANDARD</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000"> StandardComparator();<BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align=top>  </SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">static</SPAN><SPAN style="COLOR: #000000"> final ItemComparator REG_DATE</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000"> RegisterDateComparator();<BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</SPAN></SPAN></DIV></DIV> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 18pt; mso-char-indent-count: 2.0"></FONT></SPAN></I><SPAN lang=EN-US><o:p><FONT face=Verdana> </FONT></o:p></SPAN></P> <P class=MsoNormal style="MARGIN: 7.8pt 0cm 0pt; TEXT-INDENT: 21.1pt; mso-para-margin-top: .5gd; mso-char-indent-count: 2.0"><B style="mso-bidi-font-weight: normal"><SPAN lang=EN-US><FONT face=Verdana>TestItemSort</FONT></SPAN></B><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">c?/SPAN><SPAN lang=EN-US><o:p></o:p></SPAN></B></P> <P class=MsoNormal style="MARGIN: 7.8pt 0cm 0pt; TEXT-INDENT: 21pt; mso-para-margin-top: .5gd; mso-char-indent-count: 2.0"><SPAN lang=EN-US><o:p><FONT face=Verdana> </FONT></o:p></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 18pt; mso-char-indent-count: 2.0"><I style="mso-bidi-font-style: normal"><SPAN lang=EN-US style="FONT-SIZE: 9pt"><FONT face=Verdana></P> <DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid"> <DIV><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">package com.lim.designpatterns.strategy;<BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align=top><BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align=top>import java.util.</SPAN><SPAN style="COLOR: #000000">*</SPAN><SPAN style="COLOR: #000000">;<BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align=top><BR><IMG id=Codehighlighter1_88_424_Open_Image onclick="this.style.display='none'; Codehighlighter1_88_424_Open_Text.style.display='none'; Codehighlighter1_88_424_Closed_Image.style.display='inline'; Codehighlighter1_88_424_Closed_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_88_424_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_88_424_Closed_Text.style.display='none'; Codehighlighter1_88_424_Open_Image.style.display='inline'; Codehighlighter1_88_424_Open_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedBlock.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">class</SPAN><SPAN style="COLOR: #000000"> TestItemSort</SPAN><SPAN id=Codehighlighter1_88_424_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 src="http://www.aygfsteel.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_88_424_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG id=Codehighlighter1_130_422_Open_Image onclick="this.style.display='none'; Codehighlighter1_130_422_Open_Text.style.display='none'; Codehighlighter1_130_422_Closed_Image.style.display='inline'; Codehighlighter1_130_422_Closed_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_130_422_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_130_422_Closed_Text.style.display='none'; Codehighlighter1_130_422_Open_Image.style.display='inline'; Codehighlighter1_130_422_Open_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>  </SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">static</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">void</SPAN><SPAN style="COLOR: #000000"> main(String[] args)</SPAN><SPAN id=Codehighlighter1_130_422_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 src="http://www.aygfsteel.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_130_422_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align=top>    List items</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000"> ArrayList();<BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align=top>    </SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000"> 向Listd条目</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align=top>    items</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">ItemSort.sort(items,ItemSort.NAME);  </SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000"> 按名U排?/SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align=top>    items</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">ItemSort.sort(items,ItemSort.PRICE);  </SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000"> 按h格排?/SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align=top>    items</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">ItemSort.sort(items,ItemSort.REG_DATE);  </SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000"> 按注册日期排?/SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align=top>    items</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">ItemSort.sort(items,ItemSort.STANDARD);  </SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000"> 按规格排?/SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top></SPAN><SPAN style="COLOR: #000000">  }</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</SPAN></SPAN></DIV></DIV></FONT></SPAN></I><img src ="http://www.aygfsteel.com/fidodido/aggbug/9181.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/fidodido/" target="_blank">^ Mustang ^</a> 2005-08-04 12:37 <a href="http://www.aygfsteel.com/fidodido/archive/2005/08/04/9181.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <a href="http://www.aygfsteel.com/" title="狠狠久久亚洲欧美专区_中文字幕亚洲综合久久202_国产精品亚洲第五区在线_日本免费网站视频">狠狠久久亚洲欧美专区_中文字幕亚洲综合久久202_国产精品亚洲第五区在线_日本免费网站视频</a> </div> </footer> վ֩ģ壺 <a href="http://" target="_blank">Ƥ</a>| <a href="http://" target="_blank">ͭ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ԭƽ</a>| <a href="http://" target="_blank">³ľ</a>| <a href="http://" target="_blank">Ӷ</a>| <a href="http://" target="_blank">ƽ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">İ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ͷ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">캵</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">γ</a>| <a href="http://" target="_blank">֯</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ʦ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ˮ</a>| <a href="http://" target="_blank">޶</a>| <a href="http://" target="_blank">ʲ</a>| <a href="http://" target="_blank">¡</a>| <a href="http://" target="_blank">ƽ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ٰ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ϲ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">;</a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>