com.konakart.app
Class Category

java.lang.Object
  extended by com.konakart.app.Category
All Implemented Interfaces:
CategoryIf, java.lang.Cloneable

public class Category
extends java.lang.Object
implements java.lang.Cloneable, CategoryIf

Category class


Constructor Summary
Category()
          Constructor
Category(com.workingdogs.village.Record vr, org.apache.torque.util.Criteria c)
          Instantiates the attributes of the Category object from a Record object
 
Method Summary
 void calculateNumberOfProducts()
          Recursively parses through the children of this category and adds the total amount of products contained by the category to the number of products that this category may already have.
 java.lang.Object clone()
          Clones the current object and all of it's children.
 CategoryIf findCategory(int categoryId)
          Searches all of the children, grandchildren etc of this object and returns the category object with the given id .
 void getAllChildrenIds(java.util.List<java.lang.Integer> childList)
          Adds all of the ids of the children, grandchildren etc of this object to the given childList.
 CategoryIf[] getChildren()
           
 java.lang.String getCustom1()
           
 java.lang.String getCustom2()
           
 java.lang.String getCustom3()
           
 java.lang.String getDescription()
           
 int getId()
           
 java.lang.String getImage()
           
 int getLevel()
          Top level = 0.
 MiscItemIf[] getMiscItems()
          Returns the array of Miscellaneous Items associated with this category.
 java.lang.String getName()
           
 int getNumberOfProducts()
           
 CategoryIf getParent()
           
 int getParentId()
           
 int getSortOrder()
           
 boolean isInvisible()
          When invisible, a category is not returned in the category tree.
 boolean isSelected()
           
 void setChildren(CategoryIf[] children)
           
 void setCustom1(java.lang.String custom1)
           
 void setCustom2(java.lang.String custom2)
           
 void setCustom3(java.lang.String custom3)
           
 void setDescription(java.lang.String description)
           
 void setId(int id)
           
 void setImage(java.lang.String image)
           
 void setInvisible(boolean invisible)
          When invisible, a category is not returned in the category tree.
 void setLevel(int level)
          Top level = 0.
 void setMiscItems(MiscItemIf[] miscItems)
           
 void setName(java.lang.String name)
           
 void setNumberOfProducts(int numberOfProducts)
           
 void setParent(CategoryIf parent)
           
 void setParentId(int parentId)
           
 void setSelected(boolean selected)
           
 void setSortOrder(int sortOrder)
           
 java.lang.String toString()
           
 java.lang.String toStringBrief()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Category

public Category()
Constructor


Category

public Category(com.workingdogs.village.Record vr,
                org.apache.torque.util.Criteria c)
         throws com.workingdogs.village.DataSetException
Instantiates the attributes of the Category object from a Record object

Parameters:
vr - Record containing data
c - Criteria containing column names
Throws:
com.workingdogs.village.DataSetException
Method Detail

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Clones the current object and all of it's children.

Overrides:
clone in class java.lang.Object
Throws:
java.lang.CloneNotSupportedException

calculateNumberOfProducts

public void calculateNumberOfProducts()
Recursively parses through the children of this category and adds the total amount of products contained by the category to the number of products that this category may already have.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
Returns a string containing the attributes of the Category object and those of its children.

toStringBrief

public java.lang.String toStringBrief()
Returns:
Returns a string containing selected attributes of the Category object

getAllChildrenIds

public void getAllChildrenIds(java.util.List<java.lang.Integer> childList)
Adds all of the ids of the children, grandchildren etc of this object to the given childList.

Parameters:
childList -

findCategory

public CategoryIf findCategory(int categoryId)
Searches all of the children, grandchildren etc of this object and returns the category object with the given id . If it can't be found, it returns null.

Parameters:
categoryId -
Returns:
Returns a category object or null

getChildren

public CategoryIf[] getChildren()
Specified by:
getChildren in interface CategoryIf
Returns:
Returns the children.

setChildren

public void setChildren(CategoryIf[] children)
Specified by:
setChildren in interface CategoryIf
Parameters:
children - The children to set.

getId

public int getId()
Specified by:
getId in interface CategoryIf
Returns:
Returns the id.

setId

public void setId(int id)
Specified by:
setId in interface CategoryIf
Parameters:
id - The id to set.

getImage

