net.fortuna.ical4j.model

Class ParameterList

Implemented Interfaces:
Serializable

public class ParameterList
extends java.lang.Object
implements Serializable

$Id: ParameterList.java,v 1.18 2008/12/16 12:34:53 fortuna Exp $ [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.

Constructor Summary

ParameterList()
Default constructor.
ParameterList(ParameterList list, boolean unmodifiable)
Creates a deep copy of the specified parameter list.
ParameterList(boolean unmodifiable)
Constructor.

Method Summary

boolean
add(Parameter parameter)
Add a parameter to the list.
boolean
equals(Object arg0)
Uses ObjectUtils to test equality.
Parameter
getParameter(String aName)
Returns the first parameter with the specified name.
ParameterList
getParameters(String name)
Returns a list of parameters with the specified name.
int
hashCode()
Uses HashCodeBuilder to build hashcode.
boolean
isEmpty()
Iterator
iterator()
boolean
remove(Parameter parameter)
Remove a parameter from the list.
void
removeAll(String paramName)
Remove all parameters with the specified name.
boolean
replace(Parameter parameter)
Replace any parameters of the same type with the one specified.
int
size()
String
toString()

Constructor Details

ParameterList

public ParameterList()
Default constructor. Creates a modifiable parameter list.

ParameterList

public ParameterList(ParameterList list,
                     boolean unmodifiable)
            throws URISyntaxException
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 from

ParameterList

public ParameterList(boolean unmodifiable)
Constructor.

Method Details

add

public final boolean add(Parameter parameter)
Add a parameter to the list. Note that this method will not remove existing parameters of the same type. To achieve this use { }
Parameters:
parameter - the parameter to add
Returns:
true
See Also:
List.add(java.lang.Object)

equals

public final boolean equals(Object arg0)
Uses ObjectUtils to test equality. Two parameter lists are equals if and only if they contain the same set of parameters.
See Also:
java.lang.Object.equals(java.lang.Object)

getParameter

public final Parameter getParameter(String aName)
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

public final ParameterList getParameters(String name)
Returns a list of parameters with the specified name.
Parameters:
name - name of parameters to return
Returns:
a parameter list

hashCode

public final int hashCode()
Uses HashCodeBuilder to build hashcode.

isEmpty

public final boolean isEmpty()
Returns:
boolean indicates if the list is empty
See Also:
List.isEmpty()

iterator

public final Iterator iterator()
Returns:
an iterator
See Also:
List.iterator()

remove

public final boolean remove(Parameter parameter)
Remove a parameter from the list.
Parameters:
parameter - the parameter to remove
Returns:
true if the list contained the specified parameter
See Also:
List.remove(java.lang.Object)

removeAll

public final void removeAll(String paramName)
Remove all parameters with the specified name.
Parameters:
paramName -

replace

public final boolean replace(Parameter parameter)
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

size

public final int size()
Returns:
the number of parameters in the list
See Also:
List.size()

toString

public final String toString()
See Also:
java.util.AbstractCollection.toString()