Collection - in tango

Hi All,

For client-server communication, can we use 'Collection' or there is any other concept instead of 'Array'?

Regards,
TCS_GMRT
Regards,
TCS_GMRT
Hi TCS_GMRT,

I am not a Java expert so I don't know the answer but have you checked out the ez tango api e.g. :

http://www.esrf.eu/computing/cs/tango/tango_doc/kernel_doc/tango_java_api/org/tango/client/ez/data/package-summary.html

I do not see any mention of Collections but maybe it is clever enough to support them transparently.

Can a Java expert give us more details?

Cheers

Andy
Hi,

Andy
Can a Java expert give us more details?

Communication will use Array anyway. You can wrap it with ArrayList and pass it further as a Collection:


Arrays.asList(array)

If you want generics you can wrap the resulting list with another one:


new ArrayList<Element>(Arrays.asList(array))

The later is not compile time safe because you can get anything from the wire. In this case ClassCastException will be thrown.

Hope this helps.

Regards,
Hi,

Thanks for your prompt reply. Can we use 'Map' as a type of collection in tango instead of 'ArrayList'?

Regards,
TCS_GMRT
Regards,
TCS_GMRT
 
Register or login to create to post a reply.