Esempio n. 1
0
 public void RecorreArbolInOrdenTuits(Nodo nodo, XmlWriter writer)
 {
     if (nodo != null)
     {
         if (nodo.getIzquierda() != null)
         {
             RecorreArbolInOrdenTuits(nodo.getIzquierda(), writer);
         }
         if (nodo.getUsuario() != null)
         {
             NodoDoblementeEnlazado tuitNodo = nodo.getUsuario().tweets_muro.primero;
             while (tuitNodo != null)
             {
                 if (tuitNodo != null && tuitNodo.tweet != null && tuitNodo.tweet.usuario.nickname == nodo.getUsuario().nickname)
                 {
                     writer.WriteStartElement("DATA_RECORD");
                     writer.WriteElementString("NICK_NAME", tuitNodo.tweet.usuario.nickname);
                     writer.WriteElementString("TUIT", tuitNodo.tweet.contenido);
                     writer.WriteElementString("FECHA_HORA", String.Format("{0:yyyy/MM/dd HH:mm:ss}", tuitNodo.tweet.fechaHora));
                     writer.WriteEndElement();
                 }
                 tuitNodo = tuitNodo.siguiente;
             }
         }
         if (nodo.getDerecha() != null)
         {
             RecorreArbolInOrdenTuits(nodo.getDerecha(), writer);
         }
     }
 }
Esempio n. 2
0
        public int cantidadTweets()
        {
            int cantidad = 0;
            NodoDoblementeEnlazado nodo = tweets_muro.primero;

            while (nodo != null)
            {
                if (nodo.tweet.usuario.nickname == this.nickname)
                {
                    cantidad++;
                }
                nodo = nodo.siguiente;
            }
            return(cantidad);
        }