be.ac.ua.broker.output.textual
Class PriceDescriptorNode

java.lang.Object
  extended by be.ac.ua.broker.output.textual.PriceDescriptorNode

public class PriceDescriptorNode
extends java.lang.Object

This class is used as a node in the price tree that is generated using the brokering results to represent a textual cost overview.

Author:
Vermeersch Kurt

Constructor Summary
PriceDescriptorNode(java.lang.String description)
          Constructor for PriceDescriptorNode
PriceDescriptorNode(java.lang.String description, double p)
          Constructor for PriceDescriptorNode
 
Method Summary
 void addChildren(java.util.List<PriceDescriptorNode> childs)
          Add the provided list of child nodes to the price tree node
 java.util.List<PriceDescriptorNode> getChildren()
           
 java.lang.String getDescription()
           
 java.lang.Double getPrice()
           
 boolean hasChildren()
           
 void setPrice(java.lang.Double p)
          Setter for the price associated with the price tree node
 void toFile(com.csvreader.CsvWriter csvWriter)
          Write the information of the price tree node to file using the provided CsvWriter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PriceDescriptorNode

public PriceDescriptorNode(java.lang.String description)
Constructor for PriceDescriptorNode

Parameters:
description - string description of the price tree node

PriceDescriptorNode

public PriceDescriptorNode(java.lang.String description,
                           double p)
Constructor for PriceDescriptorNode

Parameters:
description - string description of the price tree node
p - price associated with the price tree node
Method Detail

getChildren

public java.util.List<PriceDescriptorNode> getChildren()
Returns:
the children of the price tree node

addChildren

public void addChildren(java.util.List<PriceDescriptorNode> childs)
Add the provided list of child nodes to the price tree node

Parameters:
childs - list of children to add to the price tree node

getDescription

public java.lang.String getDescription()
Returns:
string description of the price tree node

getPrice

public java.lang.Double getPrice()
Returns:
price associated with the price tree node

setPrice

public void setPrice(java.lang.Double p)
Setter for the price associated with the price tree node

Parameters:
p - the price associated with the price tree node

hasChildren

public boolean hasChildren()
Returns:
whether the price tree node has children

toFile

public void toFile(com.csvreader.CsvWriter csvWriter)
Write the information of the price tree node to file using the provided CsvWriter. The information of the children is recursively written to file using the same writer. So, if this method is called for the root node of the price tree, the whole price overview will be written to file.

Parameters:
csvWriter - the writer to use to write the price tree node information to file