Dear visitor, welcome to Palo Community Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.
)
Quoted
Originally posted by arnd
In fact the handling of consolidated elements is a little bit awkward and we may change that in the 2.0 version of the api. So we will come back to your suggestions then... Overloading the updateConsolidation() method is not a big thing, neither it is to call it with '(Consolidation[])list.toArray(new Consolidation[0])' as parameter![]()
):|
|
Source code |
1 2 3 4 5 6 7 8 |
public void addConsolidation(Element elem, Consolidation cons)
{
Consolidation[] consolis = elem.getConsolidations();
Consolidation[] consPlusOne = new Consolidations[ consolis.length + 1 ];
System.arrayCopy( consolis, 0, consPlusOne, 0, consolis.length );
consPlusOne[ consolis.length ] = cons;
elem.updateConsolidations( consolis );
}
|
Quoted
Originally posted by arnd
Regarding the Dimension#getElement(int) method:
actually this method is called getElementAt(int). And in this sense we thought that dimension.getElementAt(index) or dimension.getElementByName(nextElName) is better to read within source code than e.g. dimension.getElement(index) or dimension.getElement(name). Of course this is personal style and flavour. (And personally I like the overloading stuff more, but pssst)

|
|
Source code |
1 2 |
dimension.getElement( name ); // 'name' will never be expected to contain an int dimension.getElement( index ); // 'index' will never be expected to contain a String |