Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## net.sourceforge.pebble.domain
Class Category

    java.lang.Object
      net.sourceforge.pebble.domain.Category

All Implemented Interfaces:
  java.io.Serializable, java.lang.Comparable, Permalinkable

    public class Category

extends java.lang.Object
implements Permalinkable, java.lang.Comparable, java.io.Serializable

Represents a blog category.

Author:
  Simon Brown
See Also:
  Serialized Form

Constructor Summary
`Category()` Default, no args constructor.
`Category(java.lang.String id, java.lang.String name)` Creates a new category with the specified properties.

Method Summary
`void` | `addBlogEntry(java.lang.String blogEntry)` Adds a blog entry to this category.
`void` | `addSubCategory(Category category)` Adds a sub-category.
`int` | `compareTo(java.lang.Object o)` Compares this object with the specified object for order.
`boolean` | `equals(java.lang.Object o)` Determines whether the specified object is equal to this one.
`java.util.List` | `getAllTags()` Gets the tags associated with this category and its parents.
`java.util.List<java.lang.String>` | `getBlogEntries()` Gets the blog entries associated with this category.
`java.lang.String` | `getId()` Gets the id of this category.
`java.lang.String` | `getName()` Gets the name of this category.
`int` | `getNumberOfBlogEntries()` Gets the number of blog entries associated with this category.
`int` | `getNumberOfParents()` Gets the number of parents that this category has.
`Category` | `getParent()` Gets the parent of thie category.
`java.lang.String` | `getPermalink()` Gets the permalink for this object.
`java.util.List` | `getSubCategories()` Gets the list of sub-categories.
`java.lang.String` | `getTags()` Gets the tags associated with this category.
`java.util.List` | `getTagsAsList()` Gets the tags associated with this category, as a List.
`int` | `hashCode()` Gets the hashcode of this object.
`boolean` | `hasParent(Category category)` Determines whether this category has the specified parent.
`boolean` | `isRootCategory()` Determines whether this category is a root category.
`void` | `removeAllBlogEntries()` Removes all blog entries from this category.
`void` | `removeBlogEntry(java.lang.String blogEntry)` Removes a blog entry from this category.
`void` | `removeSubCategory(Category category)` Removes a sub-category.
`void` | `setBlog(Blog blog)` Sets the owning blog.
`void` | `setId(java.lang.String id)` Sets the id of this category.
`void` | `setName(java.lang.String name)` Sets the name of this category.
`void` | `setParent(Category parent)` Sets the parent of this category.
`void` | `setTags(java.lang.String newTags)` Sets the set of tags associated with this category.
`java.lang.String` | `toString()` Returns a String representation of this object.

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

Constructor Detail

### Category

    public Category()

  Default, no args constructor.

### Category

    public Category(java.lang.String id,
                    java.lang.String name)

  Creates a new category with the specified properties.

  Parameters:
    `id` - the id
    `name` - the name

Method Detail

### getId

    public java.lang.String getId()

  Gets the id of this category.

  Returns:
    the id as a String

### setId

    public void setId(java.lang.String id)

  Sets the id of this category.

  Parameters:
    `id` - the id as a String

### getName

    public java.lang.String getName()

  Gets the name of this category.

  Returns:
    the name as a String

### setName

    public void setName(java.lang.String name)

  Sets the name of this category.

  Parameters:
    `name` - the new category name

### isRootCategory

    public boolean isRootCategory()

  Determines whether this category is a root category.

  Returns:
    true if the ID is "/", false otherwise

### getParent

    public Category getParent()

  Gets the parent of thie category.

  Returns:
    a Category instance, or null if this category has no parent

### hasParent

    public boolean hasParent(Category category)

  Determines whether this category has the specified parent.

  Parameters:
    `category` - a Category to test for
  Returns:
    true if this category has the specified category as one of its parents, false otherwise

### setParent

    public void setParent(Category parent)

  Sets the parent of this category.

  Parameters:
    `parent` - a Category instance

### getNumberOfParents

    public int getNumberOfParents()

  Gets the number of parents that this category has.

  Returns:
    the number of parents this category has, or 0 if it is the root category

### addSubCategory

    public void addSubCategory(Category category)

  Adds a sub-category.

  Parameters:
    `category` - a Category instance

### removeSubCategory

    public void removeSubCategory(Category category)

  Removes a sub-category.

  Parameters:
    `category` - a Category instance

### getSubCategories

    public java.util.List getSubCategories()

  Gets the list of sub-categories.

  Returns:
    a List of Category instances

### getTags

    public java.lang.String getTags()

  Gets the tags associated with this category.

  Returns:
    a list of tags

### getTagsAsList

    public java.util.List getTagsAsList()

  Gets the tags associated with this category, as a List.

  Returns:
    a List of tags

### getAllTags

    public java.util.List getAllTags()

  Gets the tags associated with this category and its parents.

  Returns:
    a list of tags

### setTags

    public void setTags(java.lang.String newTags)

  Sets the set of tags associated with this category.

  Parameters:
    `newTags` - a set of tags

### setBlog

    public void setBlog(Blog blog)

  Sets the owning blog.

  Parameters:
    `blog` - a Blog instance

### getPermalink

    public java.lang.String getPermalink()

  Gets the permalink for this object.

  Specified by:
    `getPermalink` in interface `Permalinkable`
  Returns:
    a URL as a String

### hashCode

    public int hashCode()

  Gets the hashcode of this object.

  Overrides:
    `hashCode` in class `java.lang.Object`
  Returns:
    the hashcode as an int

### equals

    public boolean equals(java.lang.Object o)

  Determines whether the specified object is equal to this one.

  Overrides:
    `equals` in class `java.lang.Object`
  Parameters:
    `o` - the object to compare against
  Returns:
    true if Object o represents the same category, false otherwise

### compareTo

    public int compareTo(java.lang.Object o)

  Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

  Specified by:
    `compareTo` in interface `java.lang.Comparable`
  Parameters:
    `o` - the Object to be compared.
  Returns:
    a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
  Throws:
    `java.lang.ClassCastException` - if the specified object's type prevents it from being compared to this Object.

### toString

    public java.lang.String toString()

  Returns a String representation of this object.

  Overrides:
    `toString` in class `java.lang.Object`
  Returns:
    a String

### getBlogEntries

    public java.util.List<java.lang.String> getBlogEntries()

  Gets the blog entries associated with this category.

  Returns:
    a Collection of BlogEntry instances

### addBlogEntry

    public void addBlogEntry(java.lang.String blogEntry)

  Adds a blog entry to this category.

  Parameters:
    `blogEntry` - a blog entry id

### removeBlogEntry

    public void removeBlogEntry(java.lang.String blogEntry)

  Removes a blog entry from this category.

  Parameters:
    `blogEntry` - a blog entry id

### removeAllBlogEntries

    public void removeAllBlogEntries()

  Removes all blog entries from this category.

### getNumberOfBlogEntries

    public int getNumberOfBlogEntries()

  Gets the number of blog entries associated with this category.

  Returns:
    an int

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2003-2006, Simon Brown. All Rights Reserved.