public class AbstractFoods extends java.lang.Object implements java.io.Serializable
Mapwith the item number as key (a String) and the
Itemobject as value.
Mapwith the contact number as key (a String) and the
Contactobject as value.
Trxinstances each representing a posted sales transaction.
|Constructor and Description|
Construct a company having empty collections.
Construct a company having the passed collections.
|Modifier and Type||Method and Description|
Determine the contacts map of
Determine the inventory map of
Determine the transaction list of
Create a randomly chosen Abstract Foods Company.
Construct a string representation of
public AbstractFoods(java.util.Map<java.lang.String,Item> inventory, java.util.Map<java.lang.String,Contact> contacts, java.util.List<Trx> journal)
inventory- the inventory map
contacts- the contacts map
journal- the transaction list
public java.util.Map<java.lang.String,Item> getInventory()
public java.util.Map<java.lang.String,Contact> getContacts()
public java.util.List<Trx> getJournal()
public java.lang.String toString()
Abstract Foods Company".
public static AbstractFoods getRandom()
Item) mappings of which about 25% are for
Freshitems. The numbers, names, and prices are randomly chosen but the numbers are 8-character each. The contacts map consists of about 100 (contact number,
Contact) mappings of which 50% are
Clientand 50% are
Supplierinstances. The numbers, names, ratings (for clients), and catalogues (for suppliers) are randomly chosen but the numbers are formatted as 5-digit each. The journal list consists of about 750 posted
Trxtransactions spanning approximately 4 months (with the latest occurring in the past 48 hours).
In order to facilitate the testing of front-ends and reports that are
based on this randomly-chosen company, it is persisted (serialized) by
storing the returned instance on disk in the file
This method was added for pedagogical reasons.