|
Holger's Java API |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.antelmann.db.Category.Adapter<T>
public static class Category.Adapter<T>
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface com.antelmann.db.Category |
|---|
Category.Adapter<T>, Category.Entry |
| Constructor Summary | |
|---|---|
Category.Adapter(String name,
Category<T> parent,
Collection<? extends Category<T>> children)
|
|
| Method Summary | ||
|---|---|---|
static
|
addAllChildrenFrom(Category<T> category,
T context,
ArrayList<Category<T>> list)
works recursively; does not include the given category itself |
|
static void |
checkForCircularReferenceInParent(Category<?> category,
Category<?> parent)
|
|
boolean |
equals(Object obj)
|
|
static
|
getAllChildren(Category<T> category,
T context)
does not include the given category itself |
|
String |
getCategoryName()
returns the name for this category |
|
Category<T> |
getParentCategory()
returns the super category that this category belongs to - or null if it is a top-level category |
|
static
|
getPath(Category<T> c)
|
|
static String |
getPathName(Category<?> c)
|
|
static String |
getPathName(Category<?> c,
String separator)
|
|
List<? extends Category<T>> |
getSubCategories(T context)
the returned list by this implementation allows direct modifications; the context parameter is ignored and may be null |
|
static Category<?> |
getTopCategory(Category<?> c)
|
|
int |
hashCode()
|
|
static
|
isParent(Category<T> parent,
Category<T> child)
|
|
static
|
iterate(Category<T> category,
T context)
iterates over all children recursively |
|
static
|
iterate(List<? extends Category<T>> categoryList,
T context)
iterates over the list itself and all children recursively |
|
static
|
listAll(Collection<? extends Category<T>> topCategories,
T context)
|
|
protected void |
setCategoryName(String name)
|
|
void |
setChildren(Collection<Category<T>> col)
|
|
protected void |
setParentCategory(Category<T> parent)
|
|
String |
toDetailedString()
provides full details of this instance in a String. |
|
String |
toString()
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Category.Adapter(String name,
Category<T> parent,
Collection<? extends Category<T>> children)
| Method Detail |
|---|
public String toString()
toString in class Objectpublic String toDetailedString()
DetailedString
toDetailedString in interface DetailedStringprotected void setCategoryName(String name)
protected void setParentCategory(Category<T> parent)
throws IllegalArgumentException
IllegalArgumentExceptionpublic String getCategoryName()
Category
getCategoryName in interface Category<T>public Category<T> getParentCategory()
Category
getParentCategory in interface Category<T>
public List<? extends Category<T>> getSubCategories(T context)
throws IOException
getSubCategories in interface Category<T>context - the object (typically a database, a file, a URL, etc.) that
provides the information required to derive the children from.
IOException - if the categories could not be retrieved@Warning(value="if this instance of the given elements are not mutable, you must ensure yourself that the parent of the elements is this instance.") public void setChildren(Collection<Category<T>> col)
public int hashCode()
hashCode in class Objectpublic boolean equals(Object obj)
equals in class Objectpublic static String getPathName(Category<?> c)
public static Category<?> getTopCategory(Category<?> c)
public static String getPathName(Category<?> c,
String separator)
public static <T> ArrayList<Category<T>> getPath(Category<T> c)
public static void checkForCircularReferenceInParent(Category<?> category,
Category<?> parent)
public static <T> List<Category<T>> listAll(Collection<? extends Category<T>> topCategories,
T context)
public static <T> Iterator<Category<T>> iterate(Category<T> category,
T context)
public static <T> Iterator<Category<T>> iterate(List<? extends Category<T>> categoryList,
T context)
public static <T> ArrayList<Category<T>> getAllChildren(Category<T> category,
T context)
throws IOException
IOException
public static <T> ArrayList<Category<T>> addAllChildrenFrom(Category<T> category,
T context,
ArrayList<Category<T>> list)
throws IOException
IOException
public static <T> boolean isParent(Category<T> parent,
Category<T> child)
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||