Package py4j
Class JVMView
java.lang.Object
py4j.JVMView
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.
- Author:
- Barthelemy Dagenais
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addSingleImport
(String singleImport) void
addStarImport
(String starImport) void
getId()
String[]
Return the current list of imports known to this view.getName()
int
Sequence ID for getImportedNames().boolean
removeSingleImport
(String importString) boolean
removeStarImport
(String starImport) void
void
-
Field Details
-
JAVA_LANG_STAR_IMPORT
- See Also:
-
-
Constructor Details
-
JVMView
-
-
Method Details
-
addSingleImport
- Parameters:
singleImport
- Single import statement of the form package1.package2.SimpleName
-
addStarImport
- Parameters:
starImport
- Star Import of the form "package1.package2.*"
-
clearImports
public void clearImports() -
getId
-
getLastImportSearches
-
getName
-
getSingleImportsMap
-
getStarImports
-
removeSingleImport
-
removeStarImport
-
setId
-
setName
-
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
-