public bool contains(string find) { if (isEmpty()) { return(false); } CDNode current = top; while (current != null) { if (find == current.Name) { current.getTracks(); current.getDuration(); return(true); } current = current.Prev; } return(false); }//contains
}//push public string list() { if (isEmpty()) { return("Spindle is empty\n"); } string output = "Contents of Stack\nCD's: " + size + "\n"; CDNode current = top; while (current != null) { output += current.Name + " By " + current.Artist + " || No. of tracks: " + current.getTracks() + " || runtime in mins: " + current.getDuration() + "\n"; current = current.Prev; } return(output); }//list