Exemplo n.º 1
0
        private static void criafila(String tipo)
        {
            int tam = int.Parse(pedeDados("o tamanho"));

            if (tipo == "String")
            {
                if (!fcNomesExist)
                {
                    fcNomesExist = true;
                    fcNomes      = new FilaCircular <String>(tam);
                    return;
                }
            }
            if (tipo == "Integer")
            {
                if (!fcIntegerExist)
                {
                    fcIntegerExist = true;
                    fcInteger      = new FilaCircular <int>(tam);
                    return;
                }
            }
            if (tipo == "Montadoras")
            {
                if (!fcMontadorasExist)
                {
                    fcMontadorasExist = true;
                    fcMontadoras      = new FilaCircular <Montadoras>(tam);
                    return;
                }
            }
            Console.WriteLine("Fila ja existe não pode ser criada novamente");
        }
Exemplo n.º 2
0
        private static void destroiFila(String tipo)
        {
            if (tipo == "String")
            {
                if (fcNomesExist)
                {
                    if (fcNomes.getQtdEmelento() == 0)
                    {
                        fcNomes      = null;
                        fcNomesExist = false;
                        return;
                    }
                    else
                    {
                        Console.WriteLine("fila não esta vazia");
                        return;
                    }
                }
            }

            if (tipo == "Integer")
            {
                if (fcIntegerExist)
                {
                    if (fcInteger.getQtdEmelento() == 0)
                    {
                        fcInteger      = null;
                        fcIntegerExist = false;
                        return;
                    }
                    else
                    {
                        Console.WriteLine("fila não esta vazia");
                        return;
                    }
                }
            }
            if (tipo == "Montadoras")
            {
                if (fcMontadorasExist)
                {
                    if (fcMontadoras.getQtdEmelento() == 0)
                    {
                        fcMontadoras      = null;
                        fcMontadorasExist = false;
                        return;
                    }
                    else
                    {
                        Console.WriteLine("Fila não esta vazia");
                        return;
                    }
                }
            }
            Console.WriteLine("fila não existe");
        }