The Reflect
.setField() method is then used to set the read - only property createdOn . The remaining variables
can be set normally.
Implementing Classes
Implementation is the typical relation that exists between a class and an interface; haXe is much more
flexible and also permits that classes may implement other classes. When implementing another class it
will be necessary to provide code for each of the instance fields associated with the implemented class,
both public and private, and no code will be automatically borrowed in the same way as it happens
when implementing interfaces.
The Flash 9 platform doesn ??™ t support the implementation of classes at all. On this platform it is possible
just to extend one class and to implement one or more interfaces.
Type Parameters
Some classes or interfaces are specialized in operating over instances of other classes. Such operations
can possibly be performed on instances of classes that do not share any common parent class or
interface. Consider the following example:
class BinaryNode {
private var content : String;
public var parent : BinaryNode;
public var leftChild : BinaryNode;
public var rightChild : BinaryNode;
public function new (content : String)
{
this.
Pages:
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264