Package dovetaildb.bytes

Examples of dovetaildb.bytes.Bytes.compareTo()


      long curDoc = node.doc();
      if (curDoc > smallestDoc || curDoc == Long.MAX_VALUE) continue;
      Bytes curTerm = node.term();
      if (smallestTerm == null ||
          curDoc < smallestDoc ||
          curTerm.compareTo(smallestTerm) < 0) {
        smallestDoc = curDoc;
        smallestTerm = curTerm;
        idx = curIdx;
      }
    }
View Full Code Here


  }
  public boolean matches(Bytes term) {
    if (! prefix.isPrefixOf(term)) return false;
    Bytes suffix = term.copy().subBytes(prefix.getLength());
    if (minSuffix != null) {
      int minCmp = suffix.compareTo(minSuffix);
      if (minCmp < 0) return false;
      if (minCmp == 0 && ! isMinIncluded) return false;
    }
    if (maxSuffix != null) {
      int maxCmp = suffix.compareTo(maxSuffix);
View Full Code Here

      int minCmp = suffix.compareTo(minSuffix);
      if (minCmp < 0) return false;
      if (minCmp == 0 && ! isMinIncluded) return false;
    }
    if (maxSuffix != null) {
      int maxCmp = suffix.compareTo(maxSuffix);
      if (maxCmp > 0) return false;
      if (maxCmp == 0 && ! isMaxIncluded) return false;
    }
    return true;
  }
View Full Code Here

    } else {
      if (! prefix.isPrefixOf(test)) return false;
      Bytes testSuffix = new SlicedBytes(test, prefixLen, testLen-prefixLen);
      if (minSuffix != null) {
        if ((! testSuffix.isPrefixOf(minSuffix)) &&
            (testSuffix.compareTo(minSuffix) < 0)) return false;
      }
      if (maxSuffix != null) {
        if ((! testSuffix.isPrefixOf(maxSuffix)) &&
              (testSuffix.compareTo(maxSuffix) > 0)) return false;
      }
View Full Code Here

        if ((! testSuffix.isPrefixOf(minSuffix)) &&
            (testSuffix.compareTo(minSuffix) < 0)) return false;
      }
      if (maxSuffix != null) {
        if ((! testSuffix.isPrefixOf(maxSuffix)) &&
              (testSuffix.compareTo(maxSuffix) > 0)) return false;
      }
      return true;
    }
  }
  public boolean contains(Range other) {
View Full Code Here

    Bytes maxTerm = null;
    for(Bytes term : terms) {
      if (minTerm == null || minTerm.compareTo(term) > 0) {
        minTerm = term;
      }
      if (maxTerm == null || maxTerm.compareTo(term) < 0) {
        maxTerm = term;
      }
    }
    if (minTerm == maxTerm && minTerm != null) {
      maxTerm = minTerm.copy();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.