From 651e36acc4331a019e5efa323faad315308147d3 Mon Sep 17 00:00:00 2001 From: naeem4633 <91604353+naeem4633@users.noreply.github.com> Date: Sat, 20 Jul 2024 11:50:17 +0500 Subject: [PATCH 1/2] added Kotlin classes section. Changes done to meta_info.json. added Kotlin folder --- web/thesauruses/kotlin/1.5/classes.json | 112 ++++++++++++++++++++++++ web/thesauruses/meta_info.json | 1 + 2 files changed, 113 insertions(+) create mode 100644 web/thesauruses/kotlin/1.5/classes.json diff --git a/web/thesauruses/kotlin/1.5/classes.json b/web/thesauruses/kotlin/1.5/classes.json new file mode 100644 index 000000000..7b82e9caf --- /dev/null +++ b/web/thesauruses/kotlin/1.5/classes.json @@ -0,0 +1,112 @@ +{ + "meta": { + "language": "kotlin", + "language_version": "1.5", + "language_name": "Kotlin", + "structure": "classes" + }, + "concepts": { + "normal_class": { + "code": "class ClassName {\n // Class body containing properties and methods \n}", + "name": "Normal class" + }, + "abstract_class": { + "code": "abstract class ClassName {\n // Class body containing abstract methods \n}", + "name": "Abstract class" + }, + "interface": { + "code": "interface InterfaceName {\n // Interface body containing method declarations \n}", + "name": "Interface" + }, + "read_only_class": { + "code": "class ClassName(val property: Type) {\n // Only getter methods are provided \n}", + "name": "Read-only class" + }, + "static_class": { + "code": "class ClassName {\n companion object {\n // Static properties and methods \n}\n}", + "name": "Static class" + }, + "inner_class": { + "code": "class OuterClassName {\n inner class InnerClassName {\n // Inner class body \n}\n}", + "name": "Inner class" + }, + "packages": { + "code": "package PackageName", + "comment": "Packages are declared at the beginning of the file using the package keyword.", + "name": "Packages" + }, + "class_with_generic_type": { + "code": "class ClassName {\n var property: T\n}", + "comment": "Kotlin generic classes are defined with a type parameter in angle brackets.", + "name": "Class with a generic type" + }, + "private_variables": { + "code": "private var variableName: Type = value", + "name": "Defining private variables" + }, + "protected_variables": { + "code": "protected var variableName: Type = value", + "name": "Defining protected variables" + }, + "public_variables": { + "code": "var variableName: Type = value", + "comment": "Variables are public by default in Kotlin.", + "name": "Defining public variables" + }, + "static_variables": { + "code": "class ClassName {\n companion object {\n var staticVar: Type = value\n}\n}", + "name": "Defining static variables" + }, + "private_functions": { + "code": "private fun methodName() {\n // Method body \n}", + "name": "Defining private functions" + }, + "protected_functions": { + "code": "protected fun methodName() {\n // Method body \n}", + "name": "Defining protected functions" + }, + "public_functions": { + "code": "fun methodName() {\n // Method body \n}", + "name": "Defining public functions" + }, + "static_functions": { + "code": "class ClassName {\n companion object {\n fun methodName() {\n // Method body \n}\n}\n}", + "name": "Defining static functions" + }, + "extends_class": { + "code": "class ChildClassName : ParentClassName() {\n // Class body \n}", + "name": "Class that inherits/extends another class" + }, + "extending_interface": { + "code": "class ClassName : InterfaceName {\n // Class body \n}", + "name": "Class/Interface that inherits/extends another class/interface" + }, + "calling_superclass_functions": { + "code": "super.methodName()", + "name": "Calling a superclass function" + }, + "overriding_superclass_functions": { + "code": "override fun methodName() {\n // Overridden method body \n}", + "name": "Overriding a superclass function" + }, + "instantiating_object": { + "code": "val obj = ClassName()", + "name": "Instantiating a new object" + }, + "instantiating_polymorphic_object": { + "code": "val obj: InterfaceName = ClassName()", + "comment": "An object can be instantiated as a polymorphic type.", + "name": "Instantiating a polymorphic object" + }, + "implement_constructor": { + "code": "class ClassName(val property: Type) {\n init {\n // Constructor body \n}\n}", + "name": "Implementing a class constructor" + }, + "implement_deconstructor": { + "not-implemented": true, + "comment": "Kotlin does not have destructors like C++.", + "name": "Implementing a class deconstructor" + } + } + } + \ No newline at end of file diff --git a/web/thesauruses/meta_info.json b/web/thesauruses/meta_info.json index fc7bc6cae..787c1409f 100644 --- a/web/thesauruses/meta_info.json +++ b/web/thesauruses/meta_info.json @@ -10,6 +10,7 @@ "haskell": "Haskell", "java": "Java", "javascript": "JavaScript", + "kotlin": "Kotlin", "lua": "Lua", "nim": "Nim", "objectivec": "Objective-C", From a73888f7dc2776aa8d39cdf7b9e0d72e37958ad4 Mon Sep 17 00:00:00 2001 From: naeem4633 <91604353+naeem4633@users.noreply.github.com> Date: Sun, 21 Jul 2024 07:44:04 +0500 Subject: [PATCH 2/2] Fixed formatting and removed unnecessary comments for Kotlin classes --- web/thesauruses/kotlin/1.5/classes.json | 213 ++++++++++++------------ 1 file changed, 104 insertions(+), 109 deletions(-) diff --git a/web/thesauruses/kotlin/1.5/classes.json b/web/thesauruses/kotlin/1.5/classes.json index 7b82e9caf..4866358e4 100644 --- a/web/thesauruses/kotlin/1.5/classes.json +++ b/web/thesauruses/kotlin/1.5/classes.json @@ -1,112 +1,107 @@ { - "meta": { - "language": "kotlin", - "language_version": "1.5", - "language_name": "Kotlin", - "structure": "classes" - }, - "concepts": { - "normal_class": { - "code": "class ClassName {\n // Class body containing properties and methods \n}", - "name": "Normal class" - }, - "abstract_class": { - "code": "abstract class ClassName {\n // Class body containing abstract methods \n}", - "name": "Abstract class" - }, - "interface": { - "code": "interface InterfaceName {\n // Interface body containing method declarations \n}", - "name": "Interface" - }, - "read_only_class": { - "code": "class ClassName(val property: Type) {\n // Only getter methods are provided \n}", - "name": "Read-only class" - }, - "static_class": { - "code": "class ClassName {\n companion object {\n // Static properties and methods \n}\n}", - "name": "Static class" - }, - "inner_class": { - "code": "class OuterClassName {\n inner class InnerClassName {\n // Inner class body \n}\n}", - "name": "Inner class" - }, - "packages": { - "code": "package PackageName", - "comment": "Packages are declared at the beginning of the file using the package keyword.", - "name": "Packages" - }, - "class_with_generic_type": { - "code": "class ClassName {\n var property: T\n}", - "comment": "Kotlin generic classes are defined with a type parameter in angle brackets.", - "name": "Class with a generic type" - }, - "private_variables": { - "code": "private var variableName: Type = value", - "name": "Defining private variables" - }, - "protected_variables": { - "code": "protected var variableName: Type = value", - "name": "Defining protected variables" - }, - "public_variables": { - "code": "var variableName: Type = value", - "comment": "Variables are public by default in Kotlin.", - "name": "Defining public variables" - }, - "static_variables": { - "code": "class ClassName {\n companion object {\n var staticVar: Type = value\n}\n}", - "name": "Defining static variables" - }, - "private_functions": { - "code": "private fun methodName() {\n // Method body \n}", - "name": "Defining private functions" - }, - "protected_functions": { - "code": "protected fun methodName() {\n // Method body \n}", - "name": "Defining protected functions" - }, - "public_functions": { - "code": "fun methodName() {\n // Method body \n}", - "name": "Defining public functions" - }, - "static_functions": { - "code": "class ClassName {\n companion object {\n fun methodName() {\n // Method body \n}\n}\n}", - "name": "Defining static functions" - }, - "extends_class": { - "code": "class ChildClassName : ParentClassName() {\n // Class body \n}", - "name": "Class that inherits/extends another class" - }, - "extending_interface": { - "code": "class ClassName : InterfaceName {\n // Class body \n}", - "name": "Class/Interface that inherits/extends another class/interface" - }, - "calling_superclass_functions": { - "code": "super.methodName()", - "name": "Calling a superclass function" - }, - "overriding_superclass_functions": { - "code": "override fun methodName() {\n // Overridden method body \n}", - "name": "Overriding a superclass function" - }, - "instantiating_object": { - "code": "val obj = ClassName()", - "name": "Instantiating a new object" - }, - "instantiating_polymorphic_object": { - "code": "val obj: InterfaceName = ClassName()", - "comment": "An object can be instantiated as a polymorphic type.", - "name": "Instantiating a polymorphic object" - }, - "implement_constructor": { - "code": "class ClassName(val property: Type) {\n init {\n // Constructor body \n}\n}", - "name": "Implementing a class constructor" - }, - "implement_deconstructor": { - "not-implemented": true, - "comment": "Kotlin does not have destructors like C++.", - "name": "Implementing a class deconstructor" - } + "meta": { + "language": "kotlin", + "language_version": "1.5", + "language_name": "Kotlin", + "structure": "classes" + }, + "concepts": { + "normal_class": { + "code": "class ClassName {\n // Class body containing properties and methods\n}", + "name": "Normal class" + }, + "abstract_class": { + "code": "abstract class ClassName {\n // Class body containing abstract methods\n}", + "name": "Abstract class" + }, + "interface": { + "code": "interface InterfaceName {\n // Interface body containing method declarations\n}", + "name": "Interface" + }, + "read_only_class": { + "code": "class ClassName(val property: Type) {\n // Only getter methods are provided\n}", + "name": "Read-only class" + }, + "static_class": { + "code": "class ClassName {\n companion object {\n // Static properties and methods\n }\n}", + "name": "Static class" + }, + "inner_class": { + "not-implemented": true, + "name": "Inner class" + }, + "packages": { + "comment": "Use 'import' keyword to include packages.", + "not-implemented": true, + "name": "Packages" + }, + "class_with_generic_type": { + "code": "class ClassName {\n // Class body with generic type T\n}", + "name": "Class with a generic type" + }, + "private_variables": { + "code": "private var variableName: Type = value", + "name": "Defining private variables" + }, + "protected_variables": { + "code": "protected var variableName: Type = value", + "name": "Defining protected variables" + }, + "public_variables": { + "code": "var variableName: Type = value", + "name": "Defining public variables" + }, + "static_variables": { + "code": "companion object {\n var variableName: Type = value\n}", + "name": "Defining static variables" + }, + "private_functions": { + "code": "private fun methodName() {\n // Method body\n}", + "name": "Defining private functions" + }, + "protected_functions": { + "code": "protected fun methodName() {\n // Method body\n}", + "name": "Defining protected functions" + }, + "public_functions": { + "code": "fun methodName() {\n // Method body\n}", + "name": "Defining public functions" + }, + "static_functions": { + "code": "companion object {\n fun methodName() {\n // Method body\n }\n}", + "name": "Defining static functions" + }, + "extends_class": { + "code": "class ChildClassName : ParentClassName() {\n // Class body containing variables and methods\n}", + "name": "Class that inherits/extends another class" + }, + "extending_interface": { + "code": "class ClassName : InterfaceName {\n // Class body containing variables and methods\n}", + "name": "Class/Interface that inherits/extends another class/interface" + }, + "calling_superclass_functions": { + "code": "super.methodName()", + "name": "Calling a superclass function" + }, + "overriding_superclass_functions": { + "code": "class ChildClassName : ParentClassName() {\n override fun methodName() {\n // Overriding method body\n }\n}", + "name": "Overriding a superclass function" + }, + "instantiating_object": { + "code": "val objectName = ClassName()", + "name": "Instantiating a new object" + }, + "instantiating_polymorphic_object": { + "code": "val objectName: InterfaceName = ClassName()", + "name": "Instantiating a polymorphic object" + }, + "implement_constructor": { + "code": "class ClassName(val property: Type) {\n init {\n // Constructor body\n }\n}", + "name": "Implementing a class constructor" + }, + "implement_deconstructor": { + "not-implemented": true, + "name": "Implementing a class deconstructor" } } - \ No newline at end of file +} \ No newline at end of file