Example #1
0
 @Override
 protected ExtendedIterator<Triple> processMethod() throws AsyncException {
   checkOpen();
   if (!isPrepared) prepare(getHandler(""));
   Finder cascade =
       transitiveEngine.getFinder(
           getHandler(""), pattern, FinderUtil.cascade(tbox, continuation));
   return UniqueExtendedIterator.create(cascade.find(getHandler(""), pattern));
 }
 /**
  * Internals of findWithContinuation implementation which allows control over functor filtering.
  */
 private ExtendedIterator<Triple> findWithContinuation(
     TriplePattern pattern, Finder continuation, boolean filter) {
   checkOpen();
   this.requirePrepared();
   ExtendedIterator<Triple> result = null;
   if (fdata == null) {
     result = fdeductions.findWithContinuation(pattern, continuation);
   } else {
     if (continuation == null) {
       result = fdata.findWithContinuation(pattern, fdeductions);
     } else {
       result = fdata.findWithContinuation(pattern, FinderUtil.cascade(fdeductions, continuation));
     }
   }
   if (filter && filterFunctors) {
     return result.filterDrop(Functor.acceptFilter);
   } else {
     return result;
   }
 }
 @Override
 protected ExtendedIterator<Triple> processMethod() throws AsyncException {
   checkOpen();
   if (!isPrepared) prepare(getHandler(""));
   ExtendedIterator<Triple> result = null;
   if (fdata == null) {
     result = fdeductions.findWithContinuation(getHandler("result"), pattern, continuation);
   } else {
     if (continuation == null) {
       result = fdata.findWithContinuation(getHandler("result"), pattern, fdeductions);
     } else {
       result =
           fdata.findWithContinuation(
               getHandler("result"), pattern, FinderUtil.cascade(fdeductions, continuation));
     }
   }
   if (filter && filterFunctors) {
     return result.filterDrop(Functor.acceptFilter);
   } else {
     return result;
   }
 }
  @Override
  public void doExecute() {
    super.doExecute();

    SpecType theOneAndOnlySpecType = ((Content) this.owner).getSpecTypes().get(0);

    Collection<AttributeDefinition> affectedAttributeDefinitions =
        FinderUtil.helper_findAttributedefinitionsInSpectypeBasedonDatatypedefinition(
            (DatatypeDefinition) value, theOneAndOnlySpecType);
    // replace the old TYPE (=DataDefinition) with the new one, in each affected AttributeDefinition
    for (AttributeDefinition attributeDefinition : affectedAttributeDefinitions) {
      Command cmd =
          new SetCommand(
              this.domain,
              attributeDefinition,
              attributeDefinition
                  .eClass()
                  .getEStructuralFeature(ErfPackage.ATTRIBUTE_DEFINITION__TYPE),
              this.collection.toArray()[0]);
      this.domain.getCommandStack().execute(cmd);
    }
  }