eShopper
Class eShopperRoot

java.lang.Object
  extended byeShopper.eShopperNode
      extended byeShopper.eShopperRoot

public class eShopperRoot
extends eShopperNode

This class takes care of all the view stuff and is consequently the most messy. Other than that, it is fairly straightforward.

Author:
Jim Laing

Constructor Summary
eShopperRoot(int view, int listID, eShopperDB db)
          constructor
 
Method Summary
 boolean doCombine()
          Queries database and sees whether combining is configured
 java.util.Vector getChildren()
          Gets all of the immediate children of the root node
 java.lang.String getDate()
          There is never a date associated with a root node
 java.util.Vector getDateViewVector()
          Gets the children of the root node when the view is set to DATE
 java.util.Vector getItemViewVector()
          Gets the children of the root node when the view is set to ITEM based upon the value of "combine" in the configure table
 java.util.Vector getRecipeViewVector()
          Gets the children of the root node when the view is set to RECIPE
 int getView()
          Gets the current view
 int nodeID()
          A root node is uniquely IDed as a node value of -1
 void setView(int view)
          Sets the current view
 java.lang.String toString()
          Gets the name of the list as set in the database and uses it as the name of the root node
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

eShopperRoot

public eShopperRoot(int view,
                    int listID,
                    eShopperDB db)
constructor

Method Detail

getChildren

public java.util.Vector getChildren()
Gets all of the immediate children of the root node

Specified by:
getChildren in class eShopperNode
Returns:
a vector of this node's children, based on the current set view

toString

public java.lang.String toString()
Gets the name of the list as set in the database and uses it as the name of the root node

Specified by:
toString in class eShopperNode
Returns:
a string representation of this node

getDate

public java.lang.String getDate()
There is never a date associated with a root node

Specified by:
getDate in class eShopperNode
Returns:
an empty string

getView

public int getView()
Gets the current view

Returns:
an int corresponding to one of the static view values (DATE, RECIPE, or ITEM)

setView

public void setView(int view)
Sets the current view

Parameters:
view - an int corresponding to one of the static view values (DATE, RECIPE, or ITEM)

nodeID

public int nodeID()
A root node is uniquely IDed as a node value of -1

Specified by:
nodeID in class eShopperNode
Returns:
always returns -1

getDateViewVector

public java.util.Vector getDateViewVector()
Gets the children of the root node when the view is set to DATE

Returns:
a vector of children

getRecipeViewVector

public java.util.Vector getRecipeViewVector()
Gets the children of the root node when the view is set to RECIPE

Returns:
a vector of children

getItemViewVector

public java.util.Vector getItemViewVector()
Gets the children of the root node when the view is set to ITEM based upon the value of "combine" in the configure table

Returns:
a vector of children

doCombine

public boolean doCombine()
Queries database and sees whether combining is configured

Returns:
a boolean, true if combining is desired. False otherwise