| java.lang.Object javax.media.jai.DescriptorCache
DescriptorCache | class DescriptorCache (Code) | | A class to manage the descriptors belong to a certain
RegistryMode
The RegistryElementDescriptor names are used in a
case-insensitive manner.
|
Field Summary | |
final boolean | arePreferencesSupported Does the registry mode for this cache support preferences. | final boolean | arePropertiesSupported Does the registry mode for this cache support properties. | final RegistryMode | mode Cache the RegistryMode since it is bound to get used
many, many times. | final String | modeName The name of the mode for which the cache of descriptors is
being maintained. |
Method Summary | |
boolean | addDescriptor(RegistryElementDescriptor rdesc) Adds a RegistryElementDescriptor to the cache.
An RegistryElementDescriptor cannot be added against a
descriptor name under which another RegistryElementDescriptor
was added previously.
Parameters: rdesc - an RegistryElementDescriptor containinginformation about the descriptor. | OperationGraph | addProduct(String descriptorName, String productName) Registers a product name against a descriptor. | void | addPropertyGenerator(String descriptorName, PropertyGenerator generator) Adds a PropertyGenerator to the a particular
descriptor. | boolean | clearProductPreferences(String descriptorName) Removes all preferences between products registered under
a common RegistryElementDescriptor . | void | clearPropertyState() Removes all property associated information from this
DescriptorCache . | void | copyPropertyFromSource(String descriptorName, String propertyName, int sourceIndex) Forces a property to be copied from the specified source index
by nodes associated with a particular descriptor. | RegistryElementDescriptor | getDescriptor(String descriptorName) Returns the RegistryElementDescriptor that is
currently registered under the given name, or null if none
exists.
Parameters: descriptorName - the String to be queried. | String[] | getDescriptorNames() Returns a list of names under which all the
RegistryElementDescriptor s in the registry are registered. | List | getDescriptors() Returns a List of all currently registered
RegistryElementDescriptor s. | String[] | getGeneratedPropertyNames(String descriptorName) Returns a list of the properties generated by nodes implementing
the functionality associated with a particular descriptor.
Returns null if no properties are generated.
Parameters: descriptorName - the operation name as a String. | Vector | getOrderedProductList(String descriptorName) Returns a list of the products registered under a particular
RegistryElementDescriptor , in an ordering that
satisfies all of the pairwise preferences that have been
set. | String[][] | getProductPreferences(String descriptorName) Returns a list of the pairwise product preferences
under a particular RegistryElementDescriptor . | PropertySource | getPropertySource(String descriptorName, Object op, Vector sources) Merge mode-specific property environment with mode-independent
property environment of the descriptor. | OperationGraph | lookupProduct(String descriptorName, String productName) Looks up a product name against a descriptor.
Parameters: descriptorName - the descriptor name as a String Parameters: productName - the product name as a String. | boolean | removeDescriptor(String descriptorName) Removes a RegistryElementDescriptor from the cache.
Parameters: descriptorName - the descriptor name as a String. | boolean | removeDescriptor(RegistryElementDescriptor rdesc) Removes a RegistryElementDescriptor from the cache.
Parameters: rdesc - an RegistryElementDescriptor to be removed. | boolean | removeProduct(String descriptorName, String productName) Unregisters a product name against a descriptor. | void | removePropertyGenerator(String descriptorName, PropertyGenerator generator) Removes a PropertyGenerator from its association
with a particular descriptor. | boolean | setProductPreference(String descriptorName, String preferredProductName, String otherProductName) Sets a preference between two products registered under
a common RegistryElementDescriptor .
if the descriptor was not registered previously and no preference
will be set. | void | suppressAllProperties(String descriptorName) Forces all properties to be suppressed by nodes associated with a
particular descriptor. | void | suppressProperty(String descriptorName, String propertyName) Forces a particular property to be suppressed by nodes associated
with a particular descriptor. | boolean | unsetProductPreference(String descriptorName, String preferredProductName, String otherProductName) Removes a preference between two products registered under
a common RegistryElementDescriptor . |
arePreferencesSupported | final boolean arePreferencesSupported(Code) | | Does the registry mode for this cache support preferences.
|
arePropertiesSupported | final boolean arePropertiesSupported(Code) | | Does the registry mode for this cache support properties.
|
mode | final RegistryMode mode(Code) | | Cache the RegistryMode since it is bound to get used
many, many times.
|
modeName | final String modeName(Code) | | The name of the mode for which the cache of descriptors is
being maintained.
|
DescriptorCache | DescriptorCache(String modeName)(Code) | | The Constructor. Create a RegistryElementDescriptor
cache for maintaining descriptors for the specified mode.
Parameters: modeName - the registry mode name. |
addDescriptor | boolean addDescriptor(RegistryElementDescriptor rdesc)(Code) | | Adds a RegistryElementDescriptor to the cache.
An RegistryElementDescriptor cannot be added against a
descriptor name under which another RegistryElementDescriptor
was added previously.
Parameters: rdesc - an RegistryElementDescriptor containinginformation about the descriptor. false, if one already existed. true otherwise. throws: IllegalArgumentException - is rdesc in null throws: IllegalArgumentException - if the descriptor hasalready been registered in this cache. |
addProduct | OperationGraph addProduct(String descriptorName, String productName)(Code) | | Registers a product name against a descriptor. The descriptor
must already exist in the cache. If the product already existed
under the descriptor, the old one is returned without adding
another.
Parameters: descriptorName - the descriptor name as a String Parameters: productName - the product name as a String. null, if the descriptor or the product did not exist or the product throws: IllegalArgumentException - if descriptorName is null |
addPropertyGenerator | void addPropertyGenerator(String descriptorName, PropertyGenerator generator)(Code) | | Adds a PropertyGenerator to the a particular
descriptor.
Parameters: descriptorName - the operation name as a String. Parameters: generator - the PropertyGenerator to be added. |
clearProductPreferences | boolean clearProductPreferences(String descriptorName)(Code) | | Removes all preferences between products registered under
a common RegistryElementDescriptor . An error message will
be printed out if the operation was not registered previously.
Parameters: descriptorName - the operation name as a String. throws: IllegalArgumentException - if this registry mode doesnot support preferences. throws: IllegalArgumentException - if descriptorName is null. |
clearPropertyState | void clearPropertyState()(Code) | | Removes all property associated information from this
DescriptorCache .
|
copyPropertyFromSource | void copyPropertyFromSource(String descriptorName, String propertyName, int sourceIndex)(Code) | | Forces a property to be copied from the specified source index
by nodes associated with a particular descriptor. By default, a
property is copied from the first source node that emits it. The
result of specifying an invalid source is undefined.
Parameters: descriptorName - the operation name as a String. Parameters: propertyName - the name of the property to be copied. Parameters: sourceIndex - the index of the source to copy the property from. throws: IllegalArgumentException - if descriptorName is null. throws: IllegalArgumentException - if propertyName is null. |
getDescriptor | RegistryElementDescriptor getDescriptor(String descriptorName)(Code) | | Returns the RegistryElementDescriptor that is
currently registered under the given name, or null if none
exists.
Parameters: descriptorName - the String to be queried. an RegistryElementDescriptor . throws: IllegalArgumentException - if descriptorName is null |
getDescriptorNames | String[] getDescriptorNames()(Code) | | Returns a list of names under which all the
RegistryElementDescriptor s in the registry are registered.
a list of currently existing descriptor names. |
getDescriptors | List getDescriptors()(Code) | | Returns a List of all currently registered
RegistryElementDescriptor s.
a List of RegistryElementDescriptor s. |
getGeneratedPropertyNames | String[] getGeneratedPropertyNames(String descriptorName)(Code) | | Returns a list of the properties generated by nodes implementing
the functionality associated with a particular descriptor.
Returns null if no properties are generated.
Parameters: descriptorName - the operation name as a String. an array of Strings. throws: IllegalArgumentException - if descriptorName is null. |
getOrderedProductList | Vector getOrderedProductList(String descriptorName)(Code) | | Returns a list of the products registered under a particular
RegistryElementDescriptor , in an ordering that
satisfies all of the pairwise preferences that have been
set. Returns null if cycles exist. Returns
null if no RegistryElementDescriptor
has been registered under this descriptorName, or if no products
exist for this operation.
Parameters: descriptorName - the operation name as a String. a Vector of Strings representing product names. returnsnull if this registry mode does not support preferences. throws: IllegalArgumentException - if descriptorName is null. |
getProductPreferences | String[][] getProductPreferences(String descriptorName)(Code) | | Returns a list of the pairwise product preferences
under a particular RegistryElementDescriptor . If no product
preferences have been set, returns null.
Parameters: descriptorName - the operation name as a String. an array of 2-element arrays of Strings. throws: IllegalArgumentException - if this registry mode doesnot support preferences. throws: IllegalArgumentException - if descriptorName is null |
getPropertySource | PropertySource getPropertySource(String descriptorName, Object op, Vector sources)(Code) | | Merge mode-specific property environment with mode-independent
property environment of the descriptor. Array elements of
"sources" are expected to be in the same ordering as referenced
by the "sourceIndex" parameter of copyPropertyFromSource().
Parameters: descriptorName - the descriptor name as a String Parameters: sources - the PropertySource s corresponding tothe sources of the object representing the named descriptorin the indicated mode. Parameters: op - the Object from which properties willbe generated. A PropertySource which encapsulatesthe global property environment for the object representingthe named descriptor in the indicated mode. throws: IllegalArgumentException - if any of the argumentsis null throws: IllegalArgumentException - if there is no RegistryElementDescriptor registered againstthe descriptorName throws: IllegalArgumentException - if the specified mode does notsupport properties. since: JAI 1.1 |
lookupProduct | OperationGraph lookupProduct(String descriptorName, String productName)(Code) | | Looks up a product name against a descriptor.
Parameters: descriptorName - the descriptor name as a String Parameters: productName - the product name as a String. null, if the descriptor did not exist or the productwas not already registered. Otherwise returns thePartialOrderNode corresponding to this product throws: IllegalArgumentException - if descriptorName is null |
removeDescriptor | boolean removeDescriptor(String descriptorName)(Code) | | Removes a RegistryElementDescriptor from the cache.
Parameters: descriptorName - the descriptor name as a String. false, if one wasnt previously registered, true otherwise. throws: IllegalArgumentException - if descriptorName is null orwas not previously registered. throws: IllegalArgumentException - if any of the PropertyGenerator s associated with the RegistryElementDescriptor to be removed is null. |
removeDescriptor | boolean removeDescriptor(RegistryElementDescriptor rdesc)(Code) | | Removes a RegistryElementDescriptor from the cache.
Parameters: rdesc - an RegistryElementDescriptor to be removed. false, if one wasnt previously registered, true otherwise. throws: IllegalArgumentException - if rdesc is null. throws: IllegalArgumentException - if rdesc was notpreviously registered. throws: IllegalArgumentException - if any of the PropertyGenerator s associated with the RegistryElementDescriptor to be removed is null. |
removeProduct | boolean removeProduct(String descriptorName, String productName)(Code) | | Unregisters a product name against a descriptor. The
descriptor must already exist in the cache and the procduct
must have been registered against the descriptor
Parameters: descriptorName - the descriptor name as a String Parameters: productName - the product name as a String. false, if the descriptor did not exist or the productwas not already registered. throws: IllegalArgumentException - if descriptorName is null |
removePropertyGenerator | void removePropertyGenerator(String descriptorName, PropertyGenerator generator)(Code) | | Removes a PropertyGenerator from its association
with a particular descriptor. If the generator was not associated
with the descriptor, nothing happens.
Parameters: descriptorName - the operation name as a String. Parameters: generator - the PropertyGenerator to be removed. throws: IllegalArgumentException - if descriptorName is null. throws: IllegalArgumentException - if generator is null. |
setProductPreference | boolean setProductPreference(String descriptorName, String preferredProductName, String otherProductName)(Code) | | Sets a preference between two products registered under
a common RegistryElementDescriptor .
if the descriptor was not registered previously and no preference
will be set. Any attempt to set a preference between a product
and itself will be ignored.
Parameters: descriptorName - the operation name as a String. Parameters: preferredProductName - the product to be preferred. Parameters: otherProductName - the other product. false, if the descriptor was not registered previouslyor if either if the products were not alreadyadded against the descriptor. throws: IllegalArgumentException - if this registry mode doesnot support preferences. throws: IllegalArgumentException - if any of the args is null throws: IllegalArgumentException - if descriptorName or either ofthe products were not previously registered. |
suppressAllProperties | void suppressAllProperties(String descriptorName)(Code) | | Forces all properties to be suppressed by nodes associated with a
particular descriptor. By default, properties are passed through
unchanged.
Parameters: descriptorName - the operation name as a String. throws: IllegalArgumentException - if descriptorName is null. |
suppressProperty | void suppressProperty(String descriptorName, String propertyName)(Code) | | Forces a particular property to be suppressed by nodes associated
with a particular descriptor. By default, properties are passed
through unchanged.
Parameters: descriptorName - the operation name as a String. Parameters: propertyName - the name of the property to be suppressed. throws: IllegalArgumentException - if descriptorName is null. throws: IllegalArgumentException - if propertyName is null. |
unsetProductPreference | boolean unsetProductPreference(String descriptorName, String preferredProductName, String otherProductName)(Code) | | Removes a preference between two products registered under
a common RegistryElementDescriptor . An error message will
be printed out if the operation was not registered previously.
Parameters: descriptorName - the operation name as a String. Parameters: preferredProductName - the product formerly preferred. Parameters: otherProductName - the other product. false, if the descriptor was not registered previouslyor if either if the products were not alreadyadded against the descriptor. throws: IllegalArgumentException - if this registry mode doesnot support preferences. throws: IllegalArgumentException - if any of the args is null throws: IllegalArgumentException - if descriptorName or either ofthe products were not previously registered. |
|
|