// returns true if multigroup private boolean openDocumentIndex(int docID) throws Exception { // The data is only the data for this document id. Thus the base is set // to zero. _data = _env.getPositions(docID); _base = 0; _startingIndex = 0; int kk = _data[_base] & 0xFF, k2; switch (kk >> 6) // get type { case 0: // single group, no extents k2 = _data[_base + 1]; _firstGenerator.init(_data, _base += 2, k2); // decode concept table _nConcepts = _firstGenerator.decodeConcepts(kk & 0x3F, 0, _concepts); return false; case 2: // multi group, no extents _kTable.clear(); _offsets.clear(); _maxConcepts.clear(); ByteArrayDecompressor compr = new ByteArrayDecompressor(_data, _base + 1); compr.decode(kk & 0x3F, _kTable); compr.ascDecode(_kTable.popLast(), _offsets); compr.ascDecode(_kTable.popLast(), _maxConcepts); _base += 1 + compr.bytesRead(); _limit = _maxConcepts.cardinality(); return true; case 1: // single group, extents case 3: // multi group, extents throw new Exception("extents not yet implemented\n"); } return false; }