private Object visitInheritDocInterfaces(ArrayList<IType> visited,IType currentType,ITypeHierarchy typeHierarchy) throws JavaModelException {
  ArrayList<IType> toVisitChildren=new ArrayList<IType>();
  IType[] superInterfaces=typeHierarchy.getSuperInterfaces(currentType);
  for (int i=0; i < superInterfaces.length; i++) {
    IType superInterface=superInterfaces[i];
    if (visited.contains(superInterface))     continue;
    visited.add(superInterface);
    Object result=visit(superInterface);
    if (result == InheritDocVisitor.STOP_BRANCH) {
    }
 else     if (result == InheritDocVisitor.CONTINUE) {
      toVisitChildren.add(superInterface);
    }
 else {
      return result;
    }
  }
  for (Iterator<IType> iter=toVisitChildren.iterator(); iter.hasNext(); ) {
    IType child=iter.next();
    Object result=visitInheritDocInterfaces(visited,child,typeHierarchy);
    if (result != InheritDocVisitor.CONTINUE)     return result;
  }
  return InheritDocVisitor.CONTINUE;
}

private Object visitInheritDocInterfaces ( ArrayList < IType > visited , IType currentType , ITypeHierarchy typeHierarchy ) throws JavaModelException { ArrayList < IType > toVisitChildren = new ArrayList < IType > ( ) ; IType [ ] superInterfaces = typeHierarchy . getSuperInterfaces ( currentType ) ; for ( int i = 0 ; i < superInterfaces . length ; i ++ ) { IType superInterface = superInterfaces [ i ] ; if ( visited . contains ( superInterface ) ) continue ; visited . add ( superInterface ) ; Object result = visit ( superInterface ) ; if ( result == InheritDocVisitor . STOP_BRANCH ) { } else if ( result == InheritDocVisitor . CONTINUE ) { toVisitChildren . add ( superInterface ) ; } else { return result ; } } for ( Iterator < IType > iter = toVisitChildren . iterator ( ) ; iter . hasNext ( ) ; ) { IType child = iter . next ( ) ; Object result = visitInheritDocInterfaces ( visited , child , typeHierarchy ) ; if ( result != InheritDocVisitor . CONTINUE ) return result ; } return InheritDocVisitor . CONTINUE ; }
visits the super interfaces of the given type in the given hierarchy , thereby skipping already visited types .
