예제 #1
0
        public static QueueDMA ReadStringQueueFROMfile(string filename)
        {
            QueueDMA     queue  = new QueueDMA();
            StreamReader reader = new StreamReader(filename, Encoding.Default);
            string       str    = String.Empty;

            while ((str = reader.ReadLine()) != null)
            {
                queue.Add(str);
            }
            reader.Close();
            return(queue);
        }
예제 #2
0
        public static void RemoveXnames(QueueDMA queue, char x)
        {
            string element     = String.Empty;
            int    initialSize = queue.Count;

            //no additional queues
            for (int i = 0; i < initialSize; i++)
            {
                element = queue.TakeFirst();
                if (element[0] != x)
                {
                    queue.Add(element);
                }
            }
        }