public java.lang.String getImage()
Specified by:
getImage in interface CategoryIf
Returns:
Returns the image.

setImage

public void setImage(java.lang.String image)
Specified by:
setImage in interface CategoryIf
Parameters:
image - The image to set.

getName

public java.lang.String getName()
Specified by:
getName in interface CategoryIf
Returns:
Returns the name.

setName

public void setName(java.lang.String name)
Specified by:
setName in interface CategoryIf
Parameters:
name - The name to set.

getNumberOfProducts

public int getNumberOfProducts()
Specified by:
getNumberOfProducts in interface CategoryIf
Returns:
Returns the numberOfProducts.

setNumberOfProducts

public void setNumberOfProducts(int numberOfProducts)
Specified by:
setNumberOfProducts in interface CategoryIf
Parameters:
numberOfProducts - The numberOfProducts to set.

getParentId

public int getParentId()
Specified by:
getParentId in interface CategoryIf
Returns:
Returns the parentId.

setParentId

public void setParentId(int parentId)
Specified by:
setParentId in interface CategoryIf
Parameters:
parentId - The parentId to set.

getSortOrder

public int getSortOrder()
Specified by:
getSortOrder in interface CategoryIf
Returns:
Returns the sortOrder.

setSortOrder

public void setSortOrder(int sortOrder)
Specified by:
setSortOrder in interface CategoryIf
Parameters:
sortOrder - The sortOrder to set.

getParent

public CategoryIf getParent()
Specified by:
getParent in interface CategoryIf
Returns:
Returns the parent.

setParent

public void setParent(CategoryIf parent)
Specified by:
setParent in interface CategoryIf
Parameters:
parent - The parent to set.

isSelected

public boolean isSelected()
Specified by:
isSelected in interface CategoryIf
Returns:
Returns the selected.

setSelected

public void setSelected(boolean selected)
Specified by:
setSelected in interface CategoryIf
Parameters:
selected - The selected to set.

getLevel

public int getLevel()
Description copied from interface: CategoryIf
Top level = 0.

Specified by:
getLevel in interface CategoryIf
Returns:
Returns the level.

setLevel

public void setLevel(int level)
Description copied from interface: CategoryIf
Top level = 0.

Specified by:
setLevel in interface CategoryIf
Parameters:
level - The level to set.

getCustom1

public java.lang.String getCustom1()
Specified by:
getCustom1 in interface CategoryIf
Returns:
Returns the custom1.

setCustom1

public void setCustom1(java.lang.String custom1)
Specified by:
setCustom1 in interface CategoryIf
Parameters:
custom1 - The custom1 to set.

getCustom2

public java.lang.String getCustom2()
Specified by:
getCustom2 in interface CategoryIf
Returns:
Returns the custom2.

setCustom2

public void setCustom2(java.lang.String custom2)
Specified by:
setCustom2 in interface CategoryIf
Parameters:
custom2 - The custom2 to set.

getCustom3

public java.lang.String getCustom3()
Specified by:
getCustom3 in interface CategoryIf
Returns:
Returns the custom3.

setCustom3

public void setCustom3(java.lang.String custom3)
Specified by:
setCustom3 in interface CategoryIf
Parameters:
custom3 - The custom3 to set.

isInvisible

public boolean isInvisible()
Description copied from interface: CategoryIf
When invisible, a category is not returned in the category tree.

Specified by:
isInvisible in interface CategoryIf
Returns:
the invisible

setInvisible

public void setInvisible(boolean invisible)
Description copied from interface: CategoryIf
When invisible, a category is not returned in the category tree.

Specified by:
setInvisible in interface CategoryIf
Parameters:
invisible - the invisible to set

getDescription

public java.lang.String getDescription()
Specified by:
getDescription in interface CategoryIf
Returns:
the description

setDescription

public void setDescription(java.lang.String description)
Specified by:
setDescription in interface CategoryIf
Parameters:
description - the description to set

getMiscItems

public MiscItemIf[] getMiscItems()
Returns the array of Miscellaneous Items associated with this category.

Specified by:
getMiscItems in interface CategoryIf
Returns:
the miscItems associated with this product.

setMiscItems

public void setMiscItems(MiscItemIf[] miscItems)
Specified by:
setMiscItems in interface CategoryIf
Parameters:
miscItems - the miscItems to set


Copyright © 2011 DS Data Systems UK Ltd.