/// <summary> /// /// </summary> /// <param name="sentido"></param> private void inicializarLivro(int sentido) { sentidos[sentido] = new LivroPorSentido(); sentidos[sentido].porOferta = new SortedDictionary <string, LivroOfertasEntry>(); if (sentido == LIVRO_COMPRA) { sentidos[sentido].porPreco = new SortedDictionary <Decimal, SortedSet <string> >(new ComparadorPrecoCompra()); } else if (sentido == LIVRO_VENDA) { sentidos[sentido].porPreco = new SortedDictionary <Decimal, SortedSet <string> >(); } //sentidos[sentido].qtdPorOferta = new HashMap<string, string>(); }
public void recarregar(int sentidoOferta, string idOferta, LivroOfertasEntry dadosOferta) { LivroPorSentido livroDoSentido = sentidos[sentidoOferta]; livroDoSentido.porOferta.Put(idOferta, dadosOferta); Decimal precoOferta = dadosOferta.Preco; SortedSet <string> ofertasDoPreco = livroDoSentido.porPreco[precoOferta]; if (ofertasDoPreco == null) { ofertasDoPreco = new SortedSet <string>(); } ofertasDoPreco.Add(idOferta); livroDoSentido.porPreco.Put(precoOferta, ofertasDoPreco); return; }