javax.media.jai.tilecodec
Class TileCodecDescriptorImpl

java.lang.Object
  |
  +--javax.media.jai.tilecodec.TileCodecDescriptorImpl
All Implemented Interfaces:
RegistryElementDescriptor, TileCodecDescriptor
Direct Known Subclasses:
GZIPTileCodecDescriptor, JPEGTileCodecDescriptor, RawTileCodecDescriptor

public abstract class TileCodecDescriptorImpl
extends Object
implements TileCodecDescriptor

An abstract class that implements the TileCodecDescriptor interface and is suitable for subclassing. This class provides default implementations for some of the methods from TileCodecDescriptor. Subclasses should override these methods if they do not wish to retain the default implementation. All Strings are treated in a case-retentive and case-insensitive manner.

Since:
JAI 1.1

Constructor Summary
TileCodecDescriptorImpl(String formatName, boolean includesSampleModelInfo, boolean includesLocationInfo)
          Creates a TileCodecDescriptorImpl with the given format name and booleans to specify whether layout information is included in the encoded stream.
 
Method Summary
 boolean arePropertiesSupported()
          Whether this descriptor supports properties.
 String getName()
          Returns the name of the format.
 PropertyGenerator[] getPropertyGenerators(String modeName)
          Returns an array of PropertyGenerators implementing the property inheritance for this operation.
 String[] getSupportedModes()
          Returns the registry modes supported by this descriptor.
 boolean includesLocationInfo()
          Returns true if the format encodes in the data stream the location of the Raster with respect to its enclosing image.
 boolean includesSampleModelInfo()
          Returns true if the format encodes layout information generally specified via the SampleModel in the encoded data stream.
 boolean isModeSupported(String registryModeName)
          This method is implemented to return true if the specified registryModeName is either "tileDecoder" or "tileEncoder".
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.media.jai.tilecodec.TileCodecDescriptor
getCompatibleParameters, getDefaultParameters, getDefaultParameters
 
Methods inherited from interface javax.media.jai.RegistryElementDescriptor
getParameterListDescriptor
 

Constructor Detail

TileCodecDescriptorImpl

public TileCodecDescriptorImpl(String formatName,
                               boolean includesSampleModelInfo,
                               boolean includesLocationInfo)
Creates a TileCodecDescriptorImpl with the given format name and booleans to specify whether layout information is included in the encoded stream.
Parameters:
formatName - The name of the format. This is also the name under which this descriptor will be registered under in the OperationRegistry.
includesSampleModelInfo - Whether the format encodes the tile's SampleModel or equivalent information into the encoded stream.
includesLocationInfo - Whether the format encodes the tile's upper left corner position or equivalent information into the encoded stream.
Throws:
IllegalArgumentException - if formatName is null.
Method Detail

getName

public String getName()
Returns the name of the format.
Specified by:
getName in interface RegistryElementDescriptor

getSupportedModes

public String[] getSupportedModes()
Returns the registry modes supported by this descriptor. The default implementation of this method in this class returns a String array containing the "tileDecoder" and "tileEncoder" strings. If the subclass does not support any of these modes, it should override this method to return the names of those modes that it supports.
Specified by:
getSupportedModes in interface RegistryElementDescriptor
See Also:
RegistryMode

isModeSupported

public boolean isModeSupported(String registryModeName)
This method is implemented to return true if the specified registryModeName is either "tileDecoder" or "tileEncoder". If the subclass doesn't support any one of these modes, it should override this method to return true only for the supported mode(s).
Specified by:
isModeSupported in interface RegistryElementDescriptor
Parameters:
registryModeName - The name of the registry mode to check support for.
Throws:
IllegalArgumentException - if registryModeName is null.

arePropertiesSupported

public boolean arePropertiesSupported()
Whether this descriptor supports properties.
Specified by:
arePropertiesSupported in interface RegistryElementDescriptor
Returns:
true, if the implementation of this descriptor supports properties. false otherwise. Since tile codecs do not support properties, so this default implementation returns false.
See Also:
PropertyGenerator

getPropertyGenerators

public PropertyGenerator[] getPropertyGenerators(String modeName)
Returns an array of PropertyGenerators implementing the property inheritance for this operation. Since neither TileEncoder or TileDecoder supports properties, the default implementation throws an UnsupportedOperationException. Subclasses should override this method if they wish to produce inherited properties.
Specified by:
getPropertyGenerators in interface RegistryElementDescriptor
Throws:
IllegalArgumentException - if modeName is null.
UnsupportedOperationException - if arePropertiesSupported() returns false

includesSampleModelInfo

public boolean includesSampleModelInfo()
Returns true if the format encodes layout information generally specified via the SampleModel in the encoded data stream.
Specified by:
includesSampleModelInfo in interface TileCodecDescriptor

includesLocationInfo

public boolean includesLocationInfo()
Returns true if the format encodes in the data stream the location of the Raster with respect to its enclosing image.
Specified by:
includesLocationInfo in interface TileCodecDescriptor