Пример #1
0
        /*public Boolean validandoTipo(String tipo1, String tipo2, itemValor valor2)
         * {
         *  //aquí también hay que verificar las dimensiones
         *
         *
         *  //if (tipo1.Equals(tipo2) || tipo2.Equals("nulo"))
         *  itemValor tempIt = new itemValor();
         *  String tipoDato1 = tempIt.getTipoApartirDeString(tipo1);
         *
         *  if (tipoDato1.Equals("objeto") && valor2.isTypeObjeto())
         *  //validando que sean los mismos tipos
         *  {
         *      if (tipo1.Equals(valor2.nombreObjeto))
         *      {
         *          return true;
         *      }
         *      else
         *      {
         *          return false;
         *      }
         *  }
         *  else if (tipoDato1.Equals(tipo2) || tipo2.Equals("nulo"))
         *  {
         *      return true;
         *  }
         *  else
         *  {
         *      return false;
         *  }
         *
         * }*/

        public static Boolean validandoTipo(String tipo1, itemValor valor2)
        {
            //aquí también hay que verificar las dimensiones


            //if (tipo1.Equals(tipo2) || tipo2.Equals("nulo"))
            itemValor tempIt    = new itemValor();
            String    tipoDato1 = tempIt.getTipoApartirDeString(tipo1);

            if (valor2.getTipo().Equals("nulo"))
            {
                return(true);
            }
            else if (tipoDato1.Equals("objeto") && valor2.isTypeObjeto())
            //validando que sean los mismos tipos
            {
                if (tipo1.Equals(valor2.nombreObjeto))
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }

            else if (tipoDato1.Equals(valor2.getTipo()) || valor2.getTipo().Equals("nulo"))
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }