Package ai.timefold.jpyinterpreter
Class CPythonBackedPythonInterpreter
java.lang.Object
ai.timefold.jpyinterpreter.CPythonBackedPythonInterpreter
- All Implemented Interfaces:
PythonInterpreter
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic TriFunction<OpaquePythonReference,List<PythonLikeObject>, Map<PythonString, PythonLikeObject>, PythonLikeObject> static QuadFunction<OpaquePythonReference,Map<String, PythonLikeObject>, PythonLikeTuple, PythonString, PythonObjectWrapper> static BiConsumer<OpaquePythonReference,String> static PentaFunction<String,Map<String, PythonLikeObject>, Map<String, PythonLikeObject>, List<String>, Long, PythonLikeObject> static BiConsumer<Map<String,PythonLikeObject>, String> static Function<OpaquePythonReference,Number> Fields inherited from interface ai.timefold.jpyinterpreter.PythonInterpreter
DEFAULT -
Constructor Summary
ConstructorsConstructorDescriptionCPythonBackedPythonInterpreter(InputStream standardInput, PrintStream standardOutput) -
Method Summary
Modifier and TypeMethodDescriptionstatic PythonLikeObjectcallPythonReference(OpaquePythonReference object, List<PythonLikeObject> positionalArguments, Map<PythonString, PythonLikeObject> keywordArguments) static PythonObjectWrappercreatePythonFunctionWrapper(OpaquePythonReference codeObject, Map<String, PythonLikeObject> globals, PythonLikeTuple closure, PythonString name) static voiddeleteAttributeOnPythonReference(OpaquePythonReference object, String attribute) voiddeleteGlobal(Map<String, PythonLikeObject> globalsMap, String name) getGlobal(Map<String, PythonLikeObject> globalsMap, String name) static Map<String,PythonLikeObject> getPythonReferenceDict(OpaquePythonReference object, Map<Number, PythonLikeObject> referenceMap) static NumbergetPythonReferenceId(OpaquePythonReference reference) static OpaquePythonReferencegetPythonReferenceType(OpaquePythonReference reference) booleanhasValidPythonReference(PythonLikeObject instance) importModule(PythonInteger level, List<PythonString> fromList, Map<String, PythonLikeObject> globalsMap, Map<String, PythonLikeObject> localsMap, String moduleName) static PythonLikeObjectlookupAttributeOnPythonReference(OpaquePythonReference object, String attribute) static PythonLikeObjectlookupAttributeOnPythonReference(OpaquePythonReference object, String attribute, Map<Number, PythonLikeObject> map) static OpaquePythonReference[]lookupPointerArrayForAttributeOnPythonReference(OpaquePythonReference object, String attribute) static OpaquePythonReferencelookupPointerForAttributeOnPythonReference(OpaquePythonReference object, String attribute) readLine()Reads a line from standard inputstatic voidsetAttributeOnPythonReference(OpaquePythonReference object, OpaquePythonReference cloneMap, String attribute, Object value) voidsetGlobal(Map<String, PythonLikeObject> globalsMap, String name, PythonLikeObject value) voidsetPythonReference(PythonLikeObject instance, OpaquePythonReference reference) static voidupdateJavaObjectFromPythonObject(PythonLikeObject javaObject, OpaquePythonReference pythonObject, Map<Number, PythonLikeObject> instanceMap) static voidupdateJavaObjectFromPythonObject(CPythonBackedPythonLikeObject javaObject, OpaquePythonReference pythonObject, Map<Number, PythonLikeObject> instanceMap) voidWrites output without a trailing newline to standard output
-
Field Details
-
pythonObjectIdToConvertedObjectMap
-
lookupPythonReferenceIdPythonFunction
-
lookupPythonReferenceTypePythonFunction
public static Function<OpaquePythonReference,OpaquePythonReference> lookupPythonReferenceTypePythonFunction -
lookupAttributeOnPythonReferencePythonFunction
public static BiFunction<OpaquePythonReference,String, lookupAttributeOnPythonReferencePythonFunctionPythonLikeObject> -
lookupPointerForAttributeOnPythonReferencePythonFunction
public static BiFunction<OpaquePythonReference,String, lookupPointerForAttributeOnPythonReferencePythonFunctionOpaquePythonReference> -
lookupPointerArrayForAttributeOnPythonReferencePythonFunction
public static BiFunction<OpaquePythonReference,String, lookupPointerArrayForAttributeOnPythonReferencePythonFunctionOpaquePythonReference[]> -
loadObjectFromPythonGlobalDict
-
lookupAttributeOnPythonReferenceWithMapPythonFunction
public static TriFunction<OpaquePythonReference,String, lookupAttributeOnPythonReferenceWithMapPythonFunctionMap<Number, PythonLikeObject>, PythonLikeObject> -
setAttributeOnPythonReferencePythonFunction
public static QuadConsumer<OpaquePythonReference,OpaquePythonReference, setAttributeOnPythonReferencePythonFunctionString, Object> -
deleteAttributeOnPythonReferencePythonFunction
public static BiConsumer<OpaquePythonReference,String> deleteAttributeOnPythonReferencePythonFunction -
lookupDictOnPythonReferencePythonFunction
public static BiFunction<OpaquePythonReference,Map<Number, lookupDictOnPythonReferencePythonFunctionPythonLikeObject>, Map<String, PythonLikeObject>> -
callPythonFunction
public static TriFunction<OpaquePythonReference,List<PythonLikeObject>, callPythonFunctionMap<PythonString, PythonLikeObject>, PythonLikeObject> -
importModuleFunction
public static PentaFunction<String,Map<String, importModuleFunctionPythonLikeObject>, Map<String, PythonLikeObject>, List<String>, Long, PythonLikeObject> -
createFunctionFromCodeFunction
public static QuadFunction<OpaquePythonReference,Map<String, createFunctionFromCodeFunctionPythonLikeObject>, PythonLikeTuple, PythonString, PythonObjectWrapper>
-
-
Constructor Details
-
CPythonBackedPythonInterpreter
public CPythonBackedPythonInterpreter() -
CPythonBackedPythonInterpreter
-
-
Method Details
-
getPythonReferenceId
-
getPythonReferenceType
-
lookupAttributeOnPythonReference
public static PythonLikeObject lookupAttributeOnPythonReference(OpaquePythonReference object, String attribute) -
lookupAttributeOnPythonReference
public static PythonLikeObject lookupAttributeOnPythonReference(OpaquePythonReference object, String attribute, Map<Number, PythonLikeObject> map) -
lookupPointerForAttributeOnPythonReference
public static OpaquePythonReference lookupPointerForAttributeOnPythonReference(OpaquePythonReference object, String attribute) -
lookupPointerArrayForAttributeOnPythonReference
public static OpaquePythonReference[] lookupPointerArrayForAttributeOnPythonReference(OpaquePythonReference object, String attribute) -
setAttributeOnPythonReference
public static void setAttributeOnPythonReference(OpaquePythonReference object, OpaquePythonReference cloneMap, String attribute, Object value) -
deleteAttributeOnPythonReference
-
getPythonReferenceDict
public static Map<String,PythonLikeObject> getPythonReferenceDict(OpaquePythonReference object, Map<Number, PythonLikeObject> referenceMap) -
updateJavaObjectFromPythonObject
public static void updateJavaObjectFromPythonObject(CPythonBackedPythonLikeObject javaObject, OpaquePythonReference pythonObject, Map<Number, PythonLikeObject> instanceMap) -
updateJavaObjectFromPythonObject
public static void updateJavaObjectFromPythonObject(PythonLikeObject javaObject, OpaquePythonReference pythonObject, Map<Number, PythonLikeObject> instanceMap) -
callPythonReference
public static PythonLikeObject callPythonReference(OpaquePythonReference object, List<PythonLikeObject> positionalArguments, Map<PythonString, PythonLikeObject> keywordArguments) -
createPythonFunctionWrapper
public static PythonObjectWrapper createPythonFunctionWrapper(OpaquePythonReference codeObject, Map<String, PythonLikeObject> globals, PythonLikeTuple closure, PythonString name) -
hasValidPythonReference
- Specified by:
hasValidPythonReferencein interfacePythonInterpreter
-
setPythonReference
- Specified by:
setPythonReferencein interfacePythonInterpreter
-
getGlobal
- Specified by:
getGlobalin interfacePythonInterpreter
-
setGlobal
- Specified by:
setGlobalin interfacePythonInterpreter
-
deleteGlobal
- Specified by:
deleteGlobalin interfacePythonInterpreter
-
importModule
public PythonLikeObject importModule(PythonInteger level, List<PythonString> fromList, Map<String, PythonLikeObject> globalsMap, Map<String, PythonLikeObject> localsMap, String moduleName) - Specified by:
importModulein interfacePythonInterpreter
-
write
Description copied from interface:PythonInterpreterWrites output without a trailing newline to standard output- Specified by:
writein interfacePythonInterpreter- Parameters:
output- the text to write
-
readLine
Description copied from interface:PythonInterpreterReads a line from standard input- Specified by:
readLinein interfacePythonInterpreter- Returns:
- A line read from standard input
-
getTraceback
- Specified by:
getTracebackin interfacePythonInterpreter
-