About: Mutator method     Goto   Sponge   NotDistinct   Permalink

An Entity of Type : dbo:Software, within Data Space : dbpedia.org associated with source document(s)
QRcode icon
http://dbpedia.org/describe/?url=http%3A%2F%2Fdbpedia.org%2Fresource%2FMutator_method

In computer science, a mutator method is a method used to control changes to a variable. They are also widely known as setter methods. Often a setter is accompanied by a getter (together also known as accessors), which returns the value of the private member variable. In programming languages that support them, properties offer a convenient alternative without giving up the utility of encapsulation. In the examples below, a fully implemented mutator method can also validate the input data or take further action such as triggering an event.

AttributesValues
rdf:type
rdfs:label
  • Mètode d'actualització (ca)
  • Zugriffsfunktion (de)
  • Mutator method (en)
  • Сеттер (программирование) (ru)
  • 变异子与访问子 (zh)
rdfs:comment
  • Eine Zugriffsfunktion, auch Zugriffsmethode, Akzessor oder im getter und setter genannt, ist in der objektorientierten Programmierung eine spezielle Methode, die eine einzelne Eigenschaft (Attribut) eines Objekts abfragt oder ändert. Zugriffsfunktionen sind Teil der öffentlichen Schnittstelle eines Objekts und verbergen Implementierungsdetails dieses Objekts. Dadurch kann die Implementierung eines Objekts geändert werden, ohne seine öffentliche Schnittstelle zu ändern. (de)
  • Сеттер (англ. setter, также устанавливающий метод, модифицирующий метод, мутатор) — метод, используемый в объектно-ориентированном программировании для присвоения какого-либо значения инкапсулированному полю, например, обработав при этом недопустимые присваивания. Часто реализуется в паре с методом-геттером, позволяющим получать значение поля класса. (ru)
  • 在计算机科学中, 变异子方法(mutator或setter)是一种用于控制变量更改的方法。通常,变异子伴随着访问子 (accessor或getter)返回私有成员变量的值。 变异子方法最常用于面向对象的编程封装,与封装原则保持一致。根据这个原则,类的成员变量被设为私有以隐藏和保护它们不受其他代码的影响,并且只能由公共成员函数(变异子方法)修改,该函数将所需的新值作为参数來修改私有成员变量。可以将变异子方法与赋值运算符重载进行比较。 变异子方法也可以在非面向对象的环境中使用。在这种情况下,对要修改的变量的引用与新值一起传递给变异子。编译器无法限制代码绕过变异子方法并直接更改变量。开发人员有责任确保仅通过变异子方法修改变量,而不是直接修改变量。 在支持它们的编程语言中,属性提供了一种方便的替代方案,而不放弃封装的效用。 在下面的示例中,完全实现的 变异子方法还可以验证输入数据或采取进一步的操作,例如触发 。 (zh)
  • En la programació informàtica, un mètode d'actualització és un mètode usat per mantenir l'estat d'una classe. El mètode d'actualització, de vegades anomenat setter, és usat majoritàriament en programació orientada a objectes, per mantenir el principi d'. D'acord amb aquest principi, les variables que conformen una classe són fetes privades per ocultar-les i protegir-les d'altres codis, i només poden ser modificades per un mètode públic (el mètode d'actualització), que pren el nou valor desitjat com un paràmetre, opcionalment el valida i modifica la variable privada. (ca)
  • In computer science, a mutator method is a method used to control changes to a variable. They are also widely known as setter methods. Often a setter is accompanied by a getter (together also known as accessors), which returns the value of the private member variable. In programming languages that support them, properties offer a convenient alternative without giving up the utility of encapsulation. In the examples below, a fully implemented mutator method can also validate the input data or take further action such as triggering an event. (en)
dcterms:subject
Wikipage page ID
Wikipage revision ID
Link from a Wikipage to another Wikipage
sameAs
dbp:wikiPageUsesTemplate
has abstract
  • En la programació informàtica, un mètode d'actualització és un mètode usat per mantenir l'estat d'una classe. El mètode d'actualització, de vegades anomenat setter, és usat majoritàriament en programació orientada a objectes, per mantenir el principi d'. D'acord amb aquest principi, les variables que conformen una classe són fetes privades per ocultar-les i protegir-les d'altres codis, i només poden ser modificades per un mètode públic (el mètode d'actualització), que pren el nou valor desitjat com un paràmetre, opcionalment el valida i modifica la variable privada. Sovint un setter ve aparellat amb un getter (també conegut com a ""), que simplment retorna el valor de la variable per l'estat d'aquell moment. El mètodes d'actualització poden ser usats en entorns no orientats a objectes. En tal cas, es passa una referència a la variable a modificar, contenint el nou valor. En aquest escenari, la dada no està protegida als canvis que se salten el mètode d'actualització, el rol de la qual es limita a validar l'entrada. És tasca del desenvolupador assegurar que la variable no és modificada directament. (ca)
  • Eine Zugriffsfunktion, auch Zugriffsmethode, Akzessor oder im getter und setter genannt, ist in der objektorientierten Programmierung eine spezielle Methode, die eine einzelne Eigenschaft (Attribut) eines Objekts abfragt oder ändert. Zugriffsfunktionen sind Teil der öffentlichen Schnittstelle eines Objekts und verbergen Implementierungsdetails dieses Objekts. Dadurch kann die Implementierung eines Objekts geändert werden, ohne seine öffentliche Schnittstelle zu ändern. (de)
  • In computer science, a mutator method is a method used to control changes to a variable. They are also widely known as setter methods. Often a setter is accompanied by a getter (together also known as accessors), which returns the value of the private member variable. The mutator method is most often used in object-oriented programming, in keeping with the principle of encapsulation. According to this principle, member variables of a class are made private to hide and protect them from other code, and can only be modified by a public member function (the mutator method), which takes the desired new value as a parameter, optionally validates it, and modifies the private member variable. Mutator methods can be compared to assignment operator overloading but they typically appear at different levels of the object hierarchy. Mutator methods may also be used in non-object-oriented environments. In this case, a reference to the variable to be modified is passed to the mutator, along with the new value. In this scenario, the compiler cannot restrict code from bypassing the mutator method and changing the variable directly. The responsibility falls to the developers to ensure the variable is only modified through the mutator method and not modified directly. In programming languages that support them, properties offer a convenient alternative without giving up the utility of encapsulation. In the examples below, a fully implemented mutator method can also validate the input data or take further action such as triggering an event. (en)
  • Сеттер (англ. setter, также устанавливающий метод, модифицирующий метод, мутатор) — метод, используемый в объектно-ориентированном программировании для присвоения какого-либо значения инкапсулированному полю, например, обработав при этом недопустимые присваивания. Часто реализуется в паре с методом-геттером, позволяющим получать значение поля класса. (ru)
  • 在计算机科学中, 变异子方法(mutator或setter)是一种用于控制变量更改的方法。通常,变异子伴随着访问子 (accessor或getter)返回私有成员变量的值。 变异子方法最常用于面向对象的编程封装,与封装原则保持一致。根据这个原则,类的成员变量被设为私有以隐藏和保护它们不受其他代码的影响,并且只能由公共成员函数(变异子方法)修改,该函数将所需的新值作为参数來修改私有成员变量。可以将变异子方法与赋值运算符重载进行比较。 变异子方法也可以在非面向对象的环境中使用。在这种情况下,对要修改的变量的引用与新值一起传递给变异子。编译器无法限制代码绕过变异子方法并直接更改变量。开发人员有责任确保仅通过变异子方法修改变量,而不是直接修改变量。 在支持它们的编程语言中,属性提供了一种方便的替代方案,而不放弃封装的效用。 在下面的示例中,完全实现的 变异子方法还可以验证输入数据或采取进一步的操作,例如触发 。 (zh)
gold:hypernym
prov:wasDerivedFrom
page length (characters) of wiki page
foaf:isPrimaryTopicOf
Faceted Search & Find service v1.17_git139 as of Feb 29 2024


Alternative Linked Data Documents: ODE     Content Formats:   [cxml] [csv]     RDF   [text] [turtle] [ld+json] [rdf+json] [rdf+xml]     ODATA   [atom+xml] [odata+json]     Microdata   [microdata+json] [html]    About   
This material is Open Knowledge   W3C Semantic Web Technology [RDF Data] Valid XHTML + RDFa
OpenLink Virtuoso version 08.03.3330 as of Mar 19 2024, on Linux (x86_64-generic-linux-glibc212), Single-Server Edition (61 GB total memory, 51 GB memory in use)
Data on this page belongs to its respective rights holders.
Virtuoso Faceted Browser Copyright © 2009-2024 OpenLink Software