LOG.debug( "getDescendants took " + (System.currentTimeMillis() - start) + "ms.");
	public ArraySet getDescendants(ArraySet al, int mode) {		if (al.counter == 0 || counter == 0)			return new ArraySet(1);		//long start = System.currentTimeMillis();		al.sort();		sort();		// the descendant set will be modified: copy if required 		NodeProxy[] dl = null;		if (mode == DESCENDANT) {			dl = new NodeProxy[counter];			for (int i = 0; i < counter; i++)				dl[i] = new NodeProxy(nodes[i]);		} else			dl = nodes;		ArraySet result = new ArraySet(counter);		int ax;		int dx;		int cmp;		final int dlen = dl.length;		boolean more = false;		do {			// calculate parent id for each node in the			// descendant set. Returns false if no more			// valid nodes are found			more = getParentSet(dl);			ax = 0;			dx = 0;			while (dx < dlen) {				if (dl[dx] == null) { // || dl[dx].gid < 1) {					dx++;					continue;				}				//System.out.println(dl[dx].gid + " = " + al.nodes[ax].gid);				cmp = dl[dx].compareTo(al.nodes[ax]);				if (cmp > 0) {					if (ax < al.counter - 1)						ax++;					else						break;				} else if (cmp < 0)					dx++;				else {					// found a matching node					switch (mode) {						case ANCESTOR :							dl[dx].addMatches(al.nodes[ax].matches);							result.add(dl[dx]);							break;						case DESCENDANT :							nodes[dx].addMatches(al.nodes[ax].matches);							result.add(nodes[dx]);							break;					}					dx++;				}			}		}		while (more);		//		LOG.debug(		//			"getDescendants took "		//				+ (System.currentTimeMillis() - start)		//				+ "ms.");		return result;	}