Package com.helger.html.hc
Interface IHCHasChildrenMutable<IMPLTYPE extends IHCHasChildrenMutable<IMPLTYPE,CHILDTYPE>,CHILDTYPE extends IHCNode>
-
- Type Parameters:
IMPLTYPE- Implementation typeCHILDTYPE- Desired child type
- All Superinterfaces:
com.helger.commons.traits.IGenericImplTrait<IMPLTYPE>,com.helger.commons.hierarchy.IHasChildren<IHCNode>,com.helger.commons.hierarchy.IHasChildrenRecursive<IHCNode>,com.helger.commons.hierarchy.IHasChildrenSorted<IHCNode>,IHCNode,Serializable
- All Known Subinterfaces:
IHCA<IMPLTYPE>,IHCButton<IMPLTYPE>,IHCCanvas<IMPLTYPE>,IHCCell<IMPLTYPE>,IHCDefinitionItem<IMPLTYPE>,IHCDiv<IMPLTYPE>,IHCElementWithChildren<IMPLTYPE>,IHCElementWithInternalChildren<IMPLTYPE,CHILDTYPE>,IHCFooter<IMPLTYPE>,IHCForm<IMPLTYPE>,IHCIFrame<IMPLTYPE>,IHCLabel<IMPLTYPE>,IHCLI<IMPLTYPE>,IHCList<IMPLTYPE,ITEMTYPE>,IHCMediaElement<IMPLTYPE>,IHCMeter<IMPLTYPE>,IHCNav<IMPLTYPE>,IHCNodeList<IMPLTYPE>,IHCNodeWithChildren<IMPLTYPE>,IHCObject<IMPLTYPE>,IHCOL<IMPLTYPE>,IHCOLBase<IMPLTYPE,ITEMTYPE>,IHCPre<IMPLTYPE>,IHCProgress<IMPLTYPE>,IHCRubyChild<IMPLTYPE>,IHCSpan<IMPLTYPE>,IHCTablePart<IMPLTYPE>,IHCUL<IMPLTYPE>,IHCULBase<IMPLTYPE,ITEMTYPE>
- All Known Implementing Classes:
AbstractHCA,AbstractHCBlockQuote,AbstractHCButton,AbstractHCCanvas,AbstractHCCell,AbstractHCDefinitionItem,AbstractHCDiv,AbstractHCElementWithChildren,AbstractHCElementWithInternalChildren,AbstractHCFooter,AbstractHCForm,AbstractHCH1,AbstractHCH2,AbstractHCH3,AbstractHCH4,AbstractHCH5,AbstractHCH6,AbstractHCHasChildrenMutable,AbstractHCIFrame,AbstractHCLabel,AbstractHCLI,AbstractHCList,AbstractHCListLI,AbstractHCMediaElement,AbstractHCMeter,AbstractHCNav,AbstractHCNodeList,AbstractHCObject,AbstractHCOL,AbstractHCOLBase,AbstractHCPre,AbstractHCProgress,AbstractHCRubyChild,AbstractHCSpan,AbstractHCTablePart,AbstractHCUL,AbstractHCULBase,HCA,HCA_JS,HCA_MailTo,HCAbbr,HCAddress,HCArticle,HCAside,HCAudio,HCB,HCBDI,HCBDO,HCBlockQuote,HCBody,HCButton,HCButton_Reset,HCButton_Submit,HCCanvas,HCCaption,HCCenter,HCCite,HCCode,HCColGroup,HCData,HCDataList,HCDD,HCDel,HCDetails,HCDFN,HCDialog,HCDir,HCDiv,HCDL,HCDT,HCEM,HCFieldSet,HCFigCaption,HCFigure,HCFont,HCFooter,HCForm,HCFrameset,HCGenericElementWithChildren,HCH1,HCH2,HCH3,HCH4,HCH5,HCH6,HCHeader,HCHGroup,HCI,HCIFrame,HCIns,HCKBD,HCLabel,HCLegend,HCLI,HCLinkButton,HCMain,HCMap,HCMark,HCMenu,HCMenuItem,HCMeter,HCNav,HCNoBR,HCNodeList,HCNoScript,HCObject,HCOL,HCOptGroup,HCOption,HCOutput,HCP,HCPicture,HCPre,HCProgress,HCQ,HCRow,HCRP,HCRT,HCRuby,HCS,HCSamp,HCSection,HCSlot,HCSmall,HCSpan,HCStrong,HCSub,HCSummary,HCSup,HCTBody,HCTD,HCTFoot,HCTH,HCTHead,HCTime,HCU,HCUL,HCVar,HCVideo
public interface IHCHasChildrenMutable<IMPLTYPE extends IHCHasChildrenMutable<IMPLTYPE,CHILDTYPE>,CHILDTYPE extends IHCNode> extends IHCNode, com.helger.commons.traits.IGenericImplTrait<IMPLTYPE>
Base interface for HC nodes that have mutable children.- Author:
- Philip Helger
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description default <V extends CHILDTYPE>
VaddAndReturnChild(V aChild)default <V extends CHILDTYPE>
VaddAndReturnChildAt(int nIndex, V aChild)IMPLTYPEaddChild(CHILDTYPE aNode)Add a new child.IMPLTYPEaddChildAt(int nIndex, CHILDTYPE aNode)default IMPLTYPEaddChildren(CHILDTYPE aChild)Deprecated.default IMPLTYPEaddChildren(CHILDTYPE... aChildren)default IMPLTYPEaddChildren(Iterable<? extends CHILDTYPE> aChildren)default IMPLTYPEaddChildrenAt(int nIndex, CHILDTYPE... aChildren)default IMPLTYPEaddChildrenAt(int nIndex, Iterable<? extends CHILDTYPE> aChildren)IHCNodeList<?>getAllChildrenAsNodeList()IMPLTYPEremoveAllChildren()Remove all children of this object.IMPLTYPEremoveChild(CHILDTYPE aNode)Remove the passed direct child object.IMPLTYPEremoveChildAt(int nIndex)Remove the child at the specified index.default IMPLTYPEsetChild(CHILDTYPE aNode)Remove all existing children and only set the new child.IMPLTYPEsortAllChildren(Comparator<? super CHILDTYPE> aComparator)Sort all children with the passed comparator-
Methods inherited from interface com.helger.commons.hierarchy.IHasChildren
forAllChildren, forAllChildren, forAllChildrenBreakable, forAllChildrenMapped, getChildCount, getChildren, hasChildren, hasNoChildren
-
Methods inherited from interface com.helger.commons.hierarchy.IHasChildrenRecursive
forAllChildrenRecursive, forAllChildrenRecursive
-
Methods inherited from interface com.helger.commons.hierarchy.IHasChildrenSorted
findFirstChild, findFirstChildMapped, getAllChildren, getChildAtIndex, getFirstChild, getLastChild
-
Methods inherited from interface com.helger.html.hc.IHCNode
canConvertToMicroNode, consistencyCheck, convertToMicroNode, customizeNode, finalizeNodeState, getNodeState, getPlainText, registerExternalResources
-
-
-
-
Method Detail
-
addChild
@Nonnull IMPLTYPE addChild(@Nullable CHILDTYPE aNode)
Add a new child.- Parameters:
aNode- Child to add. May benullin which case nothing happens.- Returns:
- this
-
setChild
@Nonnull default IMPLTYPE setChild(@Nullable CHILDTYPE aNode)
Remove all existing children and only set the new child.- Parameters:
aNode- Child to add. May benullin which case the elements stays empty.- Returns:
- this
-
addChildAt
@Nonnull IMPLTYPE addChildAt(@Nonnegative int nIndex, @Nullable CHILDTYPE aNode)
- Parameters:
nIndex- The index to where the element should be inserted.aNode- Child to add. May benullin which case nothing happens.- Returns:
- this
-
addChildren
@Deprecated(forRemoval=false) @DevelopersNote("Use addChild instead") default IMPLTYPE addChildren(@Nullable CHILDTYPE aChild)
Deprecated.UseaddChild(IHCNode)instead.- Parameters:
aChild- The child to add. May benullin which case nothing happens.- Returns:
- this
-
addChildren
@Nonnull default IMPLTYPE addChildren(@Nullable CHILDTYPE... aChildren)
- Parameters:
aChildren- Children to add. May benullin which case nothing happens.- Returns:
- this
-
addChildrenAt
@Nonnull default IMPLTYPE addChildrenAt(@Nonnegative int nIndex, @Nullable CHILDTYPE... aChildren)
- Parameters:
nIndex- The index to where the elements should be inserted.aChildren- Children to add. May benullin which case nothing happens.- Returns:
- this
-
addChildren
@Nonnull default IMPLTYPE addChildren(@Nullable Iterable<? extends CHILDTYPE> aChildren)
- Parameters:
aChildren- Children to add. May benullin which case nothing happens.- Returns:
- this
-
addChildrenAt
@Nonnull default IMPLTYPE addChildrenAt(@Nonnegative int nIndex, @Nullable Iterable<? extends CHILDTYPE> aChildren)
- Parameters:
nIndex- The index to where the elements should be inserted.aChildren- Children to add. May benullin which case nothing happens.- Returns:
- this
-
addAndReturnChild
@Nullable @CheckReturnValue default <V extends CHILDTYPE> V addAndReturnChild(@Nullable V aChild)
- Type Parameters:
V- The type to add. Needs to be a IHCNode or a sub class.- Parameters:
aChild- Child to add. May benullin which case nothing happens.- Returns:
- the added child. May be
null.
-
addAndReturnChildAt
@Nullable @CheckReturnValue default <V extends CHILDTYPE> V addAndReturnChildAt(@Nonnegative int nIndex, @Nullable V aChild)
- Type Parameters:
V- The type to add. Needs to be a IHCNode or a sub class.- Parameters:
nIndex- The index where the element should be added. Always ≥ 0.aChild- Child to add. May benullin which case nothing happens.- Returns:
- the added child. May be
null.
-
removeChildAt
@Nonnull IMPLTYPE removeChildAt(@Nonnegative int nIndex)
Remove the child at the specified index.- Parameters:
nIndex- The index to use. Must be ≥ 0.- Returns:
- this for chaining
-
removeChild
@Nonnull IMPLTYPE removeChild(@Nullable CHILDTYPE aNode)
Remove the passed direct child object.- Parameters:
aNode- The node to be removed. May benullin which case nothing happens.- Returns:
- this for chaining
-
removeAllChildren
@Nonnull IMPLTYPE removeAllChildren()
Remove all children of this object.- Returns:
- this for chaining
-
sortAllChildren
@Nonnull IMPLTYPE sortAllChildren(@Nonnull Comparator<? super CHILDTYPE> aComparator)
Sort all children with the passed comparator- Parameters:
aComparator- The comparator to be used. May not benull.- Returns:
- this for chaining
-
getAllChildrenAsNodeList
@Nonnull IHCNodeList<?> getAllChildrenAsNodeList()
- Returns:
- A new node list with all contained children. Never
nullbut maybe empty.
-
-