sPFApp/src/main/java/it/polimi/spf/app/fragments/groupinfo/ClientsGuiList.java
public void addClientIfNotPresent(DeviceGuiElement device) {
        boolean add = true;
        for (DeviceGuiElement element : clients) {
            if (element != null
                    && element.getName().equals(device.getName())
                    && element.getAddress().equals(device.getAddress())) {
                add = false; //already in the list
            }
        }

        if (add) {
            clients.add(device);
        }
    }
public void addClientIfNotPresent(DeviceGuiElement device) {
        boolean add = true;
        for (DeviceGuiElement element : clients) {
            if (element != null
                    && element.getName().equals(device.getName())
                    && element.getAddress().equals(device.getAddress())) {
                add = false; //already in the list
            }
        }

        if (add) {
            clients.add(device);
        }
    }
public void addClientIfNotPresent ( DeviceGuiElement device ) { boolean add = true ; for ( DeviceGuiElement element : clients ) { if ( element != null && element . getName ( ) . equals ( device . getName ( ) ) && element . getAddress ( ) . equals ( device . getAddress ( ) ) ) { add = false ; //already in the list } } if ( add ) { clients . add ( device ) ; } }
Method to add a client inside the list in a secure way.
The client is added only if isn't already inside the list.

@param device {@link DeviceGuiElement} to add.
Method to add a client inside the list in a secure way . The client is added only if isn t already inside the list .