Пример #1
0
    public boolean evaluateCachedLeft(
        InternalWorkingMemory workingMemory,
        final VariableContextEntry context,
        final InternalFactHandle right) {
      if (context.leftNull || context.extractor.isNullValue(workingMemory, right.getObject())) {
        return false;
      }

      long leftTS = ((LeftStartRightEndContextEntry) context).timestamp;
      long rightTS;
      if (context.getFieldExtractor().isSelfReference()) {
        rightTS = ((EventFactHandle) right).getEndTimestamp();
      } else {
        rightTS = context.getFieldExtractor().getLongValue(workingMemory, right.getObject());
      }
      return evaluate(rightTS, leftTS);
    }
    public boolean evaluateCachedLeft(
        InternalWorkingMemory workingMemory,
        final VariableContextEntry context,
        final InternalFactHandle right) {
      if (context.leftNull || context.extractor.isNullValue(workingMemory, right.getObject())) {
        return false;
      }

      long leftTS = ((LeftStartRightEndContextEntry) context).timestamp;
      long rightTS;
      if (context.getFieldExtractor().isSelfReference()) {
        rightTS = ((EventFactHandle) right).getEndTimestamp();
      } else {
        rightTS = context.getFieldExtractor().getLongValue(workingMemory, right.getObject());
      }
      long dist = leftTS - rightTS;
      return this.getOperator().isNegated() ^ (dist >= this.initRange && dist <= this.finalRange);
    }