Exemple #1
0
        public void removeByStart(int i)
        {
            process tmp  = findByStart(i);
            process tmp2 = tmp.get_next().get_next();

            tmp.set_next(tmp2);
        }
Exemple #2
0
        public void removeByName(string name)
        {
            process tmp = head;

            if (size() == 1)
            {
                head = null;
                return;
            }
            else if (tmp.get_processName() == name)
            {
                head = tmp.get_next();
                return;
            }
            else
            {
                tmp = tmp.get_next();
                while (tmp.get_processName() != name && tmp.get_next() != null)
                {
                    tmp = tmp.get_next();
                }
                process tmp2 = tmp.get_next();
                tmp.set_next(tmp2.get_next());
            }
        }
Exemple #3
0
        public void Add(string str, int start, int size, int holeNum)
        {
            process nw = new process(str, start, size, holeNum);

            if (isEmpty())
            {
                head = nw;
            }
            else
            {
                process tmp = last();
                tmp.set_next(nw);
            }
        }
Exemple #4
0
        public void remove(process p)
        {
            process tmp = head;

            if (size() == 1)
            {
                head = null;
                return;
            }
            else if (tmp == p)
            {
                head = tmp.get_next();
                return;
            }
            else
            {
                while (tmp.get_next() != p && tmp.get_next() != null)
                {
                    tmp = tmp.get_next();
                }
                process tmp2 = tmp.get_next();
                tmp.set_next(tmp2.get_next());
            }
        }