2021-05-11 13:36:40 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2021 eichehome
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
2021-05-14 15:44:48 +00:00
|
|
|
package test;
|
2021-05-11 13:36:40 +00:00
|
|
|
|
2021-05-13 22:25:42 +00:00
|
|
|
import utils.ArrayHelper;
|
2021-05-13 19:09:10 +00:00
|
|
|
import java.io.IOException;
|
|
|
|
import java.io.PipedReader;
|
|
|
|
import java.io.PipedWriter;
|
2021-05-13 22:25:42 +00:00
|
|
|
import utils.FifoPipe;
|
|
|
|
import utils.Message;
|
|
|
|
import utils.PipeElement;
|
2021-05-13 19:09:10 +00:00
|
|
|
|
2021-05-11 13:36:40 +00:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @author eichehome
|
|
|
|
*/
|
|
|
|
public class PipeTest {
|
2021-05-13 19:09:10 +00:00
|
|
|
|
2021-05-11 13:36:40 +00:00
|
|
|
public static void main(String[] args) {
|
2021-05-14 15:44:48 +00:00
|
|
|
/*FifoPipe pipe = new FifoPipe();
|
2021-05-11 13:36:40 +00:00
|
|
|
System.out.println("Erstes Element: " + pipe.firstElement);
|
|
|
|
System.out.println("Letztes Element: " + pipe.lastElement);
|
2021-05-13 22:25:42 +00:00
|
|
|
Message el = new Message("Christian", "Test");
|
|
|
|
pipe.setElement(el);
|
2021-05-11 13:36:40 +00:00
|
|
|
System.out.println("Angehängt");
|
|
|
|
System.out.println("Erstes Element: " + pipe.firstElement);
|
|
|
|
System.out.println("Letztes Element: " + pipe.lastElement);
|
|
|
|
System.out.println("Erstes Element Inhalt: " + pipe.firstElement.getData().gebeData());
|
|
|
|
System.out.println("Letztes Element Inhalt: " + pipe.lastElement.getData().gebeData());
|
2021-05-13 22:25:42 +00:00
|
|
|
Message el2 = new Message("Christian", "Test");
|
|
|
|
pipe.setElement(el2);
|
2021-05-11 13:36:40 +00:00
|
|
|
System.out.println("Angehängt2");
|
|
|
|
System.out.println("Erstes Element: " + pipe.firstElement);
|
|
|
|
System.out.println("Letztes Element: " + pipe.lastElement);
|
|
|
|
System.out.println("Erstes Element Inhalt: " + pipe.firstElement.getData().gebeData());
|
|
|
|
System.out.println("Letztes Element Inhalt: " + pipe.lastElement.getData().gebeData());
|
2021-05-13 22:25:42 +00:00
|
|
|
Message pipeElement = pipe.getNextElement();
|
2021-05-11 13:36:40 +00:00
|
|
|
System.out.println("Oben entnommen");
|
|
|
|
System.out.println("Entnommen Inhalt: " + pipeElement.getData().gebeData());
|
|
|
|
System.out.println("Erstes Element: " + pipe.firstElement);
|
|
|
|
System.out.println("Letztes Element: " + pipe.lastElement);
|
|
|
|
System.out.println("Erstes Element Inhalt: " + pipe.firstElement.getData().gebeData());
|
|
|
|
System.out.println("Letztes Element Inhalt: " + pipe.lastElement.getData().gebeData());
|
2021-05-13 22:25:42 +00:00
|
|
|
Message pipeElement2 = pipe.getNextElement();
|
2021-05-11 13:36:40 +00:00
|
|
|
System.out.println("Oben entnommen2");
|
|
|
|
System.out.println("Entnommen Inhalt: " + pipeElement2.getData().gebeData());
|
|
|
|
System.out.println("Erstes Element: " + pipe.firstElement);
|
|
|
|
System.out.println("Letztes Element: " + pipe.lastElement);
|
|
|
|
//Wieso wills nicht funktionieren?
|
2021-05-13 22:25:42 +00:00
|
|
|
Message pipeElement3 = pipe.getNextElement();
|
2021-05-11 13:36:40 +00:00
|
|
|
System.out.println("Oben entnommen3");
|
|
|
|
//System.out.println(pipeElement3.getData().gebeData());
|
|
|
|
System.out.println("Erstes Element: " + pipe.firstElement);
|
2021-05-13 22:25:42 +00:00
|
|
|
System.out.println("Letztes Element: " + pipe.lastElement);
|
2021-05-13 19:09:10 +00:00
|
|
|
|
|
|
|
ArrayHelper test = new ArrayHelper();
|
2021-05-14 15:44:48 +00:00
|
|
|
*/
|
2021-05-11 13:36:40 +00:00
|
|
|
}
|
2021-05-13 19:09:10 +00:00
|
|
|
|
2021-05-11 13:36:40 +00:00
|
|
|
}
|