Exemple #1
0
 @Override
 public int textLen(final int pre, final boolean text) {
   final long o = textOff(pre);
   if (number(o)) return numDigits((int) o);
   final DataAccess da = text ? texts : values;
   final int l = da.readNum(o & IO.OFFCOMP - 1);
   // compressed: next number contains number of compressed bytes
   return compressed(o) ? da.readNum() : l;
 }
Exemple #2
0
 /**
  * Constructor, initializing the index structure.
  *
  * @param data data
  * @param prefix prefix
  * @throws IOException I/O exception
  */
 FTList(final Data data, final int prefix) throws IOException {
   files = data.meta.dbfile(DATAFTX + prefix + 'y');
   filed = data.meta.dbfile(DATAFTX + prefix + 'z');
   str = new DataAccess(files);
   dat = new DataAccess(filed);
   tp = new int[data.meta.maxlen + 3];
   final int tl = tp.length;
   for (int t = 0; t < tl; t++) tp[t] = -1;
   sizes = data.meta.dbfile(DATAFTX + prefix + 'x');
   try (final DataAccess li = new DataAccess(sizes)) {
     int is = li.readNum();
     while (--is >= 0) {
       final int p = li.readNum();
       tp[p] = li.read4();
     }
     tp[tl - 1] = (int) str.length();
   }
   next();
 }
Exemple #3
0
  /** Checks if more tokens are found. */
  void next() {
    if (wasted) return;

    tok = token();
    if (tok.length == 0) {
      wasted = true;
      prv = NOINTS;
      pov = NOINTS;
      close();
    } else {
      prv = new int[size];
      pov = new int[size];
      for (int j = 0; j < size; ++j) {
        prv[j] = dat.readNum();
        pov[j] = dat.readNum();
      }
    }
  }