Beispiel #1
0
 public void Torol(T elem)
 {
     if (elso != null)
     {
         LancoltListaElem <T> jelenlegi = elso;
         while (jelenlegi != null && jelenlegi.Adat.CompareTo(elem) != 0) //Equals [bool]
         {
             jelenlegi = jelenlegi.Kovetkezo;
         }
         if (jelenlegi != null)
         {
             if (jelenlegi.Elozo == null)
             {
                 elso = jelenlegi.Kovetkezo;
                 if (elso != null)
                 {
                     elso.Elozo = null;
                 }
             }
             else if (jelenlegi.Kovetkezo != null)
             {
                 jelenlegi.Kovetkezo.Elozo = jelenlegi.Elozo;
                 jelenlegi.Elozo.Kovetkezo = jelenlegi.Kovetkezo;
             }
             else if (jelenlegi.Kovetkezo == null)
             {
                 jelenlegi.Elozo.Kovetkezo = null;
                 utolso = jelenlegi.Elozo;
             }
         }
     }
 }
Beispiel #2
0
 public void Beszur(T elem)
 {
     if (elso == null)
     {
         elso   = new LancoltListaElem <T>(elem);
         utolso = elso;
     }
     else
     {
         LancoltListaElem <T> jelenlegi = elso;
         while (jelenlegi.Kovetkezo != null && jelenlegi.Adat.CompareTo(elem) == -1)
         {
             jelenlegi = jelenlegi.Kovetkezo;
         }
         if (jelenlegi.Adat.CompareTo(elem) == 1)
         {
             jelenlegi.Elozo           = new LancoltListaElem <T>(elem);
             jelenlegi.Elozo.Kovetkezo = jelenlegi;
             elso = jelenlegi.Elozo;
             if (jelenlegi.Kovetkezo == null)
             {
                 utolso = jelenlegi;
             }
         }
         else
         {
             jelenlegi.Kovetkezo = new LancoltListaElem <T>(elem, jelenlegi);
             utolso = jelenlegi.Kovetkezo;
         }
     }
 }
Beispiel #3
0
 public bool Kereses(T elem)
 {
     if (elso != null)
     {
         LancoltListaElem <T> jelenlegi = elso;
         while (jelenlegi != null && jelenlegi.Adat.CompareTo(elem) != 0) //Equals [bool]
         {
             jelenlegi = jelenlegi.Kovetkezo;
         }
         return(jelenlegi != null);
     }
     return(false);
 }
 public bool MoveNext()
 {
     //throw new NotImplementedException();
     if (lepteto == null && elso != null)
     {
         lepteto = elso;
         return(true);
     }
     else if (elso != null && lepteto.Kovetkezo != null)
     {
         lepteto = lepteto.Kovetkezo;
         return(true);
     }
     return(false);
 }
 public void Reset()
 {
     //throw new NotImplementedException();
     lepteto = null;
 }
 public void Dispose()
 {
     //throw new NotImplementedException();
     elso    = null;
     lepteto = null;
 }
 public LancoltListaBejaro(LancoltListaElem <T> lista)
 {
     elso = lista;
 }
Beispiel #8
0
 public LancoltListaElem(T _adat, LancoltListaElem <T> _elozo = null)
 {
     Adat  = _adat;
     Elozo = _elozo;
 }