Tabnine Logo
RangeCondition.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
com.oberasoftware.jasdb.core.index.query.RangeCondition
constructor

Best Java code snippets using com.oberasoftware.jasdb.core.index.query.RangeCondition.<init> (Showing top 4 results out of 315)

origin: oberasoftware/jasdb

private static SearchCondition createCondition(QueryField queryField) {
  Key searchKey = valueToKey(queryField.getSearchKey());
  switch(queryField.getOperator()) {
    case LARGER_THAN:
      return new RangeCondition(searchKey, false, null, false);
    case LARGER_THAN_OR_EQUALS:
      return new RangeCondition(searchKey, true, null, false);
    case SMALLER_THAN:
      return new RangeCondition(null,  false, searchKey, false);
    case SMALLER_THAN_OR_EQUALS:
      return new RangeCondition(null,  false, searchKey, true);
    case NOT_EQUALS:
      return new NotEqualsCondition(searchKey);
    case EQUALS:
    default:
      return new EqualsCondition(searchKey);
  }
}
origin: oberasoftware/jasdb

private SearchCondition handleEqualsToRange(EqualsCondition equalsCondition) {
  int nrOfKeys = keyInfo.getKeyFields().size();
  if(nrOfKeys > 1) {
    //composite keys always use range search
    return new RangeCondition(equalsCondition.getKey(), true, equalsCondition.getKey(), true);
  } else {
    return equalsCondition;
  }
}
origin: oberasoftware/jasdb

private static RangeCondition mergeRangeConditions(List<RangeCondition> rangeConditions) {
  Key lowestKey = null;
  boolean startInclusive = false;
  boolean endInclusive = false;
  Key highestKey = null;
  for(SearchCondition condition : rangeConditions) {
    RangeCondition rangeCondition = (RangeCondition) condition;
    Key rangeStartKey = rangeCondition.getStart();
    Key rangeEndKey = rangeCondition.getEnd();
    if(rangeStartKey != null && (lowestKey == null || rangeStartKey.compareTo(lowestKey) < 0)) {
      lowestKey = rangeStartKey;
      startInclusive = rangeCondition.isStartIncluded();
    }
    if(rangeEndKey != null && (highestKey == null || rangeEndKey.compareTo(highestKey) > 0)) {
      highestKey = rangeEndKey;
      endInclusive = rangeCondition.isEndIncluded();
    }
  }
  return new RangeCondition(lowestKey, startInclusive, highestKey, endInclusive);
}
origin: oberasoftware/jasdb

@Override
public SearchCondition mergeCondition(KeyNameMapper nameMapper, String sourceField, String mergeField, SearchCondition condition) {
  if(condition instanceof EqualsCondition) {
    CompositeKey compositeKey;
    if(key instanceof CompositeKey) {
      compositeKey = (CompositeKey) key;
    } else {
      compositeKey = new CompositeKey();
      compositeKey.addKey(nameMapper, sourceField, key);
    }
    return new EqualsCondition(compositeKey.addKey(nameMapper, mergeField, ((EqualsCondition) condition).getKey()));
  } else if(condition instanceof RangeCondition) {
    RangeCondition rangeCondition = (RangeCondition) condition;
    Key startKey = null, endKey = null;
    if(rangeCondition.getStart() != null) {
      startKey = new CompositeKey()
          .addKey(nameMapper, sourceField, key)
          .addKey(nameMapper, mergeField, rangeCondition.getStart());
    }
    if(rangeCondition.getEnd() != null) {
      endKey = new CompositeKey()
          .addKey(nameMapper, sourceField, key)
          .addKey(nameMapper, mergeField, rangeCondition.getEnd());
    }
    return new RangeCondition(startKey, rangeCondition.isStartIncluded(), endKey, rangeCondition.isEndIncluded());
  }
  return null;
}
com.oberasoftware.jasdb.core.index.queryRangeCondition<init>

Popular methods of RangeCondition

  • getEnd
  • getStart
  • isEndIncluded
  • isStartIncluded
  • setEnd
  • setStart
  • toString

Popular in Java

  • Start an intent from android
  • scheduleAtFixedRate (ScheduledExecutorService)
  • setContentView (Activity)
  • runOnUiThread (Activity)
  • String (java.lang)
  • Path (java.nio.file)
  • KeyStore (java.security)
    KeyStore is responsible for maintaining cryptographic keys and their owners. The type of the syste
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now