collections.hashset
Class Cart

java.lang.Object
  extended by collections.hashset.Cart

public class Cart
extends java.lang.Object

Demonstrates adding Product objects that already exist in a HashSet. The test for existence is based on the hashCode and equals methods implemented in the Product class.

Author:
Thomas Rowland

Constructor Summary
Cart()
           
 
Method Summary
 void addProduct(Product product)
           
static void main(java.lang.String[] args)
           
 void removeProduct(Product product)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Cart

public Cart()
Method Detail

main

public static void main(java.lang.String[] args)

addProduct

public void addProduct(Product product)

removeProduct

public void removeProduct(Product product)