KEYTYPE - Tree key typeVALUETYPE - Tree value typepublic abstract class AbstractSessionApplicationSingletonTreeWithUniqueID<KEYTYPE,VALUETYPE> extends AbstractSessionApplicationSingleton implements ITreeWithGlobalUniqueID<KEYTYPE,VALUETYPE,DefaultTreeItemWithID<KEYTYPE,VALUETYPE>>
AbstractSessionApplicationSingleton wrapping a
DefaultTreeWithGlobalUniqueID with the same API.| Modifier and Type | Field and Description |
|---|---|
protected DefaultTreeWithGlobalUniqueID<KEYTYPE,VALUETYPE> |
m_aTree |
m_aRWLock| Constructor and Description |
|---|
AbstractSessionApplicationSingletonTreeWithUniqueID() |
getAllSessionApplicationSingletons, getSessionApplicationSingleton, getSessionApplicationSingletonIfInstantiated, isSessionApplicationSingletonInstantiatedgetAllSingletons, getSingleton, getSingletonIfInstantiated, getSingletonScopeKey, isDestroyed, isInDestruction, isInInstantiation, isInPreDestruction, isInstantiated, isSingletonInstantiated, isUsableObject, onAfterInstantiation, onBeforeDestroy, onBeforeScopeDestruction, onDestroy, onScopeDestruction, readAbstractSingletonFields, setDestroyed, setInDestruction, setInInstantiation, setInPreDestruction, setInstantiated, toString, writeAbstractSingletonFieldsclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waithasNoChildrenhasNoChildrenprotected final DefaultTreeWithGlobalUniqueID<KEYTYPE,VALUETYPE> m_aTree
public AbstractSessionApplicationSingletonTreeWithUniqueID()
public final boolean hasChildren()
hasChildren in interface IHasChildren<DefaultTreeItemWithID<KEYTYPE,VALUETYPE>>true if this item has direct children,
false otherwise.@Nonnegative public int getChildCount()
getChildCount in interface IHasChildren<DefaultTreeItemWithID<KEYTYPE,VALUETYPE>>@Nonnull @ReturnsMutableCopy public final ICommonsCollection<? extends DefaultTreeItemWithID<KEYTYPE,VALUETYPE>> getAllChildren()
getAllChildren in interface IHasChildren<DefaultTreeItemWithID<KEYTYPE,VALUETYPE>>null
.@Nonnull public DefaultTreeItemWithID<KEYTYPE,VALUETYPE> getRootItem()
getRootItem in interface IBasicTree<VALUETYPE,DefaultTreeItemWithID<KEYTYPE,VALUETYPE>>null. The root item
should not be displayed but it is the parent node of all displayed
root items and therefore cannot be removed.@Nullable public DefaultTreeItemWithID<KEYTYPE,VALUETYPE> getChildWithID(@Nullable DefaultTreeItemWithID<KEYTYPE,VALUETYPE> aCurrent, @Nullable KEYTYPE aID)
IChildrenProviderWithIDnull if no such
object.getChildWithID in interface IChildrenProviderWithID<KEYTYPE,DefaultTreeItemWithID<KEYTYPE,VALUETYPE>>aCurrent - The object to determine the children of. No null or
non- null constraint possible.aID - the ID of the object in question. No null or non-
null constraint possible.nullpublic boolean hasChildren(@Nullable DefaultTreeItemWithID<KEYTYPE,VALUETYPE> aCurrent)
IChildrenProviderhasChildren in interface IChildrenProvider<DefaultTreeItemWithID<KEYTYPE,VALUETYPE>>aCurrent - The object to determine the children of. No null or
non- null constraint possible.true if this item has children, false
otherwise.@Nonnegative public int getChildCount(@Nullable DefaultTreeItemWithID<KEYTYPE,VALUETYPE> aCurrent)
getChildCount in interface IChildrenProvider<DefaultTreeItemWithID<KEYTYPE,VALUETYPE>>aCurrent - The object to determine the children count of. No null
or non- null constraint possible.@Nullable public ICommonsCollection<? extends DefaultTreeItemWithID<KEYTYPE,VALUETYPE>> getAllChildren(@Nullable DefaultTreeItemWithID<KEYTYPE,VALUETYPE> aCurrent)
IChildrenProvidergetAllChildren in interface IChildrenProvider<DefaultTreeItemWithID<KEYTYPE,VALUETYPE>>aCurrent - The object to determine the children of. No null or
non-null constraint possible.null if there are no children.
If null is passed, the resolver is expected to return
any possible top level (root) elements. This method may NOT return
null if the call to IChildrenProvider.hasChildren(Object) with
the same object returned true.@Nullable public DefaultTreeItemWithID<KEYTYPE,VALUETYPE> getItemWithID(@Nullable KEYTYPE aDataID)
ITreeWithGlobalUniqueIDITreeItemWithID that corresponds to the given ID.getItemWithID in interface ITreeWithGlobalUniqueID<KEYTYPE,VALUETYPE,DefaultTreeItemWithID<KEYTYPE,VALUETYPE>>aDataID - The ID of the tree item to search.null if no such tree item exists.@Nonnegative public int getItemCount()
getItemCount in interface ITreeWithGlobalUniqueID<KEYTYPE,VALUETYPE,DefaultTreeItemWithID<KEYTYPE,VALUETYPE>>@Nonnull public Collection<DefaultTreeItemWithID<KEYTYPE,VALUETYPE>> getAllItems()
getAllItems in interface ITreeWithGlobalUniqueID<KEYTYPE,VALUETYPE,DefaultTreeItemWithID<KEYTYPE,VALUETYPE>>null collection of all items.public boolean isItemSameOrDescendant(@Nullable KEYTYPE aParentItemID, @Nullable KEYTYPE aChildItemID)
ITreeWithGlobalUniqueIDisItemSameOrDescendant in interface ITreeWithGlobalUniqueID<KEYTYPE,VALUETYPE,DefaultTreeItemWithID<KEYTYPE,VALUETYPE>>aParentItemID - The parent item ID to a validate.aChildItemID - The item ID to check whether it is a child of the passed parent
folder.true if the child item is the same or a child of the
parent item, false if one of the IDs could not be
resolved or they are not in a parent-child-relationship.public boolean containsItemWithID(@Nullable KEYTYPE aDataID)
ITreeWithGlobalUniqueIDcontainsItemWithID in interface ITreeWithGlobalUniqueID<KEYTYPE,VALUETYPE,DefaultTreeItemWithID<KEYTYPE,VALUETYPE>>aDataID - The ID of the tree item to search.true if such an item is present@Nullable public VALUETYPE getItemDataWithID(@Nullable KEYTYPE aDataID)
ITreeWithGlobalUniqueIDgetItemDataWithID in interface ITreeWithGlobalUniqueID<KEYTYPE,VALUETYPE,DefaultTreeItemWithID<KEYTYPE,VALUETYPE>>aDataID - The ID of the tree item to search.null if no such tree item exists.@Nonnull @ReturnsMutableCopy public Collection<VALUETYPE> getAllItemDatas()
getAllItemDatas in interface ITreeWithGlobalUniqueID<KEYTYPE,VALUETYPE,DefaultTreeItemWithID<KEYTYPE,VALUETYPE>>null collection of all item datas.@Nonnull public EChange removeItemWithID(@Nullable KEYTYPE aDataID)
ITreeWithGlobalUniqueIDremoveItemWithID in interface ITreeWithGlobalUniqueID<KEYTYPE,VALUETYPE,DefaultTreeItemWithID<KEYTYPE,VALUETYPE>>aDataID - The ID of the item to be removedEChange.CHANGED if the item was removed,
EChange.UNCHANGED otherwise. Never null.Copyright © 2014–2016 Philip Helger. All rights reserved.