예제 #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;
 }