Top Description Fields Constructors Methods
net.fortuna.ical4j.model

public Class IndexedComponentList<T extends Component>

extends Object
Class Inheritance
Imports
java.util.*

$Id$ Created on 4/02/2006 Provides indexing of components on a specific property.
Author
Ben Fortuna

Field Summary

Modifier and TypeField and Description
private final Map<String, List<T>>

Constructor Summary

AccessConstructor and Description
public
IndexedComponentList(final List<T>
a list of components
list
,
final String
the name of the properties to index on
propertyName
)

Creates a new instance indexed on properties with the specified name.

Method Summary

Modifier and TypeMethod and Description
public T

Returns:

a component or null if no component is found containing a property with the specified value
getComponent
(final String
the value of the property identified in the returned component
propertyValue
)

Returns the first component containing a property with the specified value.

public List<T>

Returns:

a component list
getComponents
(final String
the value of the property contained in the returned components
propertyValue
)

Returns a list of components containing a property with the specified value.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

indexback to summary
private final Map<String, List<T>> index

Constructor Detail

IndexedComponentListback to summary
public IndexedComponentList(final List<T> list, final String propertyName)

Creates a new instance indexed on properties with the specified name.

Parameters
list:List<T>

a list of components

propertyName:String

the name of the properties to index on

Method Detail

getComponentback to summary
public T getComponent(final String propertyValue)

Returns the first component containing a property with the specified value.

Parameters
propertyValue:String

the value of the property identified in the returned component

Returns:T

a component or null if no component is found containing a property with the specified value

getComponentsback to summary
public List<T> getComponents(final String propertyValue)

Returns a list of components containing a property with the specified value.

Parameters
propertyValue:String

the value of the property contained in the returned components

Returns:List<T>

a component list