Class ArgumentSpec<Out_>
java.lang.Object
ai.timefold.jpyinterpreter.util.arguments.ArgumentSpec<Out_>
-
Method Summary
Modifier and TypeMethodDescription<ArgumentType_ extends PythonLikeObject>
ArgumentSpec<Out_>addArgument(String argumentName, String argumentTypeName) <ArgumentType_ extends PythonLikeObject>
ArgumentSpec<Out_>addArgument(String argumentName, String argumentTypeName, ArgumentType_ defaultValue) addExtraKeywordVarArgument(String argumentName) addExtraPositionalVarArgument(String argumentName) <ArgumentType_ extends PythonLikeObject>
ArgumentSpec<Out_>addKeywordOnlyArgument(String argumentName, String argumentTypeName) <ArgumentType_ extends PythonLikeObject>
ArgumentSpec<Out_>addKeywordOnlyArgument(String argumentName, String argumentTypeName, ArgumentType_ defaultValue) <ArgumentType_ extends PythonLikeObject>
ArgumentSpec<Out_>addNullableArgument(String argumentName, String argumentTypeName) <ArgumentType_ extends PythonLikeObject>
ArgumentSpec<Out_>addNullableKeywordOnlyArgument(String argumentName, String argumentTypeName) <ArgumentType_ extends PythonLikeObject>
ArgumentSpec<Out_>addNullablePositionalOnlyArgument(String argumentName, String argumentTypeName) <ArgumentType_ extends PythonLikeObject>
ArgumentSpec<Out_>addPositionalOnlyArgument(String argumentName, String argumentTypeName) <ArgumentType_ extends PythonLikeObject>
ArgumentSpec<Out_>addPositionalOnlyArgument(String argumentName, String argumentTypeName, ArgumentType_ defaultValue) asClassPythonFunctionSignature(Method method) asClassPythonFunctionSignature(String internalClassName, String methodName, String methodDescriptor) asPythonFunctionSignature(Method method) asPythonFunctionSignature(String internalClassName, String methodName, String methodDescriptor) asStaticPythonFunctionSignature(String internalClassName, String methodName, String methodDescriptor) extractArgumentList(List<PythonLikeObject> positionalArguments, Map<PythonString, PythonLikeObject> keywordArguments) static <T extends PythonLikeObject>
ArgumentSpec<T>forFunctionReturning(String functionName, String outClass) intintgetArgumentIndex(String argumentName) Returns the index of an argument with the given name.getArgumentKind(int argumentIndex) static ArgumentSpec<?>getArgumentSpec(int argumentSpecIndex) getArgumentTypeInternalName(int argumentIndex) getDefaultValue(int defaultIndex) intgetUnspecifiedArgumentSet(int positionalArguments, List<String> keywordArgumentNameList) booleanbooleanbooleanisArgumentNullable(int argumentIndex) voidloadArgumentSpec(org.objectweb.asm.MethodVisitor methodVisitor) toString()booleanverifyMatchesCallSignature(int positionalArgumentCount, List<String> keywordArgumentNameList, List<PythonLikeType> callStackTypeList)
-
Method Details
-
forFunctionReturning
public static <T extends PythonLikeObject> ArgumentSpec<T> forFunctionReturning(String functionName, String outClass) -
getTotalArgumentCount
public int getTotalArgumentCount() -
getAllowPositionalArgumentCount
public int getAllowPositionalArgumentCount() -
hasExtraPositionalArgumentsCapture
public boolean hasExtraPositionalArgumentsCapture() -
hasExtraKeywordArgumentsCapture
public boolean hasExtraKeywordArgumentsCapture() -
getArgumentTypeInternalName
-
getArgumentKind
-
getArgumentIndex
Returns the index of an argument with the given name. Returns -1 if no argument has the given name.- Parameters:
argumentName- The name of the argument.- Returns:
- the index of an argument with the given name, or -1 if no argument has that name
-
isArgumentNullable
public boolean isArgumentNullable(int argumentIndex) -
getExtraPositionalsArgumentIndex
-
getExtraKeywordsArgumentIndex
-
getUnspecifiedArgumentSet
public Collection<Integer> getUnspecifiedArgumentSet(int positionalArguments, List<String> keywordArgumentNameList) -
getArgumentSpec
-
loadArgumentSpec
public void loadArgumentSpec(org.objectweb.asm.MethodVisitor methodVisitor) -
extractArgumentList
public List<PythonLikeObject> extractArgumentList(List<PythonLikeObject> positionalArguments, Map<PythonString, PythonLikeObject> keywordArguments) -
verifyMatchesCallSignature
public boolean verifyMatchesCallSignature(int positionalArgumentCount, List<String> keywordArgumentNameList, List<PythonLikeType> callStackTypeList) -
addArgument
public <ArgumentType_ extends PythonLikeObject> ArgumentSpec<Out_> addArgument(String argumentName, String argumentTypeName) -
addPositionalOnlyArgument
public <ArgumentType_ extends PythonLikeObject> ArgumentSpec<Out_> addPositionalOnlyArgument(String argumentName, String argumentTypeName) -
addKeywordOnlyArgument
public <ArgumentType_ extends PythonLikeObject> ArgumentSpec<Out_> addKeywordOnlyArgument(String argumentName, String argumentTypeName) -
addArgument
public <ArgumentType_ extends PythonLikeObject> ArgumentSpec<Out_> addArgument(String argumentName, String argumentTypeName, ArgumentType_ defaultValue) -
addPositionalOnlyArgument
public <ArgumentType_ extends PythonLikeObject> ArgumentSpec<Out_> addPositionalOnlyArgument(String argumentName, String argumentTypeName, ArgumentType_ defaultValue) -
addKeywordOnlyArgument
public <ArgumentType_ extends PythonLikeObject> ArgumentSpec<Out_> addKeywordOnlyArgument(String argumentName, String argumentTypeName, ArgumentType_ defaultValue) -
addNullableArgument
public <ArgumentType_ extends PythonLikeObject> ArgumentSpec<Out_> addNullableArgument(String argumentName, String argumentTypeName) -
addNullablePositionalOnlyArgument
public <ArgumentType_ extends PythonLikeObject> ArgumentSpec<Out_> addNullablePositionalOnlyArgument(String argumentName, String argumentTypeName) -
addNullableKeywordOnlyArgument
public <ArgumentType_ extends PythonLikeObject> ArgumentSpec<Out_> addNullableKeywordOnlyArgument(String argumentName, String argumentTypeName) -
addExtraPositionalVarArgument
-
addExtraKeywordVarArgument
-
asPythonFunctionSignature
-
asStaticPythonFunctionSignature
-
asClassPythonFunctionSignature
-
asPythonFunctionSignature
public PythonFunctionSignature asPythonFunctionSignature(String internalClassName, String methodName, String methodDescriptor) -
asStaticPythonFunctionSignature
public PythonFunctionSignature asStaticPythonFunctionSignature(String internalClassName, String methodName, String methodDescriptor) -
asClassPythonFunctionSignature
public PythonFunctionSignature asClassPythonFunctionSignature(String internalClassName, String methodName, String methodDescriptor) -
getDefaultValue
-
toString
-