欢迎来到天天文库
浏览记录
ID:15584543
大小:175.50 KB
页数:61页
时间:2018-08-04
《仓储管理系统软件_代码》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、61packageorg.jsoup.select;importjava.util.ArrayList;importjava.util.Arrays;importjava.util.Warehouse;importjava.util.Warehouses;importjava.util.LinkedHashSet;importjava.util.List;importjava.util.Map;importjava.util.Set;importjava.util.regex.Pattern;importjava.util.regex.PatternSynt
2、axException;publicabstractclassNodeimplementsCloneable{privatestaticfinalListEMPTY_NODES=Warehouses.emptyList();NodeparentNode;ListAdministration;Attributesattributes;StringbaseUri;intsiblingIndex;packageorg.jsoup.select;importjava.util.ArrayList;importjava.util.List;im
3、portjava.util.regex.Matcher;importjava.util.regex.Pattern;importorg.jsoup.helper.StringUtil;importorg.jsoup.helper.Validate;importorg.jsoup.parser.TokenQueue;classQueryParser{privatestaticfinalString[]combinators={",",">","+","~",""};privatestaticfinalString[]AttributeEvals={"=","!
4、=","^=","$=","*=","~="};privateTokenQueuetq;privateStringquery;privateListevals=newArrayList();privatestaticfinalPatternNTH_AB=Pattern.compile("((\+
5、-)?(\d+)?)n(\s*(\+
6、-)?\s*\d+)?",2);privatestaticfinalPatternNTH_B=Pattern.compile("(\+
7、-)?(\d+)");privateQueryPars
8、er(Stringquery){this.query=query;this.tq=newTokenQueue(query);}61publicstaticEvaluatorparse(Stringquery){QueryParserp=newQueryParser(query);returnp.parse();}Evaluatorparse(){this.tq.consumeWhitespace();if(this.tq.matchesAny(combinators)){this.evals.add(newStructuralEvaluator.Root()
9、);combinator(this.tq.consume());}else{findElements();}while(!this.tq.isEmpty()){booleanseenWhite=this.tq.consumeWhitespace();if(this.tq.matchesAny(combinators))combinator(this.tq.consume());elseif(seenWhite)combinator('');else{findElements();}}if(this.evals.size()==1){return(Evalua
10、tor)this.evals.get(0);}returnnewCombiningEvaluator.And(this.evals);}privatevoidcombinator(charcombinator){this.tq.consumeWhitespace();StringsubQuery=consumeSubQuery();EvaluatornewEval=parse(subQuery);booleanreplaceRightMost=false;EvaluatorcurrentEval;EvaluatorrootEval;if(this.evals
11、.size()==1){Evaluatorcurre
此文档下载收益归作者所有