Skip to content

Commit

Permalink
Added functions, methods, and subroutines to Java 17, 15, 11
Browse files Browse the repository at this point in the history
  • Loading branch information
tpenn committed Oct 1, 2023
1 parent 344066b commit 86f3ea9
Show file tree
Hide file tree
Showing 3 changed files with 150 additions and 0 deletions.
50 changes: 50 additions & 0 deletions web/thesauruses/java/11/functions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"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}"
},
"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();"
}
}
}
50 changes: 50 additions & 0 deletions web/thesauruses/java/15/functions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"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}"
},
"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();"
}
}
}
50 changes: 50 additions & 0 deletions web/thesauruses/java/17/functions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"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}"
},
"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();"
}
}
}

0 comments on commit 86f3ea9

Please sign in to comment.