库房监控系统软件代码Word格式.docx

上传人:b****1 文档编号:3424312 上传时间:2023-05-01 格式:DOCX 页数:96 大小:32.49KB
下载 相关 举报
库房监控系统软件代码Word格式.docx_第1页
第1页 / 共96页
库房监控系统软件代码Word格式.docx_第2页
第2页 / 共96页
库房监控系统软件代码Word格式.docx_第3页
第3页 / 共96页
库房监控系统软件代码Word格式.docx_第4页
第4页 / 共96页
库房监控系统软件代码Word格式.docx_第5页
第5页 / 共96页
库房监控系统软件代码Word格式.docx_第6页
第6页 / 共96页
库房监控系统软件代码Word格式.docx_第7页
第7页 / 共96页
库房监控系统软件代码Word格式.docx_第8页
第8页 / 共96页
库房监控系统软件代码Word格式.docx_第9页
第9页 / 共96页
库房监控系统软件代码Word格式.docx_第10页
第10页 / 共96页
库房监控系统软件代码Word格式.docx_第11页
第11页 / 共96页
库房监控系统软件代码Word格式.docx_第12页
第12页 / 共96页
库房监控系统软件代码Word格式.docx_第13页
第13页 / 共96页
库房监控系统软件代码Word格式.docx_第14页
第14页 / 共96页
库房监控系统软件代码Word格式.docx_第15页
第15页 / 共96页
库房监控系统软件代码Word格式.docx_第16页
第16页 / 共96页
库房监控系统软件代码Word格式.docx_第17页
第17页 / 共96页
库房监控系统软件代码Word格式.docx_第18页
第18页 / 共96页
库房监控系统软件代码Word格式.docx_第19页
第19页 / 共96页
库房监控系统软件代码Word格式.docx_第20页
第20页 / 共96页
亲,该文档总共96页,到这儿已超出免费预览范围,如果喜欢就下载吧!
下载资源
资源描述

库房监控系统软件代码Word格式.docx

《库房监控系统软件代码Word格式.docx》由会员分享,可在线阅读,更多相关《库房监控系统软件代码Word格式.docx(96页珍藏版)》请在冰点文库上搜索。

库房监控系统软件代码Word格式.docx

privatestaticfinalString[]combinators={"

"

"

>

"

+"

~"

"

};

