public abstract class AbstractAssetNode<N extends AssetNode<N> & ConfigurableNode<N>> extends Object implements AssetNode<N>, ConfigurableNode<N>
Modifier and Type | Field and Description |
---|---|
protected ArrayList<N> |
children |
protected com.fatwire.assetapi.data.AssetId |
id |
protected N |
parent |
Constructor and Description |
---|
AbstractAssetNode(com.fatwire.assetapi.data.AssetId assetId) |
Modifier and Type | Method and Description |
---|---|
void |
addChild(N node)
Add a child at the end of this node's list of children.
|
boolean |
equals(Object o) |
List<N> |
getChildren()
Return this node's children, if any, in ranked order
|
com.fatwire.assetapi.data.AssetId |
getId() |
N |
getParent()
Get the parent node
|
List<N> |
getSiblings()
Get the siblings of this node.
|
int |
hashCode() |
boolean |
removeChild(N child)
Breaks the relationship between this node and the specified child, meaning:
- This node is not the parent of the specified child anymore.
|
void |
removeChildren()
Breaks the relationship between this node and all of its children, meaning:
- This node is not the parent of any of its children anymore.
|
void |
setParent(N parent)
Can only be called once per instance.
|
protected com.fatwire.assetapi.data.AssetId id
protected N extends AssetNode<N> & ConfigurableNode<N> parent
public AbstractAssetNode(com.fatwire.assetapi.data.AssetId assetId)
public com.fatwire.assetapi.data.AssetId getId()
public void addChild(N node)
ConfigurableNode
addChild
in interface ConfigurableNode<N extends AssetNode<N> & ConfigurableNode<N>>
public void setParent(N parent)
ConfigurableNode
setParent
in interface ConfigurableNode<N extends AssetNode<N> & ConfigurableNode<N>>
public void removeChildren()
ConfigurableNode
removeChildren
in interface ConfigurableNode<N extends AssetNode<N> & ConfigurableNode<N>>
public boolean removeChild(N child)
ConfigurableNode
removeChild
in interface ConfigurableNode<N extends AssetNode<N> & ConfigurableNode<N>>
child
- The child node we want to removepublic List<N> getSiblings()
Node
getSiblings
in interface Node<N extends AssetNode<N> & ConfigurableNode<N>>
public List<N> getChildren()
Node
getChildren
in interface Node<N extends AssetNode<N> & ConfigurableNode<N>>
Copyright © 2010–2017. All rights reserved.