Esempio n. 1
0
 public void iteratorNext()
 {
     if (iterator.nextElement == null)
     {
         iterator = first;
     }
     else
     {
         iterator = iterator.nextElement;
     }
 }
Esempio n. 2
0
 public void addElement(OperationListElement element)
 {
     if (first == null)
     {
         first = element;
         last  = first;
     }
     else
     {
         last.nextElement        = element;
         element.previousElement = last;
         last = element;
     }
 }
Esempio n. 3
0
        public void removeElement(OperationListElement element)
        {
            if (first == element)
            {
                element.operation.stop();

                if (first.nextElement == null)
                {
                    first = null;
                    last  = null;
                    return;
                }

                first.nextElement.previousElement = null;
                first = first.nextElement;

                return;
            }

            OperationListElement iterator = first;

            while (iterator.nextElement != null)
            {
                iterator = iterator.nextElement;

                if (iterator == element)
                {
                    iterator.operation.stop();

                    if (iterator.nextElement == null)
                    {
                        last = iterator.previousElement;
                        iterator.previousElement.nextElement = null;
                        return;
                    }

                    iterator.nextElement.previousElement = iterator.previousElement;
                    iterator.previousElement.nextElement = iterator.nextElement;

                    return;
                }
            }
        }
Esempio n. 4
0
 public OperationList()
 {
     first = null;
     last  = null;
 }
Esempio n. 5
0
 public void iteratorToStart()
 {
     iterator = first;
 }