Prev | Current Page 230 | Next

L. McColl-Sylvester and F. Ponticelli

"Professional haXe and Neko"


method name The specified method, usually marked as private, must belong to the
same class of the property and is used to access the property value. If set
in place of the getKeyword it will be a getter; otherwise it will be a setter.
dynamic The access is provided by using a runtime-generated method.
The getModifier and setModifier can assume one of the values described in Table 5 - 1 .
The variable associated with a read - only/ write - only property continues to be fully accessible inside the
class that owns it. The access limitation is valid just from outside and makes sense for public variables only.
A getter method must conform to the signature Void - > T , which literally means that the method must
accept no parameters and must return a value of type T where T is the type of the variable. The signature
for the setter method is T - > T , which means that the function must accept and must return one value
of the same type as the property itself.
The setter method, although it ??™ s used for changing something inside the object instance, must always
return a value (usually the same that would be returned accessing sequentially the getter method).


Pages:
218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242