@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(CORRECTIONCOLLAR)) { return getCorrectionCollar(); } else if (field.equals(MEDIUM)) { return getMedium(); } else if (field.equals(REFRACTIVEINDEX)) { return getRefractiveIndex(); } else if (field.equals(OBJECTIVE)) { return getObjective(); } else if (field.equals(DETAILS)) { return getDetails(); } else { if (_dynamicFields != null) { return _dynamicFields.get(field); } return null; } }
/** * Finds the matching unique settings for an image. * @param uniqueSettings Set of existing unique settings. * @param image Image to find unique settings for. * @return Matched unique settings or <code>null</code> if * <code>lc.getObjectiveSettings() == null</code>. */ private ObjectiveSettings getUniqueObjectiveSettings( Set<ObjectiveSettings> uniqueSettings, Image image) { ObjectiveSettings s1 = image.getObjectiveSettings(); if (s1 == null) { return null; } for (ObjectiveSettings s2 : uniqueSettings) { if (compare(s1.getCorrectionCollar(), s2.getCorrectionCollar()) && compare(s1.getMedium(), s2.getMedium()) && s1.getObjective() == s2.getObjective() && compare(s1.getRefractiveIndex(), s2.getRefractiveIndex())) { return s2; } } uniqueSettings.add(s1); return s1; }