Top Description Fields Constructors Methods
com.rometools.rome.feed.synd

pack-priv Class SyndCategoryListFacade

extends AbstractList<SyndCategory>
Class Inheritance
Imports
java.util.AbstractList, .ArrayList, .List, com.rometools.rome.feed.module.DCSubject

List implementation for SyndCategoryImpl elements. To be directly used by the SyndFeedImpl and SyndEntryImpl classes only.

It acts as a facade on top of the DCSubjectImpl elements of the underlying list and remains in synch with it. It is possible to work on either list, the categories one or the subjects one and they remain in synch.

This is necessary because the SyndFeedImpl categories are just a convenience to access the DublinCore subjects.

All this mess to avoid making DCSubjectImpl implement SyndCategory (which it would be odd).

Field Summary

Modifier and TypeField and Description
private final List<DCSubject>
Inherited from java.util.AbstractList:
modCount

Constructor Summary

AccessConstructor and Description
public
SyndCategoryListFacade()

Default constructor.

public
SyndCategoryListFacade(final List<DCSubject>
the list of subjects to create the facade.
subjects
)

Creates a facade list of categories on top the given subject list.

Method Summary

Modifier and TypeMethod and Description
public void
add(final int
position to add the category.
index
,
final SyndCategory
the SyndCategoryImpl object to add.
obj
)

Overrides java.util.AbstractList.add.

Implements java.util.List.add.

Adds a category to the list.
public static List<DCSubject>

Returns:

a list with DCSubject elements corresponding to the categories in the given list.
convertElementsSyndCategoryToSubject
(final List<SyndCategory>
the list with SyndCategoryImpl elements to convert to subject list.
cList
)

Returns a list with the DCSubject elements of the SyndCategoryImpl list facade.

public SyndCategory

Returns:

the SyndCategoryImpl in position index, null if none.
get
(final int
the index position to retrieve the category.
index
)

Implements abstract java.util.AbstractList.get.

Implements java.util.List.get.

Gets the category by index.
public SyndCategory

Returns:

the SyndCategoryImpl being removed from position index, null if none.
remove
(final int
position to remove the category from.
index
)

Overrides java.util.AbstractList.remove.

Implements java.util.List.remove.

Removes a category element from a specific position.
public SyndCategory

Returns:

the SyndCategoryImpl object that is being replaced, null if none.
set
(final int
position to set the category.
index
,
final SyndCategory
the SyndCategoryImpl object to set.
obj
)

Overrides java.util.AbstractList.set.

Implements java.util.List.set.

Sets a category in an existing position in the list.
public int

Returns:

the size of the list.
size
()

Implements abstract java.util.AbstractCollection.size.

Implements java.util.List.size, java.util.Collection.size.

Returns the size of the list.
Inherited from java.util.AbstractList:
addaddAllclearequalshashCodeindexOfiteratorlastIndexOflistIteratorlistIteratorremoveRangesubList

Field Detail

subjectsback to summary
private final List<DCSubject> subjects

Constructor Detail

SyndCategoryListFacadeback to summary
public SyndCategoryListFacade()

Default constructor. Creates and empty list.

SyndCategoryListFacadeback to summary
public SyndCategoryListFacade(final List<DCSubject> subjects)

Creates a facade list of categories on top the given subject list.

Parameters
subjects:List<DCSubject>

the list of subjects to create the facade.

Method Detail

addback to summary
public void add(final int index, final SyndCategory obj)

Overrides java.util.AbstractList.add.

Implements java.util.List.add.

Adds a category to the list.

Parameters
index:int

position to add the category.

obj:SyndCategory

the SyndCategoryImpl object to add.

Annotations
@Override
convertElementsSyndCategoryToSubjectback to summary
public static List<DCSubject> convertElementsSyndCategoryToSubject(final List<SyndCategory> cList)

Returns a list with the DCSubject elements of the SyndCategoryImpl list facade. To be used by the SyndFeedImpl class only.

Parameters
cList:List<SyndCategory>

the list with SyndCategoryImpl elements to convert to subject list.

Returns:List<DCSubject>

a list with DCSubject elements corresponding to the categories in the given list.

getback to summary
public SyndCategory get(final int index)

Implements abstract java.util.AbstractList.get.

Implements java.util.List.get.

Gets the category by index.

Parameters
index:int

the index position to retrieve the category.

Returns:SyndCategory

the SyndCategoryImpl in position index, null if none.

Annotations
@Override
removeback to summary
public SyndCategory remove(final int index)

Overrides java.util.AbstractList.remove.

Implements java.util.List.remove.

Removes a category element from a specific position.

Parameters
index:int

position to remove the category from.

Returns:SyndCategory

the SyndCategoryImpl being removed from position index, null if none.

Annotations
@Override
setback to summary
public SyndCategory set(final int index, final SyndCategory obj)

Overrides java.util.AbstractList.set.

Implements java.util.List.set.

Sets a category in an existing position in the list.

Parameters
index:int

position to set the category.

obj:SyndCategory

the SyndCategoryImpl object to set.

Returns:SyndCategory

the SyndCategoryImpl object that is being replaced, null if none.

Annotations
@Override
sizeback to summary
public int size()

Implements abstract java.util.AbstractCollection.size.

Implements java.util.List.size, java.util.Collection.size.

Returns the size of the list.

Returns:int

the size of the list.

Annotations
@Override