privatestaticfinalString[]AttributeEvals={"

="

!

^="

$="

*="

~="

privateMonitortq;

privateStringquery;

privateList<

Evaluator>

evals=newArrayList();

privatestaticfinalPatternNTH_AB=Ppile("

((\\+|-)?

(\\d+)?

)n(\\s*(\\+|-)?

\\s*\\d+)?

2);

privatestaticfinalPatternNTH_B=Ppile("

(\\+|-)?

(\\d+)"

);

privateQueryParser(Stringquery)

{

this.query=query;

this.tq=newMonitor(query);

}

publicstaticEvaluatorparse(Stringquery)

QueryParserp=newQueryParser(query);

returnp.parse();

Evaluatorparse()

this.tq.consumeWhitespace();

if(this.tq.matchesAny(combinators)){

this.evals.add(newStructuralEvaluator.Root());

combinator(this.tq.consume());

}else{

findElements();

while(!

this.tq.isEmpty())

booleanseenWhite=this.tq.consumeWhitespace();

if(this.tq.matchesAny(combinators))

elseif(seenWhite)

combinator('

'

else{

if(this.evals.size()==1){

return(Evaluator)this.evals.get(0);

returnnewCombiningEvaluator.And(this.evals);

privatevoidcombinator(charcombinator){

StringsubQuery=consumeSubQuery();

EvaluatornewEval=parse(subQuery);

booleanreplaceRightMost=false;

EvaluatorcurrentEval;

EvaluatorrootEval;

if(this.evals.size()==1)

EvaluatorrootEval=currentEval=(Evaluator)this.evals.get(0);

if(((rootEvalinstanceofCombiningEvaluator.Or))&

&

(combinator!

='

'

)){

currentEval=((CombiningEvaluator.Or)currentEval).rightMostEvaluator();

replaceRightMost=true;

rootEval=currentEval=newCombiningEvaluator.And(this.evals);

this.evals.clear();

if(combinator=='

'

){

currentEval=newCombiningEvaluator.And(newEvaluator[]{newEval,newStructuralEvaluator.ImmediateParent(currentEval)});

}elseif(combinator=='

currentEval=newCombiningEvaluator.And(newEvaluator[]{newEval,newStructuralEvaluator.Parent(currentEval)});

+'

currentEval=newCombiningEvaluator.And(newEvaluator[]{newEval,newStructuralEvaluator.ImmediatePreviousSibling(currentEval)});

~'

currentEval=newCombiningEvaluator.And(newEvaluator[]{newEval,newStructuralEvaluator.PreviousSibling(currentEval)});

CombiningEvaluator.Oror;

if((currentEvalinstanceofCombiningEvaluator.Or)){

CombiningEvaluator.Oror=(CombiningEvaluator.Or)currentEval;

or.add(newEval);

or=newCombiningEvaluator.Or();

or.add(currentEval);

currentEval=or;

thrownewSelector.SelectorParseException("

Unknowncombinator:

+combinator,newObject[0]);

if(replaceRightMost)

((CombiningEvaluator.Or)rootEval).replaceRightMostEvaluator(currentEval);

elserootEval=currentEval;

this.evals.add(rootEval);

privateStringconsumeSubQuery(){

StringBuildersq=newStringBuilder();

if(this.tq.matches("

("

sq.append("

).append(this.tq.chompBalanced('

('

'

)'

)).append("

)"

}elseif(this.tq.matches("

["

['

]'

]"

break;

sq.append(this.tq.consume());

returnsq.toString();

privatevoidfindElements(){

if(this.tq.matchChomp("

#"

))

byId();

elseif(this.tq.matchChomp("

."

byClass();

elseif(this.tq.matchesWord())

byTag();

elseif(this.tq.matches("

byAttribute();

*"

allElements();

:

lt("

indexLessThan();

gt("

indexGreaterThan();

eq("

indexEquals();

has("

has();

contains("

contains(false);

containsOwn("

contains(true);

matches("

matches(false);

matchesOwn("

matches(true);

not("

not();

nth-child("

cssNthChild(false,false);

nth-last-child("

cssNthChild(true,false);

nth-of-type("

cssNthChild(false,true);

nth-last-of-type("

cssNthChild(true,true);

first-child"

this.evals.add(newEvaluator.IsFirstChild());

last-child"

this.evals.add(newEvaluator.IsLastChild());

first-of-type"

this.evals.add(newEvaluator.IsFirstOfType());

last-of-type"

this.evals.add(newEvaluator.IsLastOfType());

only-child"

this.evals.add(newEvaluator.IsOnlyChild());

only-of-type"

this.evals.add(newEvaluator.IsOnlyOfType());

empty"

this.evals.add(newEvaluator.IsEmpty());

root"

this.evals.add(newEvaluator.IsRoot());

else

Couldnotparsequery'

%s'

unexpectedtokenat'

newObject[]{this.query,this.tq.remainder()});

privatevoidbyId()

Stringid=this.tq.consumeCssIdentifier();

Validate.notEmpty(id);

this.evals.add(newEvaluator.Id(id));

privatevoidbyClass(){

StringclassName=this.tq.consumeCssIdentifier();

Validate.notEmpty(className);

this.evals.add(newEvaluator.Class(className.trim().toLowerCase()));

privatevoidbyTag(){

StringtagName=this.tq.consumeElementSelector();

Validate.notEmpty(tagName);

if(tagName.contains("

|"

tagName=tagName.replace("

this.evals.add(newEvaluator.Tag(tagName.trim().toLowerCase()));

privatevoidbyAttribute(){

Monitorcq=newMonitor(this.tq.chompBalanced('

));

Stringkey=cq.consumeToAny(AttributeEvals);

Validate.notEmpty(key);

cq.consumeWhitespace();

if(cq.isEmpty()){

if(key.startsWith("

^"

this.evals.add(newEvaluator.AttributeStarting(key.substring

(1)));

this.evals.add(newEvaluator.Attribute(key));

elseif(cq.matchChomp("

this.evals.add(newEvaluator.AttributeWithValue(key,cq.remainder()));

this.evals.add(newEvaluator.AttributeWithValueNot(key,cq.remainder()));

this.evals.add(newEvaluator.AttributeWithValueStarting(key,cq.remainder()));

this.evals.add(newEvaluator.AttributeWithValueEnding(key,cq.remainder()));

this.evals.add(newEvaluator.AttributeWithValueContaining(key,cq.remainder()));

this.evals.add(newEvaluator.AttributeWithValueMatching(key,Ppile(cq.remainder())));

Couldnotparseattributequery'

newObject[]{this.query,cq.remainder()});

privatevoidallElements()

this.evals.add(newEvaluator.AllElements());

privatevoidindexLessThan()

this.evals.add(newEvaluator.IndexLessThan(consumeIndex()));

privatevoidindexGreaterThan(){

this.evals.add(newEvaluator.IndexGreaterThan(consumeIndex()));

privatevoidindexEquals(){

this.evals.add(newEvaluator.IndexEquals(consumeIndex()));

privatevoidcssNthChild(booleanbackwards,booleanofType)

StringargS=this.tq.chompTo("

).trim().toLowerCase();

MatchermAB=NTH_AB.matcher(argS);

MatchermB=NTH_B.matcher(argS);

intb;

if("

odd"

.equals(argS)){

inta=2;

b=1;

even"

b=0;

if(mAB.matches()){

inta=mAB.group(3)!

=null?

Integer.parseInt(mAB.group

(1).replaceFirst("

^\\+"

)):

1;

b=mAB.group(4)!

Integer.parseInt(mAB.group(4).replaceFirst("

0;

if(mB.matches()){

inta=0;

b=Integer.parseInt(mB.group().replaceFirst("

Couldnotparsenth-index'

unexpectedformat"

newObject[]{argS});

inta;

if(ofType){

if(backwards)

this.evals.add(newEvaluator.IsNthLastOfType(a,b));

this.evals.add(newEvaluator.IsNthOfType(a,b));

elseif(backwards)

this.evals.add(newEvaluator.IsNthLastChild(a,b));

this.evals.add(newEvaluator.IsNthChild(a,b));

privateintconsumeIndex()

StringindexS=this.tq.chompTo("

).trim();

Validate.isTrue(StringUtil.isNumeric(indexS),"

Indexmustbenumeric"

returnInteger.parseInt(indexS);

privatevoidhas()

this.tq.cons

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 农林牧渔 > 林学

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2