public List getAllIndependentIteratorsOfCurrentScope() { List independentIterators = new ArrayList(this.indpndtItrToRgnMap.size()); Iterator itr = this.indpndtItrToRgnMap.keySet().iterator(); int currentScopeId = this.currentScope().getScopeID(); while (itr.hasNext()) { RuntimeIterator rIter = (RuntimeIterator) itr.next(); if (rIter.getScopeID() == currentScopeId) { independentIterators.add(rIter); } } return independentIterators; }
/** * Return true if given CompiledValue is dependent on any RuntimeIterator in current scope */ boolean isDependentOnCurrentScope(CompiledValue cv) { // return !getDependencySet(cv, true).isEmpty(); Set setRItr = getDependencySet(cv, true); boolean isDependent = false; if (!setRItr.isEmpty()) { // int currScopeID = this.scopes.size(); int currScopeID = currentScope().getScopeID(); for (Iterator itr = setRItr.iterator(); itr.hasNext();) { RuntimeIterator ritr = (RuntimeIterator) itr.next(); if (currScopeID == ritr.getScopeID()) { isDependent = true; break; } } } return isDependent; }
/** * This function returns the ultimate independent RuntimeIterators of current scope on which the * CompiledValue passed is dependent upon. This does not return the RuntimeIterators on which it * may be dependent but are not part of the current scope. If no such RuntimeIterator exists it * returns empty set. * * @param compiledValue CompiledValue Object * @param context ExecutionContextobject * @return Set containing the ultimate independent RuntimeIterators of current scope */ static Set getCurrentScopeUltimateRuntimeIteratorsIfAny(CompiledValue compiledValue, ExecutionContext context) { Set set = new HashSet(); context.computeUltimateDependencies(compiledValue, set); Iterator iter = set.iterator(); while (iter.hasNext()) { RuntimeIterator rIter = (RuntimeIterator) iter.next(); if (rIter.getScopeID() != context.currentScope().getScopeID()/* context.getScopeCount() */) iter.remove(); } return set; }
/** * Checks if the iterator in question is dependent on any other RuntimeIterator of its own or * lesser scope. */ boolean isDependentOnAnyIteratorOfScopeLessThanItsOwn(ExecutionContext context) { // Get the list of all iterators on which the colelction expression // is ultimately dependent on // If dependent on self then also assume it to be dependent boolean isDep = false; // Get the list of all iterators on which the colelction expression // is dependent on Set dependencySet = context.getDependencySet(this, true); Iterator itr = dependencySet.iterator(); int currScope = context.currentScope().getScopeID();// context.getScopeCount(); while (itr.hasNext()) { RuntimeIterator ritr = (RuntimeIterator) itr.next(); if (ritr.getScopeID() <= currScope) { isDep = true; break; } } return isDep; } }
if (rIter.getScopeID() != context.currentScope().getScopeID() /* context.getScopeCount() */ || (regionPath = context.getRegionPathForIndependentRuntimeIterator(rIter)) == null) { return null;
this.indpndntItr.getScopeID() == context.currentScope()
if (itr == null) { itr = (RuntimeIterator) set.iterator().next(); if (itr.getScopeID() == this.currentScope().getScopeID()) { rgnPath = (String) this.indpndtItrToRgnMap.get(itr);