コード例 #1
0
ファイル: Spindle.cs プロジェクト: conorlyness/JukeBox
        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
コード例 #2
0
ファイル: Spindle.cs プロジェクト: conorlyness/JukeBox
        }//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