*
* @return <code>true</code> if the metadata may be ignored.
*
* @see #setInput
*/
public boolean isIgnoringMetadata() {
return ignoreMetadata;
}
/**
* Returns the lowest valid index for reading an image, thumbnail,
* or image metadata. If <code>seekForwardOnly()</code> is
* <code>false</code>, this value will typically remain 0,
* indicating that random access is possible. Otherwise, it will
* contain the value of the most recently accessed index, and
* increase in a monotonic fashion.
*
* @return the minimum legal index for reading.
*/
public int getMinIndex() {
return minIndex;
}
// Localization
/**
* Returns an array of <code>Locale</code>s that may be used to
* localize warning listeners and compression settings. A return
* value of <code>null</code> indicates that localization is not
* supported.
*
* <p> The default implementation returns a clone of the
* <code>availableLocales</code> instance variable if it is
* non-<code>null</code>, or else returns <code>null</code>.
*
* @return an array of <code>Locale</code>s that may be used as
* arguments to <code>setLocale</code>, or <code>null</code>.
*/
public Locale[] getAvailableLocales() {
if (availableLocales == null) {
return null;
} else {
return (Locale[])availableLocales.clone();
}
}
/**
* Sets the current <code>Locale</code> of this
* <code>ImageReader</code> to the given value. A value of
* <code>null</code> removes any previous setting, and indicates
* that the reader should localize as it sees fit.
*
* @param locale the desired <code>Locale</code>, or
* <code>null</code>.
*
* @exception IllegalArgumentException if <code>locale</code> is
* non-<code>null</code> but is not one of the values returned by
* <code>getAvailableLocales</code>.
*
* @see #getLocale
*/
public void setLocale(Locale locale) {
if (locale != null) {
Locale[] locales = getAvailableLocales();
boolean found = false;
if (locales != null) {
for (int i = 0; i < locales.length; i++) {
if (locale.equals(locales[i])) {
found = true;
break;
}
}
}
if (!found) {
throw new IllegalArgumentException("Invalid locale!");
}
}
this.locale = locale;
}
/**
* Returns the currently set <code>Locale</code>, or
* <code>null</code> if none has been set.
*
* @return the current <code>Locale</code>, or <code>null</code>.
*
* @see #setLocale
*/
public Locale getLocale() {
return locale;
}
// Image queries
/**
* Returns the number of images, not including thumbnails, available
* from the current input source.
*
* <p> Note that some image formats (such as animated GIF) do not
* specify how many images are present in the stream. Thus
=5= |