Package org.dbwiki.data.query.condition

Examples of org.dbwiki.data.query.condition.ProvenanceCondition


    }
   
    assert(startDate != null); // because the condition list is nonempty
    assert(endDate != null); // because the condition list is nonempty
   
    ProvenanceCondition versions = new ProvenanceCondition();
   
    for (int iVersion = 0; iVersion < versionIndex.size(); iVersion++) {
      Version version = versionIndex.get(iVersion);
      boolean matches = true;
      if (dateOp != null) {
        if (dateOp.equalsIgnoreCase(XAQLSyntaxParser.KeywordAfter)) {
          matches = version.time() > startDate.getTime();
        } else if (dateOp.equalsIgnoreCase(XAQLSyntaxParser.KeywordBefore)) {
          matches = version.time() < endDate.getTime();
        } else if (dateOp.equalsIgnoreCase(XAQLSyntaxParser.KeywordSince)) {
          matches = version.time() >= startDate.getTime();
        } else if (dateOp.equalsIgnoreCase(XAQLSyntaxParser.KeywordUntil)) {
          matches = version.time() <= endDate.getTime();
        } else if (dateOp.equalsIgnoreCase(XAQLSyntaxParser.KeywordBetween)) {
          matches = ((version.time() >= startDate.getTime()) && (version.time() <= endDate.getTime()));
        }
      }
      if ((matches) && (username != null) ) {
        if (version.provenance().user() != null) {
          matches = version.provenance().user().login().equals(username);
        } else { // unknown user differs from any specific user name
          matches = false;
        }
      }
      if ((matches) && (provenanceType != Provenance.ProvenanceTypeUnknown)) {
        matches = (version.provenance().type() == provenanceType);
      }
      if (matches) {
        versions.add(version);
      }
    }
   
    return versions;
  }
View Full Code Here

TOP

Related Classes of org.dbwiki.data.query.condition.ProvenanceCondition

Copyright © 2018 www.massapicom. 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.