public void removeLightSource(LightSource source) { if (lightSourceList == null) { return; } for (ListIterator<AttachedLightSource> i = lightSourceList.listIterator(); i.hasNext(); ) { AttachedLightSource als = i.next(); if (als != null && als.getLightSourceId() != null && als.getLightSourceId().equals(source.getId())) { i.remove(); } } }
public boolean hasLightSource(LightSource source) { if (lightSourceList == null) { return false; } for (ListIterator<AttachedLightSource> i = lightSourceList.listIterator(); i.hasNext(); ) { AttachedLightSource als = i.next(); if (als != null && als.getLightSourceId() != null && als.getLightSourceId().equals(source.getId())) { return true; } } return false; }