Update of /cvsroot/nice/Nice/web
In directory sc8-pr-cvs1:/tmp/cvs-serv1232/web
Modified Files:
manual.xml
Log Message:
Documented the generation of constructors when a Nice class has a Java parent.
Also added the generation of the alternate constructor when calling from Java,
which omits the fields with default values.
Index: manual.xml
===================================================================
RCS file: /cvsroot/nice/Nice/web/manual.xml,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -d -r1.26 -r1.27
*** manual.xml 19 Jun 2003 21:09:59 -0000 1.26
--- manual.xml 24 Jun 2003 09:06:57 -0000 1.27
***************
*** 1047,1050 ****
--- 1047,1053 ----
Therefore it is straightforward to use existing Java code
in Nice programs.
+ In particular, it is possible to call Java methods, to
+ instantiate Java classes, to create a Nice subclass of a Java
+ class, overriding methods from the parent, ...
</para>
***************
*** 1054,1057 ****
--- 1057,1077 ----
</para>
+ <section id="subclassJavaInNice"><title>Subclassing a Java class</title>
+ <para>
+ A Nice class can extend a Java class, simply by naming it in
+ its <literal>extends</literal> clause. Similarly, it can
+ implement Java interfaces.
+ </para>
+
+ <para>
+ When instantiating a Nice class with a Java parent, the
+ <link linkend="constructor">automatic constructor</link>
+ comes in several versions, one for each constructor of the
+ parent class. The call must then provide the values for one
+ of the constructors of the parent, followed by the named
+ values for the fields defined in the Nice class.
+ </para>
+ </section>
+
<section id="importJava"><title>Importing packages</title>
<para>
***************
*** 1187,1190 ****
--- 1207,1214 ----
with one parameter for each field of the class,
including those inherited from Nice super-classes.
+ Additionally, if some fields have default values, then a
+ second constructor is generated. It only has parameters for
+ the fields without a default value, and assigns to the other
+ fields their default value.
</para>
</section>
|