| java.lang.Object javax.media.jai.remote.NegotiableCapabilitySet
NegotiableCapabilitySet | public class NegotiableCapabilitySet implements Serializable(Code) | | This class is an aggregation of NegotiableCapability objects.
This class can be used to represent all the capabilities of a machine.
This class can be classified as either a preference or a non-preference.
For an explanation of the concept of preference, refer to the class
comments on javax.media.jai.remote.NegotiableCapability .
If multiple NegotiableCapability objects with the
same category and capability name are added to this class, the
NegotiableCapability added earliest has the highest
preference.
All names are treated in a case-retentive and case-insensitive manner.
since: JAI 1.1 |
Method Summary | |
public void | add(NegotiableCapability capability) Adds a new NegotiableCapability to this
NegotiableCapabilitySet . | public List | get(String category, String capabilityName) Returns all the NegotiableCapability s with the given
category and capability name added previously, as a List . | public List | get(String category) Returns all the NegotiableCapability s with the given
category as a List . | public List | getCapabilityNames(String category) Returns the capability names of all the
NegotiableCapability objects that have been added
previously, as a List . | public List | getCategories() Returns the category of all the NegotiableCapability
objects that have been added previously, as a List .
Returns an empty List , if no
NegotiableCapability objects have been added.
The returned List does not contain any
duplicates. | public NegotiableCapability | getNegotiatedValue(String category) Returns the single NegotiableCapability that is the
negotiated result for the given category from the current class. | public NegotiableCapability | getNegotiatedValue(NegotiableCapabilitySet other, String category) Performs negotiation with the given NegotiableCapabilitySet
for the specified category and returns the single
NegotiableCapability that is the negotiated result for
the given category, if the negotiation succeeds, null
otherwise.
Negotiation is only performed for the specified category. | public boolean | isEmpty() Returns true if no NegotiableCapability objects have been
added. | public boolean | isPreference() Returns true if this NegotiableCapabilitySet is an
aggregation of preference NegotiableCapability 's,
false otherwise. | public NegotiableCapabilitySet | negotiate(NegotiableCapabilitySet other) Returns the common subset supported by this
NegotiableCapabilitySet and the given
NegotiableCapabilitySet , if the negotiation succeeds.
This method returns null if negotiation fails for all categories.
For those categories that are common to both the
NegotiableCapabilitySet objects, negotiation is
performed on a per category basis. | public void | remove(NegotiableCapability capability) Removes the specified NegotiableCapability from this
NegotiableCapabilitySet . |
NegotiableCapabilitySet | public NegotiableCapabilitySet(boolean isPreference)(Code) | | Creates a NegotiableCapabilitySet . The
isPreference argument specifies whether this
NegotiableCapabilitySet should be treated as a preference
or non-preference. If this NegotiableCapabilitySet is
specified to be a non-preference, only non-preference
NegotiableCapability 's will be allowed to be added to it,
otherwise an IllegalArgumentException will be thrown
at the time of addition. Similarly only preference
NegotiableCapability objects can be added to this
NegotiableCapabilitySet if isPreference
is true.
Parameters: isPreference - a boolean that specifies whether the componentNegotiableCapability 's are preferences. |
add | public void add(NegotiableCapability capability)(Code) | | Adds a new NegotiableCapability to this
NegotiableCapabilitySet . If a
NegotiableCapability with the same category and same
capability name as the one currently being added has been added
previously, the previous one will have a higher preference.
Parameters: capability - The NegotiableCapability to be added. throws: IllegalArgumentException - if capability is null. throws: IllegalArgumentException - if isPreference() returns false, and capability is a preferenceNegotiableCapability . throws: IllegalArgumentException - if isPreference() returns true, and capability is a non-preferenceNegotiableCapability . |
get | public List get(String category, String capabilityName)(Code) | | Returns all the NegotiableCapability s with the given
category and capability name added previously, as a List .
If none were added, returns an empty List .
Parameters: category - The category of the NegotiableCapability . Parameters: capabilityName - The name of the NegotiableCapability . throws: IllegalArgumentException - if category is null. throws: IllegalArgumentException - if capabilityName is null. |
get | public List get(String category)(Code) | | Returns all the NegotiableCapability s with the given
category as a List . Returns an empty List
if no such NegotiableCapability s were added.
Parameters: category - The category of the NegotiableCapability sto return. throws: IllegalArgumentException - if category is null. |
getCapabilityNames | public List getCapabilityNames(String category)(Code) | | Returns the capability names of all the
NegotiableCapability objects that have been added
previously, as a List . Returns an empty
List if no such NegotiableCapability
objects have been added.
The returned List does not contain any
duplicates.
Parameters: category - The category of the NegotiableCapability . throws: IllegalArgumentException - if category is null. |
getCategories | public List getCategories()(Code) | | Returns the category of all the NegotiableCapability
objects that have been added previously, as a List .
Returns an empty List , if no
NegotiableCapability objects have been added.
The returned List does not contain any
duplicates.
|
getNegotiatedValue | public NegotiableCapability getNegotiatedValue(String category)(Code) | | Returns the single NegotiableCapability that is the
negotiated result for the given category from the current class.
Returns null if negotiation for this category failed. If the
negotiation is successful, then this method will return the most
prefered (the one that was added first i.e. the one that is first
in the list) NegotiableCapability from the list of
NegotiableCapability that are valid for this category.
Parameters: category - The category to find the negotiated result for. throws: IllegalArgumentException - if category is null. |
getNegotiatedValue | public NegotiableCapability getNegotiatedValue(NegotiableCapabilitySet other, String category)(Code) | | Performs negotiation with the given NegotiableCapabilitySet
for the specified category and returns the single
NegotiableCapability that is the negotiated result for
the given category, if the negotiation succeeds, null
otherwise.
Negotiation is only performed for the specified category. For
the specified category, if there are 'm'
NegotiableCapability objects for which the
NegotiableCapabilitySet being negotiated with contains
'n' NegotiableCapability objects, then the negotiation
for this category may require m x n number of negotiations at a
maximum and one negotiation at a minimum as the negotiation process
stops as soon as a negotiation is successful. The results of this
successful negotiation are then returned. If all the m x n
negotiations fail, null is returned.
If the supplied NegotiableCapabilitySet is null,
then the negotiation will fail and null will be returned.
Parameters: other - The NegotiableCapabilitySet to negotiate with. Parameters: category - The category to negotiate for. throws: IllegalArgumentException - if category is null. |
isEmpty | public boolean isEmpty()(Code) | | Returns true if no NegotiableCapability objects have been
added.
|
isPreference | public boolean isPreference()(Code) | | Returns true if this NegotiableCapabilitySet is an
aggregation of preference NegotiableCapability 's,
false otherwise.
|
negotiate | public NegotiableCapabilitySet negotiate(NegotiableCapabilitySet other)(Code) | | Returns the common subset supported by this
NegotiableCapabilitySet and the given
NegotiableCapabilitySet , if the negotiation succeeds.
This method returns null if negotiation fails for all categories.
For those categories that are common to both the
NegotiableCapabilitySet objects, negotiation is
performed on a per category basis. Within each category, negotiation
is performed on a per capabilityName basis. The categories which exist
only in one or the other NegotiableCapabilitySet are
not negotiated upon and do not show up in the resultant
NegotiableCapabilitySet , if the negotiation is successful.
If this class contains 'm' NegotiableCapability objects
for the same category and capabilityName for which the
NegotiableCapabilitySet being negotiated with contains
'n' NegotiableCapability objects, then the negotiation
for this category and capabilityName will require m x n number of
negotiations between two NegotiableCapability objects.
The ones that succeed will produce new NegotiableCapability
objects which will be added to the returned
NegotiableCapabilitySet .
If the supplied NegotiableCapabilitySet is null,
then the negotiation will fail, and null will be returned.
Parameters: other - The NegotiableCapabilitySet to negotiate with. |
remove | public void remove(NegotiableCapability capability)(Code) | | Removes the specified NegotiableCapability from this
NegotiableCapabilitySet . If the specified
NegotiableCapability was not added previously, an
IllegalArgumentException will be thrown.
Parameters: capability - The NegotiableCapability to be removed. throws: IllegalArgumentException - if capability is null. throws: IllegalArgumentException - if the specifiedNegotiableCapabilitySet was not added previously. |
|
|