py4j

## Class JVMView

- java.lang.Object
- - py4j.JVMView

-     public class JVMView
      extends java.lang.Object

  A JVM view keeps track of imports and import searches. A Python client can have multiple JVM views (e.g., one for each module) so that imports in one view do not conflict with imports from other views.

  JVM views are not hierarchical: they do not inherit from each other so an import in the default view does not affect the other views.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `JAVA_LANG_STAR_IMPORT`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `JVMView(java.lang.String name, java.lang.String id)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addSingleImport(java.lang.String singleImport)`
    `void` | `addStarImport(java.lang.String starImport)`
    `void` | `clearImports()`
    `java.lang.String` | `getId()`
    `java.lang.String[]` | `getImportedNames()` Return the current list of imports known to this view.
    `java.util.Set<java.lang.String>` | `getLastImportSearches()`
    `java.lang.String` | `getName()`
    `int` | `getSequenceId()` Sequence ID for getImportedNames().
    `java.util.Map<java.lang.String,java.lang.String>` | `getSingleImportsMap()`
    `java.util.Set<java.lang.String>` | `getStarImports()`
    `boolean` | `removeSingleImport(java.lang.String importString)`
    `boolean` | `removeStarImport(java.lang.String starImport)`
    `void` | `setId(java.lang.String id)`
    `void` | `setName(java.lang.String name)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### JAVA_LANG_STAR_IMPORT

          public static final java.lang.String JAVA_LANG_STAR_IMPORT

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### JVMView

          public JVMView(java.lang.String name,
                         java.lang.String id)

  - ### Method Detail

    - #### addSingleImport

          public void addSingleImport(java.lang.String singleImport)

      Parameters:
        `singleImport` - Single import statement of the form package1.package2.SimpleName

    - #### addStarImport

          public void addStarImport(java.lang.String starImport)

      Parameters:
        `starImport` - Star Import of the form "package1.package2.*"

    - #### clearImports

          public void clearImports()

    - #### getId

          public java.lang.String getId()

    - #### getLastImportSearches

          public java.util.Set<java.lang.String> getLastImportSearches()

    - #### getName

          public java.lang.String getName()

    - #### getSingleImportsMap

          public java.util.Map<java.lang.String,java.lang.String> getSingleImportsMap()

    - #### getStarImports

          public java.util.Set<java.lang.String> getStarImports()

    - #### removeSingleImport

          public boolean removeSingleImport(java.lang.String importString)

    - #### removeStarImport

          public boolean removeStarImport(java.lang.String starImport)

    - #### setId

          public void setId(java.lang.String id)

    - #### setName

          public void setName(java.lang.String name)

    - #### getImportedNames

          public java.lang.String[] getImportedNames()

      Return the current list of imports known to this view.
      Returns:
        list of class simple names.

    - #### getSequenceId

          public int getSequenceId()

      Sequence ID for getImportedNames(). The sequence ID can be compared to a previous call to determine if getImportedNames() will return a different value. The sequence ID is changed after the contents of getImportedNames() changes.
      Returns:
        sequence ID