Пример #1
0
        // indexelés

        public T this[int index]
        {
            get
            {
                if (index >= 0)
                {
                    Programok aktualis = fej;
                    int       db       = 0;
                    while (db < index && aktualis != null)
                    {
                        aktualis = aktualis.kovezetkezo;
                        db++;
                    }
                    if (aktualis != null)
                    {
                        return(aktualis.adat);
                    }
                    else
                    {
                        throw new IndexOutOfRangeException();
                    }
                }
                else
                {
                    throw new IndexOutOfRangeException();
                }
            }
            set { /* set the specified index to value here */ }
        }
Пример #2
0
 public bool MoveNext()
 {
     if (aktualis == null)
     {
         if (fej != null)
         {
             aktualis = fej;
             return(true);
         }
         else
         {
             return(false);
         }
     }
     else
     {
         if (aktualis.kovezetkezo != null)
         {
             aktualis = aktualis.kovezetkezo;
             return(true);
         }
         else
         {
             return(false);
         }
     }
 }
Пример #3
0
        public void BeszurElejere(T ertek)
        {
            Programok ujElem = new Programok();

            ujElem.adat        = ertek;
            ujElem.kovezetkezo = fej;
            fej = ujElem;
        }
Пример #4
0
        // bejárhatóvá tétel OK

        // elvégzi minden listaelemre a paraméterként átadott műveletet OK
        public void Bejar(Action <T> muvelet)
        {
            Programok aktualis = fej;

            while (aktualis != null)
            {
                muvelet?.Invoke(aktualis.adat);
                aktualis = aktualis.kovezetkezo;
            }
        }
Пример #5
0
 public LancoltListaBejaro(Programok fej)
 {
     this.fej = fej;
 }