(self, fully_qualified_class)
return True
Adds the specified import to the import manager.

    Args:
      fully_qualified_class: (str) The fully qualified class we want to add to
        this instance of import manager.

    Returns:
      True- If adding the import is successful.
      False- If adding the import results in a name collision.
Adds the specified import to the import manager.
Adds the specified import to the import manager .
def AddImport(self, fully_qualified_class):
    """Adds the specified import to the import manager.

    Args:
      fully_qualified_class: (str) The fully qualified class we want to add to
        this instance of import manager.

    Returns:
      True- If adding the import is successful.
      False- If adding the import results in a name collision.
    """
    if fully_qualified_class.startswith(self._JAVA_LANG_IMPORT):
      # Returning True because it is imported by default.
      return True

    # check to see if it already exists
    class_name = self.GetClassName(fully_qualified_class)
    current_import = self._class_name_to_qualified_name.get(
        class_name)
    if current_import:
      return current_import == fully_qualified_class

    if fully_qualified_class.startswith('com.google.'):
      self._google_imports.add(fully_qualified_class)
    elif fully_qualified_class.startswith('java.'):
      self._java_imports.add(fully_qualified_class)
    else:
      self._other_imports.add(fully_qualified_class)
    # Now add it to the map
    self._class_name_to_qualified_name[class_name] = fully_qualified_class
    return True
def AddImport ( self , fully_qualified_class ) : if fully_qualified_class . startswith ( self . _JAVA_LANG_IMPORT ) : # Returning True because it is imported by default. return True # check to see if it already exists class_name = self . GetClassName ( fully_qualified_class ) current_import = self . _class_name_to_qualified_name . get ( class_name ) if current_import : return current_import == fully_qualified_class if fully_qualified_class . startswith ( 'com.google.' ) : self . _google_imports . add ( fully_qualified_class ) elif fully_qualified_class . startswith ( 'java.' ) : self . _java_imports . add ( fully_qualified_class ) else : self . _other_imports . add ( fully_qualified_class ) # Now add it to the map self . _class_name_to_qualified_name [ class_name ] = fully_qualified_class return True