Beispiel #1
0
        /// <summary>
        /// Search for given barcodes in a <code>Queue<string></code>
        /// and return the corresponding Product object
        /// </summary>
        /// <param name="inputs"><code>Queue<string></code> of barcodes to search</param>
        /// <returns>LinkedList<Product></returns>
        public LinkedList <Product> search(Queue <string> inputs)
        {
            LinkedList <Product> products = new LinkedList <Product>();

            foreach (string barcode in inputs)
            {
                Barcode b = parser.parse(barcode);
                switch (b.BType())
                {
                case BarcodeEnum.KIT:
                    products.AddLast(KitProduct((BKit)b));
                    break;

                default:
                    break;
                }
            }
            return(products);
        }