BasicPart.java

package ProductConfig;
import java.io.PrintStream;

public abstract class BasicPart extends Part
{

BasicPart(String name, String description, double price)
{
        m_name = name;
        m_description = description;
        m_price = price;
        m_resourceList = new ResourceList();
}

public void setName(String name)
{
    m_name = name;
}

public void setDescription(String description)
{
    m_description = description;
}

public String getName()
{
    return m_name;
}

public String getDescription()
{
    return m_description;
}

public double getPrice()
{
    return m_price;
}

public void setPrice(double price)
{
    price = m_price;
}

public void displayInvoice(PrintStream str, int level)
{
    for (int i = 0; i < level; ++i)
    {
        str.print(" ");
    }

    str.println(this.toString());
}

public String toString()
{
    return m_name + ":" + m_description + ":" +
           Double.toString(getPrice());
}

public ResourceList getResourceList()
{
    return m_resourceList;
}

private ResourceList m_resourceList;
private String m_name;
private String m_description;
private double m_price;

}

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.147.103.8