public void Initialize(String crs, String name, String sec)
        {
            Clash node = new Clash();

            node.CrsID   = crs;
            node.secID   = sec;
            node.CrsName = name;
            head         = node;
            count        = 0;
        }
        public List <Int32> getClashStuList(String headCrs, String headSec, String CrsID, String SecID)
        {
            Clash temp = Set[0].head;

            for (int i = 0; i < Size; i++)
            {
                temp = Set[i].head;
                if ((temp.CrsID == headCrs) && (temp.secID == headSec))
                {
                    break;
                }
            }

            while (temp != null)
            {
                if ((temp.CrsID == CrsID) && (temp.secID == SecID))
                {
                    break;
                }
                temp = temp.next;
            }

            return(temp.stuList);
        }
 public ClashRow()
 {
     head = null; count = 0;
 }
        public void InsertClash(Clash listC, Section list, Clash treeC, Section tree)
        {     //compares 2 sections. list is from the ClashSet and tree is to be compared
            if (list.getIns() == tree.getIns())
            { // if an Instructor clash is found
                Clash node = new Clash();
                node.InsName = tree.getIns();
                node.type    = "Instructor";
                node.stuList = null;
                node.secID   = tree.getID();
                node.CrsID   = treeC.CrsID;
                node.CrsName = treeC.CrsName;
                node.next    = null;

                int i = 0;
                while (listC != Set[i].head)
                {
                    i++;
                }

                Clash temp = Set[i].head;
                Set[i].count++;
                while (temp.next != null)
                {
                    temp = temp.next;
                }

                temp.next = node;
            }

            else
            {
                List <Int32> clashStu = new List <Int32>();
                clashStu = getStuClash(list.getSecStu(), tree.getStuRoot());
                if (clashStu.Count > 0)
                {
                    Clash node = new Clash();
                    node.InsName = tree.getIns();
                    node.type    = "Section";
                    node.stuList = null;
                    node.secID   = tree.getID();
                    node.CrsID   = treeC.CrsID;
                    node.CrsName = treeC.CrsName;
                    node.next    = null;
                    if (clashStu.Count < 15)
                    {
                        node.type    = "Student";
                        node.stuList = clashStu;
                    }

                    int i = 0;
                    while (listC != Set[i].head)
                    {
                        i++;
                    }

                    Clash temp = Set[i].head;
                    Set[i].count++;
                    while (temp.next != null)
                    {
                        temp = temp.next;
                    }

                    temp.next = node;
                }
            }
        }
Beispiel #5
0
 public void InsertClash(Clash c, Section clist, Clash d, Section ctree)
 {
     clashSet.InsertClash(c, clist, d, ctree);
 }