Beispiel #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);
        }
Beispiel #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;
     }
 }
Beispiel #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;
     }
 }
Beispiel #4
0
 public InputList()
 {
     flag   = null;
     root   = null;
     filled = 0;
 }
Beispiel #5
0
 public InputNode(Object data, InputNode next)
 {
     this.digit  = data;
     this.follow = next;
 }
Beispiel #6
0
 public InputNode(Object data)
 {
     this.digit  = data;
     this.follow = null;
 }