@Override public Object retrieve(String field) { if (field == null) { return null; } else if (field.equals(ID)) { return getId(); } else if (field.equals(VERSION)) { return getVersion(); } else if (field.equals(ATTENUATION)) { return getAttenuation(); } else if (field.equals(WAVELENGTH)) { return getWavelength(); } else if (field.equals(LIGHTSOURCE)) { return getLightSource(); } else if (field.equals(MICROBEAMMANIPULATION)) { return getMicrobeamManipulation(); } else if (field.equals(DETAILS)) { return getDetails(); } else { if (_dynamicFields != null) { return _dynamicFields.get(field); } return null; } }
/** * Finds the matching unique settings for a logical channel. * @param uniqueSettings Set of existing unique settings. * @param lc Logical channel to find unique settings for. * @return Matched unique settings or <code>null</code> if * <code>lc.getLightSourceSettings() == null</code>. */ private LightSettings getUniqueLightSettings( Set<LightSettings> uniqueSettings, LogicalChannel lc) { LightSettings s1 = lc.getLightSourceSettings(); if (s1 == null) { return null; } for (LightSettings s2 : uniqueSettings) { if (compare(s1.getAttenuation(), s2.getAttenuation()) && s1.getLightSource() == s2.getLightSource() && s1.getMicrobeamManipulation() == s2.getMicrobeamManipulation() && compare(s1.getWavelength(), s2.getWavelength())) { return s2; } } uniqueSettings.add(s1); return s1; }