net.sourceforge.rssowl.model
Class TreeItemData

java.lang.Object
  extended bynet.sourceforge.rssowl.model.TreeItemData

public class TreeItemData
extends Object

Model class to store data in a TreeItem. The setData() Method of any TreeItem in RSSOwl is used with a TreeItemData Object.

Version:
1.1.3
Author:
Benjamin Pasero

Field Summary
private  Favorite favorite
           
private  String name
           
private  boolean statusUnread
           
private  int type
           
private static int TYPE_BLOGROLL
          TreeItem is a blogroll
private static int TYPE_BLOGROLL_FAVORITE
          TreeItem is a blogroll favorite
private static int TYPE_CATEGORY
          TreeItem is a category
private static int TYPE_FAVORITE
          TreeItem is a favorite
 
Constructor Summary
private TreeItemData(int type, String name, boolean statusUnread)
          Private constructor that is used by the factory methods
 
Method Summary
static TreeItemData createBlogroll(String name, boolean statusUnread)
          Create a new TreeItem with the type: Blogroll
static TreeItemData createBlogrollFavorite(String name, boolean statusUnread)
          Create a new TreeItem with the type: Blogroll Favorite
static TreeItemData createCategory(String name, boolean statusUnread)
          Create a new TreeItem with the type: Category
static TreeItemData createFavorite(String name, boolean statusUnread)
          Create a new TreeItem with the type: Favorite
 Favorite getFavorite()
          If this Data Object is from a Favorite, store a reference to the connected model object.
 String getName()
          Get the name for this TreeItem
 boolean isBlogroll()
           
 boolean isBlogrollFavorite()
           
 boolean isCategory()
           
 boolean isFavorite()
           
 boolean isStatusUnread()
          Get the status of this TreeItem.
 void setFavorite(Favorite favorite)
          If this Data Object is from a Favorite, store a reference to the connected model object.
 void setStatusUnread(boolean statusUnread)
          Set the status of this TreeItem.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_BLOGROLL

private static final int TYPE_BLOGROLL
TreeItem is a blogroll

See Also:
Constant Field Values

TYPE_BLOGROLL_FAVORITE

private static final int TYPE_BLOGROLL_FAVORITE
TreeItem is a blogroll favorite

See Also:
Constant Field Values

TYPE_CATEGORY

private static final int TYPE_CATEGORY
TreeItem is a category

See Also:
Constant Field Values

TYPE_FAVORITE

private static final int TYPE_FAVORITE
TreeItem is a favorite

See Also:
Constant Field Values

favorite

private Favorite favorite

name

private String name

statusUnread

private boolean statusUnread

type

private int type
Constructor Detail

TreeItemData

private TreeItemData(int type,
                     String name,
                     boolean statusUnread)
Private constructor that is used by the factory methods

Parameters:
type - The type of the TreeItem
name - Name of the given TreeItem
statusUnread - TRUE indicates that Favorite contains unread news
Method Detail

createBlogroll

public static TreeItemData createBlogroll(String name,
                                          boolean statusUnread)
Create a new TreeItem with the type: Blogroll

Parameters:
name - Name of the given TreeItem
statusUnread - TRUE indicates that Favorite contains unread news
Returns:
TreeItemData An instance of TreeItemData

createBlogrollFavorite

public static TreeItemData createBlogrollFavorite(String name,
                                                  boolean statusUnread)
Create a new TreeItem with the type: Blogroll Favorite

Parameters:
name - Name of the given TreeItem
statusUnread - TRUE indicates that Favorite contains unread news
Returns:
TreeItemData An instance of TreeItemData

createCategory

public static TreeItemData createCategory(String name,
                                          boolean statusUnread)
Create a new TreeItem with the type: Category

Parameters:
name - Name of the given TreeItem
statusUnread - TRUE indicates that Favorite contains unread news
Returns:
TreeItemData An instance of TreeItemData

createFavorite

public static TreeItemData createFavorite(String name,
                                          boolean statusUnread)
Create a new TreeItem with the type: Favorite

Parameters:
name - Name of the given TreeItem
statusUnread - TRUE indicates that Favorite contains unread news
Returns:
TreeItemData An instance of TreeItemData

getFavorite

public Favorite getFavorite()
If this Data Object is from a Favorite, store a reference to the connected model object.

Returns:
Favorite The Favorite Model Object.

getName

public String getName()
Get the name for this TreeItem

Returns:
Returns the name.

isBlogroll

public boolean isBlogroll()
Returns:
boolean TRUE if the TreeItem is a blogroll

isBlogrollFavorite

public boolean isBlogrollFavorite()
Returns:
boolean TRUE if the TreeItem is a blogroll favorite

isCategory

public boolean isCategory()
Returns:
boolean TRUE if the TreeItem is a category

isFavorite

public boolean isFavorite()
Returns:
boolean TRUE if the TreeItem is a favorite

isStatusUnread

public boolean isStatusUnread()
Get the status of this TreeItem. It shows either read or unread

Returns:
Returns the statusUnread.

setFavorite

public void setFavorite(Favorite favorite)
If this Data Object is from a Favorite, store a reference to the connected model object.

Parameters:
favorite - The Favorite Model Object to set.

setStatusUnread

public void setStatusUnread(boolean statusUnread)
Set the status of this TreeItem. Either set read or unread

Parameters:
statusUnread - The statusUnread to set.


RSSOwl - RSS / RDF / Atom Newsreader

SourceForge.net Logo