Greetings everyone,

I recently inherited a project from another developer and he was using a
lot of XSD's that was converted to XMLBeans via an Ant task. These were
then used as schemaDto's.

All this is fine and good and I really like the ease of design and
automation it brings. One question I have though, in some of the
XMLBeans there is a method generated that is something like:

sizeOfIvestmentsArray();

Now, he has been using this method as follows:

private ContractNotes(ContractNotes cn) {

Investments investments = Investments.Factory.newInstance();

this.mapInvestments(investments);

cn.addNewInvestments();
cn.setInvestmentsArray(cn.sizeOfInvestmentsArray - 1, investments);

return cn;
}

Now my question is what exactly does the sizeOf method return each time
it is called? Does it basically return 1 the first time which would
then, used with -1, return index 0 for the Array and then add the
investment to this position in the Array.

When called again it would return 2, used with -1, it would add the next
investment at index 1 within the Array etc. etc.

So am I understanding this correctly? Does this basically allow the
Array to grow dynamically as more investment objects are added?

Looking forward to you input.

Kind Regards,
Schalk Neethling

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to