com.mypos.myposcheckout.ipc.response

 

Class ResponseNode<K,V>

ava.lang.Object com.mypos.myposcheckout.ipc.response.ResponseNode<K,V>
Type Parameters:
K - the type of the keys used for mapping the children
V - the type of the values for the nodes


public class ResponseNode<K,V>
extends java.lang.Object
Represents a leaf from a tree-like structure. Every leaf is identified by a key, and can have a value and/or children of leaves of this type. It's used to represent a map structure which could have other objects of the same kind as children.

 

Constructor Summary

Constructors
Constructor and Description
ResponseNode(K key, V value) 
ResponseNode(K key, V value, ResponseNode<K,V> parent) 

 

Method Summary

All MethodsInstance MethodsConcrete Methods
Modifier and Type Method and Description
void addChild(K key, V value) 
void addChild(ResponseNode<K,V> child) 
ResponseNode<K,V> getChild(K key) 
java.util.Map<K,ResponseNode<K,V>> getChildren() 
K getKey() 
V getValue() 
boolean hasChild(K key) 
boolean hasChildren() 
boolean hasParent() 
ResponseNode<K,V> removeChild(K key) 
void removeParent() 
void setKey(K key) 
void setParent(ResponseNode<K,V> parent) 
void setValue(V value) 
java.lang.String toString() 

 

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

 

Constructor Detail

ResponseNode

public ResponseNode(K key,
                    V value)

ResponseNode

public ResponseNode(K key,
                    V value,
                    ResponseNode<K,V> parent)

 

Method Detail

getChildren

public java.util.Map<K,ResponseNode<K,V>> getChildren()

setParent

public void setParent(ResponseNode<K,V> parent)

addChild

public void addChild(K key,
                     V value)

addChild

public void addChild(ResponseNode<K,V> child)

hasChild

public boolean hasChild(K key)

getChild

public ResponseNode<K,V> getChild(K key)

removeChild

public ResponseNode<K,V> removeChild(K key)

getKey

public K getKey()

setKey

public void setKey(K key)

getValue

public V getValue()

setValue

public void setValue(V value)

removeParent

public void removeParent()

hasParent

public boolean hasParent()

hasChildren

public boolean hasChildren()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object