Ejemplo n.º 1
0
        public int CompararCom(IComparavel comparavel)
        {
            var other = comparavel as Aluno;

            if (Nota < other.Nota)
            {
                return(-1);
            }
            return(Nota > other.Nota ? 1 : 0);
        }
Ejemplo n.º 2
0
        public int CompararCom(IComparavel comparavel)
        {
            var other = comparavel as Automovel;

            if (VelocidadeMaxima < other.VelocidadeMaxima)
            {
                return(-1);
            }
            return(VelocidadeMaxima > other.VelocidadeMaxima ? 1 : 0);
        }
Ejemplo n.º 3
0
        public int CompararCom(IComparavel obj)
        {
            Pessoa pj = (Pessoa)obj;

            if (this.GetDocumento() > pj.GetDocumento())
            {
                return(1);
            }
            else if (this.GetDocumento() < pj.GetDocumento())
            {
                return(-1);
            }
            else
            {
                return(0);
            }
        }