void getNextLink()
		{
			// loop makes sure that we skip links that only point to our 'src' atom and nothing else
			while (true)
			{
				if (!linksIterator.hasNext())
				{
					currLink = null;
					if (closeResultSet)
						((HGSearchResult<HGHandle>)linksIterator).close();
					return;
				}
				hCurrLink = linksIterator.next();
				if (linkPredicate != null && !linkPredicate.satisfies(hg, hCurrLink))
					continue;
				if (hg.isLoaded(hCurrLink))
					currLink = (HGLink)hg.get(hCurrLink);
				else
				{
					tempLink.setHandleArray(hg.getStore().getLink(hg.getPersistentHandle(hCurrLink)), 2);
					currLink = tempLink;
				}
				if (currLink.getArity() < minArity)
					continue;
				tsIter.reset();
				if (tsIter.hasNext())
					break;
			}
		}