Package net.fortuna.ical4j.model
Class ParameterList
java.lang.Object
net.fortuna.ical4j.model.ParameterList
- All Implemented Interfaces:
Serializable,Comparable<ParameterList>,Iterable<Parameter>
public class ParameterList
extends Object
implements Serializable, Iterable<Parameter>, Comparable<ParameterList>
$Id$ [Apr 5, 2004]
Defines a list of iCalendar parameters. A parameter list may be specified as unmodifiable at instantiation - useful
for constant properties that you don't want modified.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.ParameterList(boolean unmodifiable) Constructor.ParameterList(ParameterList list, boolean unmodifiable) Creates a deep copy of the specified parameter list. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanAdd a parameter to the list.final booleanaddAll(Collection<Parameter> parameters) intbooleanReturns true if this parameter list includes the specified parameter.final booleanfinal <T extends Parameter>
TgetParameter(String aName) Returns the first parameter with the specified name.final ParameterListgetParameters(String name) Returns a list of parameters with the specified name.final inthashCode()final booleanisEmpty()iterator()final booleanRemove a parameter from the list.final voidRemove all parameters with the specified name.final booleanReplace any parameters of the same type with the one specified.final intsize()final StringtoString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
ParameterList
public ParameterList()Default constructor. Creates a modifiable parameter list. -
ParameterList
public ParameterList(boolean unmodifiable) Constructor.- Parameters:
unmodifiable- indicates whether the list should be mutable
-
ParameterList
Creates a deep copy of the specified parameter list. That is, copies of all parameters in the specified list are added to this list.- Parameters:
list- a parameter list to copy parameters fromunmodifiable- indicates whether the list should be mutable- Throws:
URISyntaxException- where a parameter in the list specifies an invalid URI value
-
-
Method Details
-
toString
-
getParameter
Returns the first parameter with the specified name.- Parameters:
aName- name of the parameter- Returns:
- the first matching parameter or null if no matching parameters
-
getParameters
Returns a list of parameters with the specified name.- Parameters:
name- name of parameters to return- Returns:
- a parameter list
-
add
Add a parameter to the list. Note that this method will not remove existing parameters of the same type. To achieve this use { -
addAll
-
replace
Replace any parameters of the same type with the one specified.- Parameters:
parameter- parameter to add to this list in place of all others with the same name- Returns:
- true if successfully added to this list
-
isEmpty
public final boolean isEmpty()- Returns:
- boolean indicates if the list is empty
- See Also:
-
contains
Returns true if this parameter list includes the specified parameter.- Parameters:
parameter- a parameter specification- Returns:
- true if parameter matching specification is found
-
iterator
-
remove
Remove a parameter from the list.- Parameters:
parameter- the parameter to remove- Returns:
- true if the list contained the specified parameter
- See Also:
-
removeAll
Remove all parameters with the specified name.- Parameters:
paramName- the name of parameters to remove
-
size
public final int size()- Returns:
- the number of parameters in the list
- See Also:
-
equals
-
hashCode
public final int hashCode() -
compareTo
- Specified by:
compareToin interfaceComparable<ParameterList>
-