K
- The Key objectV
- The value objectpublic class KeyValueNode<K,V> extends Object
Constructor and Description |
---|
KeyValueNode(K aKey,
V aValue)
Creates a tree node for a given key and value
|
Modifier and Type | Method and Description |
---|---|
void |
addChild(KeyValueNode<K,V> aNode)
Adds a child object to this node
|
void |
addChild(K aKey,
V aValue)
Adds child object to this node
|
KeyValueNode<K,V> |
getChild(K aKey)
Gets a child object for a given key.
|
List<KeyValueNode<K,V>> |
getChildren()
Returns all children of the node
|
K |
getKey()
Returns the key object
|
V |
getValue()
Returns the value object
|
boolean |
hasChild(K aKey)
Checks if this node has a child with a given key
|
boolean |
hasChildren()
Checks if this node has children
|
boolean |
isLeaf()
Checks if the node is a leaf node
|
void |
setChildren(List<KeyValueNode<K,V>> aChildren)
Set a list of children to this node
|
void |
setKey(K aKey)
Set a new key to this object
|
void |
setValue(V aValue)
Sets a new value for this object
|
public K getKey()
public void setKey(K aKey)
aKey
- the key.public V getValue()
public void setValue(V aValue)
aValue
- the value.public boolean hasChildren()
public KeyValueNode<K,V> getChild(K aKey)
aKey
- a key.public boolean hasChild(K aKey)
aKey
- a key.public void addChild(KeyValueNode<K,V> aNode)
aNode
- a node.public void addChild(K aKey, V aValue)
aKey
- a key.aValue
- a value.public List<KeyValueNode<K,V>> getChildren()
public void setChildren(List<KeyValueNode<K,V>> aChildren)
aChildren
- the list of children.public boolean isLeaf()
Copyright © 2007–2018 Ubiquitous Knowledge Processing (UKP) Lab, Technische Universität Darmstadt. All rights reserved.