You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hivemind.apache.org by Shing Hing Man <ma...@yahoo.com> on 2005/07/24 11:31:43 UTC

Is the order of elements in a contribution preserved ?

In HiveMind 1.0,

  suppose I have a contribution of a list of elements
like this :
 
<contribution configuration-id="Simple">
  <datum key="key0" value="value0"/>
  <datum key="key1" value="value1"/>
 <datum key="key2" value="value2"/>
</contribution>

Is the order of the  elements in the resulted list
preserved ? 
More explictly, if I access the above contribution by

List elements = registry.getConfiguration("Simple");	

Is 
  elements.get(0) : datum key="key0" value="value0"
   elements.get(1) : datum key="key1" value="value1"
   elements.get(2) : datum key="key2" value="value2" ?

 When I try out the above in an example, the order is
preserved.
 But I can not find the comfirmation in the
documentation.

Thank you in advance for any comments !

Shing


Home page :
  http://uk.geocities.com/matmsh/index.html


	
	
		
___________________________________________________________ 
Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voicemail http://uk.messenger.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org


Re: Is the order of elements in a contribution preserved ?

Posted by Knut Wannheden <kn...@gmail.com>.
Shing,

On 7/24/05, Shing Hing Man <ma...@yahoo.com> wrote:
> In HiveMind 1.0,
> 
>   suppose I have a contribution of a list of elements
> like this :
> 
> <contribution configuration-id="Simple">
>   <datum key="key0" value="value0"/>
>   <datum key="key1" value="value1"/>
>  <datum key="key2" value="value2"/>
> </contribution>
> 
> Is the order of the  elements in the resulted list
> preserved ?

Yes, the order of the elements, all contributed by the same module
(even if by multiple <contribution> elements), is preserved. There is
however no specified ordering of elements contributed by different
modules.

There is a proposal on the HiveMind Wiki
(http://wiki.apache.org/jakarta-hivemind/ContributionOrderingProposal)
regarding ordering of configuration contributions. If you're
interested then please take a look and add your comments to it.

Regards,

--knut

---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org