public class Product extends Object
Constructor and Description |
---|
Product()
Create a new product.
|
Product(String name,
double price)
Create a new product.
|
Product(String name,
double price,
Part[] parts)
Create a new product.
|
Modifier and Type | Method and Description |
---|---|
void |
addPart(Part part)
Add a part.
|
boolean |
equals(Object obj)
Test if an object is equal to this object.
|
String |
getName()
Get the name.
|
List |
getParts()
Get the parts.
|
double |
getPrice()
Get the price.
|
int |
hashCode()
Get the hash code.
|
void |
setName(String name)
Set the name.
|
void |
setParts(List parts)
Set the parts.
|
void |
setPrice(double price)
Set the price.
|
String |
toString()
Get the string representation.
|
public Product()
public Product(String name, double price)
public String getName()
public void setName(String name)
name
- The name to set.public double getPrice()
public void setPrice(double price)
price
- The price to set.public void addPart(Part part)
part
- The part.public List getParts()
public void setParts(List parts)
parts
- The parts to set.public int hashCode()
public boolean equals(Object obj)
Copyright © 2012. All Rights Reserved.