Esempio n. 1
0
        /// <summary>
        /// sets the object priority to c
        /// </summary>
        internal void set_priority(int o,int oldPriority,int newPriority)
        {
            PQMember pqm=new PQMember(o,oldPriority);

            RBNode node=tree.delete(pqm);

            if(node==tree.NIL)
            {
                throw new InvalidOperationException("in set_priority");
            }

            pqm.priority=newPriority;

            tree.insertIfUniq(pqm);
        }
Esempio n. 2
0
        /// <summary>
        /// sets the object priority to c
        /// </summary>
        internal void set_priority(int o, int oldPriority, int newPriority)
        {
            PQMember pqm = new PQMember(o, oldPriority);

            RBNode node = tree.delete(pqm);

            if (node == tree.NIL)
            {
                throw new InvalidOperationException("in set_priority");
            }

            pqm.priority = newPriority;

            tree.insertIfUniq(pqm);
        }
Esempio n. 3
0
            public int CompareTo(object obj)
            {
                PQMember qm = obj as PQMember;

                if (qm == null)
                {
                    throw new ArgumentException("obj must be of type 'PQMember'");
                }
                int v = priority - qm.priority;

                if (v != 0)
                {
                    return(v);
                }

                return(this.o - qm.o);
            }
Esempio n. 4
0
        internal void insert(int o, int priority)
        {
            PQMember pqm=new PQMember(o,priority);

            tree.insertIfUniq(pqm);
        }
Esempio n. 5
0
        internal void insert(int o, int priority)
        {
            PQMember pqm = new PQMember(o, priority);

            tree.insertIfUniq(pqm);
        }