Package com.helger.tree.withid.folder
Class AbstractFolderTreeItemFactory<KEYTYPE,DATATYPE,COLLTYPE extends Collection<DATATYPE>,ITEMTYPE extends BasicFolderTreeItem<KEYTYPE,DATATYPE,COLLTYPE,ITEMTYPE>>
- java.lang.Object
-
- com.helger.tree.withid.unique.AbstractTreeItemWithUniqueIDFactory<KEYTYPE,COLLTYPE,ITEMTYPE>
-
- com.helger.tree.withid.folder.AbstractFolderTreeItemFactory<KEYTYPE,DATATYPE,COLLTYPE,ITEMTYPE>
-
- Type Parameters:
KEYTYPE- Key typeDATATYPE- Value typeCOLLTYPE- Collection type consisting of value elementsITEMTYPE- the implementation item type
- All Implemented Interfaces:
IFolderTreeItemFactory<KEYTYPE,DATATYPE,COLLTYPE,ITEMTYPE>,ITreeItemWithIDFactory<KEYTYPE,COLLTYPE,ITEMTYPE>,ITreeItemWithUniqueIDFactory<KEYTYPE,COLLTYPE,ITEMTYPE>
- Direct Known Subclasses:
DefaultFolderTreeItemFactory
@NotThreadSafe public abstract class AbstractFolderTreeItemFactory<KEYTYPE,DATATYPE,COLLTYPE extends Collection<DATATYPE>,ITEMTYPE extends BasicFolderTreeItem<KEYTYPE,DATATYPE,COLLTYPE,ITEMTYPE>> extends AbstractTreeItemWithUniqueIDFactory<KEYTYPE,COLLTYPE,ITEMTYPE> implements IFolderTreeItemFactory<KEYTYPE,DATATYPE,COLLTYPE,ITEMTYPE>
The default folder tree item factory implementation.- Author:
- Philip Helger
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractFolderTreeItemFactory(com.helger.commons.aggregate.IAggregator<KEYTYPE,KEYTYPE> aKeyCombinator)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description ITEMTYPEcreateRoot()Create a root entry.booleanequals(Object o)com.helger.commons.aggregate.IAggregator<KEYTYPE,KEYTYPE>getKeyCombinator()inthashCode()protected abstract ITEMTYPEinternalCreateRoot()protected KEYTYPEinternalGetItemID(ITEMTYPE aItem)Get the ID of the passed tree item to use for internal storage.StringtoString()-
Methods inherited from class com.helger.tree.withid.unique.AbstractTreeItemWithUniqueIDFactory
addToItemStore, containsItemWithDataID, create, getAllItemDatas, getAllItems, getItemCount, getItemOfDataID, internalCreate, onAddItem, onRemoveItem
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.helger.tree.withid.ITreeItemWithIDFactory
create, onAddItem, onRemoveItem
-
Methods inherited from interface com.helger.tree.withid.unique.ITreeItemWithUniqueIDFactory
containsItemWithDataID, getAllItemDatas, getAllItems, getItemCount, getItemOfDataID
-
-
-
-
Method Detail
-
internalGetItemID
@Nonnull protected final KEYTYPE internalGetItemID(@Nonnull ITEMTYPE aItem)
Description copied from class:AbstractTreeItemWithUniqueIDFactoryGet the ID of the passed tree item to use for internal storage.- Overrides:
internalGetItemIDin classAbstractTreeItemWithUniqueIDFactory<KEYTYPE,COLLTYPE extends Collection<DATATYPE>,ITEMTYPE extends BasicFolderTreeItem<KEYTYPE,DATATYPE,COLLTYPE,ITEMTYPE>>- Parameters:
aItem- The item who's ID is to be resolved.- Returns:
- The ID of the item
-
getKeyCombinator
@Nullable public final com.helger.commons.aggregate.IAggregator<KEYTYPE,KEYTYPE> getKeyCombinator()
- Specified by:
getKeyCombinatorin interfaceIFolderTreeItemFactory<KEYTYPE,DATATYPE,COLLTYPE extends Collection<DATATYPE>,ITEMTYPE extends BasicFolderTreeItem<KEYTYPE,DATATYPE,COLLTYPE,ITEMTYPE>>- Returns:
- The key combinator to be used to create global unique IDs.
-
createRoot
@Nonnull public final ITEMTYPE createRoot()
Description copied from interface:ITreeItemWithIDFactoryCreate a root entry.- Specified by:
createRootin interfaceITreeItemWithIDFactory<KEYTYPE,DATATYPE,COLLTYPE extends Collection<DATATYPE>>- Returns:
- New root entry. May not be
null.
-
equals
public boolean equals(Object o)
- Overrides:
equalsin classAbstractTreeItemWithUniqueIDFactory<KEYTYPE,COLLTYPE extends Collection<DATATYPE>,ITEMTYPE extends BasicFolderTreeItem<KEYTYPE,DATATYPE,COLLTYPE,ITEMTYPE>>
-
hashCode
public int hashCode()
- Overrides:
hashCodein classAbstractTreeItemWithUniqueIDFactory<KEYTYPE,COLLTYPE extends Collection<DATATYPE>,ITEMTYPE extends BasicFolderTreeItem<KEYTYPE,DATATYPE,COLLTYPE,ITEMTYPE>>
-
toString
public String toString()
- Overrides:
toStringin classAbstractTreeItemWithUniqueIDFactory<KEYTYPE,COLLTYPE extends Collection<DATATYPE>,ITEMTYPE extends BasicFolderTreeItem<KEYTYPE,DATATYPE,COLLTYPE,ITEMTYPE>>
-
-