system/src/sc/layer/LayeredSystem.java
public boolean hasInstancesOfType(String typeName) {
      Iterator insts = getInstancesOfType(typeName);
      if (insts.hasNext())
         return true;

      TypeDeclaration type = getSrcTypeDeclaration(typeName, null, true, true);
      if (type != null) {
         do {
            Iterator<String> subTypes = getSubTypeNamesOfType(type);
            while (subTypes.hasNext()) {
               String subTypeName = subTypes.next();
               // Only check new types, not modified versions of the same type to avoid a recursive loop
               if (!subTypeName.equals(typeName) && hasInstancesOfType(subTypeName))
                  return true;
            }
            // Go down and grab the leaf type.  We check the sub-types so will pick up sub-types because we register
            // modified types in the sub-types table.
            if (type instanceof ModifyDeclaration)
               type = (TypeDeclaration) type.getPureModifiedType();
            else
               type = null;
         } while (type != null);
      }
      return false;
   }
/** Returns true if there are any instances of this type or instances of sub-types */
Returns true if there are any instances of this type or instances of sub-types
Returns true if there are any instances of this type or instances of sub - types
public boolean hasInstancesOfType(String typeName) {
      Iterator insts = getInstancesOfType(typeName);
      if (insts.hasNext())
         return true;
      TypeDeclaration type = getSrcTypeDeclaration(typeName, null, true, true);
      if (type != null) {
         do {
            Iterator<String> subTypes = getSubTypeNamesOfType(type);
            while (subTypes.hasNext()) {
               String subTypeName = subTypes.next();
               if (!subTypeName.equals(typeName) && hasInstancesOfType(subTypeName))
                  return true;
            }
            if (type instanceof ModifyDeclaration)
               type = (TypeDeclaration) type.getPureModifiedType();
            else
               type = null;
         } while (type != null);
      }
      return false;
   }
public boolean hasInstancesOfType ( String typeName ) { Iterator insts = getInstancesOfType ( typeName ) ; if ( insts . hasNext ( ) ) return true ; TypeDeclaration type = getSrcTypeDeclaration ( typeName , null , true , true ) ; if ( type != null ) { do { Iterator < String > subTypes = getSubTypeNamesOfType ( type ) ; while ( subTypes . hasNext ( ) ) { String subTypeName = subTypes . next ( ) ; if ( ! subTypeName . equals ( typeName ) && hasInstancesOfType ( subTypeName ) ) return true ; } if ( type instanceof ModifyDeclaration ) type = ( TypeDeclaration ) type . getPureModifiedType ( ) ; else type = null ; } while ( type != null ) ; } return false ; }
Returns true if there are any instances of this type or instances of sub-types
Returns true if there are any instances of this type or instances of sub - types
// Only check new types, not modified versions of the same type to avoid a recursive loop // Go down and grab the leaf type.  We check the sub-types so will pick up sub-types because we register // modified types in the sub-types table.