rss.adt
Class TreeFolder

java.lang.Object
  extended by rss.adt.TreeFolder
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
RootFolder

public class TreeFolder
extends java.lang.Object
implements java.io.Serializable

The basic container that comprises the Feed tree. A TreeFolder may contain other TreeFolders and Feeds.

Abstraction Function:



Representation Invariant: id must a unique, positive integer over all TreeFolders containedFolders, containedFeeds, name, icon, treeItem may not be null icon must either be blank or refer to the graphical image file for its icon expanded must correspond with the gui TreeItem state whether it is opened or not

Author:
Jong-Moon Kim
See Also:
Serialized Form

Constructor Summary
TreeFolder(int id, java.util.List<TreeFolder> containedFolders, java.util.List<Feed> containedFeeds, boolean expanded, java.lang.String name, java.lang.String icon)
          Initializes a TreeFolder with the given parameters.
 
Method Summary
 boolean equals(java.lang.Object o)
          Two TreeFolders can only be true if the identifiers are equal and both are not root folders.
 java.util.List<Feed> getContainedFeeds()
          Accessor to grab contained Feeds.
 java.util.List<TreeFolder> getContainedFolders()
          Accessor to grab contained TreeFolders.
 java.lang.String getIcon()
          Accessor to get the path to the icon image file.
 int getID()
          Accessor to grab identifier.
 java.lang.String getName()
          Accessor to grab the name.
 TreeItem getTreeItem()
          Accessor to grab the corresponding TreeItem.
 int hashCode()
          Hashcode function that uses it's unique identifier
 boolean isExpanded()
          Accessor to check whether expanded.
 void setContainedFeeds(java.util.List<Feed> containedFeeds)
          Modifier to set contained Feeds.
 void setContainedFolders(java.util.List<TreeFolder> containedFolders)
          Modifier to set contained TreeFolders.
 void setExpanded(boolean expanded)
          Modifier to change expanded state.
 void setIcon(java.lang.String icon)
          Modifier to set the path of the icon image file.
 void setName(java.lang.String name)
          Modifier for the name of the folder.
 void setTreeItem(TreeItem treeItem)
          Modifier for setting the corresponding TreeItem.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TreeFolder

public TreeFolder(int id,
                  java.util.List<TreeFolder> containedFolders,
                  java.util.List<Feed> containedFeeds,
                  boolean expanded,
                  java.lang.String name,
                  java.lang.String icon)
Initializes a TreeFolder with the given parameters.

Parameters:
id - Database identifier
containedFolders - A list of contained TreeFolders
containedFeeds - A list of contained Feeds
expanded - Whether the folder is expanded
name - Name of the folder
icon - Path of the icon of the folder
Method Detail

getContainedFeeds

public java.util.List<Feed> getContainedFeeds()
Accessor to grab contained Feeds.

Returns:
Contained feeds.

setContainedFeeds

public void setContainedFeeds(java.util.List<Feed> containedFeeds)
Modifier to set contained Feeds.

Parameters:
containedFeeds -

getContainedFolders

public java.util.List<TreeFolder> getContainedFolders()
Accessor to grab contained TreeFolders.

Returns:
Contained treeFolders.

setContainedFolders

public void setContainedFolders(java.util.List<TreeFolder> containedFolders)
Modifier to set contained TreeFolders.

Parameters:
containedFolders -

getID

public int getID()
Accessor to grab identifier.

Returns:
folder identifier

isExpanded

public boolean isExpanded()
Accessor to check whether expanded.

Returns:
True if expanded, false if not.

setExpanded

public void setExpanded(boolean expanded)
Modifier to change expanded state.

Parameters:
expanded -

getIcon

public java.lang.String getIcon()
Accessor to get the path to the icon image file.

Returns:
path of icon

setIcon

public void setIcon(java.lang.String icon)
Modifier to set the path of the icon image file.

Parameters:
icon - path of icon

getName

public java.lang.String getName()
Accessor to grab the name.

Returns:
name of the folder

setName

public void setName(java.lang.String name)
Modifier for the name of the folder.

Parameters:
name - name of the folder

setTreeItem

public void setTreeItem(TreeItem treeItem)
Modifier for setting the corresponding TreeItem.

Parameters:
treeItem - TreeItem to be composed.

getTreeItem

public TreeItem getTreeItem()
Accessor to grab the corresponding TreeItem.

Returns:
composed TreeItem

hashCode

public int hashCode()
Hashcode function that uses it's unique identifier

Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Two TreeFolders can only be true if the identifiers are equal and both are not root folders.

Overrides:
equals in class java.lang.Object