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