|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object yarfraw.io.FeedAppender
public class FeedAppender
Provides a set of function to facilitate modifications to an RSS 2.0 feed.
*Note* This class is not thread safe.
Constructor Summary | |
---|---|
FeedAppender(File file)
|
|
FeedAppender(File file,
FeedFormat format)
|
|
FeedAppender(String pathName)
|
|
FeedAppender(String pathName,
FeedFormat format)
|
|
FeedAppender(URI uri)
|
|
FeedAppender(URI uri,
FeedFormat format)
|
Method Summary | |
---|---|
FeedAppender |
appendAllItemsAt(int index,
List<ItemEntry> items)
Appends all of the ItemEntry in the specified collection into the current feed
at the specified position (optional operation). |
FeedAppender |
appendAllItemsToBeginning(ItemEntry... items)
Appends all of the ItemEntry to the beginning of the item list in the current feed. |
FeedAppender |
appendAllItemsToBeginning(List<ItemEntry> items)
Appends all of the ItemEntry to the beginning of the item list in the current feed. |
FeedAppender |
appendAllItemsToEnd(ItemEntry... items)
Appends all of the ItemEntry to the end of the item list in the current feed. |
FeedAppender |
appendAllItemsToEnd(List<ItemEntry> items)
Appends all of the ItemEntry to the end of the item list in current feed. |
FeedFormat |
getFormat()
The FeedFormat this writer should be using.if this is not set, the default is RSS 2.0 format. |
int |
getNumItemToKeep()
Maximum number of items to keep in a feed. |
FeedAppender |
removeItem(int index)
* Remove the item at index index from the feed. |
void |
setFormat(FeedFormat format)
The FeedFormat this writer should be using.if this is not set, the default is RSS 2.0 format. |
FeedAppender |
setItem(int index,
ItemEntry item)
Set the item at index index to be the input item |
FeedAppender |
setNumItemToKeep(int numItemToKeep)
Maximum number of items to keep in a feed. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FeedAppender(File file, FeedFormat format)
public FeedAppender(String pathName, FeedFormat format)
public FeedAppender(URI uri, FeedFormat format)
public FeedAppender(File file)
public FeedAppender(String pathName)
public FeedAppender(URI uri)
Method Detail |
---|
public FeedFormat getFormat()
FeedFormat
this writer should be using.null
format is ignored
FeedFormat
enumpublic void setFormat(FeedFormat format)
FeedFormat
this writer should be using.null
format is ignored
format
- a FeedFormat
enumpublic int getNumItemToKeep()
numItemToKeep
is non-negative and the actual number of ItemEntry
(after appends)
in the feed greater than numItemToKeep
, the appender will remove items from the END
of the feed to ensure there is at most numItemToKeep
items in the feed.
numberItemToKepp
, -1 if the value has not yet been set or there's no limit.public FeedAppender setNumItemToKeep(int numItemToKeep)
numItemToKeep
is non-negative and the actual number of ItemEntry
(after appends)
in the feed greater than numItemToKeep
, the appender will remove items from the END
of the feed to ensure there is at most numItemToKeep
items in the feed.
numItemToKeep
- number of items to keep in the current feed. no limit if it's negative.
public FeedAppender appendAllItemsAt(int index, List<ItemEntry> items) throws YarfrawException
ItemEntry
in the specified collection into the current feed
at the specified position (optional operation). Shifts the
ItemEntry
currently at that position (if any) and any subsequent
ItemEntry
to the right (increases their indices).
feedItemList.addAll(index, inputlist)
numItemToKeep
is set and the resulting number of ItemEntry
(after the append)
in the feed greater than numItemToKeep
, the appender will remove items from the END
of the feed to ensure there is at most numItemToKeep
items in the feed.
index
- index to append toitems
- any number of ItemEntry
YarfrawException
- if operation failed.public FeedAppender appendAllItemsToBeginning(List<ItemEntry> items) throws YarfrawException
ItemEntry
to the beginning of the item list in the current feed.
Shifts the ItemEntry
currently at that position (if any) and any subsequent
ItemEntry
to the right (increases their indices).
appendAllItemsAt(0, inputlist)
numItemToKeep
is set and the resulting number of ItemEntry
(after the append)
in the feed greater than numItemToKeep
, the appender will remove items from the END
of the feed to ensure there is at most numItemToKeep
items in the feed.
items
-
YarfrawException
- if the appender failed to read or write the feed file.public FeedAppender appendAllItemsToBeginning(ItemEntry... items) throws YarfrawException
ItemEntry
to the beginning of the item list in the current feed.
Shifts the ItemEntry
currently at that position (if any) and any subsequent
ItemEntry
to the right (increases their indices).
appendAllItemsAt(0, Arrays.asList(item1, item2, item3))
numItemToKeep
is set and the resulting number of ItemEntry
(after the append)
in the feed greater than numItemToKeep
, the appender will remove items from the END
of the feed to ensure there is at most numItemToKeep
items in the feed.
items
-
YarfrawException
- if the appender failed to read or write the feed file.public FeedAppender appendAllItemsToEnd(List<ItemEntry> items) throws YarfrawException
ItemEntry
to the end of the item list in current feed.
Shifts the ItemEntry
currently at that position (if any) and any subsequent
ItemEntry
to the right (increases their indices).
numItemToKeep
is set and the resulting number of ItemEntry
(after the append)
in the feed greater than numItemToKeep
, the appender will remove items from the END
of the feed to ensure there is at most numItemToKeep
items in the feed.
items
-
YarfrawException
- if the appender failed to read or write the feed file.public FeedAppender appendAllItemsToEnd(ItemEntry... items) throws YarfrawException
ItemEntry
to the end of the item list in the current feed.
Shifts the ItemEntry
currently at that position (if any) and any subsequent
ItemEntry
to the right (increases their indices).
numItemToKeep
is set and the resulting number of ItemEntry
(after the append)
in the feed greater than numItemToKeep
, the appender will remove items from the END
of the feed to ensure there is at most numItemToKeep
items in the feed.
items
-
YarfrawException
- if the appender failed to read or write the feed file.public FeedAppender removeItem(int index) throws YarfrawException
index
from the feed.
index
-
YarfrawException
- if the appender failed to read or write the feed file.public FeedAppender setItem(int index, ItemEntry item) throws YarfrawException
index
to be the input item
index
- item
-
YarfrawException
- if the appender failed to read or write the feed file.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |