Example #1
0
        public override string ToString()
        {
            string cad;

            if (Tipo.IsMap())
            {
                cad = "[";
                foreach (CollectionValue value in Valores)
                {
                    cad += value.Clave.ToString() + " : " + value.Valor.ToString();

                    if (!Valores.Last.Value.Equals(value))
                    {
                        cad += ", ";
                    }
                }
                cad += "]";
                return(cad);
            }
            else if (Tipo.IsList())
            {
                cad = "[";
                foreach (CollectionValue value in Valores)
                {
                    cad += value.Valor.ToString();
                    if (!Valores.Last.Value.Equals(value))
                    {
                        cad += ", ";
                    }
                }
                cad += "]";
                return(cad);
            }
            else if (Tipo.IsSet())
            {
                cad = "{";
                foreach (CollectionValue value in Valores)
                {
                    cad += value.Valor.ToString();
                    if (!Valores.Last.Value.Equals(value))
                    {
                        cad += ", ";
                    }
                }
                cad += "}";
                return(cad);
            }
            return(base.ToString());
        }
Example #2
0
 public bool EqualsCollection(Tipo t)
 {
     if (IsMap() && t.IsMap())
     {
         return(true);
     }
     else if (IsList() && t.IsList())
     {
         return(true);
     }
     else if (IsSet() && t.IsSet())
     {
         return(true);
     }
     return(false);
 }