Top "Getter-setter" questions

Public mutator methods in object-oriented programming, responsible for changing and returning the value of private class members, thus keeping with the principle of encapsulation.

Difference between _ and self. in Objective-C

Is there a difference between using the underscore and using the self keyword in Objective-C when calling an @property? Property …

ios objective-c getter-setter synthesize
Should I include getters & setters in class diagram?

I am required to draw a class diagram for my JSF application for a project documentation. So I have lots …

java uml getter-setter class-diagram documentation-generation
CoffeeScript: Getter/Setter in Object Initializers

ECMAScript allows us to define getters or setters as following: [text/javascript] var object = { property: 7, get getable() { return this.property + 1; }, …

javascript oop coffeescript getter-setter ecmascript-5
Why I can't use let in protocol in Swift?

I have a doubt about protocols in Swift about the use of var and the keywords { get set }. From Apple …

ios swift protocols getter-setter swift-protocols
Should I or should I not use getter and setter methods?

Okay, this is really bugging me and I'm starting to think it all comes down to personal choice rather than …

php oop getter-setter
Create a Setter Only in Swift

When I create a setter such as: var masterFrame: CGRect { set { _imageView.frame = newValue _scrollView.frame = newValue } } It's forcing me …

ios swift getter getter-setter
Naming convention for getters/setters in Java

if I have the following private member: private int xIndex; How should I name my getter/setter: getXindex() setXindex(int …

java naming-conventions javabeans getter-setter
Determine if a JavaScript property has a getter or setter defined?

Is it possible, given an object and property name to determine if that property is defined using either a getter …

javascript properties getter-setter
IntelliJ getter/setter format (single-line versus multi-line)

How can you get IntelliJ to generate getter/setters accessor methods on one line like this: public String getAbc() { return …

java intellij-idea getter-setter
Why would you declare getters and setters method private?

I saw a code where getters and setters methods are declared private. I am trying to figure out the logic …

java encapsulation getter-setter