private synchronized void add ( final String ... attributes ) throws DevFailed { userAttributesNames = new String [ attributes . length ] ; devices = new DeviceProxy [ attributes . length ] ; int i = 0 ; for ( final String attributeName : attributes ) { final String deviceName = TangoUtil . getfullDeviceNameForAttribute ( attributeName ) . toLowerCase ( Locale . ENGLISH ) ; final String fullAttribute = TangoUtil . getfullAttributeNameForAttribute ( attributeName ) . toLowerCase ( Locale . ENGLISH ) ; userAttributesNames [ i ] = fullAttribute ; try { final DeviceProxy device = ProxyFactory . getInstance ( ) . createDeviceProxy ( deviceName ) ; devices [ i ++ ] = device ; if ( ! devicesMap . containsKey ( deviceName ) ) { devicesMap . put ( deviceName , device ) ; } } catch ( final DevFailed e ) { if ( throwExceptions ) { throw e ; } else { devices [ i ++ ] = null ; if ( ! devicesMap . containsKey ( deviceName ) ) { devicesMap . put ( deviceName , null ) ; } } } final String attribute = fullAttribute . split ( "/" ) [ 3 ] ; if ( ! attributesMap . containsKey ( deviceName ) ) { final List < String > attributesNames = new ArrayList < String > ( ) ; attributesNames . add ( attribute ) ; attributesMap . put ( deviceName , attributesNames ) ; } else { attributesMap . get ( deviceName ) . add ( attribute ) ; } } }
Add a list of devices in the group or add a list of patterns