public abstract class CategoryTreeContainer<T extends AbstractCategory<T>>
extends com.exalead.access.feedapi.eval.mel.extension.AbstractMELType
implements java.lang.Iterable<T>, java.io.Serializable, com.exalead.access.feedapi.eval.mel.extension.types.MELStore<T>
Modifier and Type | Class and Description |
---|---|
static class |
CategoryTreeContainer.AggregationSortModeASC |
static class |
CategoryTreeContainer.AggregationSortModeDESC |
static class |
CategoryTreeContainer.Field |
static class |
CategoryTreeContainer.FieldsHolder |
static class |
CategoryTreeContainer.IterationMode
Controls what kind of iterator is returned by getCategoryIterator()
TODO(blindfor): Move logic from iterator(x,y) into here to make more extensible
|
static class |
CategoryTreeContainer.SortMode
Defines in which order getCategories(SortMode) returns its results
|
Modifier and Type | Field and Description |
---|---|
protected java.util.List<T> |
categories |
protected java.lang.String |
data |
protected java.lang.String |
description |
protected static CategoryTreeContainer.FieldsHolder |
FIELDS |
protected java.lang.String |
id |
protected java.lang.String |
path |
Constructor and Description |
---|
CategoryTreeContainer(java.lang.String id,
java.lang.String path,
java.lang.String desc,
java.lang.String data) |
Modifier and Type | Method and Description |
---|---|
void |
addAllCategories(java.util.Collection<T> cats)
Add all sibling categories to this node
|
void |
addCategory(T category)
Add a new sibling category to this node
|
void |
clearCategories()
Clear all sub categories
|
java.lang.Object |
clone() |
T |
getAssociatedValue(com.exalead.access.feedapi.eval.mel.extension.MELType key) |
java.util.List<T> |
getCategories()
Returns a list of sub categories
|
java.util.List<T> |
getCategories(CategoryTreeContainer.SortMode sortMode)
Returns a list of sub categories with sorting SortMode applied.
|
java.lang.String |
getData() |
CategoryTreeContainer<T> |
getDeepestRefinedTreeContainer(CategoryTreeContainer.IterationMode iterationMode)
Find the deepest refined category tree container
|
java.lang.String |
getDescription() |
com.exalead.access.feedapi.eval.mel.extension.AbstractMELType.FieldsHolder |
getFields() |
java.lang.String |
getId() |
java.lang.String |
getPath() |
java.util.List<T> |
getRefinedCategories()
Return a list of all refined categories.
|
java.util.List<T> |
getRefinedCategories(CategoryTreeContainer.IterationMode iterationMode)
Return a list of all refined categories.
|
java.util.List<T> |
getRefinedCategories(CategoryTreeContainer.IterationMode iterationMode,
CategoryTreeContainer.SortMode sortMode)
Return a list of all refined categories
|
java.util.Iterator<T> |
iterator() |
java.util.Iterator<T> |
iterator(CategoryTreeContainer.IterationMode iterMode) |
java.util.Iterator<T> |
iterator(CategoryTreeContainer.IterationMode iterMode,
CategoryTreeContainer.SortMode sortMode)
Iterate over the categories, starting with this node.
|
java.lang.String |
rawStringValue() |
void |
setData(java.lang.String data) |
void |
setDescription(java.lang.String theDesc) |
void |
setId(java.lang.String id) |
void |
setPath(java.lang.String path) |
accept, collateTo, getFlags, resolveField, resolveOperation, setFlags, stringValue, stringValue, visit, visitBoolean, visitCategory, visitCategory, visitFacet, visitFacet, visitFeed, visitList, visitMeta, visitNumber, visitString, visitUnknown
protected static final CategoryTreeContainer.FieldsHolder FIELDS
protected java.util.List<T extends AbstractCategory<T>> categories
protected java.lang.String id
protected java.lang.String path
protected java.lang.String data
protected java.lang.String description
public CategoryTreeContainer(java.lang.String id, java.lang.String path, java.lang.String desc, java.lang.String data)
public java.lang.String getId()
public void setId(java.lang.String id)
public final java.lang.String getPath()
public void setPath(java.lang.String path)
public final java.lang.String getData()
public void setData(java.lang.String data)
public final java.lang.String getDescription()
public final void setDescription(java.lang.String theDesc)
public final java.util.List<T> getCategories()
public final void clearCategories()
public final void addAllCategories(java.util.Collection<T> cats)
public final java.util.List<T> getCategories(CategoryTreeContainer.SortMode sortMode)
public final java.util.List<T> getRefinedCategories()
iterationMode
- sortMode
- public final java.util.List<T> getRefinedCategories(CategoryTreeContainer.IterationMode iterationMode)
iterationMode
- sortMode
- public final java.util.List<T> getRefinedCategories(CategoryTreeContainer.IterationMode iterationMode, CategoryTreeContainer.SortMode sortMode)
iterationMode
- sortMode
- public CategoryTreeContainer<T> getDeepestRefinedTreeContainer(CategoryTreeContainer.IterationMode iterationMode)
categoryTreeContainer
- public final void addCategory(T category)
category
- public final java.util.Iterator<T> iterator(CategoryTreeContainer.IterationMode iterMode, CategoryTreeContainer.SortMode sortMode)
iterMode
- the iteration modesortMode
- should the results be sorted or not?public final java.util.Iterator<T> iterator(CategoryTreeContainer.IterationMode iterMode)
public final java.util.Iterator<T> iterator()
iterator
in interface java.lang.Iterable<T extends AbstractCategory<T>>
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
public java.lang.String rawStringValue()
rawStringValue
in interface com.exalead.access.feedapi.eval.mel.extension.MELType
rawStringValue
in class com.exalead.access.feedapi.eval.mel.extension.AbstractMELType
public com.exalead.access.feedapi.eval.mel.extension.AbstractMELType.FieldsHolder getFields()
getFields
in class com.exalead.access.feedapi.eval.mel.extension.AbstractMELType
public T getAssociatedValue(com.exalead.access.feedapi.eval.mel.extension.MELType key)
getAssociatedValue
in interface com.exalead.access.feedapi.eval.mel.extension.types.MELStore<T extends AbstractCategory<T>>
Copyright © 2021 Dassault Systèmes, All Rights Reserved.