public int getStringCareLevel() { // if the value is cached, return cached value. // otherwise, calculate it now. OptimizationTag ot = (OptimizationTag)expression.verifierTag; if(ot==null) expression.verifierTag = ot = new OptimizationTag(); if(ot.stringCareLevel==OptimizationTag.STRING_NOTCOMPUTED) ot.stringCareLevel = StringCareLevelCalculator.calc(expression); return ot.stringCareLevel; }
public int getStringCareLevel() { // if the value is cached, return cached value. // otherwise, calculate it now. OptimizationTag ot = (OptimizationTag)expression.verifierTag; if(ot==null) expression.verifierTag = ot = new OptimizationTag(); if(ot.stringCareLevel==OptimizationTag.STRING_NOTCOMPUTED) ot.stringCareLevel = StringCareLevelCalculator.calc(expression); return ot.stringCareLevel; }
public int getStringCareLevel() { // if the value is cached, return cached value. // otherwise, calculate it now. OptimizationTag ot = (OptimizationTag)expression.verifierTag; if(ot==null) expression.verifierTag = ot = new OptimizationTag(); if(ot.stringCareLevel==OptimizationTag.STRING_NOTCOMPUTED) ot.stringCareLevel = StringCareLevelCalculator.calc(expression); return ot.stringCareLevel; }
public final Expression prune( Expression exp ) { // check the cache first. OptimizationTag ot = (OptimizationTag)exp.verifierTag; if(ot==null) exp.verifierTag = ot = new OptimizationTag(); else if( ot.attributePrunedExpression!=null ) return ot.attributePrunedExpression; // cache miss. compute it. Expression r = exp.visit(this); ot.attributePrunedExpression = r; // cache this result return r; } }
public int getStringCareLevel() { // if the value is cached, return cached value. // otherwise, calculate it now. OptimizationTag ot = (OptimizationTag)expression.verifierTag; if(ot==null) expression.verifierTag = ot = new OptimizationTag(); if(ot.stringCareLevel==OptimizationTag.STRING_NOTCOMPUTED) ot.stringCareLevel = StringCareLevelCalculator.calc(expression); return ot.stringCareLevel; }
public final Expression prune( Expression exp ) { // check the cache first. OptimizationTag ot = (OptimizationTag)exp.verifierTag; if(ot==null) exp.verifierTag = ot = new OptimizationTag(); else if( ot.attributePrunedExpression!=null ) return ot.attributePrunedExpression; // cache miss. compute it. Expression r = exp.visit(this); ot.attributePrunedExpression = r; // cache this result return r; } }
public final Expression prune( Expression exp ) { // check the cache first. OptimizationTag ot = (OptimizationTag)exp.verifierTag; if(ot==null) exp.verifierTag = ot = new OptimizationTag(); else if( ot.attributePrunedExpression!=null ) return ot.attributePrunedExpression; // cache miss. compute it. Expression r = exp.visit(this); ot.attributePrunedExpression = r; // cache this result return r; } }
public final Expression prune( Expression exp ) { // check the cache first. OptimizationTag ot = (OptimizationTag)exp.verifierTag; if(ot==null) exp.verifierTag = ot = new OptimizationTag(); else if( ot.attributePrunedExpression!=null ) return ot.attributePrunedExpression; // cache miss. compute it. Expression r = exp.visit(this); ot.attributePrunedExpression = r; // cache this result return r; } }
/** compute the residual */ final Expression calcResidual( Expression exp, ElementToken token ) { if( token.acceptedPatterns!=null && token.acceptedPatterns.length==1 ) { // we can use optimization table OptimizationTag ot; if(exp.verifierTag==null) exp.verifierTag = ot = new OptimizationTag(); else { ot = (OptimizationTag)exp.verifierTag; Expression residual = (Expression)ot.simpleElementTokenResidual.get(token.acceptedPatterns[0]); if(residual!=null) return residual; // cache hit. } this.token = token; Expression residual = exp.visit(this); // cache this residual ot.simpleElementTokenResidual.put(token.acceptedPatterns[0],residual); return residual; } // no chance of using cache. this.token = token; return exp.visit(this); }
/** compute the residual */ final Expression calcResidual( Expression exp, ElementToken token ) { if( token.acceptedPatterns!=null && token.acceptedPatterns.length==1 ) { // we can use optimization table OptimizationTag ot; if(exp.verifierTag==null) exp.verifierTag = ot = new OptimizationTag(); else { ot = (OptimizationTag)exp.verifierTag; Expression residual = (Expression)ot.simpleElementTokenResidual.get(token.acceptedPatterns[0]); if(residual!=null) return residual; // cache hit. } this.token = token; Expression residual = exp.visit(this); // cache this residual ot.simpleElementTokenResidual.put(token.acceptedPatterns[0],residual); return residual; } // no chance of using cache. this.token = token; return exp.visit(this); }
/** compute the residual */ final Expression calcResidual( Expression exp, ElementToken token ) { if( token.acceptedPatterns!=null && token.acceptedPatterns.length==1 ) { // we can use optimization table OptimizationTag ot; if(exp.verifierTag==null) exp.verifierTag = ot = new OptimizationTag(); else { ot = (OptimizationTag)exp.verifierTag; Expression residual = (Expression)ot.simpleElementTokenResidual.get(token.acceptedPatterns[0]); if(residual!=null) return residual; // cache hit. } this.token = token; Expression residual = exp.visit(this); // cache this residual ot.simpleElementTokenResidual.put(token.acceptedPatterns[0],residual); return residual; } // no chance of using cache. this.token = token; return exp.visit(this); }
/** compute the residual */ final Expression calcResidual( Expression exp, ElementToken token ) { if( token.acceptedPatterns!=null && token.acceptedPatterns.length==1 ) { // we can use optimization table OptimizationTag ot; if(exp.verifierTag==null) exp.verifierTag = ot = new OptimizationTag(); else { ot = (OptimizationTag)exp.verifierTag; Expression residual = (Expression)ot.simpleElementTokenResidual.get(token.acceptedPatterns[0]); if(residual!=null) return residual; // cache hit. } this.token = token; Expression residual = exp.visit(this); // cache this residual ot.simpleElementTokenResidual.put(token.acceptedPatterns[0],residual); return residual; } // no chance of using cache. this.token = token; return exp.visit(this); }
/** computes a combined child content pattern and (,if possible,) its continuation. */ public ExpressionPair get(Expression combinedPattern, StartTagInfo info) { StringPair sp = null; // check the cache if (combinedPattern.verifierTag != null) { OptimizationTag ot = (OptimizationTag)combinedPattern.verifierTag; sp = new StringPair(info.namespaceURI, info.localName); OptimizationTag.OwnerAndCont cache = (OptimizationTag.OwnerAndCont)ot.transitions.get(sp); if (cache != null) { // cache hit numElements = 1; result[0] = cache.owner; return new ExpressionPair(cache.owner.contentModel.getExpandedExp(pool), cache.continuation); } } ExpressionPair r = (ExpressionPair)get(combinedPattern, info, true); if (numElements == 1) { // only one element matchs this tag name. cache this result OptimizationTag ot = (OptimizationTag)combinedPattern.verifierTag; if (ot == null) combinedPattern.verifierTag = ot = new OptimizationTag(); if (sp == null) sp = new StringPair(info.namespaceURI, info.localName); ot.transitions.put(sp, new OptimizationTag.OwnerAndCont(result[0], r.continuation)); } return r; }
/** computes a combined child content pattern and (,if possible,) its continuation. */ public ExpressionPair get(Expression combinedPattern, StartTagInfo info) { StringPair sp = null; // check the cache if (combinedPattern.verifierTag != null) { OptimizationTag ot = (OptimizationTag)combinedPattern.verifierTag; sp = new StringPair(info.namespaceURI, info.localName); OptimizationTag.OwnerAndCont cache = (OptimizationTag.OwnerAndCont)ot.transitions.get(sp); if (cache != null) { // cache hit numElements = 1; result[0] = cache.owner; return new ExpressionPair(cache.owner.contentModel.getExpandedExp(pool), cache.continuation); } } ExpressionPair r = (ExpressionPair)get(combinedPattern, info, true); if (numElements == 1) { // only one element matchs this tag name. cache this result OptimizationTag ot = (OptimizationTag)combinedPattern.verifierTag; if (ot == null) combinedPattern.verifierTag = ot = new OptimizationTag(); if (sp == null) sp = new StringPair(info.namespaceURI, info.localName); ot.transitions.put(sp, new OptimizationTag.OwnerAndCont(result[0], r.continuation)); } return r; }
/** computes a combined child content pattern and (,if possible,) its continuation. */ public ExpressionPair get(Expression combinedPattern, StartTagInfo info) { StringPair sp = null; // check the cache if (combinedPattern.verifierTag != null) { OptimizationTag ot = (OptimizationTag)combinedPattern.verifierTag; sp = new StringPair(info.namespaceURI, info.localName); OptimizationTag.OwnerAndCont cache = (OptimizationTag.OwnerAndCont)ot.transitions.get(sp); if (cache != null) { // cache hit numElements = 1; result[0] = cache.owner; return new ExpressionPair(cache.owner.contentModel.getExpandedExp(pool), cache.continuation); } } ExpressionPair r = (ExpressionPair)get(combinedPattern, info, true); if (numElements == 1) { // only one element matchs this tag name. cache this result OptimizationTag ot = (OptimizationTag)combinedPattern.verifierTag; if (ot == null) combinedPattern.verifierTag = ot = new OptimizationTag(); if (sp == null) sp = new StringPair(info.namespaceURI, info.localName); ot.transitions.put(sp, new OptimizationTag.OwnerAndCont(result[0], r.continuation)); } return r; }
/** computes a combined child content pattern and (,if possible,) its continuation. */ public ExpressionPair get(Expression combinedPattern, StartTagInfo info) { StringPair sp = null; // check the cache if (combinedPattern.verifierTag != null) { OptimizationTag ot = (OptimizationTag)combinedPattern.verifierTag; sp = new StringPair(info.namespaceURI, info.localName); OptimizationTag.OwnerAndCont cache = (OptimizationTag.OwnerAndCont)ot.transitions.get(sp); if (cache != null) { // cache hit numElements = 1; result[0] = cache.owner; return new ExpressionPair(cache.owner.contentModel.getExpandedExp(pool), cache.continuation); } } ExpressionPair r = (ExpressionPair)get(combinedPattern, info, true); if (numElements == 1) { // only one element matchs this tag name. cache this result OptimizationTag ot = (OptimizationTag)combinedPattern.verifierTag; if (ot == null) combinedPattern.verifierTag = ot = new OptimizationTag(); if (sp == null) sp = new StringPair(info.namespaceURI, info.localName); ot.transitions.put(sp, new OptimizationTag.OwnerAndCont(result[0], r.continuation)); } return r; }