code: void recomposeImports()
    {
  
      m_importNumber = getStylesheetRoot().getImportNumber(this);
  
      StylesheetRoot root = getStylesheetRoot();
      int globalImportCount = root.getGlobalImportCount();
  
      m_importCountComposed = (globalImportCount - m_importNumber) - 1;
      
      // Now get the count of composed imports from this stylesheet's imports
      int count = getImportCount();
      if ( count > 0)
      {
        m_endImportCountComposed += count;
        while (count > 0)
          m_endImportCountComposed += this.getImport(--count).getEndImportCountComposed();
      }
      
      // Now get the count of composed imports from this stylesheet's
      // composed includes.
      count = getIncludeCountComposed();
      while (count>0)
      {
        int imports = getIncludeComposed(--count).getImportCount();
        m_endImportCountComposed += imports;
        while (imports > 0)
          m_endImportCountComposed +=getIncludeComposed(count).getImport(--imports).getEndImportCountComposed();
       
      }                                                            
    }
docs: Recalculate the precedence of this stylesheet in the global
  import list.  The lowest precedence stylesheet is 0.  A higher
  number has a higher precedence.