boolean rememberContext) { NodeSet result = new ArraySet(getLength()); NodeProxy current, context, item; ContextItem contextNode; for (Iterator i = iterator(); i.hasNext();) { current = (NodeProxy) i.next(); contextNode = current.getContext(); while (contextNode != null) { item = contextNode.getNode(); context = contextNodes.get(item); if (context != null) { if (!result.contains(context)) { if (rememberContext) { context.addContextNode(context); } result.add(context); } context.addMatches(current.match); } contextNode = contextNode.getNextItem(); } } return result; }
boolean rememberContext);
	public NodeSet getContextNodes(		NodeSet contextNodes,		boolean rememberContext) {		NodeSet result = new ArraySet(getLength());		NodeProxy current, context, item;		ContextItem contextNode;		for (Iterator i = iterator(); i.hasNext();) {			current = (NodeProxy) i.next();			contextNode = current.getContext();			while (contextNode != null) {				item = contextNode.getNode();				context = contextNodes.get(item);				if (context != null) {					if (!result.contains(context)) {						if (rememberContext) {							context.addContextNode(context);						}						result.add(context);					}					context.addMatches(current.match);				}				contextNode = contextNode.getNextItem();			}		}		return result;	}