[Jakarta Commons笔记] Commons Collections

openkk 13年前
     <div class="postbody">     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:'Trebuchet MS';" lang="EN-US">Commons Collections</span><span style="font-family:宋体;">,又是一个重量级的东西,为</span><span style="font-family:'Trebuchet MS';" lang="EN-US">Java</span><span style="font-family:宋体;">标准的</span><span style="font-family:'Trebuchet MS';" lang="EN-US">Collections API</span><span style="font-family:宋体;">提供了相当好的补充。我不知道其他人,就我自己而言,让我用</span><span style="font-family:'Trebuchet MS';" lang="EN-US">java.util.Collection</span><span style="font-family:宋体;">及其子类,加上</span><span style="font-family:'Trebuchet MS';" lang="EN-US">java.util.Collections</span><span style="font-family:宋体;">类提供的操作方法,处理一些简单的数据结构问题还可以,稍微复杂一点的就觉得有点头痛,很多细节的地方需要我插入这样那样的小逻辑,或者感觉它太死板,不够灵活,再或者确实有点晦涩吧。再说了,如果我只是处理一般的数据结构问题,为什么不自己用数组或者自定义的链表来做,再加上</span><span style="font-family:'Trebuchet MS';" lang="EN-US">Jakarta Commons</span><span style="font-family:宋体;">的</span><span style="font-family:'Trebuchet MS';" lang="EN-US">Lang</span><span style="font-family:宋体;">提供的</span><span style="font-family:'Trebuchet MS';" lang="EN-US">ArrayUtils</span><span style="font-family:宋体;">、</span><span style="font-family:'Trebuchet MS';" lang="EN-US">StringUtils</span><span style="font-family:宋体;">等,已经基本够了,性能可以保证,那么还要这个</span><span style="font-family:'Trebuchet MS';" lang="EN-US">Collections API</span><span style="font-family:宋体;">干嘛。当然,说到这里有些偏激了,</span><span style="font-family:'Trebuchet MS';" lang="EN-US">Collections</span><span style="font-family:宋体;">当然有它存在的道理,能够把常用的数据结构归纳起来,以通用的方式去维护和访问,这应该说是一种进步,但是用起来似乎不够友好。这个时候我就会想,如果</span><span style="font-family:'Trebuchet MS';" lang="EN-US">Java</span><span style="font-family:宋体;">比现在做得更好用些,或者有一套第三方的</span><span style="font-family:'Trebuchet MS';" lang="EN-US">API</span><span style="font-family:宋体;">把我的这些需求抽象出来,实现了,该多好。</span><span style="font-family:'Trebuchet MS';" lang="EN-US">Commons Collections</span><span style="font-family:宋体;">就是这样一套</span><span style="font-family:'Trebuchet MS';" lang="EN-US">API</span><span style="font-family:宋体;">。</span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:'Trebuchet MS';" lang="EN-US"> </span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:宋体;">在这里可以找到下载链接:(</span><span style="font-family:'Trebuchet MS';" lang="EN-US">binary</span><span style="font-family:宋体;">和</span><span style="font-family:'Trebuchet MS';" lang="EN-US">src</span><span style="font-family:宋体;">都有)</span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:'Trebuchet MS';" lang="EN-US"><a href="/misc/goto?guid=4959500026451355982">http://jakarta.apache.org/site/downloads/downloads_commons-collections.cgi</a></span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:'Trebuchet MS';" lang="EN-US"> </span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:宋体;">目前</span><span style="font-family:'Trebuchet MS';" lang="EN-US">Commons Collection</span><span style="font-family:宋体;">发布的最新版本是</span><span style="font-family:'Trebuchet MS';" lang="EN-US">3.1</span><span style="font-family:宋体;">。建议下载这个</span><span style="font-family:'Trebuchet MS';" lang="EN-US">3.1</span><span style="font-family:宋体;">版本,页面上出现的</span><span style="font-family:'Trebuchet MS';" lang="EN-US">2.1.1</span><span style="font-family:宋体;">是针对</span><span style="font-family:'Trebuchet MS';" lang="EN-US">2.1</span><span style="font-family:宋体;">不兼容</span><span style="font-family:'Trebuchet MS';" lang="EN-US">3.0</span><span style="font-family:宋体;">而发布的升级维护版。</span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:'Trebuchet MS';" lang="EN-US"> </span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:宋体;">我们先来浏览一下它的包结构。一共是</span><span style="font-family:'Trebuchet MS';" lang="EN-US">12</span><span style="font-family:宋体;">个:</span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:'Trebuchet MS';" lang="EN-US"> </span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:'Trebuchet MS';color:navy;" lang="EN-US">org.apache.commons.collections – Commons Collections</span><span style="font-family:宋体;color:navy;">自定义的一组公用的接口和工具类</span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:'Trebuchet MS';color:navy;" lang="EN-US">org.apache.commons.collections.bag – </span><span style="font-family:宋体;color:navy;">实现</span><span style="font-family:'Trebuchet MS';color:navy;" lang="EN-US">Bag</span><span style="font-family:宋体;color:navy;">接口的一组类</span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:'Trebuchet MS';color:navy;" lang="EN-US">org.apache.commons.collections.bidimap – </span><span style="font-family:宋体;color:navy;">实现</span><span style="font-family:'Trebuchet MS';color:navy;" lang="EN-US">BidiMap</span><span style="font-family:宋体;color:navy;">系列接口的一组类</span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:'Trebuchet MS';color:navy;" lang="EN-US">org.apache.commons.collections.buffer – </span><span style="font-family:宋体;color:navy;">实现</span><span style="font-family:'Trebuchet MS';color:navy;" lang="EN-US">Buffer</span><span style="font-family:宋体;color:navy;">接口的一组类</span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:'Trebuchet MS';color:navy;" lang="EN-US">org.apache.commons.collections.collection – </span><span style="font-family:宋体;color:navy;">实现</span><span style="font-family:'Trebuchet MS';color:navy;" lang="EN-US">java.util.Collection</span><span style="font-family:宋体;color:navy;">接口的一组类</span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:'Trebuchet MS';color:navy;" lang="EN-US">org.apache.commons.collections.comparators – </span><span style="font-family:宋体;color:navy;">实现</span><span style="font-family:'Trebuchet MS';color:navy;" lang="EN-US">java.util.Comparator</span><span style="font-family:宋体;color:navy;">接口的一组类</span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:'Trebuchet MS';color:navy;" lang="EN-US">org.apache.commons.collections.functors – Commons Collections</span><span style="font-family:宋体;color:navy;">自定义的一组功能类</span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:'Trebuchet MS';color:navy;" lang="EN-US">org.apache.commons.collections.iterators – </span><span style="font-family:宋体;color:navy;">实现</span><span style="font-family:'Trebuchet MS';color:navy;" lang="EN-US">java.util.Iterator</span><span style="font-family:宋体;color:navy;">接口的一组类</span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:'Trebuchet MS';color:navy;" lang="EN-US">org.apache.commons.collections.keyvalue – </span><span style="font-family:宋体;color:navy;">实现集合和键</span><span style="font-family:'Trebuchet MS';color:navy;" lang="EN-US">/</span><span style="font-family:宋体;color:navy;">值映射相关的一组类</span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:'Trebuchet MS';color:navy;" lang="EN-US">org.apache.commons.collections.list – </span><span style="font-family:宋体;color:navy;">实现</span><span style="font-family:'Trebuchet MS';color:navy;" lang="EN-US">java.util.List</span><span style="font-family:宋体;color:navy;">接口的一组类</span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:'Trebuchet MS';color:navy;" lang="EN-US">org.apache.commons.collections.map – </span><span style="font-family:宋体;color:navy;">实现</span><span style="font-family:'Trebuchet MS';color:navy;" lang="EN-US">Map</span><span style="font-family:宋体;color:navy;">系列接口的一组类</span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:'Trebuchet MS';color:navy;" lang="EN-US">org.apache.commons.collections.set – </span><span style="font-family:宋体;color:navy;">实现</span><span style="font-family:'Trebuchet MS';color:navy;" lang="EN-US">Set</span><span style="font-family:宋体;color:navy;">系列接口的一组类</span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:'Trebuchet MS';" lang="EN-US"> </span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:宋体;">用过</span><span style="font-family:'Trebuchet MS';" lang="EN-US">Java Collections API</span><span style="font-family:宋体;">的朋友大概或多或少会同意我如下的划分:在</span><span style="font-family:'Trebuchet MS';" lang="EN-US">Java</span><span style="font-family:宋体;">的</span><span style="font-family:'Trebuchet MS';" lang="EN-US">Collections API</span><span style="font-family:宋体;">中,不狭义的区分语法上的接口和类,把它们都看作是类的话,大致我们可以发现三种主要的类别:</span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:'Trebuchet MS';" lang="EN-US"> </span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:'Trebuchet MS';" lang="EN-US">1- </span><span style="font-family:宋体;">容器类:如</span><span style="font-family:'Trebuchet MS';" lang="EN-US">Collection</span><span style="font-family:宋体;">、</span><span style="font-family:'Trebuchet MS';" lang="EN-US">List</span><span style="font-family:宋体;">、</span><span style="font-family:'Trebuchet MS';" lang="EN-US">Map</span><span style="font-family:宋体;">等,用于存放对象和进行简单操作的;</span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:'Trebuchet MS';" lang="EN-US">2- </span><span style="font-family:宋体;">操作类:如</span><span style="font-family:'Trebuchet MS';" lang="EN-US">Collections</span><span style="font-family:宋体;">、</span><span style="font-family:'Trebuchet MS';" lang="EN-US">Arrays</span><span style="font-family:宋体;">等,用于对容器类的实例进行相对复杂操作如排序等;</span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:'Trebuchet MS';" lang="EN-US">3- </span><span style="font-family:宋体;">辅助类:如</span><span style="font-family:'Trebuchet MS';" lang="EN-US">Iterator</span><span style="font-family:宋体;">、</span><span style="font-family:'Trebuchet MS';" lang="EN-US">Comparator</span><span style="font-family:宋体;">等,用于辅助操作类以及外部调用代码实现对容器类的操作,所谓辅助,概括而通俗的来讲,就是这些类提供一种算法,你给它一个对象或者一组对象,或者仅仅是按一定的规则调用它,它给你一个运算后的答案,帮助你正确处理容器对象。比如</span><span style="font-family:'Trebuchet MS';" lang="EN-US">Iterator</span><span style="font-family:宋体;">会告诉你容器中下一个对象有没有、是什么,而</span><span style="font-family:'Trebuchet MS';" lang="EN-US">Comparator</span><span style="font-family:宋体;">将对象大小</span><span style="font-family:'Trebuchet MS';" lang="EN-US">/</span><span style="font-family:宋体;">先后次序的算法逻辑独立出来。</span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:'Trebuchet MS';" lang="EN-US"> </span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:宋体;">同样,</span><span style="font-family:'Trebuchet MS';" lang="EN-US">Jakarta Commons Collections</span><span style="font-family:宋体;">我们细细看来,也能够找出类似的划分:</span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:'Trebuchet MS';" lang="EN-US"> </span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:'Trebuchet MS';" lang="EN-US">1- </span><span style="font-family:宋体;">作为容器类的补充,我们可以找到</span><span style="font-family:'Trebuchet MS';" lang="EN-US">Bag</span><span style="font-family:宋体;">、</span><span style="font-family:'Trebuchet MS';" lang="EN-US">Buffer</span><span style="font-family:宋体;">、</span><span style="font-family:'Trebuchet MS';" lang="EN-US">BidiMap</span><span style="font-family:宋体;">、</span><span style="font-family:'Trebuchet MS';" lang="EN-US">OrderedMap</span><span style="font-family:宋体;">等等;</span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:'Trebuchet MS';" lang="EN-US">2- </span><span style="font-family:宋体;">作为操作类的补充,我们可以找到</span><span style="font-family:'Trebuchet MS';" lang="EN-US">CollectionUtils</span><span style="font-family:宋体;">、</span><span style="font-family:'Trebuchet MS';" lang="EN-US">IteratorUtils</span><span style="font-family:宋体;">、</span><span style="font-family:'Trebuchet MS';" lang="EN-US">ListUtils</span><span style="font-family:宋体;">、</span><span style="font-family:'Trebuchet MS';" lang="EN-US">SetUtils</span><span style="font-family:宋体;">等等;</span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:'Trebuchet MS';" lang="EN-US">3- </span><span style="font-family:宋体;">作为辅助类的补充,我们可以找到</span><span style="font-family:'Trebuchet MS';" lang="EN-US">MapIterator</span><span style="font-family:宋体;">、</span><span style="font-family:'Trebuchet MS';" lang="EN-US">Closure</span><span style="font-family:宋体;">、</span><span style="font-family:'Trebuchet MS';" lang="EN-US">Predicate</span><span style="font-family:宋体;">、</span><span style="font-family:'Trebuchet MS';" lang="EN-US">Transformer</span><span style="font-family:宋体;">等等;</span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:'Trebuchet MS';" lang="EN-US"> </span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:宋体;">对于这样的一个大包,当然不可能一个类一个类的讲了,找一些常用的和有用的当做接下来讨论的话题吧。大概列个清单:</span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:'Trebuchet MS';" lang="EN-US"> </span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:'Trebuchet MS';" lang="EN-US">Bag</span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:'Trebuchet MS';" lang="EN-US">HashBag</span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:'Trebuchet MS';" lang="EN-US">BagUtils</span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:'Trebuchet MS';" lang="EN-US"> </span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:'Trebuchet MS';" lang="EN-US">Buffer</span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:'Trebuchet MS';" lang="EN-US">BlockingBuffer</span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:'Trebuchet MS';" lang="EN-US">BoundedFifoBuffer</span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:'Trebuchet MS';" lang="EN-US">PriorityBuffer</span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:'Trebuchet MS';" lang="EN-US">BufferUtils</span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:'Trebuchet MS';" lang="EN-US"> </span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:'Trebuchet MS';" lang="EN-US">MultiMap</span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:'Trebuchet MS';" lang="EN-US">BidiMap</span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:'Trebuchet MS';" lang="EN-US">CaseInsensitiveMap</span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:'Trebuchet MS';" lang="EN-US">LazyMap</span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:'Trebuchet MS';" lang="EN-US">MapUtils</span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:'Trebuchet MS';" lang="EN-US"> </span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:'Trebuchet MS';" lang="EN-US">TypedCollection</span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:'Trebuchet MS';" lang="EN-US">CollectionUtils</span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:'Trebuchet MS';" lang="EN-US"> </span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:'Trebuchet MS';" lang="EN-US">ReverseComparator</span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:'Trebuchet MS';" lang="EN-US">ComparatorChain</span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:'Trebuchet MS';" lang="EN-US">NullComparator</span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:'Trebuchet MS';" lang="EN-US">FixedOrderComparator</span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:'Trebuchet MS';" lang="EN-US">ComparatorUtils</span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:'Trebuchet MS';" lang="EN-US"> </span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:'Trebuchet MS';" lang="EN-US">Predicate</span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:'Trebuchet MS';" lang="EN-US">AndPredicate</span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:'Trebuchet MS';" lang="EN-US">OrPredicate</span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:'Trebuchet MS';" lang="EN-US">AllPredicate</span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:'Trebuchet MS';" lang="EN-US">OnePredicate</span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:'Trebuchet MS';" lang="EN-US">NonePredicate</span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:'Trebuchet MS';" lang="EN-US">PredicateUtils</span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:'Trebuchet MS';" lang="EN-US"> </span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:'Trebuchet MS';" lang="EN-US">Transformer</span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:'Trebuchet MS';" lang="EN-US">ChainedTransformer</span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:'Trebuchet MS';" lang="EN-US">SwitchTransformer</span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:'Trebuchet MS';" lang="EN-US">TransformerUtils</span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:'Trebuchet MS';" lang="EN-US"> </span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:'Trebuchet MS';" lang="EN-US">Closure</span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:'Trebuchet MS';" lang="EN-US">ChainedClosure</span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:'Trebuchet MS';" lang="EN-US">IfClosure</span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:'Trebuchet MS';" lang="EN-US">WhileClosure</span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:'Trebuchet MS';" lang="EN-US">ClosureUtils</span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:'Trebuchet MS';" lang="EN-US"> </span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:'Trebuchet MS';" lang="EN-US">LoopingIterator</span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:'Trebuchet MS';" lang="EN-US">ArrayListIterator</span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:'Trebuchet MS';" lang="EN-US">FilterIterator</span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:'Trebuchet MS';" lang="EN-US">UniqueFilterIterator</span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:'Trebuchet MS';" lang="EN-US">IteratorUtils</span></p>     <p style="margin:0cm 0cm 0pt;" class="MsoNormal"><span style="font-family:'Trebuchet MS';" lang="EN-US"> </span></p>     <span style="font-family:宋体;">总共</span>     <span style="font-family:'Trebuchet MS';" lang="EN-US">9</span>     <span style="font-family:宋体;">组,在接下来的笔记中我们一起慢慢的看。<br /> <br /> 转自:http://www.blogjava.net/coolingverse/articles/148139.html</span>    </div>