Package com.helger.tree.withid
Interface ITreeItemWithIDFactory<KEYTYPE,DATATYPE,ITEMTYPE extends ITreeItemWithID<KEYTYPE,DATATYPE,ITEMTYPE>>
-
- Type Parameters:
KEYTYPE- The key type.DATATYPE- The value type to be contained in tree items.ITEMTYPE- tree item type
- All Known Subinterfaces:
IFolderTreeItemFactory<KEYTYPE,DATATYPE,COLLTYPE,ITEMTYPE>,ITreeItemWithUniqueIDFactory<KEYTYPE,DATATYPE,ITEMTYPE>
- All Known Implementing Classes:
AbstractFolderTreeItemFactory,AbstractTreeItemWithIDFactory,AbstractTreeItemWithUniqueIDFactory,DefaultFolderTreeItemFactory,DefaultTreeItemWithIDFactory,DefaultTreeItemWithUniqueIDFactory
public interface ITreeItemWithIDFactory<KEYTYPE,DATATYPE,ITEMTYPE extends ITreeItemWithID<KEYTYPE,DATATYPE,ITEMTYPE>>A factory interface that creates tree items.- Author:
- Philip Helger
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ITEMTYPEcreate(ITEMTYPE aParent, KEYTYPE aDataID)Create a child entry.ITEMTYPEcreateRoot()Create a root entry.voidonAddItem(ITEMTYPE aItem)To be called once a tree item is added to the owning tree.voidonRemoveItem(ITEMTYPE aItem)To be called once a tree item is removed from the owning tree.
-
-
-
Method Detail
-
createRoot
@Nonnull ITEMTYPE createRoot()
Create a root entry.- Returns:
- New root entry. May not be
null.
-
create
ITEMTYPE create(@Nonnull ITEMTYPE aParent, @Nonnull KEYTYPE aDataID)
Create a child entry.- Parameters:
aParent- The parent entry to use. May not benull.aDataID- The data ID of the new element- Returns:
- The created non-root entry. May not be
null.
-
onRemoveItem
void onRemoveItem(@Nonnull ITEMTYPE aItem)
To be called once a tree item is removed from the owning tree. This method is mainly important for the tree with globally unique IDs.- Parameters:
aItem- The item that was removed.
-
-