public class Supplier extends Contact implements java.io.Serializable
This class aggregates the catalog map via a regular aggregation, not a composition.
FIRST_NUMBER
Constructor and Description |
---|
Supplier(java.lang.String name,
java.lang.String address)
Construct a supplier having the indicated name and address, and assign a
unique number and an empty catalog of type
HashMap to
it. |
Supplier(java.lang.String name,
java.lang.String address,
java.util.Map<Item,java.lang.Double> catalog)
Construct a supplier having the indicated name, address, and catalog, and
assign a unique number to it.
|
Modifier and Type | Method and Description |
---|---|
java.util.Map<Item,java.lang.Double> |
getCatalog()
Determine the catalog
this supplier. |
void |
setCatalog(java.util.Map<Item,java.lang.Double> catalog)
Set the catalog of
this supplier to the passed one. |
compareTo, equals, getAddress, getLastContactNumber, getName, getNumber, hashCode, setAddress, setName, toString
public Supplier(java.lang.String name, java.lang.String address)
HashMap
to
it. Number assignment is handled by the superclass Contact
.name
- the name of the supplier.address
- the address of the supplier.java.lang.RuntimeException
- if either parameter is null.public Supplier(java.lang.String name, java.lang.String address, java.util.Map<Item,java.lang.Double> catalog)
name
- the name of the supplier.address
- the address of the supplier.catalog
- the catalog of the supplier. A map containing an Item
reference as key and its price as value.java.lang.RuntimeException
- if any of the parameters is null.public java.util.Map<Item,java.lang.Double> getCatalog()
this
supplier.this
supplier.public void setCatalog(java.util.Map<Item,java.lang.Double> catalog)
this
supplier to the passed one.catalog
- the catalog to mutate the state to.