import java.util.Hashtable; // Java lookup mechanism based on key public class Stock { public String SYM; // primary key public double PRICE; // public visiblity: same as record struct public Heap buyheap = new Heap(true); public Heap sellheap = new Heap(false); public static Hashtable stocks = new Hashtable(); // find stock keyed on SYM // static: just one hashtable public Stock(String SYM, double PRICE) { this.SYM = SYM; this.PRICE = PRICE; stocks.put(SYM,this); // put itself into the hastable using primary key } public String toString() { return (SYM + " " + PRICE); } }