fable.adt
Class PseudoFeed

java.lang.Object
  extended by fable.adt.PseudoFeed
All Implemented Interfaces:
FableContainer

public class PseudoFeed
extends java.lang.Object
implements FableContainer

This class represents a pseudofeed which can only store articles, and cannot be the node of the tree structure of ADT, since this is not a FableComponent.

Author:
Wonsik Kim

Constructor Summary
PseudoFeed(java.util.List<FableComponent> children)
          Construct a new PseudoFeed with initial children.
 
Method Summary
 boolean addChild(FableComponent fc)
          Add c as a child of this.
 java.util.List<FableComponent> getChildren()
          Returns a list of children of this.
 java.lang.String getTitle()
          Returns the title of this pseudofeed.
 boolean removeChild(FableComponent fc)
          Remove c from the children of this.
 void setTitle(java.lang.String newTitle)
          Sets the title of this pseudofeed as newTitle.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PseudoFeed

public PseudoFeed(java.util.List<FableComponent> children)
Construct a new PseudoFeed with initial children.

Parameters:
children - initial children of this pseudofeed.
Throws:
java.lang.NullPointerException - if children is null.
Effects:
construct a new PseudoFeed object.
Modifies:
this
Method Detail

getChildren

public java.util.List<FableComponent> getChildren()
Description copied from interface: FableContainer
Returns a list of children of this. The order is not particularly meaningful.

Specified by:
getChildren in interface FableContainer
Returns:
A list of children of this.

addChild

public boolean addChild(FableComponent fc)
Add c as a child of this. Returns true if c is article and successfully added, false otherwise.

Specified by:
addChild in interface FableContainer
Parameters:
fc - a child to be added.
Returns:
true if c is article and successfully added, false otherwise.
Throws:
java.lang.NullPointerException - if fc is null.
Effects:
add c as a child of this if c is an article.
Modifies:
this.children

removeChild

public boolean removeChild(FableComponent fc)
Description copied from interface: FableContainer
Remove c from the children of this. When c is not a children of this, it does nothing and return false. Otherwise, it will return true.

Specified by:
removeChild in interface FableContainer
Parameters:
fc - A child to remove from this.
Returns:
true if c is a child of this and successfully removed. false otherwise.

getTitle

public java.lang.String getTitle()
Returns the title of this pseudofeed.

Returns:
the title of this pseudofeed.

setTitle

public void setTitle(java.lang.String newTitle)
Sets the title of this pseudofeed as newTitle.

Parameters:
newTitle - the new title of this pseudofeed.
Throws:
java.lang.NullPointerException - if newTitle is null.
Effects:
set title of this.
Modifies:
this.title