Holger's
Java API

com.antelmann.db
Class MutableCategory.Adapter<T>

java.lang.Object
  extended by com.antelmann.db.Category.Adapter<T>
      extended by com.antelmann.db.MutableCategory.Adapter<T>
All Implemented Interfaces:
Category<T>, MutableCategory<T>, DetailedString, Serializable
Enclosing interface:
MutableCategory<T>

public static class MutableCategory.Adapter<T>
extends Category.Adapter<T>
implements MutableCategory<T>

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.antelmann.db.MutableCategory
MutableCategory.Adapter<T>, MutableCategory.Entry
 
Constructor Summary
MutableCategory.Adapter(String name, MutableCategory<T> parent, Collection<? extends MutableCategory<T>> children)
           
 
Method Summary
 MutableCategory<T> getParentCategory()
          returns the super category that this category belongs to - or null if it is a top-level category
 List<? extends MutableCategory<T>> getSubCategories(T context)
          the returned list by this implementation allows direct modifications; the context parameter is ignored and may be null
 void setChildren(Collection<Category<T>> col)
           
 void setParentCategory(MutableCategory<T> parent)
           
 
Methods inherited from class com.antelmann.db.Category.Adapter
addAllChildrenFrom, checkForCircularReferenceInParent, equals, getAllChildren, getCategoryName, getPath, getPathName, getPathName, getTopCategory, hashCode, isParent, iterate, iterate, listAll, setCategoryName, setParentCategory, toDetailedString, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.antelmann.db.Category
getCategoryName
 

Constructor Detail

MutableCategory.Adapter

public MutableCategory.Adapter(String name,
                               MutableCategory<T> parent,
                               Collection<? extends MutableCategory<T>> children)
Method Detail

setParentCategory

public void setParentCategory(MutableCategory<T> parent)
Specified by:
setParentCategory in interface MutableCategory<T>

getParentCategory

public MutableCategory<T> getParentCategory()
Description copied from interface: Category
returns the super category that this category belongs to - or null if it is a top-level category

Specified by:
getParentCategory in interface Category<T>
Specified by:
getParentCategory in interface MutableCategory<T>
Overrides:
getParentCategory in class Category.Adapter<T>

getSubCategories

public List<? extends MutableCategory<T>> getSubCategories(T context)
                                                    throws IOException
the returned list by this implementation allows direct modifications; the context parameter is ignored and may be null

Specified by:
getSubCategories in interface Category<T>
Specified by:
getSubCategories in interface MutableCategory<T>
Overrides:
getSubCategories in class Category.Adapter<T>
Parameters:
context - the object (typically a database, a file, a URL, etc.) that provides the information required to derive the children from.
Returns:
a list of Category objects that have this instance as a parent
Throws:
IOException - if the categories could not be retrieved

setChildren

public void setChildren(Collection<Category<T>> col)
                 throws InconsistentContentException
Overrides:
setChildren in class Category.Adapter<T>
Throws:
InconsistentContentException - if an element of the given collection is not mutable


(c) Holger Antelmann since 2001- all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads