@Nullable protected String getRationalOrDoubleString(int tagType) { Rational rational = _directory.getRational(tagType); if (rational != null) return rational.toSimpleString(true); Double d = _directory.getDoubleObject(tagType); if (d != null) { DecimalFormat format = new DecimalFormat("0.###"); return format.format(d); } return null; }
/** Returns the specified tag's value as a double, if possible. */ public double getDouble(int tagType) throws MetadataException { Double value = getDoubleObject(tagType); if (value!=null) return value; Object o = getObject(tagType); if (o == null) throw new MetadataException("Tag '" + getTagName(tagType) + "' has not been set -- check using containsTag() first"); throw new MetadataException("Tag '" + tagType + "' cannot be converted to a double. It is of type '" + o.getClass() + "'."); } /** Returns the specified tag's value as a Double. If the tag is not set or cannot be converted, <code>null</code> is returned. */
@Nullable public String getMaxApertureValueDescription() { Double aperture = _directory.getDoubleObject(TAG_MAX_APERTURE); if (aperture == null) return null; double fStop = PhotographicConversions.apertureToFStop(aperture); return getFStopDescription(fStop); }
@Nullable public String getApertureValueDescription() { Double aperture = _directory.getDoubleObject(TAG_APERTURE); if (aperture == null) return null; double fStop = PhotographicConversions.apertureToFStop(aperture); return getFStopDescription(fStop); }
@Nullable protected String getRationalOrDoubleString(int tagType) { Rational rational = _directory.getRational(tagType); if (rational != null) return rational.toSimpleString(true); Double d = _directory.getDoubleObject(tagType); if (d != null) { DecimalFormat format = new DecimalFormat("0.###"); return format.format(d); } return null; }
/** Returns the specified tag's value as a double, if possible. */ public double getDouble(int tagType) throws MetadataException { Double value = getDoubleObject(tagType); if (value!=null) return value; Object o = getObject(tagType); if (o == null) throw new MetadataException("Tag '" + getTagName(tagType) + "' has not been set -- check using containsTag() first"); throw new MetadataException("Tag '" + tagType + "' cannot be converted to a double. It is of type '" + o.getClass() + "'."); } /** Returns the specified tag's value as a Double. If the tag is not set or cannot be converted, <code>null</code> is returned. */
@Nullable public String getMaxApertureValueDescription() { Double aperture = _directory.getDoubleObject(TAG_MAX_APERTURE); if (aperture == null) return null; double fStop = PhotographicConversions.apertureToFStop(aperture); return getFStopDescription(fStop); }
@Nullable public String getApertureValueDescription() { Double aperture = _directory.getDoubleObject(TAG_APERTURE); if (aperture == null) return null; double fStop = PhotographicConversions.apertureToFStop(aperture); return getFStopDescription(fStop); }