Example #1
0
        public Dados Find(Dados obj)
        {
            Elemento aux = this.prim;

            while (aux != null)
            {
                if (aux.GetDados().Equals(obj))
                {
                    return(aux.GetDados());
                }
                aux = aux.Prox;
            }
            return(null);
        }
Example #2
0
        public Dados Find(int PID)
        {
            Elemento aux = this.prim.Prox;

            while (aux != null)
            {
                Processo auxpro = (Processo)aux.GetDados();
                if (auxpro.Equals(PID))
                {
                    return(aux.GetDados());
                }
                aux = aux.Prox;
            }
            return(null);
        }
Example #3
0
        private void CalcMenor()
        {
            Elemento next = this.prim.Prox;

            while (next != null)
            {
                Processo dd = (Processo)menor;
                if (dd == null)
                {
                    this.menor = next.GetDados();
                }
                else
                if (dd.CompareTTotalExecucao(next.GetDados()) == -1)
                {
                    this.menor = next.GetDados();
                }
                next = next.Prox;
            }
        }
Example #4
0
 public virtual Dados RemoveFirst()
 {
     if (this.prim.Prox != null)
     {
         Elemento aux  = this.prim.Prox;
         Elemento aux2 = aux;
         this.prim.Prox = aux.Prox;
         aux            = null;
         ElementDeleted();
         CalcMenor();
         Rebuild();
         return(aux2.GetDados());
     }
     else
     {
         return(null);
     }
 }
Example #5
0
        public virtual Dados Remover(Dados obj)
        {
            Elemento aux = this.prim;

            while (aux.Prox != null)
            {
                if (aux.Prox.GetDados().Equals(obj))
                {
                    Elemento aux2 = aux.Prox;
                    aux.Prox  = aux.Prox.Prox;
                    aux2.Prox = null;
                    ElementDeleted();
                    CalcMenor();
                    Rebuild();
                    return(aux2.GetDados());
                }
                aux = aux.Prox;
            }
            return(null);
        }