62 lines
3 KiB
Java
62 lines
3 KiB
Java
|
/*
|
||
|
* 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/>.
|
||
|
*/
|
||
|
package server;
|
||
|
|
||
|
/**
|
||
|
*
|
||
|
* @author eichehome
|
||
|
*/
|
||
|
public class PipeTest {
|
||
|
public static void main(String[] args) {
|
||
|
FifoPipe pipe = new FifoPipe();
|
||
|
System.out.println("Erstes Element: " + pipe.firstElement);
|
||
|
System.out.println("Letztes Element: " + pipe.lastElement);
|
||
|
Element el = new Element("Test");
|
||
|
pipe.queuElement(el);
|
||
|
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());
|
||
|
Element el2 = new Element("Test2");
|
||
|
pipe.queuElement(el2);
|
||
|
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());
|
||
|
PipeElement pipeElement = pipe.getNextElement();
|
||
|
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());
|
||
|
PipeElement pipeElement2 = pipe.getNextElement();
|
||
|
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?
|
||
|
PipeElement pipeElement3 = pipe.getNextElement();
|
||
|
System.out.println("Oben entnommen3");
|
||
|
//System.out.println(pipeElement3.getData().gebeData());
|
||
|
System.out.println("Erstes Element: " + pipe.firstElement);
|
||
|
System.out.println("Letztes Element: " + pipe.lastElement);
|
||
|
}
|
||
|
}
|