diff --git a/web/thesauruses/java/11/functions.json b/web/thesauruses/java/11/functions.json new file mode 100644 index 000000000..b466439ad --- /dev/null +++ b/web/thesauruses/java/11/functions.json @@ -0,0 +1,58 @@ +{ + "meta": { + "language": "java", + "language_version": "11", + "language_name": "Java", + "structure": "functions" + }, + "concepts": { + "void_function_no_parameters": { + "code": "void methodName()\n{\n\t//code\n}", + "name": "Method that does not return a value and takes no parameters" + }, + "void_function_with_parameters": { + "code": "void methodName(parameterType1 parameterName1, parameterType2 parameterName2)\n{\n\t//code\n}", + "name": "Method that does not return a value and that takes 1 or more defined parameters" + }, + "void_function_variable_parameters": { + "code": "void methodName(parameterType... parameterName)\n{\n\t//code\n}", + "name": "Method that does not return a value and takes a variable number of parameters" + }, + "return_value_function_no_parameters": { + "code": "returnValueType methodName()\n{\n\t//code\n\treturn returnValue;\n}", + "name": "Method that returns a value and takes no parameters" + }, + "return_value_function_with_parameters": { + "code": "returnValueType methodName(parameterType1 parameterName1, parameterType2 parameterName2)\n{\n\t//code\n\treturn returnValue;\n}", + "name": "Method that returns a value and takes 1 or more defined parameters" + }, + "return_value_function_variable_parameters": { + "name": "Method that returns a value and takes a variable number of parameters", + "code": "returnValueType methodName(parameterType... parameterName)\n{\n\t//code\n\treturn returnValue;\n}" + }, + "anonymous_function_no_parameters": { + "name": "Anonymous function that takes no parameters", + "code": "() -> //single line of code\n\n() ->\n{\n\t//multiple lines of code\n}" + }, + "anonymous_function_with_parameters": { + "name": "Anonymous function that takes 1 or more defined parameters", + "code": "(parameterName1, parameterName2) ->\n{\n\t//code\n}" + }, + "anonymous_function_no_parameters_with_return": { + "name": "Anonymous function that takes no parameters and returns a value", + "code": "() -> //single line expression/value\n\n() ->\n{\n\t//multiple lines of code\n\treturn returnValue;\n}" + }, + "anonymous_function_with_parameters_with_return": { + "name": "Anonymous function that takes 1 or more defined parameters and returns a value", + "code": "(parameterName1, parameterName2) ->\n{\n\t//code\n\treturn returnValue;\n}" + }, + "call_subroutine": { + "name": "Call subroutine", + "code": "MyClass x = new MyClass();\nx.subRoutine();" + }, + "return_from_subroutine": { + "name": "Return from subroutine", + "code": "MyClass x = new MyClass();\nsubRoutineReturnType y = x.subRoutine();" + } + } +} diff --git a/web/thesauruses/java/15/functions.json b/web/thesauruses/java/15/functions.json new file mode 100644 index 000000000..fe96ee0b4 --- /dev/null +++ b/web/thesauruses/java/15/functions.json @@ -0,0 +1,58 @@ +{ + "meta": { + "language": "java", + "language_version": "15", + "language_name": "Java", + "structure": "functions" + }, + "concepts": { + "void_function_no_parameters": { + "code": "void methodName()\n{\n\t//code\n}", + "name": "Method that does not return a value and takes no parameters" + }, + "void_function_with_parameters": { + "code": "void methodName(parameterType1 parameterName1, parameterType2 parameterName2)\n{\n\t//code\n}", + "name": "Method that does not return a value and that takes 1 or more defined parameters" + }, + "void_function_variable_parameters": { + "code": "void methodName(parameterType... parameterName)\n{\n\t//code\n}", + "name": "Method that does not return a value and takes a variable number of parameters" + }, + "return_value_function_no_parameters": { + "code": "returnValueType methodName()\n{\n\t//code\n\treturn returnValue;\n}", + "name": "Method that returns a value and takes no parameters" + }, + "return_value_function_with_parameters": { + "code": "returnValueType methodName(parameterType1 parameterName1, parameterType2 parameterName2)\n{\n\t//code\n\treturn returnValue;\n}", + "name": "Method that returns a value and takes 1 or more defined parameters" + }, + "return_value_function_variable_parameters": { + "name": "Method that returns a value and takes a variable number of parameters", + "code": "returnValueType methodName(parameterType... parameterName)\n{\n\t//code\n\treturn returnValue;\n}" + }, + "anonymous_function_no_parameters": { + "name": "Anonymous function that takes no parameters", + "code": "() -> //single line of code\n\n() ->\n{\n\t//multiple lines of code\n}" + }, + "anonymous_function_with_parameters": { + "name": "Anonymous function that takes 1 or more defined parameters", + "code": "(parameterName1, parameterName2) ->\n{\n\t//code\n}" + }, + "anonymous_function_no_parameters_with_return": { + "name": "Anonymous function that takes no parameters and returns a value", + "code": "() -> //single line expression/value\n\n() ->\n{\n\t//multiple lines of code\n\treturn returnValue;\n}" + }, + "anonymous_function_with_parameters_with_return": { + "name": "Anonymous function that takes 1 or more defined parameters and returns a value", + "code": "(parameterName1, parameterName2) ->\n{\n\t//code\n\treturn returnValue;\n}" + }, + "call_subroutine": { + "name": "Call subroutine", + "code": "MyClass x = new MyClass();\nx.subRoutine();" + }, + "return_from_subroutine": { + "name": "Return from subroutine", + "code": "MyClass x = new MyClass();\nsubRoutineReturnType y = x.subRoutine();" + } + } +} diff --git a/web/thesauruses/java/17/functions.json b/web/thesauruses/java/17/functions.json new file mode 100644 index 000000000..f8d5f7bb4 --- /dev/null +++ b/web/thesauruses/java/17/functions.json @@ -0,0 +1,58 @@ +{ + "meta": { + "language": "java", + "language_version": "17", + "language_name": "Java", + "structure": "functions" + }, + "concepts": { + "void_function_no_parameters": { + "code": "void methodName()\n{\n\t//code\n}", + "name": "Method that does not return a value and takes no parameters" + }, + "void_function_with_parameters": { + "code": "void methodName(parameterType1 parameterName1, parameterType2 parameterName2)\n{\n\t//code\n}", + "name": "Method that does not return a value and that takes 1 or more defined parameters" + }, + "void_function_variable_parameters": { + "code": "void methodName(parameterType... parameterName)\n{\n\t//code\n}", + "name": "Method that does not return a value and takes a variable number of parameters" + }, + "return_value_function_no_parameters": { + "code": "returnValueType methodName()\n{\n\t//code\n\treturn returnValue;\n}", + "name": "Method that returns a value and takes no parameters" + }, + "return_value_function_with_parameters": { + "code": "returnValueType methodName(parameterType1 parameterName1, parameterType2 parameterName2)\n{\n\t//code\n\treturn returnValue;\n}", + "name": "Method that returns a value and takes 1 or more defined parameters" + }, + "return_value_function_variable_parameters": { + "name": "Method that returns a value and takes a variable number of parameters", + "code": "returnValueType methodName(parameterType... parameterName)\n{\n\t//code\n\treturn returnValue;\n}" + }, + "anonymous_function_no_parameters": { + "name": "Anonymous function that takes no parameters", + "code": "() -> //single line of code\n\n() ->\n{\n\t//multiple lines of code\n}" + }, + "anonymous_function_with_parameters": { + "name": "Anonymous function that takes 1 or more defined parameters", + "code": "(parameterName1, parameterName2) ->\n{\n\t//code\n}" + }, + "anonymous_function_no_parameters_with_return": { + "name": "Anonymous function that takes no parameters and returns a value", + "code": "() -> //single line expression/value\n\n() ->\n{\n\t//multiple lines of code\n\treturn returnValue;\n}" + }, + "anonymous_function_with_parameters_with_return": { + "name": "Anonymous function that takes 1 or more defined parameters and returns a value", + "code": "(parameterName1, parameterName2) ->\n{\n\t//code\n\treturn returnValue;\n}" + }, + "call_subroutine": { + "name": "Call subroutine", + "code": "MyClass x = new MyClass();\nx.subRoutine();" + }, + "return_from_subroutine": { + "name": "Return from subroutine", + "code": "MyClass x = new MyClass();\nsubRoutineReturnType y = x.subRoutine();" + } + } +}