@Override public IndexIterator iter(final IndexToken tok) { final byte k = tok.type() == IndexType.TEXT ? Data.TEXT : Data.ATTR; final int i = id(tok.get()); if (i > 0) { final int[] pres = ids[i]; final int s = len[i]; if (s > 0) { return new IndexIterator() { int p; @Override public boolean more() { return p < s; } @Override public int next() { while (more() && data.kind(pres[p++]) != k) ; return pres[p - 1]; } }; } } return IndexIterator.EMPTY; }
/** * Returns the number of indexed pre references for the specified token. * * @param token text to be found * @return number of hits */ public final int count(final IndexToken token) { return index(token.type()).count(token); }
/** * Returns the indexed pre references for the specified token. * * @param token index token reference * @return array of sorted pre values */ public final IndexIterator iter(final IndexToken token) { return index(token.type()).iter(token); }