示例#1
0
        /// <summary>
        /// Return digit
        /// </summary>
        /// <returns>Digit in string</returns>
        public string getDigit()
        {
            string    temp       = "";
            InputNode nodeReader = flag;

            while (nodeReader != null)
            {
                temp      += nodeReader.digit;
                nodeReader = nodeReader.follow;
            }
            return(temp);
        }
示例#2
0
 /// <summary>
 /// Add data in a node (Do nothing if reached MAXSLOT)
 /// </summary>
 /// <param name="digitInput">Input digit</param>
 public void inserting(Object digitInput)
 {
     if (filled >= MAXSLOT)
     {
         return;
     }
     filled++;
     if (noList())
     {
         flag = root = new InputNode(digitInput);
     }
     else
     {
         root.follow = new InputNode(digitInput);
         root        = root.follow;
     }
 }
示例#3
0
 /// <summary>
 /// Remove node data
 /// </summary>
 public void removing()
 {
     if (noList())
     {
         return;
     }
     filled--;
     if (flag == root)
     {
         flag = root = null;
     }
     else
     {
         InputNode hand = flag;
         while (hand.follow != root)
         {
             hand = hand.follow;
         }
         root        = hand;
         root.follow = null;
     }
 }
示例#4
0
 public InputList()
 {
     flag   = null;
     root   = null;
     filled = 0;
 }
示例#5
0
 public InputNode(Object data, InputNode next)
 {
     this.digit  = data;
     this.follow = next;
 }
示例#6
0
 public InputNode(Object data)
 {
     this.digit  = data;
     this.follow = null;
 }