//private bool isEmpty() //{ // if (head == null) // { // return true; // } // else // { // return false; // } //}//is empty //public String list() //{ // if (isEmpty()) // { // return "List is empty\n"; // } // string output = "Contents of List\n Nodes: " + size + // "\n"; // ListNode current = head; // while (current != null) // { // output += "Song Name: " + current.SongName + " Price: " + current.Price + "\n"; // current = current.Previous; // } // return output; //}//list //insert data at the front public void InsertFront(MediaAccount doubleLinkedList, string songName, string Price) { ListNode newNode = new ListNode(songName, Price); newNode.Next = doubleLinkedList.head; newNode.Previous = null; if (doubleLinkedList.head != null) { doubleLinkedList.head.Previous = newNode; } doubleLinkedList.head = newNode; size++; }
public MediaIterator(MediaAccount collection) { this.collection = collection; size = collection.getSize; current = collection.head; }