الفرق بين المراجعتين ل"Kotlin/kotlin.text/MatchResult/Destructured"

من موسوعة حسوب
اذهب إلى التنقل اذهب إلى البحث
(أنشأ الصفحة ب'<noinclude>{{DISPLAYTITLE:الصنف <code>‎‎MatchResult.Destructured</code>‎ في Kotlin}}</noinclude> تصنيف:Kotlin تصنيف:Kotlin Classes ت...')
 
ط
 
(4 مراجعات متوسطة بواسطة مستخدمين اثنين آخرين غير معروضة)
سطر 1: سطر 1:
<noinclude>{{DISPLAYTITLE:الصنف <code>‎‎MatchResult.Destructured</code>‎ في Kotlin}}</noinclude>
+
<noinclude>{{DISPLAYTITLE:الصنف <code>‎‎Destructured</code>‎ في Kotlin}}</noinclude>
 +
يوفر الصنف <code>Destructured</code> مركبات الإسناد بالتفكيك (destructuring assignment) لمجموعة من القيم. يسمح الإسناد بالتفكيك باستخراج القيم الموجودة في المصفوفات أو المجموعات أو خاصيات أحد الكائنات ...إلخ. إلى متغيرات مستقلة.
  
 +
تطابق الدالة <code>[[Kotlin/kotlin.text/MatchResult/Destructured/component1|component1]]</code> قيمة المجموعة الأولى، وتطابق الدالة <code>[[Kotlin/kotlin.text/MatchResult/Destructured/component2|component2]]</code> قيمة المجموعة الثانية، وهلم جرًا.
  
 +
إن كانت المجموعة في <nowiki/>[[Kotlin/kotlin.text/Regex/index|التعبير النمطي]] اختيارية ولم ترصد هذه المجموعة أي عملية تطابق تُذكر، فيمكن حينئذٍ أن تساوي قيمة المكون المقابل لهذه المجموعة سلسلةً نصيةً فارغةً. <nowiki/><syntaxhighlight lang="kotlin">
 +
class Destructured
 +
</syntaxhighlight>
 +
 +
== الخاصيات ==
 +
<code>[[Kotlin/kotlin.text/MatchResult/Destructured/match|match]]</code>
 +
 +
== الدوال ==
 +
<code>[[Kotlin/kotlin.text/MatchResult/Destructured/component1|component1]]</code>
 +
 +
<code>[[Kotlin/kotlin.text/MatchResult/Destructured/component2|component2]]</code>
 +
 +
<code>[[Kotlin/kotlin.text/MatchResult/Destructured/component3|component3]]</code>
 +
 +
<code>[[Kotlin/kotlin.text/MatchResult/Destructured/component4|component4]]</code>
 +
 +
<code>[[Kotlin/kotlin.text/MatchResult/Destructured/component5|component5]]</code>
 +
 +
<code>[[Kotlin/kotlin.text/MatchResult/Destructured/component6|component6]]</code>
 +
 +
<code>[[Kotlin/kotlin.text/MatchResult/Destructured/component7|component7]]</code>
 +
 +
<code>[[Kotlin/kotlin.text/MatchResult/Destructured/component8|component8]]</code>
 +
 +
<code>[[Kotlin/kotlin.text/MatchResult/Destructured/component9|component9]]</code>
 +
 +
<code>[[Kotlin/kotlin.text/MatchResult/Destructured/component10|component10]]</code>
 +
 +
<code>[[Kotlin/kotlin.text/MatchResult/Destructured/toList|toList]]</code>
 +
 +
== الدوال الموروثة (Inherited Functions) ==
 +
 +
=== <code>[[Kotlin/Any/equals|equals]]</code> ===
 +
تبين هذه الدالة إذا ما كان الكائن المُمرّر إليها يساوي الكائن الذي استدعيت معه.
 +
=== <code>[[Kotlin/Any/hashCode|hashCode]]</code> ===
 +
تعيد هذه الدالة الشيفرة Hash الخاصّة بالكائن الذي استُدعي معها.
 +
 +
=== <code>[[Kotlin/Any/toString|toString]]</code> ===
 +
تحول هذه الدالة الكائن الذي يُستدعى معه إلى سلسلة نصية (String).
 +
 +
== مصادر ==
 +
* [http://kotlinlang.org/api/latest/jvm/stdlib/kotlin.text/-match-result/-destructured/index.html صفحة الصنف Destructured في التوثيق الرسميّ للمكتبة القياسيّة في لغة Kotlin.]
 
[[تصنيف:Kotlin]]
 
[[تصنيف:Kotlin]]
[[تصنيف:Kotlin Classes]]
+
[[تصنيف:Kotlin Class]]
[[تصنيف:Kotlin ‎‎MatchResult.Destructured]]
+
[[تصنيف:Kotlin Text]]
 +
[[تصنيف:Kotlin MatchResult]]
 +
[[تصنيف:Kotlin Destructured]]

المراجعة الحالية بتاريخ 07:03، 30 أغسطس 2018

يوفر الصنف Destructured مركبات الإسناد بالتفكيك (destructuring assignment) لمجموعة من القيم. يسمح الإسناد بالتفكيك باستخراج القيم الموجودة في المصفوفات أو المجموعات أو خاصيات أحد الكائنات ...إلخ. إلى متغيرات مستقلة.

تطابق الدالة component1 قيمة المجموعة الأولى، وتطابق الدالة component2 قيمة المجموعة الثانية، وهلم جرًا.

إن كانت المجموعة في التعبير النمطي اختيارية ولم ترصد هذه المجموعة أي عملية تطابق تُذكر، فيمكن حينئذٍ أن تساوي قيمة المكون المقابل لهذه المجموعة سلسلةً نصيةً فارغةً.

class Destructured

الخاصيات

match

الدوال

component1

component2

component3

component4

component5

component6

component7

component8

component9

component10

toList

الدوال الموروثة (Inherited Functions)

equals

تبين هذه الدالة إذا ما كان الكائن المُمرّر إليها يساوي الكائن الذي استدعيت معه.

hashCode

تعيد هذه الدالة الشيفرة Hash الخاصّة بالكائن الذي استُدعي معها.

toString

تحول هذه الدالة الكائن الذي يُستدعى معه إلى سلسلة نصية (String).

مصادر