public static Iterator allDirectlyLinkedObjects(Stella_Object self, Surrogate relation, boolean inverseP) {
    { Cons pattern = (inverseP ? Logic.makeRelationPattern2(relation, null, Logic.valueOf(self)) : Logic.makeRelationPattern2(relation, Logic.valueOf(self), null));
      SequenceIndex index = Logic.selectPropositions(pattern);

      if (SequenceIndex.emptyPropositionsIndexP(index, self, false)) {
        return (Logic.EMPTY_PROPOSITIONS_ITERATOR);
      }
      { DirectlyLinkedObjectsIterator self000 = DirectlyLinkedObjectsIterator.newDirectlyLinkedObjectsIterator();

        self000.selectionPattern = pattern;
        self000.propositionCursor = index.allocateIterator();
        self000.inverseP = inverseP;
        { DirectlyLinkedObjectsIterator value000 = self000;

          return (value000);
        }
      }
    }
  }