Skip to content

Commit

Permalink
Merge pull request #675 from tpenn/java-functions
Browse files Browse the repository at this point in the history
Java functions
  • Loading branch information
geekygirlsarah authored Oct 1, 2023
2 parents 344066b + 6c36f00 commit 1e04dcd
Show file tree
Hide file tree
Showing 3 changed files with 174 additions and 0 deletions.
58 changes: 58 additions & 0 deletions web/thesauruses/java/11/functions.json
Original file line number Diff line number Diff line change
@@ -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();"
}
}
}
58 changes: 58 additions & 0 deletions web/thesauruses/java/15/functions.json
Original file line number Diff line number Diff line change
@@ -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();"
}
}
}
58 changes: 58 additions & 0 deletions web/thesauruses/java/17/functions.json
Original file line number Diff line number Diff line change
@@ -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();"
}
}
}

0 comments on commit 1e04dcd

Please sign in to comment.