Beispiel #1
0
 private boolean checkAndApplyIsDefeated(
     DefeasibleLogicalDependency potentialInferior,
     Rule rule,
     DefeasibleLogicalDependency potentialSuperior) {
   if (potentialSuperior.getDefeats() == null) {
     return false;
   }
   if (potentialSuperior.getStatus() == DefeasibilityStatus.DEFINITELY
       && potentialInferior.getStatus() != DefeasibilityStatus.DEFINITELY) {
     potentialSuperior.addDefeated(potentialInferior);
     return true;
   }
   // adds the references that defeat the current node
   if (Arrays.binarySearch(potentialSuperior.getDefeats(), rule.getName()) >= 0
       || Arrays.binarySearch(
               potentialSuperior.getDefeats(), rule.getPackage() + "." + rule.getName())
           >= 0) {
     potentialSuperior.addDefeated(potentialInferior);
     return true;
   }
   return false;
 }
    public void write(MarshallerWriteContext context) throws IOException {
      context.writeShort(WorkingMemoryAction.WorkingMemoryReteAssertAction);

      context.writeInt(this.factHandle.getId());
      context.writeBoolean(this.removeLogical);
      context.writeBoolean(this.updateEqualsMap);

      if (this.ruleOrigin != null) {
        context.writeBoolean(true);
        context.writeUTF(ruleOrigin.getPackage());
        context.writeUTF(ruleOrigin.getName());
      } else {
        context.writeBoolean(false);
      }

      if (this.leftTuple != null) {
        context.writeBoolean(true);
        context.writeInt(context.terminalTupleMap.get(this.leftTuple));
      } else {
        context.writeBoolean(false);
      }
    }