|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.rhq.enterprise.communications.command.param.ParametersImpl
public class ParametersImpl
A class holding specific information about a set of parameters. It follows the Java Collection interface contract and thus can be used anywhere a Collection can be used.
This collection follows both list and map connotations. It behaves like a list in that items that come out of it
are in the same order as when they were added to it. It behaves like a map in that duplicate elements are not allowed
and looking up elements have constant time performance that is analogous to java.util.HashMap.
This class is not thread-safe.
| Constructor Summary | |
|---|---|
ParametersImpl()
Constructor for ParametersImpl that initializes the object with no parameters. |
|
ParametersImpl(Parameters original)
Copy-constructor for ParametersImpl. |
|
| Method Summary | ||
|---|---|---|
boolean |
add(Parameter parameter)
|
|
boolean |
addAll(java.util.Collection<? extends Parameter> c)
Adds the elements found in the c collection. |
|
void |
applyResourceBundleToParameterRenderingInformation(java.util.ResourceBundle resourceBundle)
This will apply the given resourceBundle to the parameters in this collection. |
|
void |
clear()
|
|
boolean |
contains(java.lang.Object o)
This is here to satisfy the Collection interface contract. |
|
boolean |
contains(Parameter parameter)
Checks to see if this parameter exists by specifying the parameter - only the name is used when
checking. |
|
boolean |
contains(java.lang.String parameterName)
Checks if this parameter exists by specifying the parameter name. |
|
boolean |
containsAll(java.util.Collection<?> c)
Checks to see if all the elements found in the c collection are in this collection. |
|
boolean |
equals(java.lang.Object obj)
|
|
Parameters |
getInternalParameters()
The returned object is not a copy - changes made to that collection affect this object's internal collection. |
|
Parameter |
getParameter(java.lang.String parameterName)
Given the name of a parameter, this will return its associated Parameter. |
|
ParameterDefinition |
getParameterDefinition(java.lang.String parameterName)
Given the name of a parameter, this will return the parameter's definition. |
|
java.lang.Object |
getParameterValue(java.lang.String parameterName)
Given the name of a parameter, this will return the parameter's value. |
|
Parameters |
getPublicParameters()
The returned object is not a copy - changes made to that collection affect this object's internal collection. |
|
int |
hashCode()
|
|
boolean |
isEmpty()
|
|
java.util.Iterator<Parameter> |
iterator()
The iterator will contain objects of type Parameter. |
|
boolean |
remove(java.lang.Object o)
This is here to satisfy the Collection interface contract. |
|
boolean |
remove(Parameter parameter)
Removes the parameter whose name is the same as the name in the given parameter. |
|
boolean |
remove(java.lang.String parameterName)
Removes the parameter stored in this collection whose name matches parameterName. |
|
boolean |
removeAll(java.util.Collection<?> c)
Removes the elements found in the c collection. |
|
boolean |
retainAll(java.util.Collection<?> c)
Retains only those elements found in the c collection. |
|
void |
setParameterValue(java.lang.String parameterName,
java.lang.Object parameterValue)
Given the name of a parameter, this will set the parameter's value. |
|
int |
size()
The returned object is not a copy - changes made to that collection affect this object's internal collection. |
|
java.lang.Object[] |
toArray()
The returned array may be cast to a Parameter array. |
|
|
toArray(T[] a)
Returns an array of Parameter objects. |
|
java.lang.String |
toString()
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ParametersImpl()
ParametersImpl that initializes the object with no parameters.
public ParametersImpl(Parameters original)
ParametersImpl.
original - the original to copy| Method Detail |
|---|
public Parameter getParameter(java.lang.String parameterName)
ParametersParameter. If it doesn't exist in this
collection, null is returned.
getParameter in interface ParametersparameterName - the name of the parameter to get
Parameters.getParameter(String)
public ParameterDefinition getParameterDefinition(java.lang.String parameterName)
throws InvalidParameterDefinitionException
Parametersnull; in this case, null is returned. If the parameter
does not exist in this collection, an exception is thrown.
getParameterDefinition in interface ParametersparameterName - the name of the parameter whose definition is to be returned
InvalidParameterDefinitionException - if the parameter does not exist in this collectionParameters.getParameterDefinition(String)
public java.lang.Object getParameterValue(java.lang.String parameterName)
throws InvalidParameterDefinitionException
Parametersnull, a return value of null means the parameter exists but its value was
null. If the parameter does not exist in this collection, an exception is thrown.
getParameterValue in interface ParametersparameterName - the name of the parameter whose value is to be returned
InvalidParameterDefinitionException - if the parameter does not exist in this collectionParameters.getParameterValue(String)
public void setParameterValue(java.lang.String parameterName,
java.lang.Object parameterValue)
throws InvalidParameterDefinitionException
Parameters
setParameterValue in interface ParametersparameterName - the name of the parameter whose value is to be setparameterValue - the value of the parameter (may be null)
InvalidParameterDefinitionException - if the parameter does not exist in this collectionParameters.setParameterValue(String, Object)public Parameters getPublicParameters()
getPublicParameters in interface ParametersParameters.getPublicParameters()public Parameters getInternalParameters()
getInternalParameters in interface ParametersParameters.getInternalParameters()public void applyResourceBundleToParameterRenderingInformation(java.util.ResourceBundle resourceBundle)
ParametersresourceBundle to the parameters in this collection. This allows you to
localize the parameters.
applyResourceBundleToParameterRenderingInformation in interface ParametersresourceBundle - the resource bundle that is to be used when rendering the parametersParameters.applyResourceBundleToParameterRenderingInformation(ResourceBundle)public int size()
size in interface java.util.Collection<Parameter>Collection.size()public void clear()
clear in interface java.util.Collection<Parameter>Collection.clear()public boolean isEmpty()
isEmpty in interface java.util.Collection<Parameter>Collection.isEmpty()
public boolean add(Parameter parameter)
throws java.lang.NullPointerException
add in interface java.util.Collection<Parameter>java.lang.NullPointerExceptionParameters#add(Parameter)
public boolean contains(java.lang.Object o)
throws java.lang.ClassCastException,
java.lang.NullPointerException
Collection interface contract. Same as if calling contains(String)
where the argument is the parameter name or contains(Parameter).
contains in interface java.util.Collection<Parameter>java.lang.ClassCastException
java.lang.NullPointerExceptionCollection.contains(Object)
public boolean contains(java.lang.String parameterName)
throws java.lang.NullPointerException
Parametersparameter name.
contains in interface ParametersparameterName - the parameter name
true if there is a parameter in this object identified by the parameterName
java.lang.NullPointerException - if parameterName is null, as per Collection interface
contractParameters.contains(String)
public boolean contains(Parameter parameter)
throws java.lang.NullPointerException
Parametersparameter - only the name is used when
checking. This means as long as the given parameter's name matches one in the collection, this returns
true, it doesn't matter if the parameter's value or definition completely match.
contains in interface Parametersparameter - the parameter to check
true if there is a parameter in this object identified by the parameterName
java.lang.NullPointerException - if parameter is null, as per Collection interface contractParameters.contains(Parameter)
public boolean remove(java.lang.Object o)
throws java.lang.ClassCastException,
java.lang.NullPointerException
Collection interface contract. Same as if calling remove(String)
where the argument is the parameter name or remove(Parameter).
remove in interface java.util.Collection<Parameter>java.lang.ClassCastException
java.lang.NullPointerExceptionCollection.remove(Object)
public boolean remove(java.lang.String parameterName)
throws java.lang.NullPointerException
parameterName.
remove in interface ParametersparameterName - the name of the parameter to remove from this collection
true if the object was removed; false if there was no object in this collection
with the given parameter name
java.lang.NullPointerException - if parameterName is null, as per Collection interface
contract
public boolean remove(Parameter parameter)
throws java.lang.NullPointerException
parameter. The full definition
and value of the given parameter is ignored when determining a match - only the parameter name is
used in the comparision.
remove in interface Parametersparameter - the parameter whose name is used to determine what to remove
true if the object was removed
java.lang.NullPointerException - if parameter is null, as per Collection interface contract
public boolean addAll(java.util.Collection<? extends Parameter> c)
throws java.lang.ClassCastException,
java.lang.NullPointerException
c collection. If one or more elements in c is not a
Parameter, an exception will be thrown.
addAll in interface java.util.Collection<Parameter>java.lang.ClassCastException
java.lang.NullPointerExceptionCollection.addAll(java.util.Collection)
public boolean containsAll(java.util.Collection<?> c)
throws java.lang.ClassCastException,
java.lang.NullPointerException
c collection are in this collection. If one or more
elements in c is not a Parameter or String, an exception will be thrown.
containsAll in interface java.util.Collection<Parameter>java.lang.ClassCastException
java.lang.NullPointerExceptionCollection.containsAll(Collection)
public boolean removeAll(java.util.Collection<?> c)
throws java.lang.ClassCastException,
java.lang.NullPointerException
c collection. If one or more elements in c is not a
Parameter, an exception will be thrown.
removeAll in interface java.util.Collection<Parameter>java.lang.ClassCastException
java.lang.NullPointerExceptionCollection.removeAll(Collection)
public boolean retainAll(java.util.Collection<?> c)
throws java.lang.ClassCastException,
java.lang.NullPointerException
c collection. If one or more elements in c is
not a Parameter, an exception will be thrown. The implementation will remove all elements in this
collection and then add all the elements in c. Because of this, true is always returned
- even if the elements end up being the same in the end.
retainAll in interface java.util.Collection<Parameter>java.lang.ClassCastException
java.lang.NullPointerExceptionCollection.retainAll(Collection)public java.util.Iterator<Parameter> iterator()
Parameter.
iterator in interface java.lang.Iterable<Parameter>iterator in interface java.util.Collection<Parameter>Collection.iterator()public java.lang.Object[] toArray()
Parameter array.
toArray in interface java.util.Collection<Parameter>Collection.toArray()public <T> T[] toArray(T[] a)
Parameter objects.
toArray in interface java.util.Collection<Parameter>java.util.Collection#toArray(T[])public java.lang.String toString()
toString in class java.lang.ObjectObject.toString()public boolean equals(java.lang.Object obj)
equals in interface java.util.Collection<Parameter>equals in class java.lang.ObjectObject.equals(Object)public int hashCode()
hashCode in interface java.util.Collection<Parameter>hashCode in class java.lang.ObjectObject.hashCode()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||