diff --git a/.classpath b/.classpath
new file mode 100644
index 0000000..17a35d5
--- /dev/null
+++ b/.classpath
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/.gitignore b/.gitignore
index cfd3c20..18580a1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,5 @@
+bin
/.idea/
/Code.iml
+test
+compress
diff --git a/.project b/.project
new file mode 100644
index 0000000..0ae19c3
--- /dev/null
+++ b/.project
@@ -0,0 +1,28 @@
+
+
+ onlineshop
+
+
+
+
+
+ org.eclipse.jdt.core.javabuilder
+
+
+
+
+
+ org.eclipse.jdt.core.javanature
+
+
+
+ 1679171126515
+
+ 30
+
+ org.eclipse.core.resources.regexFilterMatcher
+ node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__
+
+
+
+
diff --git a/.settings/net.sf.jautodoc.prefs b/.settings/net.sf.jautodoc.prefs
new file mode 100644
index 0000000..774ea65
--- /dev/null
+++ b/.settings/net.sf.jautodoc.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+replacements=\n\n\nGets the\nSets the\nAdds the\nEdits the\nRemoves the\nInits the\nParses the\nCreates the\nBuilds the\nChecks if is\nPrints the\nChecks for\n\n\n
diff --git a/.settings/org.eclipse.core.resources.prefs b/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 0000000..99f26c0
--- /dev/null
+++ b/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+encoding/=UTF-8
diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..8c9943d
--- /dev/null
+++ b/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,14 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=17
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
+org.eclipse.jdt.core.compiler.release=enabled
+org.eclipse.jdt.core.compiler.source=17
diff --git a/README.md b/README.md
index 9061d8a..534d129 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,10 @@
# IOBP02
Datenstrukturen und Java-Klassenbibliothek
+This is a sample project I created to experiment and learn, with the hope that it might be helpful to others. Although I acknowledge that my code style may not be optimal, I believe it is a good starting point for exploration and experimentation.
+
+---
+
Herzlich willkommen zu den Aufgaben des Kurses "IOBP02 Datenstrukturen und Java-Klassenbibliothek" der International University. Hier werden im Laufe des Kurses die Aufgaben hochgeladen (master-Branch). Die Lösungen werden 2 Tage später im solution-Branch angezeigt. Die Aufgaben zu jeder Einheit stehen in "einheit1.md" bis "einheit6.md".
[Einheit 1](einheit1.md)
@@ -10,3 +14,722 @@ Herzlich willkommen zu den Aufgaben des Kurses "IOBP02 Datenstrukturen und Java-
Viel Erfolg!
Ihr IU-Team
+
+Q&A:
+
+1.)
+
+Erkläre an einem Code-Beispiel, was abstrakte Klassen in java sind und zeige warum diese benötigt werden
+
+Hier ist ein Beispiel, das die Verwendung von abstrakten Klassen in Java zeigt:
+
+```java
+abstract class Shape {
+ abstract void draw();
+}
+
+class Circle extends Shape {
+ void draw() {
+ System.out.println("Kreis wird gezeichnet");
+ }
+}
+
+class Rectangle extends Shape {
+ void draw() {
+ System.out.println("Rechteck wird gezeichnet");
+ }
+}
+
+public class Main {
+ public static void main(String[] args) {
+ Shape s = new Circle();
+ s.draw();
+ }
+}
+```
+
+In diesem Beispiel ist Shape eine abstrakte Klasse, die eine abstrakte Methode draw() enthält, die von allen abgeleiteten Klassen implementiert werden muss. Circle und Rectangle sind konkrete Klassen, die Shape erweitern und die draw()-Methode implementieren, um jeweils einen Kreis oder ein Rechteck zu zeichnen. Im main-Methode wird eine Instanz von Circle erstellt und auf eine Shape-Referenz zugewiesen. Dadurch wird sichergestellt, dass der Aufruf der draw()-Methode auf der korrekten Klasse ausgeführt wird.
+
+Abstrakte Klassen sind in diesem Beispiel nützlich, weil sie eine gemeinsame Schnittstelle für verschiedene Formen bereitstellen. Dadurch können andere Teile des Codes unabhängig von der konkreten Implementierung der Formen bleiben. Zum Beispiel könnte eine Funktion, die alle Formen in einem Array zeichnet, einfach eine Schleife durchlaufen und die draw()-Methode auf jeder Form aufrufen, ohne sich um die Details der einzelnen Formen kümmern zu müssen. Außerdem kann die Abstraktion dazu beitragen, Code-Duplizierung zu vermeiden, da der gemeinsame Code in der abstrakten Klasse definiert werden kann.
+
+2.)
+
+Muss eine normale methode in einer abstrakten klasse, von den subklassen implementiert werden?
+
+Nein, normale Methoden in einer abstrakten Klasse müssen nicht von den Subklassen implementiert werden, da sie bereits eine Implementierung in der abstrakten Klasse haben.
+
+Abstrakte Methoden hingegen müssen von jeder konkreten Klasse, die von der abstrakten Klasse erbt, implementiert werden. Abstrakte Methoden haben keine Implementierung in der abstrakten Klasse selbst und müssen daher in den konkreten Klassen implementiert werden, die die abstrakte Klasse erweitern.
+
+Wenn eine Methode in der abstrakten Klasse eine normale Methode ist, die bereits eine Implementierung hat, können die konkreten Klassen diese Methode aufrufen und verwenden, ohne sie erneut zu implementieren. Wenn jedoch eine Methode in der abstrakten Klasse als abstrakt deklariert ist, müssen die konkreten Klassen sie implementieren, da sie keine Implementierung in der abstrakten Klasse hat und die konkreten Klassen selbst eine Implementierung bereitstellen müssen.
+
+3.)
+
+Erkläre den Unterschied zwischen implizierten und explizierten Aufrufen in Java. Gehe zudem auf die toString Methode ein.
+
+In Java gibt es zwei Arten von Methodenaufrufen: implizite und explizite Aufrufe.
+
+Implizite Aufrufe sind Methodenaufrufe, die automatisch von Java ausgeführt werden, ohne dass der Entwickler explizit eine Methode aufrufen muss. Ein Beispiel hierfür ist die toString()-Methode, die implizit aufgerufen wird, wenn ein Objekt als String dargestellt werden soll. Wenn ein Objekt beispielsweise an die System.out.println()-Methode übergeben wird, ruft Java implizit die toString()-Methode des Objekts auf, um es in einen String umzuwandeln und ihn auszugeben.
+
+Explizite Aufrufe hingegen sind Methodenaufrufe, bei denen der Entwickler die Methode explizit aufruft, indem er den Methodennamen und gegebenenfalls Argumente angibt.
+
+Die toString()-Methode ist eine Methode, die in der Object-Klasse definiert ist und von jeder Java-Klasse geerbt wird. Die toString()-Methode gibt eine String-Darstellung des Objekts zurück. Wenn die toString()-Methode nicht in der Klasse, die das Objekt erstellt hat, überschrieben wird, gibt sie die Standard-String-Darstellung des Objekts zurück, die den Klassennamen und eine hexadezimale Darstellung der Objektadresse enthält. Wenn die toString()-Methode jedoch in der Klasse überschrieben wird, kann der Entwickler eine benutzerdefinierte String-Darstellung des Objekts zurückgeben, die sinnvoller ist als die Standard-String-Darstellung.
+
+Zusammenfassend ist der Unterschied zwischen impliziten und expliziten Aufrufen, dass implizite Aufrufe automatisch von Java ausgeführt werden, während explizite Aufrufe explizit vom Entwickler ausgeführt werden müssen. Die toString()-Methode ist eine implizite Methode, die eine String-Darstellung des Objekts zurückgibt und automatisch von Java aufgerufen wird, wenn ein Objekt als String dargestellt werden soll.
+
+4.)
+
+Erkläre an einem geeigneten Code-Beispiel das super keyword in Java und zeige wann dies notwendig ist.
+
+In Java ist das super-Schlüsselwort eine Referenz auf die unmittelbar übergeordnete Klasse einer abgeleiteten Klasse. Es wird verwendet, um auf die Methoden, Konstruktoren und Variablen der übergeordneten Klasse zuzugreifen.
+
+Hier ist ein Beispiel, das das super-Schlüsselwort demonstriert:
+
+```java
+public class Vehicle {
+ protected String brand;
+
+ public Vehicle(String brand) {
+ this.brand = brand;
+ }
+
+ public void honk() {
+ System.out.println("Tuut, tuut!");
+ }
+}
+
+public class Car extends Vehicle {
+ private String model;
+
+ public Car(String brand, String model) {
+ super(brand);
+ this.model = model;
+ }
+
+ public void honk() {
+ super.honk();
+ System.out.println("Beep, beep!");
+ }
+
+ public void display() {
+ System.out.println("Brand: " + super.brand);
+ System.out.println("Model: " + this.model);
+ }
+}
+```
+
+In diesem Beispiel erbt die Car-Klasse von der Vehicle-Klasse. Die Vehicle-Klasse hat eine geschützte Variable brand und eine Methode honk(), die einen Standard-Ausgabe-Aufruf enthält. Die Car-Klasse hat eine private Variable model und eine Methode display(), die die Marke und das Modell des Autos ausgibt.
+
+Die Car-Klasse hat auch eine honk()-Methode, die die honk()-Methode der übergeordneten Vehicle-Klasse überschreibt und die super-Methode aufruft, um den Standard-Ausgabe-Aufruf der honk()-Methode der Vehicle-Klasse zuerst auszuführen, bevor sie ihren eigenen Ausgabe-Aufruf hinzufügt.
+
+Das super-Schlüsselwort wird auch im Konstruktor der Car-Klasse verwendet, um auf den Konstruktor der übergeordneten Vehicle-Klasse zuzugreifen und die Marke des Autos zu setzen.
+
+Das super-Schlüsselwort ist notwendig, um auf Methoden, Konstruktoren oder Variablen der übergeordneten Klasse zuzugreifen, wenn diese in der abgeleiteten Klasse überschrieben oder ausgeblendet wurden. In diesem Beispiel haben wir das super-Schlüsselwort verwendet, um auf die honk()-Methode der Vehicle-Klasse zuzugreifen und den Konstruktor der Vehicle-Klasse aufzurufen, um die brand-Variable zu setzen.
+
+5.)
+
+Gibt es importierbare pakete in java, die system heißen?
+
+Ja, es gibt in Java importierbare Pakete mit dem Namen java.lang.System. Dieses Paket enthält Klassen und Methoden, die für den Zugriff auf das System und seine Eigenschaften nützlich sind. Einige der wichtigsten Klassen in diesem Paket sind:
+
+System: eine Klasse, die statische Methoden und Variablen für den Zugriff auf das System bereitstellt, wie z.B. die Ausgabe von Meldungen auf der Konsole und die Beendigung von Programmen.
+Runtime: eine Klasse, die den Ausführungszeit- und Speicherplatzstatus des Systems verwaltet.
+Math: eine Klasse, die mathematische Funktionen wie Sinus, Kosinus und Quadratwurzeln bereitstellt.
+Es ist wichtig zu beachten, dass das Paket java.lang automatisch in jedem Java-Programm importiert wird, so dass die Klassen in diesem Paket ohne explizite Importanweisung verwendet werden können.
+
+6.)
+
+Gibt es importierbare pakete in java, die system heißen und nicht in java.lang enthalten sind?
+
+Nein, es gibt keine importierbaren Pakete in Java, die explizit den Namen system tragen und nicht in dem Paket java.lang enthalten sind. Der Name java.lang ist ein spezielles Paket in Java, das automatisch in jedem Java-Programm importiert wird, und enthält grundlegende Klassen und Schnittstellen, die für die Java-Laufzeitumgebung unverzichtbar sind.
+
+Es gibt jedoch andere Pakete in Java, die Klassen und Methoden enthalten, die mit dem System interagieren, wie z.B. das Paket java.util.logging für die Protokollierung, das Paket java.io für die Ein- und Ausgabeoperationen oder das Paket java.net für die Netzwerkprogrammierung. Diese Pakete bieten verschiedene Klassen und Methoden, die für die Interaktion mit dem System oder mit anderen Systemen erforderlich sind.
+
+7.)
+
+Stelle in einem Code Beispiel das Datum über einen Konstruktor mit einer Zeitzone in Java zusammen.
+
+Hier ist ein Beispiel, wie man ein Datum mit einer bestimmten Zeitzone in Java über den Konstruktor der Klasse java.time.LocalDateTime zusammenstellt:
+
+```java
+import java.time.LocalDateTime;
+import java.time.ZoneId;
+
+public class LocalDateTimeExample {
+ public static void main(String[] args) {
+ // Erstelle eine neue Zeitzone
+ ZoneId timezone = ZoneId.of("Europe/Berlin");
+
+ // Erstelle ein Datum mit der aktuellen Systemzeit und der Zeitzone
+ LocalDateTime datetime = LocalDateTime.now(timezone);
+ System.out.println("Datum mit der Systemzeit und Zeitzone: " + datetime);
+ }
+}
+```
+
+In diesem Beispiel wird zunächst eine neue Zeitzone mit dem Namen "Europe/Berlin" erstellt. Dann wird ein neues Datum mit der aktuellen Systemzeit und der Zeitzone "Europe/Berlin" über den Konstruktor der Klasse LocalDateTime erstellt.
+
+Wenn dieses Programm ausgeführt wird, wird es das Datum mit der Systemzeit und der Zeitzone "Europe/Berlin" auf der Konsole ausgeben.
+
+8.)
+
+Warum kann man equals in Java überschreiben?
+
+In Java ist die equals()-Methode eine Methode der Klasse Object, die für die Überprüfung von Objektgleichheit verwendet wird. Die Standardimplementierung von equals() in der Klasse Object prüft, ob zwei Objekte dieselbe Referenz haben, also auf dasselbe Objekt zeigen. Das bedeutet, dass zwei verschiedene Objekte mit denselben Attributwerten nicht als gleich betrachtet werden.
+
+In vielen Fällen ist es jedoch erforderlich, Objekte anhand ihrer Attribute zu vergleichen, um zu prüfen, ob sie semantisch gleich sind. Um dies zu ermöglichen, können Java-Klassen die equals()-Methode überschreiben und eine eigene Implementierung bereitstellen, die die Attributwerte der Objekte vergleicht.
+
+Die Überschreibung von equals() ist sinnvoll, wenn ein Objektgleichheitstest durchgeführt werden soll, bei dem nur bestimmte Attribute der Objekte verglichen werden sollen. Zum Beispiel können zwei Person-Objekte gleich sein, wenn ihre Namen und Alter übereinstimmen, auch wenn sie unterschiedliche Adressen haben.
+
+Insgesamt ermöglicht die Möglichkeit, die equals()-Methode in Java zu überschreiben, eine flexiblere und genauere Definition der Objektgleichheit, was in vielen Anwendungsfällen sehr nützlich sein kann.
+
+9.)
+
+Was sind statische methoden in java?
+
+Statische Methoden in Java sind Methoden, die einer Klasse zugeordnet sind, nicht jedoch einem bestimmten Objekt dieser Klasse. Sie können aufgerufen werden, ohne dass eine Instanz der Klasse erstellt wird, und können somit unabhängig von den Eigenschaften der Instanz arbeiten.
+
+Statische Methoden werden in Java mit dem Schlüsselwort static vor dem Methodennamen deklariert. Sie können auf Klassenebene aufgerufen werden, ohne dass eine Instanz der Klasse erstellt werden muss. Statische Methoden können auf Klassenvariablen und -methoden zugreifen, aber nicht auf Instanzvariablen und -methoden.
+
+Ein typisches Beispiel für eine statische Methode in Java ist die Math-Klasse, die viele nützliche mathematische Funktionen wie z.B. abs(), sqrt() oder sin() bereitstellt. Die Methoden dieser Klasse können auf Klassenebene aufgerufen werden, ohne dass eine Instanz der Klasse erstellt werden muss.
+
+Ein weiteres Beispiel ist die main()-Methode, die in der Regel als Einstiegspunkt für die Ausführung von Java-Programmen dient. Die main()-Methode muss statisch sein, damit sie auf Klassenebene aufgerufen werden kann, ohne dass eine Instanz der Klasse erstellt werden muss.
+
+Statische Methoden werden oft eingesetzt, um nützliche Hilfsfunktionen bereitzustellen, die unabhängig von einer bestimmten Instanz der Klasse arbeiten. Da sie auf Klassenebene aufgerufen werden können, sind sie auch nützlich für die Organisation von Code in Bibliotheken und Frameworks.
+
+10.)
+
+Wann macht es Sinn in Java eine eigene Wrapper klasse zu verwenden? Erkläre an einem Code-Beispiel.
+
+Es kann sinnvoll sein, eine eigene Wrapper-Klasse in Java zu erstellen, um bestimmte Funktionalitäten hinzuzufügen oder um den Umgang mit bestimmten Datentypen zu vereinfachen. Eine Wrapper-Klasse ist im Wesentlichen eine Klasse, die einen anderen Datentyp "umwickelt" (engl. "wraps"), um zusätzliche Funktionen bereitzustellen.
+
+Ein Beispiel für die Verwendung einer eigenen Wrapper-Klasse wäre, wenn man eine Klasse benötigt, die ein Integer-Array enthält und zusätzliche Methoden bereitstellt, um z.B. den Durchschnitt oder die Summe der Werte im Array zu berechnen. Hier kann eine Wrapper-Klasse nützlich sein, um die Funktionalität zu erweitern und den Code lesbarer und modularer zu gestalten.
+
+Hier ist ein Beispiel für eine solche Wrapper-Klasse:
+
+```java
+public class IntegerArray {
+ private int[] array;
+
+ public IntegerArray(int[] array) {
+ this.array = array;
+ }
+
+ public int sum() {
+ int result = 0;
+ for (int i : array) {
+ result += i;
+ }
+ return result;
+ }
+
+ public double average() {
+ if (array.length == 0) {
+ return 0.0;
+ }
+ return (double) sum() / array.length;
+ }
+
+ // Weitere Methoden können hier hinzugefügt werden, um die Funktionalität zu erweitern
+
+ public int[] getArray() {
+ return array;
+ }
+}
+```
+
+In diesem Beispiel umhüllt die IntegerArray-Klasse ein Integer-Array und bietet zusätzliche Methoden, um die Summe und den Durchschnitt der Werte im Array zu berechnen. Außerdem bietet sie eine getArray()-Methode, um auf das darunterliegende Array zuzugreifen.
+
+Die Verwendung einer solchen Wrapper-Klasse kann dazu beitragen, den Code lesbarer und modularer zu gestalten, indem sie die Funktionalität erweitert und die Handhabung des Integer-Arrays vereinfacht.
+
+11.)
+
+Was sind Attribute in Java. Erkläre an einem Code-Beispiel.
+
+In Java bezeichnet der Begriff "Attribute" die Eigenschaften einer Klasse, die deren Zustand definieren. Diese Attribute werden auch als Instanzvariablen bezeichnet, da sie für jede Instanz der Klasse individuell existieren.
+
+Hier ist ein Beispiel für eine Klasse mit einigen Attributen:
+
+```java
+public class Person {
+ private String name;
+ private int age;
+ private String address;
+ private boolean isStudent;
+
+ public Person(String name, int age, String address, boolean isStudent) {
+ this.name = name;
+ this.age = age;
+ this.address = address;
+ this.isStudent = isStudent;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public int getAge() {
+ return age;
+ }
+
+ public String getAddress() {
+ return address;
+ }
+
+ public boolean isStudent() {
+ return isStudent;
+ }
+}
+```
+
+In diesem Beispiel sind name, age, address und isStudent Attribute der Person-Klasse. Diese Attribute definieren den Zustand einer Person-Instanz und können von außen über Getter-Methoden abgefragt werden.
+
+Beispielsweise kann eine Person-Instanz wie folgt erstellt und abgefragt werden:
+
+```java
+Person person = new Person("Max Mustermann", 30, "Musterstraße 123", true);
+System.out.println(person.getName()); // Output: Max Mustermann
+System.out.println(person.getAge()); // Output: 30
+System.out.println(person.getAddress()); // Output: Musterstraße 123
+System.out.println(person.isStudent()); // Output: true
+```
+
+In diesem Beispiel werden die Attribute der Person-Instanz durch den Konstruktor gesetzt und können dann über die Getter-Methoden abgefragt werden.
+
+12.)
+
+Welche Methoden bietet die Klasse Object in Java an?
+
+In Java ist die Klasse Object die Basisklasse aller Klassen und bietet einige allgemeine Methoden an, die von allen Objekten geerbt werden. Hier sind einige der wichtigsten Methoden:
+
+toString(): Gibt eine Zeichenfolgendarstellung des Objekts zurück.
+
+equals(Object obj): Überprüft, ob das aktuelle Objekt gleich dem angegebenen Objekt ist.
+
+hashCode(): Gibt den Hash-Code des Objekts zurück.
+
+getClass(): Gibt das Klassenobjekt zurück, das das Objekt repräsentiert.
+
+wait(): Hält das aktuelle Thread-Objekt an, bis das Objekt, auf das gewartet wird, benachrichtigt wird.
+
+notify(): Benachrichtigt einen Thread, der auf das Objekt wartet, auf das notify() aufgerufen wird.
+
+notifyAll(): Benachrichtigt alle Threads, die auf das Objekt warten, auf das notifyAll() aufgerufen wird.
+
+Diese Methoden können überschrieben werden, um das Verhalten von Objekten zu ändern. Zum Beispiel kann die toString()-Methode überschrieben werden, um eine benutzerdefinierte Zeichenfolgendarstellung des Objekts zurückzugeben.
+
+Es ist auch wichtig zu beachten, dass die Methoden wait(), notify() und notifyAll() nur aufgerufen werden sollten, wenn das aktuelle Objekt ein Monitor ist, dh wenn es von Threads gemeinsam genutzt wird. Andernfalls wird eine IllegalMonitorStateException ausgelöst.
+
+13.)
+
+Was ist der Unterschied zwischen throw und throws in Java?
+
+In Java gibt es einen Unterschied zwischen throw und throws.
+
+Das Schlüsselwort throw wird verwendet, um eine Ausnahme manuell auszulösen. Wenn eine Ausnahmebedingung eintritt und ein entsprechendes Objekt erstellt wird, kann es mit dem throw-Schlüsselwort an die Aufrufermethode weitergegeben werden. Das bedeutet, dass der Code, der das Problem erkannt hat, die Verantwortung für die Behandlung der Ausnahme an die Methode abgibt, die den Aufruf durchgeführt hat.
+
+Ein Beispiel:
+
+```java
+public void myMethod() {
+ int a = 10;
+ if (a > 5) {
+ throw new IllegalArgumentException("a should be less than or equal to 5");
+ }
+}
+```
+
+Das Schlüsselwort throws wird in der Methodendeklaration verwendet, um anzuzeigen, dass eine Methode eine Ausnahme auslösen kann, die sie nicht behandeln wird. Dies bedeutet, dass der Aufrufer der Methode die Verantwortung dafür hat, die Ausnahme zu behandeln oder sie an den Aufrufer seiner eigenen Methode weiterzugeben.
+
+Ein Beispiel:
+
+```java
+public void myMethod() throws IOException {
+ // Method implementation
+}
+```
+
+In diesem Beispiel gibt die Methode an, dass sie eine IOException auslösen kann, aber sie behandelt sie nicht. Der Aufrufer der Methode muss dann entweder die Ausnahme behandeln oder sie ebenfalls mit dem throws-Schlüsselwort kennzeichnen, um sie an seinen eigenen Aufrufer weiterzugeben.
+
+Zusammenfassend lässt sich sagen, dass throw verwendet wird, um eine Ausnahme manuell auszulösen, während throws in der Methodendeklaration verwendet wird, um anzuzeigen, dass eine Methode eine Ausnahme auslösen kann, die sie nicht behandelt.
+
+14.)
+
+Welche Funktion hat mkdirs() in Java?
+
+Die Funktion mkdirs() in Java wird verwendet, um Verzeichnisse auf dem Dateisystem zu erstellen. Es ist eine Methode der Klasse File, die einen Verzeichnispfad als Argument annimmt und true zurückgibt, wenn das Verzeichnis erstellt wurde, oder false, wenn es nicht erstellt werden konnte.
+
+Der Hauptunterschied zwischen mkdir() und mkdirs() besteht darin, dass mkdir() nur ein einzelnes Verzeichnis erstellen kann, während mkdirs() alle erforderlichen Verzeichnisse in einem Pfad erstellt.
+
+Ein Beispiel:
+
+```java
+File file = new File("C:/myDirectory/mySubDirectory");
+if(file.mkdirs()){
+ System.out.println("Directory has been created successfully");
+}
+else{
+ System.out.println("Failed to create directory");
+}
+```
+
+In diesem Beispiel wird das Verzeichnis "mySubDirectory" im Verzeichnis "myDirectory" auf dem Laufwerk "C:" erstellt, falls es noch nicht existiert. Die mkdirs()-Methode erstellt alle Verzeichnisse, die im Pfad angegeben sind, wenn sie nicht vorhanden sind.
+
+Diese Funktion ist besonders nützlich, wenn eine Anwendung mehrere Verzeichnisse erstellen muss und nicht sicher ist, ob diese bereits vorhanden sind oder nicht.
+
+15.)
+
+Sind im Standard Konstruktor, in Java Methoden-Aufrufe erlaubt?
+
+Ja, im Standard-Konstruktor in Java sind Methoden-Aufrufe erlaubt. Der Standard-Konstruktor ist ein spezieller Konstruktor, der automatisch von Java erzeugt wird, wenn keine anderen Konstruktoren in einer Klasse definiert wurden.
+
+Der Standard-Konstruktor hat keine Argumente und führt normalerweise keine spezifischen Aktionen aus. Er wird jedoch oft verwendet, um Standardwerte für Attribute der Klasse zu setzen oder um eine Verbindung zu einer Datenbank herzustellen.
+
+In einem Standard-Konstruktor können Methoden-Aufrufe wie in jedem anderen Konstruktor verwendet werden. Ein Beispiel:
+
+```java
+public class MyClass {
+ private int count;
+
+ public MyClass() {
+ this.count = 0;
+ init();
+ }
+
+ private void init() {
+ System.out.println("Initializing MyClass");
+ }
+}
+```
+
+In diesem Beispiel wird der Standard-Konstruktor von MyClass definiert, der die Anzahl auf Null setzt und die Methode init() aufruft, um die Initialisierung der Klasse abzuschließen.
+
+16.)
+
+Es soll festgestellt werden, ob ein Wort aus der Zeichenkette, in Java das erste Wort ist anhand der Methode lastIndexOf(). Ist dies möglich? Wenn ja implementieren, wenn nein begründen.
+
+Es ist grundsätzlich möglich, mit Hilfe der lastIndexOf()-Methode in Java zu bestimmen, ob das erste Wort einer Zeichenkette vorliegt. Dazu müsste man allerdings zunächst das letzte Leerzeichen in der Zeichenkette finden, um dann den Substring vom Anfang der Zeichenkette bis zum letzten Leerzeichen zu extrahieren und mit dem ersten Wort zu vergleichen.
+
+Allerdings ist diese Methode nicht sehr effizient und auch anfällig für Fehler, da sie davon ausgeht, dass das erste Wort einer Zeichenkette immer direkt vor dem ersten Leerzeichen steht. Das ist jedoch nicht immer der Fall, da es beispielsweise auch Zeichenketten geben kann, die mit einem Leerzeichen beginnen.
+
+Es gibt in Java einfachere und robustere Möglichkeiten, das erste Wort einer Zeichenkette zu extrahieren und zu vergleichen, zum Beispiel indem man die split()-Methode verwendet oder eine reguläre Ausdruck (Regex) benutzt.
+
+Hier ist ein Beispiel, das zeigt, wie man das erste Wort einer Zeichenkette mit der split()-Methode ermitteln und vergleichen kann:
+
+```java
+String input = "Hello world, how are you?";
+String[] words = input.split(" ");
+if(words.length > 0 && words[0].equals("Hello")) {
+ System.out.println("The first word is 'Hello'");
+} else {
+ System.out.println("The first word is not 'Hello'");
+}
+```
+
+In diesem Beispiel wird die Zeichenkette "Hello world, how are you?" in ein Array von Wörtern aufgeteilt, indem die split()-Methode mit einem Leerzeichen als Trennzeichen verwendet wird. Anschließend wird überprüft, ob das erste Wort des Arrays gleich "Hello" ist.
+
+17.)
+
+Collections-Framework in Java. Warum können die Collections daraus den Iterator verwenden?
+
+Das Collections-Framework in Java bietet eine Vielzahl von Datenstrukturen, die es ermöglichen, Gruppen von Objekten zu verwalten. Dazu gehören beispielsweise Listen, Sets, Maps und Queues. Eine gemeinsame Eigenschaft dieser Datenstrukturen ist, dass sie alle den Iterator verwenden können, um über die in ihnen enthaltenen Elemente zu iterieren.
+
+Der Iterator ist eine Schnittstelle in Java, die es ermöglicht, sequentiell durch die Elemente einer Collection zu laufen, ohne dabei das zugrunde liegende Objekt zu verändern. Er bietet eine sichere und effiziente Möglichkeit, auf die Elemente einer Collection zuzugreifen und sie zu durchlaufen.
+
+Jede Collection in Java, die die Schnittstelle Iterable implementiert, kann einen Iterator erstellen, um durch ihre Elemente zu iterieren. Dies liegt daran, dass die Iterable-Schnittstelle die iterator()-Methode definiert, die eine Iterator-Instanz zurückgibt. Durch das Implementieren dieser Schnittstelle kann jede Collection-Implementierung eine einheitliche Methode zum Erstellen eines Iterators bereitstellen, unabhängig von der konkreten Art der Collection.
+
+Dank der Verwendung von Iteratoren kann das Collections-Framework in Java auf eine einfache, effektive und standardisierte Weise die Elemente in den verschiedenen Datenstrukturen durchlaufen und darauf zugreifen.
+
+18.)
+
+Was ist der unterschied zwischen deque und queue in Java?
+
+Deque und Queue sind beide Interfaces im Java Collections-Framework, die sich auf die Verwaltung von Elementen in einer Warteschlange beziehen. Sie haben jedoch einige Unterschiede.
+
+Deque steht für "Double Ended Queue" und ermöglicht das Einfügen und Entfernen von Elementen von beiden Seiten der Warteschlange, d.h. am Anfang und am Ende. Es bietet Methoden wie addFirst(), addLast(), removeFirst(), removeLast() usw. Deque kann sowohl als LIFO- (Last In First Out) als auch als FIFO- (First In First Out) Warteschlange verwendet werden.
+
+Queue ist dagegen eine Schnittstelle, die das FIFO-Verhalten unterstützt, d.h. das Element, das zuerst in die Warteschlange eingefügt wurde, wird als erstes wieder entfernt. Es bietet Methoden wie add(), offer(), remove(), poll() usw. Es gibt auch Implementierungen von Queue wie z.B. PriorityQueue, die die Elemente nach ihrer Priorität sortieren.
+
+Zusammenfassend kann man sagen, dass Deque im Gegensatz zu Queue eine Warteschlange ist, die sowohl vom Anfang als auch vom Ende aus zugänglich ist und sowohl als LIFO- als auch als FIFO-Struktur verwendet werden kann, während Queue eine Warteschlange ist, bei der das älteste Element zuerst entfernt wird und die als FIFO-Struktur verwendet wird.
+
+19.)
+
+Um eine for-Schleife zur Iteration nutzen zu können, muss welche Voraussetzung, in Java erfüllt werden? Geben Sie ein Beispiel für eine Datenstruktur an und einen Schleifenkopf einer erweiterten for-Schleife.
+
+Um eine for-Schleife zur Iteration nutzen zu können, muss das Iterable-Interface implementiert werden. Dieses Interface bietet die Methode iterator(), die ein Iterator-Objekt zurückgibt, das die Iteration über die Elemente der Datenstruktur ermöglicht.
+
+Ein Beispiel für eine Datenstruktur, die das Iterable-Interface implementiert, ist ArrayList aus dem Java Collections-Framework. Hier ist ein Beispiel für eine erweiterte for-Schleife, die eine ArrayList durchläuft:
+
+```java
+import java.util.ArrayList;
+
+public class Main {
+ public static void main(String[] args) {
+ ArrayList liste = new ArrayList();
+ liste.add("Hallo");
+ liste.add("Welt");
+ liste.add("!");
+
+ for (String element : liste) {
+ System.out.println(element);
+ }
+ }
+}
+```
+
+In diesem Beispiel wird eine ArrayList mit drei Elementen erstellt und dann mit einer erweiterten for-Schleife durchlaufen. Der Schleifenkopf for (String element : liste) gibt an, dass die Schleife über jedes Element der ArrayList iterieren soll und jedes Element der Variable element zugewiesen wird.
+
+20.)
+
+Müssen Collections in Java zwingend Iterable überschreiben bzw. implementieren?
+
+Ja, um eine Collection in Java verwenden zu können, muss sie das Iterable-Interface implementieren. Das Iterable-Interface definiert die Methode iterator(), die ein Iterator-Objekt zurückgibt, das die Iteration über die Elemente der Collection ermöglicht.
+
+Das bedeutet, dass alle Standard-Implementierungen von Collection in Java, wie z.B. ArrayList, LinkedList, HashSet und TreeSet, das Iterable-Interface implementieren müssen. Wenn Sie Ihre eigene Collection-Klasse schreiben, müssen Sie das Iterable-Interface ebenfalls implementieren, um sie mit der erweiterten for-Schleife und anderen Iterations-Mechanismen in Java verwenden zu können.
+
+21.)
+
+Müssen Collections in Java zwingend Iterable überschreiben bzw. implementieren? Zeige dies an einem Code Beispiel
+
+Ja, Collections in Java müssen das Iterable-Interface implementieren, um die Verwendung von Iteratoren und der erweiterten for-Schleife zu ermöglichen. Hier ist ein Beispiel:
+
+```java
+import java.util.*;
+
+public class MyCollection implements Iterable {
+ private List items = new ArrayList();
+
+ public void add(T item) {
+ items.add(item);
+ }
+
+ public Iterator iterator() {
+ return items.iterator();
+ }
+
+ public static void main(String[] args) {
+ MyCollection myCollection = new MyCollection();
+ myCollection.add("foo");
+ myCollection.add("bar");
+ myCollection.add("baz");
+
+ for (String item : myCollection) {
+ System.out.println(item);
+ }
+ }
+}
+```
+
+In diesem Beispiel implementiert die Klasse MyCollection das Iterable-Interface und definiert eine Methode iterator(), die einen Iterator über die in der Collection gespeicherten Elemente zurückgibt. Die main()-Methode zeigt, wie die erweiterte for-Schleife verwendet werden kann, um die Elemente der Collection zu durchlaufen. Ohne die Implementierung des Iterable-Interfaces wäre dies nicht möglich.
+
+22.)
+
+Anforderungen für die eigene equals() - Implementierung
+
+Wenn Sie in Java eine eigene equals()-Methode implementieren, müssen Sie sicherstellen, dass sie die folgenden Anforderungen erfüllt:
+
+Reflexivität: Eine Objektreferenz x muss gleich der Objektreferenz x sein. Das bedeutet, x.equals(x) muss immer true zurückgeben.
+
+Symmetrie: Wenn eine Objektreferenz x gleich einer Objektreferenz y ist, dann muss auch die Objektreferenz y gleich der Objektreferenz x sein. Das bedeutet, wenn x.equals(y) true zurückgibt, muss auch y.equals(x) true zurückgeben.
+
+Transitivität: Wenn eine Objektreferenz x gleich einer Objektreferenz y ist und y gleich einer Objektreferenz z ist, dann muss auch x gleich z sein. Das bedeutet, wenn x.equals(y) und y.equals(z) true zurückgeben, muss auch x.equals(z) true zurückgeben.
+
+Konsistenz: Eine Objektreferenz x muss während ihres gesamten Lebenszyklus immer den gleichen Wert zurückgeben, wenn sie mit equals() verglichen wird. Das bedeutet, dass wiederholte Aufrufe von x.equals(y) immer das gleiche Ergebnis liefern sollten, solange sich x oder y nicht ändern.
+
+Nicht-Null: Eine Objektreferenz darf niemals gleich null sein. Das bedeutet, dass der Aufruf x.equals(null) immer false zurückgeben muss.
+
+Hier ist ein Beispiel für eine Implementierung von equals(), die diese Anforderungen erfüllt:
+
+```java
+public class Person {
+ private String name;
+ private int age;
+
+ public Person(String name, int age) {
+ this.name = name;
+ this.age = age;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (obj == this) {
+ return true;
+ }
+
+ if (!(obj instanceof Person)) {
+ return false;
+ }
+
+ Person other = (Person) obj;
+
+ return this.name.equals(other.name) && this.age == other.age;
+ }
+}
+```
+
+In diesem Beispiel wird equals() überschrieben, um zwei Person-Objekte anhand ihrer Namen und ihres Alters zu vergleichen. Es wird überprüft, ob die Objektreferenz gleich this ist, und falls ja, wird true zurückgegeben. Dann wird überprüft, ob das übergebene Objekt eine Instanz von Person ist, und falls nein, wird false zurückgegeben. Schließlich werden die Namen und Alter der beiden Person-Objekte verglichen, um zu entscheiden, ob sie gleich sind.
+
+23.)
+
+Was passiert wenn ein Int und ein String mit dem == Operator, in Java verglichen werden?
+
+Wenn ein int und ein String mit dem == Operator in Java verglichen werden, wird die Referenzgleichheit überprüft, nicht der Wertgleichheit.
+
+Für primitive Datentypen wie int vergleicht der == Operator die Werte direkt. Wenn die Werte gleich sind, wird true zurückgegeben, ansonsten false.
+
+Für Objekte, wie z.B. String, vergleicht der == Operator die Speicheradressen der Objekte. Wenn beide Variablen auf dasselbe Objekt verweisen, wird true zurückgegeben, ansonsten false.
+
+Hier ist ein Beispiel:
+
+```java
+int num = 10;
+String str = "10";
+if (num == str) {
+ System.out.println("Equal");
+} else {
+ System.out.println("Not equal");
+}
+```
+
+Dies würde "Not equal" ausgeben, da num und str unterschiedliche Typen haben und der == Operator die Referenzgleichheit vergleicht, nicht den Wert. Um den Wert zu vergleichen, muss die equals() Methode verwendet werden, wie folgt:
+
+```java
+int num = 10;
+String str = "10";
+if (Integer.toString(num).equals(str)) {
+ System.out.println("Equal");
+} else {
+ System.out.println("Not equal");
+}
+```
+Dies würde "Equal" ausgeben, da die equals() Methode den Wert der Objekte vergleicht, nicht die Speicheradressen.
+
+24.)
+
+Welches Schlüsselwort existiert in Javadoc nicht?
+
+In Javadoc existiert das Schlüsselwort "inheritdoc" nicht. Es handelt sich hierbei um ein Schlüsselwort in der Dokumentation von C#. In Javadoc kann das Schlüsselwort "@inheritDoc" verwendet werden, um die Dokumentation der überschriebenen Methode zu erben.
+
+25.)
+
+Was gibt es nicht, in Java?
+
+@catch
+
+@throw
+
+@exception
+
+@param
+
+Das Javadoc-Schlüsselwort "@catch" gibt es nicht in Java. Stattdessen wird das Schlüsselwort "@throws" verwendet, um anzuzeigen, dass eine Methode eine Ausnahme auslösen kann und welche Ausnahme das ist. "@param" wird verwendet, um die Parameter einer Methode zu dokumentieren und "@exception" wird verwendet, um Ausnahmen zu dokumentieren, die von einer Methode ausgelöst werden können.
+
+26.)
+
+Implementiere in der Klasse Tier das Interface Comparable, in Java und überprüfe die Objekte.
+
+Gerne zeige ich ein Beispiel, wie das Interface Comparable in der Klasse Tier implementiert werden kann:
+
+```java
+public class Tier implements Comparable {
+ private String name;
+ private int age;
+
+ public Tier(String name, int age) {
+ this.name = name;
+ this.age = age;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public int getAge() {
+ return age;
+ }
+
+ @Override
+ public int compareTo(Tier o) {
+ // Vergleiche die Tiere nach ihrem Alter
+ return this.age - o.age;
+ }
+}
+```
+
+In diesem Beispiel implementiert die Klasse Tier das Interface Comparable und überschreibt die Methode compareTo(). Die Methode vergleicht die Tiere nach ihrem Alter. Wenn das aktuelle Tier älter ist als das übergebene Tier, gibt compareTo() eine positive Zahl zurück, wenn das übergebene Tier älter ist als das aktuelle Tier, gibt es eine negative Zahl zurück und wenn beide Tiere das gleiche Alter haben, gibt es 0 zurück.
+
+Um die Objekte zu überprüfen, kann man beispielsweise ein Array von Tier-Objekten erzeugen und dieses mit Hilfe der Arrays.sort()-Methode sortieren:
+
+```java
+public class Test {
+ public static void main(String[] args) {
+ Tier[] tiere = new Tier[3];
+ tiere[0] = new Tier("Hund", 5);
+ tiere[1] = new Tier("Katze", 3);
+ tiere[2] = new Tier("Pferd", 10);
+
+ Arrays.sort(tiere);
+
+ for (Tier t : tiere) {
+ System.out.println(t.getName() + ": " + t.getAge() + " Jahre");
+ }
+ }
+}
+```
+
+Das Ausführen dieses Codes würde folgende Ausgabe erzeugen:
+
+```
+Katze: 3 Jahre
+Hund: 5 Jahre
+Pferd: 10 Jahre
+```
+
+Da die Tiere nach ihrem Alter sortiert wurden, erscheint die Katze als erstes, gefolgt vom Hund und dann vom Pferd.
+
+27.)
+
+Welche Kontrollstrukturen gibt es in Java?
+
+In Java gibt es verschiedene Arten von Kontrollstrukturen, die zur Steuerung des Programmablaufs genutzt werden können:
+
+Bedingte Anweisungen (if-Anweisung, switch-Anweisung): Hierbei wird der Programmfluss abhängig von einer Bedingung gesteuert. Wenn die Bedingung erfüllt ist, wird eine bestimmte Anweisung ausgeführt.
+
+Schleifen (for-Schleife, while-Schleife, do-while-Schleife): Schleifen werden verwendet, um Anweisungen wiederholt auszuführen, bis eine bestimmte Bedingung erfüllt ist.
+
+Sprunganweisungen (break, continue): Mit Sprunganweisungen kann der Programmfluss an eine bestimmte Stelle im Code gesprungen werden.
+
+Try-catch-Block: Der Try-catch-Block wird verwendet, um Ausnahmen zu behandeln, die während der Ausführung des Codes auftreten können.
+
+Diese Kontrollstrukturen können je nach Anforderungen und Anwendungsfall miteinander kombiniert werden, um einen bestimmten Programmablauf zu realisieren.
+
+28.)
+
+Unterschiede und Gemeinsamkeiten zwischen primitiven Datentypen und Zeichenketten in Java
+
+In Java gibt es acht primitiven Datentypen: boolean, byte, short, int, long, float, double und char. Zeichenketten werden in Java durch den Datentyp String dargestellt. Hier sind einige Unterschiede und Gemeinsamkeiten zwischen primitiven Datentypen und Zeichenketten in Java:
+
+Datentypen: Primitiven Datentypen repräsentieren einfache Werte wie Zahlen, Wahrheitswerte oder Zeichen, während Zeichenketten komplexe Datenstrukturen sind, die aus einer Sequenz von Zeichen bestehen.
+
+Initialisierung: Primitiven Datentypen können mit einem Standardwert initialisiert werden, während Zeichenketten in Java immer initialisiert werden müssen, bevor sie verwendet werden können.
+
+Verarbeitung: Primitiven Datentypen werden häufig durch mathematische Operationen oder Vergleiche verarbeitet, während Zeichenketten häufig durch Textmanipulation verarbeitet werden, wie zum Beispiel das Verketten von Zeichenketten oder das Entfernen von Zeichen aus einer Zeichenkette.
+
+Speicherplatzbedarf: Primitiven Datentypen benötigen in der Regel weniger Speicherplatz als Zeichenketten.
+
+Vergleich: Primitiven Datentypen werden mit dem == Operator verglichen, während Zeichenketten mit der equals() Methode verglichen werden müssen.
+
+Konvertierung: Primitiven Datentypen können durch das Casten in andere Datentypen konvertiert werden, während Zeichenketten durch die Verwendung von Methoden wie parseInt() oder valueOf() in andere Datentypen konvertiert werden können.
+
+Manipulation: Primitiven Datentypen können nicht direkt manipuliert werden, während Zeichenketten durch Methoden wie replace() oder substring() manipuliert werden können.
+
+Trotz dieser Unterschiede haben primitiven Datentypen und Zeichenketten in Java auch einige Gemeinsamkeiten. Beide können als Argumente an Methoden übergeben und als Rückgabewerte von Methoden verwendet werden. Darüber hinaus können beide auch in Arrays gespeichert werden.
+
+29.)
+
+Gibt es in java pakete die nicht mit java beginnen?
+
+Ja, es gibt Java-Pakete, die nicht mit "java" beginnen. Dies liegt daran, dass Java eine standardisierte Möglichkeit bietet, Pakete zu benennen und zu organisieren, um Code-Organisation und -Wiederverwendung zu erleichtern. Java-Pakete können jedoch auch von Drittanbietern erstellt werden, die ihre eigenen Konventionen für die Benennung von Paketen haben können.
+
+Ein Beispiel für ein Java-Paket, das nicht mit "java" beginnt, ist das Paket "javax", das eine Erweiterung der Standard-Java-Bibliothek darstellt und zusätzliche APIs und Funktionen enthält, die nicht Teil des Kern-Java-SDKs sind. Ein weiteres Beispiel ist das Paket "org", das oft von Drittanbietern verwendet wird, um ihre eigenen Bibliotheken und Frameworks zu organisieren.
+
+Es ist wichtig zu beachten, dass es in der Java-Community eine Konvention gibt, Pakete umgekehrt von einer umgekehrten Domain-Namen-Notation zu benennen, um Paketnamenskonflikte zu vermeiden. Zum Beispiel könnte ein Paket eines Unternehmens "com.meinefirma" heißen, anstatt einfach "meinefirma".
diff --git a/doc/allclasses-index.html b/doc/allclasses-index.html
new file mode 100644
index 0000000..4468a5f
--- /dev/null
+++ b/doc/allclasses-index.html
@@ -0,0 +1,110 @@
+
+
+
+
+All Classes and Interfaces
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Starting from the Overview page, you can browse the documentation using the links in each page, and in the navigation bar at the top of each page. The Index and Search box allow you to navigate to specific declarations and summary pages, including: All Packages, All Classes and Interfaces
+
+
Search
+
You can search for definitions of modules, packages, types, fields, methods, system properties and other terms defined in the API, using some or all of the name, optionally using "camelCase" abbreviations. For example:
+
+
j.l.obj will match "java.lang.Object"
+
InpStr will match "java.io.InputStream"
+
HM.cK will match "java.util.HashMap.containsKey(Object)"
+The following sections describe the different kinds of pages in this collection.
+
+
Overview
+
The Overview page is the front page of this API document and provides a list of all packages with a summary for each. This page can also contain an overall description of the set of packages.
+
+
+
Package
+
Each package has a page that contains a list of its classes and interfaces, with a summary for each. These pages may contain the following categories:
+
+
Interfaces
+
Classes
+
Enum Classes
+
Exceptions
+
Errors
+
Annotation Interfaces
+
+
+
+
Class or Interface
+
Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a declaration and description, member summary tables, and detailed member descriptions. Entries in each of these sections are omitted if they are empty or not applicable.
+
+
Class Inheritance Diagram
+
Direct Subclasses
+
All Known Subinterfaces
+
All Known Implementing Classes
+
Class or Interface Declaration
+
Class or Interface Description
+
+
+
+
Nested Class Summary
+
Enum Constant Summary
+
Field Summary
+
Property Summary
+
Constructor Summary
+
Method Summary
+
Required Element Summary
+
Optional Element Summary
+
+
+
+
Enum Constant Details
+
Field Details
+
Property Details
+
Constructor Details
+
Method Details
+
Element Details
+
+
Note: Annotation interfaces have required and optional elements, but not methods. Only enum classes have enum constants. The components of a record class are displayed as part of the declaration of the record class. Properties are a feature of JavaFX.
+
The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.
+
+
+
Other Files
+
Packages and modules may contain pages with additional information related to the declarations nearby.
+
+
+
Use
+
Each documented package, class and interface has its own Use page. This page describes what packages, classes, methods, constructors and fields use any part of the given class or package. Given a class or interface A, its Use page includes subclasses of A, fields declared as A, methods that return A, and methods and constructors with parameters of type A. You can access this page by first going to the package, class or interface, then clicking on the USE link in the navigation bar.
+
+
+
Tree (Class Hierarchy)
+
There is a Class Hierarchy page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. Classes are organized by inheritance structure starting with java.lang.Object. Interfaces do not inherit from java.lang.Object.
+
+
When viewing the Overview page, clicking on TREE displays the hierarchy for all packages.
+
When viewing a particular package, class or interface page, clicking on TREE displays the hierarchy for only that package.
+
+
+
+
Deprecated API
+
The Deprecated API page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to shortcomings, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.
+
+
+
All Packages
+
The All Packages page contains an alphabetic index of all packages contained in the documentation.
+
+
+
All Classes and Interfaces
+
The All Classes and Interfaces page contains an alphabetic index of all classes and interfaces contained in the documentation, including annotation interfaces, enum classes, and record classes.
+
+
+
Index
+
The Index contains an alphabetic index of all classes, interfaces, constructors, methods, and fields in the documentation, as well as summary pages such as All Packages, All Classes and Interfaces.
+
+
+
+This help file applies to API documentation generated by the standard doclet.
+
+
+
diff --git a/doc/jquery-ui.overrides.css b/doc/jquery-ui.overrides.css
new file mode 100644
index 0000000..facf852
--- /dev/null
+++ b/doc/jquery-ui.overrides.css
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+.ui-state-active,
+.ui-widget-content .ui-state-active,
+.ui-widget-header .ui-state-active,
+a.ui-button:active,
+.ui-button:active,
+.ui-button.ui-state-active:hover {
+ /* Overrides the color of selection used in jQuery UI */
+ background: #F8981D;
+ border: 1px solid #F8981D;
+}
diff --git a/doc/legal/ADDITIONAL_LICENSE_INFO b/doc/legal/ADDITIONAL_LICENSE_INFO
new file mode 100644
index 0000000..76b7b2f
--- /dev/null
+++ b/doc/legal/ADDITIONAL_LICENSE_INFO
@@ -0,0 +1 @@
+../java.base/ADDITIONAL_LICENSE_INFO
\ No newline at end of file
diff --git a/doc/legal/ASSEMBLY_EXCEPTION b/doc/legal/ASSEMBLY_EXCEPTION
new file mode 100644
index 0000000..bd8da86
--- /dev/null
+++ b/doc/legal/ASSEMBLY_EXCEPTION
@@ -0,0 +1 @@
+../java.base/ASSEMBLY_EXCEPTION
\ No newline at end of file
diff --git a/doc/legal/LICENSE b/doc/legal/LICENSE
new file mode 100644
index 0000000..902705b
--- /dev/null
+++ b/doc/legal/LICENSE
@@ -0,0 +1 @@
+../java.base/LICENSE
\ No newline at end of file
diff --git a/doc/legal/jquery.md b/doc/legal/jquery.md
new file mode 100644
index 0000000..f7b72e3
--- /dev/null
+++ b/doc/legal/jquery.md
@@ -0,0 +1,72 @@
+## jQuery v3.6.0
+
+### jQuery License
+```
+jQuery v 3.6.0
+Copyright OpenJS Foundation and other contributors, https://openjsf.org/
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+******************************************
+
+The jQuery JavaScript Library v3.6.0 also includes Sizzle.js
+
+Sizzle.js includes the following license:
+
+Copyright JS Foundation and other contributors, https://js.foundation/
+
+This software consists of voluntary contributions made by many
+individuals. For exact contribution history, see the revision history
+available at https://github.com/jquery/sizzle
+
+The following license applies to all parts of this software except as
+documented below:
+
+====
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+====
+
+All files located in the node_modules and external directories are
+externally maintained libraries used by this software which have their
+own licenses; we recommend you read them, as their terms may differ from
+the terms above.
+
+*********************
+
+```
diff --git a/doc/legal/jqueryUI.md b/doc/legal/jqueryUI.md
new file mode 100644
index 0000000..8031bdb
--- /dev/null
+++ b/doc/legal/jqueryUI.md
@@ -0,0 +1,49 @@
+## jQuery UI v1.12.1
+
+### jQuery UI License
+```
+Copyright jQuery Foundation and other contributors, https://jquery.org/
+
+This software consists of voluntary contributions made by many
+individuals. For exact contribution history, see the revision history
+available at https://github.com/jquery/jquery-ui
+
+The following license applies to all parts of this software except as
+documented below:
+
+====
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+====
+
+Copyright and related rights for sample code are waived via CC0. Sample
+code is defined as all source code contained within the demos directory.
+
+CC0: http://creativecommons.org/publicdomain/zero/1.0/
+
+====
+
+All files located in the node_modules and external directories are
+externally maintained libraries used by this software which have their
+own licenses; we recommend you read them, as their terms may differ from
+the terms above.
+
+```
diff --git a/doc/member-search-index.js b/doc/member-search-index.js
new file mode 100644
index 0000000..a778624
--- /dev/null
+++ b/doc/member-search-index.js
@@ -0,0 +1 @@
+memberSearchIndex = [{"p":"onlineshop","c":"Kunde","l":"add(int, Integer)","u":"add(int,java.lang.Integer)"},{"p":"onlineshop","c":"KundenverwaltungMitMaps","l":"aktualisiereAlleKunden()"},{"p":"onlineshop.waren","c":"Artikel","l":"Artikel()","u":"%3Cinit%3E()"},{"p":"onlineshop","c":"Warenkorb","l":"artikelEntfernen(Artikel)","u":"artikelEntfernen(onlineshop.waren.Artikel)"},{"p":"onlineshop","c":"Warenkorb","l":"artikelHinzufuegen(Artikel)","u":"artikelHinzufuegen(onlineshop.waren.Artikel)"},{"p":"onlineshop","c":"Warenkorb","l":"artikelHinzufuegen(int, Artikel)","u":"artikelHinzufuegen(int,onlineshop.waren.Artikel)"},{"p":"onlineshop","c":"Bestellung","l":"Bestellung(String, Kunde, Warenkorb)","u":"%3Cinit%3E(java.lang.String,onlineshop.Kunde,onlineshop.Warenkorb)"},{"p":"onlineshop.waren","c":"Buch","l":"Buch()","u":"%3Cinit%3E()"},{"p":"onlineshop","c":"Kunde","l":"clone()"},{"p":"onlineshop.waren","c":"Buch","l":"clone()"},{"p":"onlineshop.waren","c":"Sachbuch","l":"clone()"},{"p":"onlineshop","c":"Kunde","l":"compareTo(Kunde)","u":"compareTo(onlineshop.Kunde)"},{"p":"onlineshop.sortiment","c":"Sortiment","l":"entferneArtikel(Artikel)","u":"entferneArtikel(onlineshop.waren.Artikel)"},{"p":"onlineshop","c":"Kunde","l":"equals(Object)","u":"equals(java.lang.Object)"},{"p":"onlineshop.waren","c":"Artikel","l":"equals(Object)","u":"equals(java.lang.Object)"},{"p":"onlineshop.waren","c":"Buch","l":"equals(Object)","u":"equals(java.lang.Object)"},{"p":"onlineshop.waren","c":"Sachbuch","l":"equals(Object)","u":"equals(java.lang.Object)"},{"p":"onlineshop.sortiment","c":"Sortiment","l":"ermittleFehlendeArtikel(Set)","u":"ermittleFehlendeArtikel(java.util.Set)"},{"p":"onlineshop.sortiment","c":"Sortiment","l":"ermittleVerfuegbareArtikel(Set)","u":"ermittleVerfuegbareArtikel(java.util.Set)"},{"p":"onlineshop.sortiment","c":"Sortiment","l":"erweitereSortiment(Collection)","u":"erweitereSortiment(java.util.Collection)"},{"p":"onlineshop","c":"Warenkorb","l":"getAnzahlArtikel()"},{"p":"onlineshop.waren","c":"Artikel","l":"getBeschreibung()"},{"p":"onlineshop.waren","c":"Buch","l":"getBeschreibung()"},{"p":"onlineshop","c":"KundenverwaltungMitMaps","l":"getKundendaten(int)"},{"p":"onlineshop","c":"Kunde","l":"getKundennummer()"},{"p":"onlineshop.waren","c":"Artikel","l":"getPreis()"},{"p":"onlineshop.waren","c":"Sachbuch","l":"getThema()"},{"p":"onlineshop","c":"Kunde","l":"hashCode()"},{"p":"onlineshop.waren","c":"Artikel","l":"hashCode()"},{"p":"onlineshop.waren","c":"Buch","l":"hashCode()"},{"p":"onlineshop.waren","c":"Sachbuch","l":"hashCode()"},{"p":"onlineshop","c":"Warenkorb","l":"hashCode()"},{"p":"onlineshop","c":"Historie","l":"Historie()","u":"%3Cinit%3E()"},{"p":"onlineshop","c":"Kunde","l":"Kunde(String, String)","u":"%3Cinit%3E(java.lang.String,java.lang.String)"},{"p":"onlineshop","c":"KundenverwaltungMitMaps","l":"KundenverwaltungMitMaps()","u":"%3Cinit%3E()"},{"p":"onlineshop","c":"Warenkorb","l":"leereWarenkorb()"},{"p":"onlineshop","c":"Main","l":"Main()","u":"%3Cinit%3E()"},{"p":"onlineshop","c":"Main","l":"main(String[])","u":"main(java.lang.String[])"},{"p":"onlineshop.sortiment","c":"Sortiment","l":"neuerArtikel(Artikel)","u":"neuerArtikel(onlineshop.waren.Artikel)"},{"p":"onlineshop","c":"Main","l":"neuesBuch(String, String, String, int)","u":"neuesBuch(java.lang.String,java.lang.String,java.lang.String,int)"},{"p":"onlineshop","c":"Main","l":"onlineShop"},{"p":"onlineshop","c":"OnlineShop","l":"OnlineShop()","u":"%3Cinit%3E()"},{"p":"onlineshop","c":"OnlineShop","l":"OnlineShop(Queue, Historie)","u":"%3Cinit%3E(java.util.Queue,onlineshop.Historie)"},{"p":"onlineshop.sortiment","c":"Sortiment","l":"pruefeBestellung(Collection)","u":"pruefeBestellung(java.util.Collection)"},{"p":"onlineshop.waren","c":"Sachbuch","l":"Sachbuch()","u":"%3Cinit%3E()"},{"p":"onlineshop.waren","c":"Sachbuch","l":"Sachbuch(String, String, String, double, String, String)","u":"%3Cinit%3E(java.lang.String,java.lang.String,java.lang.String,double,java.lang.String,java.lang.String)"},{"p":"onlineshop.waren","c":"Buch","l":"setAnzahlSeiten(int)"},{"p":"onlineshop.waren","c":"Buch","l":"setAutor(String)","u":"setAutor(java.lang.String)"},{"p":"onlineshop.waren","c":"Artikel","l":"setHersteller(String)","u":"setHersteller(java.lang.String)"},{"p":"onlineshop.waren","c":"Artikel","l":"setPreis(float)"},{"p":"onlineshop.waren","c":"Buch","l":"setSeiten(int)"},{"p":"onlineshop.waren","c":"Sachbuch","l":"setThema(String)","u":"setThema(java.lang.String)"},{"p":"onlineshop.waren","c":"Buch","l":"setTitel(String)","u":"setTitel(java.lang.String)"},{"p":"onlineshop.sortiment","c":"Sortiment","l":"Sortiment()","u":"%3Cinit%3E()"},{"p":"onlineshop","c":"Bestellung","l":"toString()"},{"p":"onlineshop","c":"Kunde","l":"toString()"},{"p":"onlineshop","c":"OnlineShop","l":"toString()"},{"p":"onlineshop.waren","c":"Artikel","l":"toString()"},{"p":"onlineshop.waren","c":"Buch","l":"toString()"},{"p":"onlineshop.waren","c":"Sachbuch","l":"toString()"},{"p":"onlineshop","c":"Warenkorb","l":"toString()"},{"p":"onlineshop","c":"Warenkorb","l":"Warenkorb()","u":"%3Cinit%3E()"},{"p":"onlineshop","c":"Warenkorb","l":"Warenkorb(int, float, boolean)","u":"%3Cinit%3E(int,float,boolean)"},{"p":"onlineshop","c":"Historie","l":"weiter(String)","u":"weiter(java.lang.String)"},{"p":"onlineshop","c":"Historie","l":"zurueck()"},{"p":"onlineshop.waren","c":"Sachbuch","l":"zusammenfassen()"}];updateSearchResults();
\ No newline at end of file
diff --git a/doc/module-search-index.js b/doc/module-search-index.js
new file mode 100644
index 0000000..0d59754
--- /dev/null
+++ b/doc/module-search-index.js
@@ -0,0 +1 @@
+moduleSearchIndex = [];updateSearchResults();
\ No newline at end of file
diff --git a/doc/onlineshop/Bestellung.html b/doc/onlineshop/Bestellung.html
new file mode 100644
index 0000000..a285f2a
--- /dev/null
+++ b/doc/onlineshop/Bestellung.html
@@ -0,0 +1,180 @@
+
+
+
+
+Bestellung
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Diese Klasse stellt den Einstiegspunkt in das Programm dar.
+ Dies Klasse beinhaltet die mmain-Methode, mit der
+ das Programm gestartet wird. Die main-Methode erzeugt
+ alle benötigten Objekte selbst und beendet sich, nachdem alle
+ Anweisungen abgearbeitet wurden.
").text(e.label)).appendTo(t)},_move:function(t,e){if(this.menu.element.is(":visible"))return this.menu.isFirstItem()&&/^previous/.test(t)||this.menu.isLastItem()&&/^next/.test(t)?(this.isMultiLine||this._value(this.term),void this.menu.blur()):void this.menu[t](e);this.search(null,e)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(t,e){this.isMultiLine&&!this.menu.element.is(":visible")||(this._move(t,e),e.preventDefault())},_isContentEditable:function(t){if(!t.length)return!1;var e=t.prop("contentEditable");return"inherit"===e?this._isContentEditable(t.parent()):"true"===e}}),x.extend(x.ui.autocomplete,{escapeRegex:function(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(t,e){var i=new RegExp(x.ui.autocomplete.escapeRegex(e),"i");return x.grep(t,function(t){return i.test(t.label||t.value||t)})}}),x.widget("ui.autocomplete",x.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(t){return t+(1").text(e))},100))}});x.ui.autocomplete});
\ No newline at end of file
diff --git a/doc/script.js b/doc/script.js
new file mode 100644
index 0000000..864989c
--- /dev/null
+++ b/doc/script.js
@@ -0,0 +1,132 @@
+/*
+ * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+var moduleSearchIndex;
+var packageSearchIndex;
+var typeSearchIndex;
+var memberSearchIndex;
+var tagSearchIndex;
+function loadScripts(doc, tag) {
+ createElem(doc, tag, 'search.js');
+
+ createElem(doc, tag, 'module-search-index.js');
+ createElem(doc, tag, 'package-search-index.js');
+ createElem(doc, tag, 'type-search-index.js');
+ createElem(doc, tag, 'member-search-index.js');
+ createElem(doc, tag, 'tag-search-index.js');
+}
+
+function createElem(doc, tag, path) {
+ var script = doc.createElement(tag);
+ var scriptElement = doc.getElementsByTagName(tag)[0];
+ script.src = pathtoroot + path;
+ scriptElement.parentNode.insertBefore(script, scriptElement);
+}
+
+function show(tableId, selected, columns) {
+ if (tableId !== selected) {
+ document.querySelectorAll('div.' + tableId + ':not(.' + selected + ')')
+ .forEach(function(elem) {
+ elem.style.display = 'none';
+ });
+ }
+ document.querySelectorAll('div.' + selected)
+ .forEach(function(elem, index) {
+ elem.style.display = '';
+ var isEvenRow = index % (columns * 2) < columns;
+ elem.classList.remove(isEvenRow ? oddRowColor : evenRowColor);
+ elem.classList.add(isEvenRow ? evenRowColor : oddRowColor);
+ });
+ updateTabs(tableId, selected);
+}
+
+function updateTabs(tableId, selected) {
+ document.querySelector('div#' + tableId +' .summary-table')
+ .setAttribute('aria-labelledby', selected);
+ document.querySelectorAll('button[id^="' + tableId + '"]')
+ .forEach(function(tab, index) {
+ if (selected === tab.id || (tableId === selected && index === 0)) {
+ tab.className = activeTableTab;
+ tab.setAttribute('aria-selected', true);
+ tab.setAttribute('tabindex',0);
+ } else {
+ tab.className = tableTab;
+ tab.setAttribute('aria-selected', false);
+ tab.setAttribute('tabindex',-1);
+ }
+ });
+}
+
+function switchTab(e) {
+ var selected = document.querySelector('[aria-selected=true]');
+ if (selected) {
+ if ((e.keyCode === 37 || e.keyCode === 38) && selected.previousSibling) {
+ // left or up arrow key pressed: move focus to previous tab
+ selected.previousSibling.click();
+ selected.previousSibling.focus();
+ e.preventDefault();
+ } else if ((e.keyCode === 39 || e.keyCode === 40) && selected.nextSibling) {
+ // right or down arrow key pressed: move focus to next tab
+ selected.nextSibling.click();
+ selected.nextSibling.focus();
+ e.preventDefault();
+ }
+ }
+}
+
+var updateSearchResults = function() {};
+
+function indexFilesLoaded() {
+ return moduleSearchIndex
+ && packageSearchIndex
+ && typeSearchIndex
+ && memberSearchIndex
+ && tagSearchIndex;
+}
+
+// Workaround for scroll position not being included in browser history (8249133)
+document.addEventListener("DOMContentLoaded", function(e) {
+ var contentDiv = document.querySelector("div.flex-content");
+ window.addEventListener("popstate", function(e) {
+ if (e.state !== null) {
+ contentDiv.scrollTop = e.state;
+ }
+ });
+ window.addEventListener("hashchange", function(e) {
+ history.replaceState(contentDiv.scrollTop, document.title);
+ });
+ contentDiv.addEventListener("scroll", function(e) {
+ var timeoutID;
+ if (!timeoutID) {
+ timeoutID = setTimeout(function() {
+ history.replaceState(contentDiv.scrollTop, document.title);
+ timeoutID = null;
+ }, 100);
+ }
+ });
+ if (!location.hash) {
+ history.replaceState(contentDiv.scrollTop, document.title);
+ }
+});
diff --git a/doc/search.js b/doc/search.js
new file mode 100644
index 0000000..db3b2f4
--- /dev/null
+++ b/doc/search.js
@@ -0,0 +1,354 @@
+/*
+ * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+var noResult = {l: "No results found"};
+var loading = {l: "Loading search index..."};
+var catModules = "Modules";
+var catPackages = "Packages";
+var catTypes = "Classes and Interfaces";
+var catMembers = "Members";
+var catSearchTags = "Search Tags";
+var highlight = "$&";
+var searchPattern = "";
+var fallbackPattern = "";
+var RANKING_THRESHOLD = 2;
+var NO_MATCH = 0xffff;
+var MIN_RESULTS = 3;
+var MAX_RESULTS = 500;
+var UNNAMED = "";
+function escapeHtml(str) {
+ return str.replace(//g, ">");
+}
+function getHighlightedText(item, matcher, fallbackMatcher) {
+ var escapedItem = escapeHtml(item);
+ var highlighted = escapedItem.replace(matcher, highlight);
+ if (highlighted === escapedItem) {
+ highlighted = escapedItem.replace(fallbackMatcher, highlight)
+ }
+ return highlighted;
+}
+function getURLPrefix(ui) {
+ var urlPrefix="";
+ var slash = "/";
+ if (ui.item.category === catModules) {
+ return ui.item.l + slash;
+ } else if (ui.item.category === catPackages && ui.item.m) {
+ return ui.item.m + slash;
+ } else if (ui.item.category === catTypes || ui.item.category === catMembers) {
+ if (ui.item.m) {
+ urlPrefix = ui.item.m + slash;
+ } else {
+ $.each(packageSearchIndex, function(index, item) {
+ if (item.m && ui.item.p === item.l) {
+ urlPrefix = item.m + slash;
+ }
+ });
+ }
+ }
+ return urlPrefix;
+}
+function createSearchPattern(term) {
+ var pattern = "";
+ var isWordToken = false;
+ term.replace(/,\s*/g, ", ").trim().split(/\s+/).forEach(function(w, index) {
+ if (index > 0) {
+ // whitespace between identifiers is significant
+ pattern += (isWordToken && /^\w/.test(w)) ? "\\s+" : "\\s*";
+ }
+ var tokens = w.split(/(?=[A-Z,.()<>[\/])/);
+ for (var i = 0; i < tokens.length; i++) {
+ var s = tokens[i];
+ if (s === "") {
+ continue;
+ }
+ pattern += $.ui.autocomplete.escapeRegex(s);
+ isWordToken = /\w$/.test(s);
+ if (isWordToken) {
+ pattern += "([a-z0-9_$<>\\[\\]]*?)";
+ }
+ }
+ });
+ return pattern;
+}
+function createMatcher(pattern, flags) {
+ var isCamelCase = /[A-Z]/.test(pattern);
+ return new RegExp(pattern, flags + (isCamelCase ? "" : "i"));
+}
+var watermark = 'Search';
+$(function() {
+ var search = $("#search-input");
+ var reset = $("#reset-button");
+ search.val('');
+ search.prop("disabled", false);
+ reset.prop("disabled", false);
+ search.val(watermark).addClass('watermark');
+ search.blur(function() {
+ if ($(this).val().length === 0) {
+ $(this).val(watermark).addClass('watermark');
+ }
+ });
+ search.on('click keydown paste', function() {
+ if ($(this).val() === watermark) {
+ $(this).val('').removeClass('watermark');
+ }
+ });
+ reset.click(function() {
+ search.val('').focus();
+ });
+ search.focus()[0].setSelectionRange(0, 0);
+});
+$.widget("custom.catcomplete", $.ui.autocomplete, {
+ _create: function() {
+ this._super();
+ this.widget().menu("option", "items", "> :not(.ui-autocomplete-category)");
+ },
+ _renderMenu: function(ul, items) {
+ var rMenu = this;
+ var currentCategory = "";
+ rMenu.menu.bindings = $();
+ $.each(items, function(index, item) {
+ var li;
+ if (item.category && item.category !== currentCategory) {
+ ul.append("
" + item.category + "
");
+ currentCategory = item.category;
+ }
+ li = rMenu._renderItemData(ul, item);
+ if (item.category) {
+ li.attr("aria-label", item.category + " : " + item.l);
+ li.attr("class", "result-item");
+ } else {
+ li.attr("aria-label", item.l);
+ li.attr("class", "result-item");
+ }
+ });
+ },
+ _renderItem: function(ul, item) {
+ var label = "";
+ var matcher = createMatcher(escapeHtml(searchPattern), "g");
+ var fallbackMatcher = new RegExp(fallbackPattern, "gi")
+ if (item.category === catModules) {
+ label = getHighlightedText(item.l, matcher, fallbackMatcher);
+ } else if (item.category === catPackages) {
+ label = getHighlightedText(item.l, matcher, fallbackMatcher);
+ } else if (item.category === catTypes) {
+ label = (item.p && item.p !== UNNAMED)
+ ? getHighlightedText(item.p + "." + item.l, matcher, fallbackMatcher)
+ : getHighlightedText(item.l, matcher, fallbackMatcher);
+ } else if (item.category === catMembers) {
+ label = (item.p && item.p !== UNNAMED)
+ ? getHighlightedText(item.p + "." + item.c + "." + item.l, matcher, fallbackMatcher)
+ : getHighlightedText(item.c + "." + item.l, matcher, fallbackMatcher);
+ } else if (item.category === catSearchTags) {
+ label = getHighlightedText(item.l, matcher, fallbackMatcher);
+ } else {
+ label = item.l;
+ }
+ var li = $("").appendTo(ul);
+ var div = $("").appendTo(li);
+ if (item.category === catSearchTags && item.h) {
+ if (item.d) {
+ div.html(label + " (" + item.h + ") "
+ + item.d + " ");
+ } else {
+ div.html(label + " (" + item.h + ")");
+ }
+ } else {
+ if (item.m) {
+ div.html(item.m + "/" + label);
+ } else {
+ div.html(label);
+ }
+ }
+ return li;
+ }
+});
+function rankMatch(match, category) {
+ if (!match) {
+ return NO_MATCH;
+ }
+ var index = match.index;
+ var input = match.input;
+ var leftBoundaryMatch = 2;
+ var periferalMatch = 0;
+ // make sure match is anchored on a left word boundary
+ if (index === 0 || /\W/.test(input[index - 1]) || "_" === input[index]) {
+ leftBoundaryMatch = 0;
+ } else if ("_" === input[index - 1] || (input[index] === input[index].toUpperCase() && !/^[A-Z0-9_$]+$/.test(input))) {
+ leftBoundaryMatch = 1;
+ }
+ var matchEnd = index + match[0].length;
+ var leftParen = input.indexOf("(");
+ var endOfName = leftParen > -1 ? leftParen : input.length;
+ // exclude peripheral matches
+ if (category !== catModules && category !== catSearchTags) {
+ var delim = category === catPackages ? "/" : ".";
+ if (leftParen > -1 && leftParen < index) {
+ periferalMatch += 2;
+ } else if (input.lastIndexOf(delim, endOfName) >= matchEnd) {
+ periferalMatch += 2;
+ }
+ }
+ var delta = match[0].length === endOfName ? 0 : 1; // rank full match higher than partial match
+ for (var i = 1; i < match.length; i++) {
+ // lower ranking if parts of the name are missing
+ if (match[i])
+ delta += match[i].length;
+ }
+ if (category === catTypes) {
+ // lower ranking if a type name contains unmatched camel-case parts
+ if (/[A-Z]/.test(input.substring(matchEnd)))
+ delta += 5;
+ if (/[A-Z]/.test(input.substring(0, index)))
+ delta += 5;
+ }
+ return leftBoundaryMatch + periferalMatch + (delta / 200);
+
+}
+function doSearch(request, response) {
+ var result = [];
+ searchPattern = createSearchPattern(request.term);
+ fallbackPattern = createSearchPattern(request.term.toLowerCase());
+ if (searchPattern === "") {
+ return this.close();
+ }
+ var camelCaseMatcher = createMatcher(searchPattern, "");
+ var fallbackMatcher = new RegExp(fallbackPattern, "i");
+
+ function searchIndexWithMatcher(indexArray, matcher, category, nameFunc) {
+ if (indexArray) {
+ var newResults = [];
+ $.each(indexArray, function (i, item) {
+ item.category = category;
+ var ranking = rankMatch(matcher.exec(nameFunc(item)), category);
+ if (ranking < RANKING_THRESHOLD) {
+ newResults.push({ranking: ranking, item: item});
+ }
+ return newResults.length <= MAX_RESULTS;
+ });
+ return newResults.sort(function(e1, e2) {
+ return e1.ranking - e2.ranking;
+ }).map(function(e) {
+ return e.item;
+ });
+ }
+ return [];
+ }
+ function searchIndex(indexArray, category, nameFunc) {
+ var primaryResults = searchIndexWithMatcher(indexArray, camelCaseMatcher, category, nameFunc);
+ result = result.concat(primaryResults);
+ if (primaryResults.length <= MIN_RESULTS && !camelCaseMatcher.ignoreCase) {
+ var secondaryResults = searchIndexWithMatcher(indexArray, fallbackMatcher, category, nameFunc);
+ result = result.concat(secondaryResults.filter(function (item) {
+ return primaryResults.indexOf(item) === -1;
+ }));
+ }
+ }
+
+ searchIndex(moduleSearchIndex, catModules, function(item) { return item.l; });
+ searchIndex(packageSearchIndex, catPackages, function(item) {
+ return (item.m && request.term.indexOf("/") > -1)
+ ? (item.m + "/" + item.l) : item.l;
+ });
+ searchIndex(typeSearchIndex, catTypes, function(item) {
+ return request.term.indexOf(".") > -1 ? item.p + "." + item.l : item.l;
+ });
+ searchIndex(memberSearchIndex, catMembers, function(item) {
+ return request.term.indexOf(".") > -1
+ ? item.p + "." + item.c + "." + item.l : item.l;
+ });
+ searchIndex(tagSearchIndex, catSearchTags, function(item) { return item.l; });
+
+ if (!indexFilesLoaded()) {
+ updateSearchResults = function() {
+ doSearch(request, response);
+ }
+ result.unshift(loading);
+ } else {
+ updateSearchResults = function() {};
+ }
+ response(result);
+}
+$(function() {
+ $("#search-input").catcomplete({
+ minLength: 1,
+ delay: 300,
+ source: doSearch,
+ response: function(event, ui) {
+ if (!ui.content.length) {
+ ui.content.push(noResult);
+ } else {
+ $("#search-input").empty();
+ }
+ },
+ autoFocus: true,
+ focus: function(event, ui) {
+ return false;
+ },
+ position: {
+ collision: "flip"
+ },
+ select: function(event, ui) {
+ if (ui.item.category) {
+ var url = getURLPrefix(ui);
+ if (ui.item.category === catModules) {
+ url += "module-summary.html";
+ } else if (ui.item.category === catPackages) {
+ if (ui.item.u) {
+ url = ui.item.u;
+ } else {
+ url += ui.item.l.replace(/\./g, '/') + "/package-summary.html";
+ }
+ } else if (ui.item.category === catTypes) {
+ if (ui.item.u) {
+ url = ui.item.u;
+ } else if (ui.item.p === UNNAMED) {
+ url += ui.item.l + ".html";
+ } else {
+ url += ui.item.p.replace(/\./g, '/') + "/" + ui.item.l + ".html";
+ }
+ } else if (ui.item.category === catMembers) {
+ if (ui.item.p === UNNAMED) {
+ url += ui.item.c + ".html" + "#";
+ } else {
+ url += ui.item.p.replace(/\./g, '/') + "/" + ui.item.c + ".html" + "#";
+ }
+ if (ui.item.u) {
+ url += ui.item.u;
+ } else {
+ url += ui.item.l;
+ }
+ } else if (ui.item.category === catSearchTags) {
+ url += ui.item.u;
+ }
+ if (top !== window) {
+ parent.classFrame.location = pathtoroot + url;
+ } else {
+ window.location.href = pathtoroot + url;
+ }
+ $("#search-input").focus();
+ }
+ }
+ });
+});
diff --git a/doc/stylesheet.css b/doc/stylesheet.css
new file mode 100644
index 0000000..4a576bd
--- /dev/null
+++ b/doc/stylesheet.css
@@ -0,0 +1,869 @@
+/*
+ * Javadoc style sheet
+ */
+
+@import url('resources/fonts/dejavu.css');
+
+/*
+ * Styles for individual HTML elements.
+ *
+ * These are styles that are specific to individual HTML elements. Changing them affects the style of a particular
+ * HTML element throughout the page.
+ */
+
+body {
+ background-color:#ffffff;
+ color:#353833;
+ font-family:'DejaVu Sans', Arial, Helvetica, sans-serif;
+ font-size:14px;
+ margin:0;
+ padding:0;
+ height:100%;
+ width:100%;
+}
+iframe {
+ margin:0;
+ padding:0;
+ height:100%;
+ width:100%;
+ overflow-y:scroll;
+ border:none;
+}
+a:link, a:visited {
+ text-decoration:none;
+ color:#4A6782;
+}
+a[href]:hover, a[href]:focus {
+ text-decoration:none;
+ color:#bb7a2a;
+}
+a[name] {
+ color:#353833;
+}
+pre {
+ font-family:'DejaVu Sans Mono', monospace;
+ font-size:14px;
+}
+h1 {
+ font-size:20px;
+}
+h2 {
+ font-size:18px;
+}
+h3 {
+ font-size:16px;
+}
+h4 {
+ font-size:15px;
+}
+h5 {
+ font-size:14px;
+}
+h6 {
+ font-size:13px;
+}
+ul {
+ list-style-type:disc;
+}
+code, tt {
+ font-family:'DejaVu Sans Mono', monospace;
+}
+:not(h1, h2, h3, h4, h5, h6) > code,
+:not(h1, h2, h3, h4, h5, h6) > tt {
+ font-size:14px;
+ padding-top:4px;
+ margin-top:8px;
+ line-height:1.4em;
+}
+dt code {
+ font-family:'DejaVu Sans Mono', monospace;
+ font-size:14px;
+ padding-top:4px;
+}
+.summary-table dt code {
+ font-family:'DejaVu Sans Mono', monospace;
+ font-size:14px;
+ vertical-align:top;
+ padding-top:4px;
+}
+sup {
+ font-size:8px;
+}
+button {
+ font-family: 'DejaVu Sans', Arial, Helvetica, sans-serif;
+ font-size: 14px;
+}
+/*
+ * Styles for HTML generated by javadoc.
+ *
+ * These are style classes that are used by the standard doclet to generate HTML documentation.
+ */
+
+/*
+ * Styles for document title and copyright.
+ */
+.clear {
+ clear:both;
+ height:0;
+ overflow:hidden;
+}
+.about-language {
+ float:right;
+ padding:0 21px 8px 8px;
+ font-size:11px;
+ margin-top:-9px;
+ height:2.9em;
+}
+.legal-copy {
+ margin-left:.5em;
+}
+.tab {
+ background-color:#0066FF;
+ color:#ffffff;
+ padding:8px;
+ width:5em;
+ font-weight:bold;
+}
+/*
+ * Styles for navigation bar.
+ */
+@media screen {
+ .flex-box {
+ position:fixed;
+ display:flex;
+ flex-direction:column;
+ height: 100%;
+ width: 100%;
+ }
+ .flex-header {
+ flex: 0 0 auto;
+ }
+ .flex-content {
+ flex: 1 1 auto;
+ overflow-y: auto;
+ }
+}
+.top-nav {
+ background-color:#4D7A97;
+ color:#FFFFFF;
+ float:left;
+ padding:0;
+ width:100%;
+ clear:right;
+ min-height:2.8em;
+ padding-top:10px;
+ overflow:hidden;
+ font-size:12px;
+}
+.sub-nav {
+ background-color:#dee3e9;
+ float:left;
+ width:100%;
+ overflow:hidden;
+ font-size:12px;
+}
+.sub-nav div {
+ clear:left;
+ float:left;
+ padding:0 0 5px 6px;
+ text-transform:uppercase;
+}
+.sub-nav .nav-list {
+ padding-top:5px;
+}
+ul.nav-list {
+ display:block;
+ margin:0 25px 0 0;
+ padding:0;
+}
+ul.sub-nav-list {
+ float:left;
+ margin:0 25px 0 0;
+ padding:0;
+}
+ul.nav-list li {
+ list-style:none;
+ float:left;
+ padding: 5px 6px;
+ text-transform:uppercase;
+}
+.sub-nav .nav-list-search {
+ float:right;
+ margin:0 0 0 0;
+ padding:5px 6px;
+ clear:none;
+}
+.nav-list-search label {
+ position:relative;
+ right:-16px;
+}
+ul.sub-nav-list li {
+ list-style:none;
+ float:left;
+ padding-top:10px;
+}
+.top-nav a:link, .top-nav a:active, .top-nav a:visited {
+ color:#FFFFFF;
+ text-decoration:none;
+ text-transform:uppercase;
+}
+.top-nav a:hover {
+ text-decoration:none;
+ color:#bb7a2a;
+ text-transform:uppercase;
+}
+.nav-bar-cell1-rev {
+ background-color:#F8981D;
+ color:#253441;
+ margin: auto 5px;
+}
+.skip-nav {
+ position:absolute;
+ top:auto;
+ left:-9999px;
+ overflow:hidden;
+}
+/*
+ * Hide navigation links and search box in print layout
+ */
+@media print {
+ ul.nav-list, div.sub-nav {
+ display:none;
+ }
+}
+/*
+ * Styles for page header and footer.
+ */
+.title {
+ color:#2c4557;
+ margin:10px 0;
+}
+.sub-title {
+ margin:5px 0 0 0;
+}
+.header ul {
+ margin:0 0 15px 0;
+ padding:0;
+}
+.header ul li, .footer ul li {
+ list-style:none;
+ font-size:13px;
+}
+/*
+ * Styles for headings.
+ */
+body.class-declaration-page .summary h2,
+body.class-declaration-page .details h2,
+body.class-use-page h2,
+body.module-declaration-page .block-list h2 {
+ font-style: italic;
+ padding:0;
+ margin:15px 0;
+}
+body.class-declaration-page .summary h3,
+body.class-declaration-page .details h3,
+body.class-declaration-page .summary .inherited-list h2 {
+ background-color:#dee3e9;
+ border:1px solid #d0d9e0;
+ margin:0 0 6px -8px;
+ padding:7px 5px;
+}
+/*
+ * Styles for page layout containers.
+ */
+main {
+ clear:both;
+ padding:10px 20px;
+ position:relative;
+}
+dl.notes > dt {
+ font-family: 'DejaVu Sans', Arial, Helvetica, sans-serif;
+ font-size:12px;
+ font-weight:bold;
+ margin:10px 0 0 0;
+ color:#4E4E4E;
+}
+dl.notes > dd {
+ margin:5px 10px 10px 0;
+ font-size:14px;
+ font-family:'DejaVu Serif', Georgia, "Times New Roman", Times, serif;
+}
+dl.name-value > dt {
+ margin-left:1px;
+ font-size:1.1em;
+ display:inline;
+ font-weight:bold;
+}
+dl.name-value > dd {
+ margin:0 0 0 1px;
+ font-size:1.1em;
+ display:inline;
+}
+/*
+ * Styles for lists.
+ */
+li.circle {
+ list-style:circle;
+}
+ul.horizontal li {
+ display:inline;
+ font-size:0.9em;
+}
+div.inheritance {
+ margin:0;
+ padding:0;
+}
+div.inheritance div.inheritance {
+ margin-left:2em;
+}
+ul.block-list,
+ul.details-list,
+ul.member-list,
+ul.summary-list {
+ margin:10px 0 10px 0;
+ padding:0;
+}
+ul.block-list > li,
+ul.details-list > li,
+ul.member-list > li,
+ul.summary-list > li {
+ list-style:none;
+ margin-bottom:15px;
+ line-height:1.4;
+}
+.summary-table dl, .summary-table dl dt, .summary-table dl dd {
+ margin-top:0;
+ margin-bottom:1px;
+}
+ul.see-list, ul.see-list-long {
+ padding-left: 0;
+ list-style: none;
+}
+ul.see-list li {
+ display: inline;
+}
+ul.see-list li:not(:last-child):after,
+ul.see-list-long li:not(:last-child):after {
+ content: ", ";
+ white-space: pre-wrap;
+}
+/*
+ * Styles for tables.
+ */
+.summary-table, .details-table {
+ width:100%;
+ border-spacing:0;
+ border-left:1px solid #EEE;
+ border-right:1px solid #EEE;
+ border-bottom:1px solid #EEE;
+ padding:0;
+}
+.caption {
+ position:relative;
+ text-align:left;
+ background-repeat:no-repeat;
+ color:#253441;
+ font-weight:bold;
+ clear:none;
+ overflow:hidden;
+ padding:0;
+ padding-top:10px;
+ padding-left:1px;
+ margin:0;
+ white-space:pre;
+}
+.caption a:link, .caption a:visited {
+ color:#1f389c;
+}
+.caption a:hover,
+.caption a:active {
+ color:#FFFFFF;
+}
+.caption span {
+ white-space:nowrap;
+ padding-top:5px;
+ padding-left:12px;
+ padding-right:12px;
+ padding-bottom:7px;
+ display:inline-block;
+ float:left;
+ background-color:#F8981D;
+ border: none;
+ height:16px;
+}
+div.table-tabs {
+ padding:10px 0 0 1px;
+ margin:0;
+}
+div.table-tabs > button {
+ border: none;
+ cursor: pointer;
+ padding: 5px 12px 7px 12px;
+ font-weight: bold;
+ margin-right: 3px;
+}
+div.table-tabs > button.active-table-tab {
+ background: #F8981D;
+ color: #253441;
+}
+div.table-tabs > button.table-tab {
+ background: #4D7A97;
+ color: #FFFFFF;
+}
+.two-column-summary {
+ display: grid;
+ grid-template-columns: minmax(15%, max-content) minmax(15%, auto);
+}
+.three-column-summary {
+ display: grid;
+ grid-template-columns: minmax(10%, max-content) minmax(15%, max-content) minmax(15%, auto);
+}
+.four-column-summary {
+ display: grid;
+ grid-template-columns: minmax(10%, max-content) minmax(10%, max-content) minmax(10%, max-content) minmax(10%, auto);
+}
+@media screen and (max-width: 600px) {
+ .two-column-summary {
+ display: grid;
+ grid-template-columns: 1fr;
+ }
+}
+@media screen and (max-width: 800px) {
+ .three-column-summary {
+ display: grid;
+ grid-template-columns: minmax(10%, max-content) minmax(25%, auto);
+ }
+ .three-column-summary .col-last {
+ grid-column-end: span 2;
+ }
+}
+@media screen and (max-width: 1000px) {
+ .four-column-summary {
+ display: grid;
+ grid-template-columns: minmax(15%, max-content) minmax(15%, auto);
+ }
+}
+.summary-table > div, .details-table > div {
+ text-align:left;
+ padding: 8px 3px 3px 7px;
+}
+.col-first, .col-second, .col-last, .col-constructor-name, .col-summary-item-name {
+ vertical-align:top;
+ padding-right:0;
+ padding-top:8px;
+ padding-bottom:3px;
+}
+.table-header {
+ background:#dee3e9;
+ font-weight: bold;
+}
+.col-first, .col-first {
+ font-size:13px;
+}
+.col-second, .col-second, .col-last, .col-constructor-name, .col-summary-item-name, .col-last {
+ font-size:13px;
+}
+.col-first, .col-second, .col-constructor-name {
+ vertical-align:top;
+ overflow: auto;
+}
+.col-last {
+ white-space:normal;
+}
+.col-first a:link, .col-first a:visited,
+.col-second a:link, .col-second a:visited,
+.col-first a:link, .col-first a:visited,
+.col-second a:link, .col-second a:visited,
+.col-constructor-name a:link, .col-constructor-name a:visited,
+.col-summary-item-name a:link, .col-summary-item-name a:visited,
+.constant-values-container a:link, .constant-values-container a:visited,
+.all-classes-container a:link, .all-classes-container a:visited,
+.all-packages-container a:link, .all-packages-container a:visited {
+ font-weight:bold;
+}
+.table-sub-heading-color {
+ background-color:#EEEEFF;
+}
+.even-row-color, .even-row-color .table-header {
+ background-color:#FFFFFF;
+}
+.odd-row-color, .odd-row-color .table-header {
+ background-color:#EEEEEF;
+}
+/*
+ * Styles for contents.
+ */
+.deprecated-content {
+ margin:0;
+ padding:10px 0;
+}
+div.block {
+ font-size:14px;
+ font-family:'DejaVu Serif', Georgia, "Times New Roman", Times, serif;
+}
+.col-last div {
+ padding-top:0;
+}
+.col-last a {
+ padding-bottom:3px;
+}
+.module-signature,
+.package-signature,
+.type-signature,
+.member-signature {
+ font-family:'DejaVu Sans Mono', monospace;
+ font-size:14px;
+ margin:14px 0;
+ white-space: pre-wrap;
+}
+.module-signature,
+.package-signature,
+.type-signature {
+ margin-top: 0;
+}
+.member-signature .type-parameters-long,
+.member-signature .parameters,
+.member-signature .exceptions {
+ display: inline-block;
+ vertical-align: top;
+ white-space: pre;
+}
+.member-signature .type-parameters {
+ white-space: normal;
+}
+/*
+ * Styles for formatting effect.
+ */
+.source-line-no {
+ color:green;
+ padding:0 30px 0 0;
+}
+h1.hidden {
+ visibility:hidden;
+ overflow:hidden;
+ font-size:10px;
+}
+.block {
+ display:block;
+ margin:0 10px 5px 0;
+ color:#474747;
+}
+.deprecated-label, .descfrm-type-label, .implementation-label, .member-name-label, .member-name-link,
+.module-label-in-package, .module-label-in-type, .override-specify-label, .package-label-in-type,
+.package-hierarchy-label, .type-name-label, .type-name-link, .search-tag-link, .preview-label {
+ font-weight:bold;
+}
+.deprecation-comment, .help-footnote, .preview-comment {
+ font-style:italic;
+}
+.deprecation-block {
+ font-size:14px;
+ font-family:'DejaVu Serif', Georgia, "Times New Roman", Times, serif;
+ border-style:solid;
+ border-width:thin;
+ border-radius:10px;
+ padding:10px;
+ margin-bottom:10px;
+ margin-right:10px;
+ display:inline-block;
+}
+.preview-block {
+ font-size:14px;
+ font-family:'DejaVu Serif', Georgia, "Times New Roman", Times, serif;
+ border-style:solid;
+ border-width:thin;
+ border-radius:10px;
+ padding:10px;
+ margin-bottom:10px;
+ margin-right:10px;
+ display:inline-block;
+}
+div.block div.deprecation-comment {
+ font-style:normal;
+}
+/*
+ * Styles specific to HTML5 elements.
+ */
+main, nav, header, footer, section {
+ display:block;
+}
+/*
+ * Styles for javadoc search.
+ */
+.ui-autocomplete-category {
+ font-weight:bold;
+ font-size:15px;
+ padding:7px 0 7px 3px;
+ background-color:#4D7A97;
+ color:#FFFFFF;
+}
+.result-item {
+ font-size:13px;
+}
+.ui-autocomplete {
+ max-height:85%;
+ max-width:65%;
+ overflow-y:scroll;
+ overflow-x:scroll;
+ white-space:nowrap;
+ box-shadow: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23);
+}
+ul.ui-autocomplete {
+ position:fixed;
+ z-index:999999;
+ background-color: #FFFFFF;
+}
+ul.ui-autocomplete li {
+ float:left;
+ clear:both;
+ width:100%;
+}
+.result-highlight {
+ font-weight:bold;
+}
+.ui-autocomplete .result-item {
+ font-size: inherit;
+}
+#search-input {
+ background-image:url('resources/glass.png');
+ background-size:13px;
+ background-repeat:no-repeat;
+ background-position:2px 3px;
+ padding-left:20px;
+ position:relative;
+ right:-18px;
+ width:400px;
+}
+#reset-button {
+ background-color: rgb(255,255,255);
+ background-image:url('resources/x.png');
+ background-position:center;
+ background-repeat:no-repeat;
+ background-size:12px;
+ border:0 none;
+ width:16px;
+ height:16px;
+ position:relative;
+ left:-4px;
+ top:-4px;
+ font-size:0px;
+}
+.watermark {
+ color:#545454;
+}
+.search-tag-desc-result {
+ font-style:italic;
+ font-size:11px;
+}
+.search-tag-holder-result {
+ font-style:italic;
+ font-size:12px;
+}
+.search-tag-result:target {
+ background-color:yellow;
+}
+.module-graph span {
+ display:none;
+ position:absolute;
+}
+.module-graph:hover span {
+ display:block;
+ margin: -100px 0 0 100px;
+ z-index: 1;
+}
+.inherited-list {
+ margin: 10px 0 10px 0;
+}
+section.class-description {
+ line-height: 1.4;
+}
+.summary section[class$="-summary"], .details section[class$="-details"],
+.class-uses .detail, .serialized-class-details {
+ padding: 0px 20px 5px 10px;
+ border: 1px solid #ededed;
+ background-color: #f8f8f8;
+}
+.inherited-list, section[class$="-details"] .detail {
+ padding:0 0 5px 8px;
+ background-color:#ffffff;
+ border:none;
+}
+.vertical-separator {
+ padding: 0 5px;
+}
+ul.help-section-list {
+ margin: 0;
+}
+ul.help-subtoc > li {
+ display: inline-block;
+ padding-right: 5px;
+ font-size: smaller;
+}
+ul.help-subtoc > li::before {
+ content: "\2022" ;
+ padding-right:2px;
+}
+span.help-note {
+ font-style: italic;
+}
+/*
+ * Indicator icon for external links.
+ */
+main a[href*="://"]::after {
+ content:"";
+ display:inline-block;
+ background-image:url('data:image/svg+xml; utf8, \
+ ');
+ background-size:100% 100%;
+ width:7px;
+ height:7px;
+ margin-left:2px;
+ margin-bottom:4px;
+}
+main a[href*="://"]:hover::after,
+main a[href*="://"]:focus::after {
+ background-image:url('data:image/svg+xml; utf8, \
+ ');
+}
+
+/*
+ * Styles for user-provided tables.
+ *
+ * borderless:
+ * No borders, vertical margins, styled caption.
+ * This style is provided for use with existing doc comments.
+ * In general, borderless tables should not be used for layout purposes.
+ *
+ * plain:
+ * Plain borders around table and cells, vertical margins, styled caption.
+ * Best for small tables or for complex tables for tables with cells that span
+ * rows and columns, when the "striped" style does not work well.
+ *
+ * striped:
+ * Borders around the table and vertical borders between cells, striped rows,
+ * vertical margins, styled caption.
+ * Best for tables that have a header row, and a body containing a series of simple rows.
+ */
+
+table.borderless,
+table.plain,
+table.striped {
+ margin-top: 10px;
+ margin-bottom: 10px;
+}
+table.borderless > caption,
+table.plain > caption,
+table.striped > caption {
+ font-weight: bold;
+ font-size: smaller;
+}
+table.borderless th, table.borderless td,
+table.plain th, table.plain td,
+table.striped th, table.striped td {
+ padding: 2px 5px;
+}
+table.borderless,
+table.borderless > thead > tr > th, table.borderless > tbody > tr > th, table.borderless > tr > th,
+table.borderless > thead > tr > td, table.borderless > tbody > tr > td, table.borderless > tr > td {
+ border: none;
+}
+table.borderless > thead > tr, table.borderless > tbody > tr, table.borderless > tr {
+ background-color: transparent;
+}
+table.plain {
+ border-collapse: collapse;
+ border: 1px solid black;
+}
+table.plain > thead > tr, table.plain > tbody tr, table.plain > tr {
+ background-color: transparent;
+}
+table.plain > thead > tr > th, table.plain > tbody > tr > th, table.plain > tr > th,
+table.plain > thead > tr > td, table.plain > tbody > tr > td, table.plain > tr > td {
+ border: 1px solid black;
+}
+table.striped {
+ border-collapse: collapse;
+ border: 1px solid black;
+}
+table.striped > thead {
+ background-color: #E3E3E3;
+}
+table.striped > thead > tr > th, table.striped > thead > tr > td {
+ border: 1px solid black;
+}
+table.striped > tbody > tr:nth-child(even) {
+ background-color: #EEE
+}
+table.striped > tbody > tr:nth-child(odd) {
+ background-color: #FFF
+}
+table.striped > tbody > tr > th, table.striped > tbody > tr > td {
+ border-left: 1px solid black;
+ border-right: 1px solid black;
+}
+table.striped > tbody > tr > th {
+ font-weight: normal;
+}
+/**
+ * Tweak font sizes and paddings for small screens.
+ */
+@media screen and (max-width: 1050px) {
+ #search-input {
+ width: 300px;
+ }
+}
+@media screen and (max-width: 800px) {
+ #search-input {
+ width: 200px;
+ }
+ .top-nav,
+ .bottom-nav {
+ font-size: 11px;
+ padding-top: 6px;
+ }
+ .sub-nav {
+ font-size: 11px;
+ }
+ .about-language {
+ padding-right: 16px;
+ }
+ ul.nav-list li,
+ .sub-nav .nav-list-search {
+ padding: 6px;
+ }
+ ul.sub-nav-list li {
+ padding-top: 5px;
+ }
+ main {
+ padding: 10px;
+ }
+ .summary section[class$="-summary"], .details section[class$="-details"],
+ .class-uses .detail, .serialized-class-details {
+ padding: 0 8px 5px 8px;
+ }
+ body {
+ -webkit-text-size-adjust: none;
+ }
+}
+@media screen and (max-width: 500px) {
+ #search-input {
+ width: 150px;
+ }
+ .top-nav,
+ .bottom-nav {
+ font-size: 10px;
+ }
+ .sub-nav {
+ font-size: 10px;
+ }
+ .about-language {
+ font-size: 10px;
+ padding-right: 12px;
+ }
+}
diff --git a/doc/tag-search-index.js b/doc/tag-search-index.js
new file mode 100644
index 0000000..0367dae
--- /dev/null
+++ b/doc/tag-search-index.js
@@ -0,0 +1 @@
+tagSearchIndex = [];updateSearchResults();
\ No newline at end of file
diff --git a/doc/type-search-index.js b/doc/type-search-index.js
new file mode 100644
index 0000000..10a0870
--- /dev/null
+++ b/doc/type-search-index.js
@@ -0,0 +1 @@
+typeSearchIndex = [{"l":"All Classes and Interfaces","u":"allclasses-index.html"},{"p":"onlineshop.waren","l":"Artikel"},{"p":"onlineshop","l":"Bestellung"},{"p":"onlineshop.waren","l":"Buch"},{"p":"onlineshop","l":"Historie"},{"p":"onlineshop","l":"Kunde"},{"p":"onlineshop","l":"KundenverwaltungMitMaps"},{"p":"onlineshop","l":"Main"},{"p":"onlineshop","l":"OnlineShop"},{"p":"onlineshop.waren","l":"Sachbuch"},{"p":"onlineshop.sortiment","l":"Sortiment"},{"p":"onlineshop","l":"Warenkorb"}];updateSearchResults();
\ No newline at end of file
diff --git a/src/onlineshop/Bestellung.java b/src/onlineshop/Bestellung.java
new file mode 100644
index 0000000..cbb1358
--- /dev/null
+++ b/src/onlineshop/Bestellung.java
@@ -0,0 +1,38 @@
+package onlineshop;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class Bestellung.
+ */
+public class Bestellung {
+
+ /** The date. */
+ private String date;
+
+ /** The besteller. */
+ private Kunde besteller;
+
+ /** The warenkorb. */
+ private Warenkorb warenkorb;
+
+ /**
+ * Instantiates a new bestellung.
+ *
+ * @param date the date
+ * @param besteller the besteller
+ * @param warenkorb the warenkorb
+ */
+ public Bestellung(String date, Kunde besteller, Warenkorb warenkorb) {
+ this.date = date;
+ this.besteller = besteller;
+ this.warenkorb = warenkorb;
+ }
+
+ /**
+ * @return String
+ */
+ @Override
+ public String toString() {
+ return this.date + " " + this.besteller + " " + this.warenkorb;
+ }
+}
diff --git a/src/onlineshop/Historie.java b/src/onlineshop/Historie.java
new file mode 100644
index 0000000..043927a
--- /dev/null
+++ b/src/onlineshop/Historie.java
@@ -0,0 +1,35 @@
+package onlineshop;
+
+import java.util.ArrayDeque;
+import java.util.Deque;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class Historie.
+ */
+public class Historie {
+
+ /** The historie. */
+ private Deque historie = new ArrayDeque();
+
+ /**
+ * Zurueck.
+ *
+ * @return String
+ */
+ public String zurueck() {
+ String letzterSchritt = historie.peekFirst();
+ if (letzterSchritt != null)
+ historie.removeFirst();
+ return letzterSchritt;
+ }
+
+ /**
+ * Weiter.
+ *
+ * @param s the s
+ */
+ public void weiter(String s) {
+ historie.addFirst(s);
+ }
+}
diff --git a/src/onlineshop/Kunde.java b/src/onlineshop/Kunde.java
new file mode 100644
index 0000000..d2cae30
--- /dev/null
+++ b/src/onlineshop/Kunde.java
@@ -0,0 +1,129 @@
+package onlineshop;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class Kunde.
+ */
+public class Kunde implements Cloneable {
+
+ /** The kundennummer. */
+ private int kundennummer;
+
+ /** The vorname. */
+ private String vorname;
+
+ /** The name. */
+ private String name;
+
+ /** The geschlecht. */
+ private String geschlecht;
+
+ /** The geburtsdatum. */
+ private Date geburtsdatum;
+
+ /**
+ * Instantiates a new kunde.
+ *
+ * @param vorname the vorname
+ * @param nachname the nachname
+ */
+ public Kunde(String vorname, String nachname) {
+ this.vorname = vorname;
+ this.name = nachname;
+ }
+
+ /**
+ * Gets the kundennummer.
+ *
+ * @return int
+ */
+ public int getKundennummer() {
+ return kundennummer;
+ }
+
+ /**
+ * To string.
+ *
+ * @return String
+ */
+ public String toString() {
+ return vorname + " " + name;
+ // "Geschlecht: " + geschlecht + "\n" +
+ // "Geburtsdatum: " + geburtsdatum;
+ }
+
+ /**
+ * Equals.
+ *
+ * @param obj the obj
+ * @return boolean
+ */
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+
+ if (obj instanceof Kunde) {
+ Kunde k = (Kunde) obj;
+ return kundennummer == k.kundennummer;
+ } else
+ return super.equals(obj);
+ }
+
+ /**
+ * Compare to.
+ *
+ * @param k the k
+ * @return the int
+ */
+ public int compareTo(Kunde k) {
+ return kundennummer - k.kundennummer;
+ }
+
+ /**
+ * Clone.
+ *
+ * @return the kunde
+ */
+ public Kunde clone() {
+ try {
+ Kunde k = (Kunde) super.clone();
+ return k;
+ } catch (CloneNotSupportedException ex) {
+ System.out.println("Catch clone exception");
+ return null;
+ }
+ }
+
+ /**
+ * Hash code.
+ *
+ * @return int
+ */
+ public int hashCode() {
+ String s = vorname + name + geschlecht;
+ return s.hashCode();
+ }
+
+ /** The zahl. */
+ int zahl = 5;
+
+ /** The list. */
+ List list = new ArrayList();
+
+ /** The wrapper. */
+ Integer wrapper = new Integer(zahl);
+
+ /**
+ *
+ *
+ * @param zahl the zahl
+ * @param wrapper the wrapper
+ */
+ public void add(int zahl, Integer wrapper) {
+ list.add(wrapper);
+ }
+}
diff --git a/src/onlineshop/KundenverwaltungMitMaps.java b/src/onlineshop/KundenverwaltungMitMaps.java
new file mode 100644
index 0000000..abb0059
--- /dev/null
+++ b/src/onlineshop/KundenverwaltungMitMaps.java
@@ -0,0 +1,48 @@
+package onlineshop;
+
+import java.util.HashMap;
+import java.util.Map;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class KundenverwaltungMitMaps.
+ */
+public class KundenverwaltungMitMaps {
+
+ /** The kunden speicher. */
+ private Map kunden, kundenSpeicher;
+
+ /**
+ * Instantiates a new kundenverwaltung mit maps.
+ */
+ public KundenverwaltungMitMaps() {
+ kunden = new HashMap();
+ Kunde k1 = new Kunde("Ulf", "Koll");
+ Kunde k2 = new Kunde("Ilse", "Stahl");
+
+ kunden.put(k1.getKundennummer(), k1);
+ kunden.put(k2.getKundennummer(), k2);
+
+ for (Kunde k : kunden.values())
+ System.out.println(k);
+ }
+
+ /**
+ * Aktualisiere alle kunden.
+ */
+ public void aktualisiereAlleKunden() {
+ for (Kunde k : kunden.values())
+ kundenSpeicher.put(k.zahl, k);
+ }
+
+ /**
+ * Gets the kundendaten.
+ *
+ * @param kundenNr the kunden nr
+ * @return Kunde
+ */
+ public Kunde getKundendaten(int kundenNr) {
+ Kunde k = kunden.get(kundenNr);
+ return k;
+ }
+}
diff --git a/src/onlineshop/Main.java b/src/onlineshop/Main.java
index f41f97c..a9ce07a 100644
--- a/src/onlineshop/Main.java
+++ b/src/onlineshop/Main.java
@@ -1,9 +1,16 @@
package onlineshop;
+import java.time.LocalDateTime;
+import java.time.ZoneId;
+import java.util.Scanner;
+
import onlineshop.waren.Buch;
+
+// TODO: Auto-generated Javadoc
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
+// TODO: Auto-generated Javadoc
/**
* Diese Klasse stellt den Einstiegspunkt in das Programm dar.
* Dies Klasse beinhaltet die mmain-Methode, mit der
@@ -15,6 +22,8 @@
* @version 1.0
*/
public class Main {
+
+ /** The logger. */
private static Logger LOGGER = LogManager.getLogger(Main.class);
/**
@@ -22,11 +31,46 @@ public class Main {
*/
public OnlineShop onlineShop = null;
+ /**
+ * The main method.
+ *
+ * @param args the arguments
+ */
public static void main(String[] args) {
// write your code here
- Buch buch = neuesBuch("asdfasdf", "asdfasdfasdf", "asdfasdf", 333);
- Buch buch2 = buch.clone();
- System.out.println("buch2 = " + buch2);
+ System.out.println("Bitte eine Zahl auswählen (1 oder 2): ");
+ Scanner s = new Scanner(System.in);
+ int eingabe = s.nextInt();
+ switch (eingabe) {
+ default -> {
+ // Erstelle eine neue Zeitzone
+ ZoneId timezone = ZoneId.of("Europe/Berlin");
+
+ // Erstelle ein Datum mit der aktuellen Systemzeit und der Zeitzone
+ LocalDateTime datetime = LocalDateTime.now(timezone);
+ System.out.println("Datum mit der Systemzeit und Zeitzone: " + datetime);
+ System.out.println("Hi - please read docs!");
+ s.close();
+ break;
+ }
+ case 1 -> {
+ Buch buch = neuesBuch("asdfasdf", "asdfasdfasdf", "asdfasdf", 333);
+ Buch buch2 = buch.clone();
+ Kunde k1 = new Kunde("Markus", "G");
+ Kunde k2 = new Kunde("Anja", "K");
+ System.out.println("buch2 = " + buch2);
+ System.out.println(buch.toString());
+ System.out.println(buch.hashCode());
+ System.out.println(k1.hashCode());
+ System.out.println(k1 == k2);
+ s.close();
+ break;
+ }
+ case 2 -> {
+ new OnlineShop();
+ break;
+ }
+ }
}
@@ -42,7 +86,7 @@ public static void main(String[] args) {
* @throws RuntimeException wenn das Aktualisieren des Bestandes fehlschlägt
*/
static public Buch neuesBuch(String autor, String titel,
- String hersteller, int bestand) {
+ String hersteller, int bestand) {
Buch neuesBuch = new Buch();
neuesBuch.setAutor(autor);
neuesBuch.setTitel(titel);
diff --git a/src/onlineshop/OnlineShop.java b/src/onlineshop/OnlineShop.java
index 134df47..9429be0 100644
--- a/src/onlineshop/OnlineShop.java
+++ b/src/onlineshop/OnlineShop.java
@@ -1,4 +1,315 @@
package onlineshop;
+import org.apache.logging.log4j.Logger;
+
+import onlineshop.waren.Buch;
+import onlineshop.waren.Sachbuch;
+
+import java.util.Scanner;
+
+import org.apache.logging.log4j.LogManager;
+
+import java.io.BufferedReader;
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.OutputStreamWriter;
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.GregorianCalendar;
+import java.util.Queue;
+
+import java.util.concurrent.ConcurrentLinkedQueue;
+import java.util.zip.DeflaterOutputStream;
+import java.util.zip.InflaterInputStream;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class OnlineShop.
+ */
public class OnlineShop {
-}
+
+ /** The logger. */
+ private static Logger logger = LogManager.getRootLogger();
+
+ /** The bestellungen. */
+ private Queue bestellungen = new ConcurrentLinkedQueue();
+
+ /** The historie. */
+ private Historie historie = new Historie();
+
+ /**
+ * Instantiates a new online shop.
+ *
+ * @param bestellungen the bestellungen
+ * @param historie the historie
+ */
+ public OnlineShop(Queue bestellungen, Historie historie) {
+ this.bestellungen = bestellungen;
+ this.historie = historie;
+ }
+
+ /**
+ * Instantiates a new online shop.
+ */
+ public OnlineShop() {
+ System.out.println("Bitte eine Zahl auswählen (1,2,3,4,5,6,7,8 oder 9): ");
+ Kunde besteller = new Kunde("Ralf", "Koschke");
+ Warenkorb w1 = new Warenkorb();
+ Buch buch = new Buch();
+ Warenkorb w2 = new Warenkorb();
+ Warenkorb w3 = new Warenkorb();
+ Scanner s = new Scanner(System.in);
+ int eingabe = s.nextInt();
+ switch (eingabe) {
+ case 1 -> {
+ buch.setAnzahlSeiten(42);
+ buch.setAutor("meister");
+ logger.info(buch);
+ logger.debug("1");
+ s.close();
+ break;
+ }
+ case 2 -> {
+ buch.setAnzahlSeiten(24);
+ buch.setAutor("gandalf");
+ logger.info(buch);
+ logger.debug("2");
+ s.close();
+ break;
+ }
+ case 3 -> {
+ this.bestellprozess();
+ break;
+ }
+ case 4 -> {
+ w1.artikelHinzufuegen(new Sachbuch("47-11", "dpunkt Verlag",
+ "Requirements Engineering", 49.00, "Klaus Pohl", "SE"));
+ w1.artikelHinzufuegen(1, new Sachbuch("47-12", "Spektrum",
+ "UML Kompakt", 14.99F, "Helde Balzert", "SE"));
+ Bestellung erste = new Bestellung("2013-08-13 15:33:56", besteller, w1);
+ this.bestellungen.offer(erste);
+ // 2. Bestellung
+ w2.artikelHinzufuegen(new Sachbuch("47-13", "Spektrum",
+ "Software-Qualität", 34.99f, "Peter Liggesmeyer", "SE"));
+ w2.artikelHinzufuegen(0, new Sachbuch("47-14", "Springer",
+ "Faint Objects", 27.00f, "Brian Cudnik", "Astronomy"));
+ Bestellung zweite = new Bestellung("2013-08-13 15:42:11", besteller, w2);
+ this.bestellungen.offer(zweite);
+ w3.artikelHinzufuegen(new Sachbuch("47-15", "Pearson",
+ "Software-Engineering", 59.95f, "Ian Summerville", "SE"));
+ w3.artikelHinzufuegen(0, new Sachbuch("47-16", "Spektrum",
+ "Softwaremanagement", 64.99f, "Helmut Balzert", "SE"));
+ Bestellung dritte = new Bestellung("2013-08-13 15:45:23", besteller, w3);
+ this.bestellungen.offer(dritte);
+ while (!this.bestellungen.isEmpty()) {
+ System.out.println(this.bestellungen.poll());
+ }
+ break;
+ }
+ case 5 -> {
+ this.date();
+ break;
+ }
+ case 6 -> {
+ this.file();
+ break;
+ }
+ case 7 -> {
+ this.compress();
+ break;
+ }
+ case 8 -> {
+ this.decompress();
+ break;
+ }
+ case 9 -> {
+ this.cMkdirs();
+ break;
+ }
+ }
+ s.close();
+ }
+
+ /** The schritte. */
+ private String[] schritte = new String[] { "Warenkorb anzeigen",
+ "Zahlungsmethode wählen", "Zahlungsinformationen eingeben",
+ "Versandart wählen", "Bestellübersicht anzeigen",
+ "Bestellbestätigung anzeigen" };
+
+ /**
+ * To string.
+ *
+ * @return String
+ */
+ // @Override
+ public String toString() {
+ return this.bestellungen.toString() + " " + this.historie.toString();
+ }
+
+ /**
+ * Bestellprozess.
+ */
+ private void bestellprozess() {
+ Scanner s = new Scanner(System.in);
+ int prozessPosition = 0;
+ int eingabe = 1;
+
+ while (eingabe != 0) {
+ System.out.println("Aktueller Schritt: " + schritte[prozessPosition]);
+ System.out.print("Bitte wählen Sie (1=weiter zu '" + schritte[prozessPosition + 1] + "', 2=zurück, 0=beenden): ");
+ eingabe = s.nextInt();
+
+ switch (eingabe) {
+ case 0:
+ System.out.println("Vielen Dank für Ihren Besuch!");
+ break;
+ case 1:
+ prozessPosition++;
+ historie.weiter(schritte[prozessPosition]);
+ if (prozessPosition == schritte.length - 1) {
+ System.out.println("Vielen Dank für Ihren Einkauf!");
+ return;
+ }
+ break;
+ case 2:
+ if (historie.zurueck() != null)
+ prozessPosition--;
+ break;
+ }
+ }
+ s.close();
+ }
+
+ /**
+ * Date.
+ */
+ private void date() {
+ Date datum = new Date();
+ datum.setMonth(datum.getMonth() + 6);
+ System.out.println(datum);
+ SimpleDateFormat sdf;
+ sdf = new SimpleDateFormat("dd.MM.yyyy");
+ String formatDate = sdf.format(datum);
+ System.out.println(formatDate);
+ System.out.println("GregorianCalendar:");
+ GregorianCalendar calendar = new GregorianCalendar();
+ sdf.setCalendar(calendar);
+ formatDate = sdf.format(calendar.getTime());
+ System.out.println(formatDate);
+ System.out.println("GregorianCalendar Roll:");
+ calendar.roll(Calendar.MONTH, 3);
+ sdf.setCalendar(calendar);
+ formatDate = sdf.format(calendar.getTime());
+ System.out.println(formatDate);
+ }
+
+ /**
+ * File.
+ */
+ private void file() {
+ File[] roots = File.listRoots();
+ for (File root : roots) {
+ System.out.println(root);
+
+ File[] files = root.listFiles();
+ for (File file : files) {
+ System.out.print(file.getAbsolutePath() + " ");
+ }
+ System.out.println();
+ }
+
+ File datei = new File("test");
+ if (datei.exists()) {
+ try {
+ FileReader fileReader = new FileReader(datei);
+ BufferedReader bufferedReader = new BufferedReader(fileReader);
+ for (String zeile = bufferedReader.readLine(); zeile != null; zeile = bufferedReader.readLine()) {
+ System.out.println(zeile);
+ }
+ bufferedReader.close();
+ fileReader.close();
+ } catch (FileNotFoundException ex) {
+ ex.printStackTrace();
+ } catch (IOException ex) {
+ ex.printStackTrace();
+ }
+ }
+
+ try {
+ FileWriter fileWriter = new FileWriter(datei);
+ Date datum = new Date();
+ SimpleDateFormat sdf;
+ sdf = new SimpleDateFormat("dd.MM.yyyy");
+ String formatDate = sdf.format(datum);
+ fileWriter.write(formatDate);
+ fileWriter.close();
+ } catch (IOException ex) {
+ ex.printStackTrace();
+ }
+ }
+
+ /**
+ * Compress.
+ */
+ private void compress() {
+ try {
+ BufferedWriter w = new BufferedWriter(
+ new OutputStreamWriter(new DeflaterOutputStream(new FileOutputStream(new File("compress")))));
+ GregorianCalendar calendar = new GregorianCalendar();
+ SimpleDateFormat sdf;
+ sdf = new SimpleDateFormat("kk.mm.ss.SSS");
+ for (int i = 0; i < 100; ++i) {
+ Date date = new Date();
+ calendar.setTime(date);
+ String formatDate = sdf.format(calendar.getTime());
+ System.out.println(formatDate);
+ w.write(formatDate + "\n");
+ }
+ w.close();
+ } catch (FileNotFoundException ex) {
+ ex.printStackTrace();
+ } catch (IOException ex) {
+ ex.printStackTrace();
+ }
+ }
+
+ /**
+ * Decompress.
+ */
+ private void decompress() {
+ try {
+ BufferedReader b = new BufferedReader(
+ new InputStreamReader(new InflaterInputStream(new FileInputStream((new File("compress"))))));
+ for (String s = b.readLine(); s != null; s = b.readLine()) {
+ System.out.println(s);
+ }
+ b.close();
+ } catch (FileNotFoundException ex) {
+ ex.printStackTrace();
+ } catch (IOException ex) {
+ ex.printStackTrace();
+ }
+ }
+
+ /**
+ * @return boolean
+ */
+ public boolean cMkdirs() {
+ String sep = File.separator;
+ String pfad = "yoyoyo" + sep;
+ File verzeichnis = new File(pfad);
+ if (verzeichnis.exists() && verzeichnis.canWrite()) {
+ return true;
+ } else {
+ return verzeichnis.mkdirs();
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/onlineshop/Warenkorb.java b/src/onlineshop/Warenkorb.java
new file mode 100644
index 0000000..3082805
--- /dev/null
+++ b/src/onlineshop/Warenkorb.java
@@ -0,0 +1,128 @@
+package onlineshop;
+
+import java.util.LinkedList;
+import java.util.List;
+
+import onlineshop.waren.Artikel;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class Warenkorb.
+ */
+public class Warenkorb {
+
+ /** The anzahl artikel. */
+ private int anzahlArtikel;
+
+ /** The artikel summe. */
+ private float artikelSumme;
+
+ /** The gutschein eingeloest. */
+ private boolean gutscheinEingeloest;
+
+ /** The artikel liste. */
+ private List artikelListe = new LinkedList();
+
+ /**
+ * Instantiates a new warenkorb.
+ *
+ * @param anzahlArtikel the anzahl artikel
+ * @param artikelSumme the artikel summe
+ * @param gutscheinEingeloest the gutschein eingeloest
+ */
+ public Warenkorb(int anzahlArtikel, float artikelSumme, boolean gutscheinEingeloest) {
+ this.anzahlArtikel = anzahlArtikel;
+ this.artikelSumme = artikelSumme;
+ this.gutscheinEingeloest = gutscheinEingeloest;
+ }
+
+ /**
+ * Instantiates a new warenkorb.
+ */
+ public Warenkorb() {
+ }
+
+ /**
+ * @return String
+ */
+ @Override
+ public String toString() {
+ return Integer.toString(this.anzahlArtikel) + Float.toString(this.artikelSumme) + " "
+ + Boolean.toString(this.gutscheinEingeloest);
+ }
+
+ /**
+ * Hash code.
+ *
+ * @return int
+ */
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + anzahlArtikel;
+ result = prime * result + Float.floatToIntBits(artikelSumme);
+ result = prime * result + (gutscheinEingeloest ? 1231 : 1237);
+ return result;
+ }
+
+ /**
+ * Artikel hinzufuegen.
+ *
+ * @param position the position
+ * @param a the a
+ * @return boolean
+ * I recommend to use a Database. Following code is just for learning
+ */
+ public boolean artikelHinzufuegen(int position, Artikel a) {
+ try {
+ artikelListe.add(position, a);
+ artikelSumme += a.getPreis();
+ } catch (IndexOutOfBoundsException ex) {
+ return false; // Position ist ungültig
+ }
+ return true;
+ }
+
+ /**
+ * Artikel hinzufuegen.
+ *
+ * @param a the a
+ * @return boolean
+ */
+ public boolean artikelHinzufuegen(Artikel a) {
+ boolean erfolgreich = artikelListe.add(a);
+ if (erfolgreich)
+ artikelSumme += a.getPreis();
+ return erfolgreich;
+ }
+
+ /**
+ * Artikel entfernen.
+ *
+ * @param a the a
+ * @return boolean
+ */
+ public boolean artikelEntfernen(Artikel a) {
+ boolean erfolgreich = artikelListe.remove(a);
+ if (erfolgreich)
+ artikelSumme -= a.getPreis();
+ return erfolgreich;
+ }
+
+ /**
+ * Leere warenkorb.
+ */
+ public void leereWarenkorb() {
+ artikelListe.clear();
+ artikelSumme = 0;
+ }
+
+ /**
+ * Gets the anzahl artikel.
+ *
+ * @return int
+ */
+ public int getAnzahlArtikel() {
+ return artikelListe.size();
+ }
+}
diff --git a/src/onlineshop/sortiment/Sortiment.java b/src/onlineshop/sortiment/Sortiment.java
new file mode 100644
index 0000000..ae9075d
--- /dev/null
+++ b/src/onlineshop/sortiment/Sortiment.java
@@ -0,0 +1,82 @@
+package onlineshop.sortiment;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+
+import onlineshop.waren.Artikel;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class Sortiment.
+ */
+public class Sortiment {
+
+ /** The sortiment. */
+ private Set sortiment = new HashSet();
+
+ /**
+ * Neuer artikel.
+ *
+ * @param b the b
+ * @return boolean
+ */
+ public boolean neuerArtikel(Artikel b) {
+ return sortiment.add(b);
+ }
+
+ /**
+ * Entferne artikel.
+ *
+ * @param b the b
+ * @return true, if successful
+ */
+ public boolean entferneArtikel(Artikel b) {
+ return sortiment.remove(b);
+ }
+
+ /**
+ * Pruefe bestellung.
+ *
+ * @param bestellung the bestellung
+ * @return true, if successful
+ */
+ public boolean pruefeBestellung(Collection bestellung) {
+ return sortiment.containsAll(bestellung);
+ }
+
+ /**
+ * Ermittle verfuegbare artikel.
+ *
+ * @param bestellung the bestellung
+ * @return the sets the
+ */
+ public Set ermittleVerfuegbareArtikel(Set bestellung) {
+ Set verfuegbareArtikel = new HashSet(sortiment);
+ verfuegbareArtikel.retainAll(bestellung);
+ return verfuegbareArtikel;
+ }
+
+ /**
+ * Ermittle fehlende artikel.
+ *
+ * @param pruefListe the pruef liste
+ * @return the sets the
+ */
+ public Set ermittleFehlendeArtikel(Set pruefListe) {
+ Set fehlendeArtikel = new HashSet(sortiment);
+ fehlendeArtikel.removeAll(pruefListe);
+ return fehlendeArtikel;
+ }
+
+ /**
+ * Erweitere sortiment.
+ *
+ * @param neueArtikel the neue artikel
+ * @return true, if successful
+ */
+ public boolean erweitereSortiment(Collection neueArtikel) {
+ return sortiment.addAll(neueArtikel);
+ }
+
+}
diff --git a/src/onlineshop/waren/Artikel.java b/src/onlineshop/waren/Artikel.java
index 373f474..5364cd1 100644
--- a/src/onlineshop/waren/Artikel.java
+++ b/src/onlineshop/waren/Artikel.java
@@ -1,22 +1,72 @@
package onlineshop.waren;
+// TODO: Auto-generated Javadoc
+/**
+ * The Class Artikel.
+ */
public class Artikel implements Cloneable {
+
+ /** The beschreibung. */
protected String beschreibung;
+
+ /** The preis. */
+ protected float preis;
+
+ /** The hersteller. */
protected String hersteller;
+ /**
+ * Gets the beschreibung.
+ *
+ * @return the beschreibung
+ */
public String getBeschreibung() {
return beschreibung;
}
+ /**
+ * Sets the preis.
+ *
+ * @param preis the new preis
+ */
+ public void setPreis(float preis) {
+ this.preis = preis;
+ }
+
+ /**
+ * Gets the preis.
+ *
+ * @return float
+ */
+ public float getPreis() {
+ return this.preis;
+ }
+
+ /**
+ * Sets the hersteller.
+ *
+ * @param hersteller the new hersteller
+ */
public void setHersteller(final String hersteller) {
this.hersteller = hersteller;
}
+ /**
+ * Hash code.
+ *
+ * @return the int
+ */
@Override
public int hashCode() {
return super.hashCode();
}
+ /**
+ * Clone.
+ *
+ * @return the artikel
+ * @throws CloneNotSupportedException the clone not supported exception
+ */
@Override
protected Artikel clone() throws CloneNotSupportedException {
Artikel artikel = (Artikel) super.clone();
@@ -24,4 +74,29 @@ protected Artikel clone() throws CloneNotSupportedException {
artikel.beschreibung = this.beschreibung;
return artikel;
}
+
+ /**
+ * To string.
+ *
+ * @return the string
+ */
+ public String toString() {
+ return super.toString();
+ }
+
+ /**
+ * Equals.
+ *
+ * @param obj the obj
+ * @return boolean
+ */
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj instanceof Artikel) {
+ Artikel a = (Artikel) obj;
+ return (beschreibung.equals(a.beschreibung) && hersteller.equals(a.hersteller));
+ } else
+ return super.equals(obj);
+ }
}
diff --git a/src/onlineshop/waren/Buch.java b/src/onlineshop/waren/Buch.java
index 76f823b..0b1beef 100644
--- a/src/onlineshop/waren/Buch.java
+++ b/src/onlineshop/waren/Buch.java
@@ -2,40 +2,84 @@
import java.util.Scanner;
+// TODO: Auto-generated Javadoc
+/**
+ * The Class Buch.
+ */
public class Buch extends Artikel implements Cloneable {
+
+ /** The seiten. */
protected int seiten;
+
+ /** The autor. */
protected String autor;
+
+ /** The titel. */
protected String titel;
+
+ /** The scanner. */
Scanner scanner;
+ /**
+ * Gets the beschreibung.
+ *
+ * @return the beschreibung
+ */
+
@Override
public String getBeschreibung() {
return super.getBeschreibung();
}
+ /**
+ * Sets the seiten.
+ *
+ * @param seiten the new seiten
+ */
@Deprecated
public void setSeiten(int seiten) {
this.seiten = seiten;
}
+ /**
+ * Sets the anzahl seiten.
+ *
+ * @param seiten the new anzahl seiten
+ */
public void setAnzahlSeiten(int seiten) {
this.seiten = seiten;
}
+ /**
+ * Sets the autor.
+ *
+ * @param autor the new autor
+ */
public void setAutor(final String autor) {
this.autor = autor;
}
+ /**
+ * Sets the titel.
+ *
+ * @param titel the new titel
+ */
public void setTitel(final String titel) {
this.titel = titel;
}
+ /**
+ * Clone.
+ *
+ * @return the buch
+ */
@Override
public Buch clone() {
Buch buch = null;
try {
- buch = (Buch)super.clone();
+ buch = (Buch) super.clone();
+ buch = (Buch) super.clone();
buch.titel = this.titel;
buch.autor = this.autor;
buch.seiten = this.seiten;
@@ -45,13 +89,41 @@ public Buch clone() {
return buch;
}
+ /**
+ * Equals.
+ *
+ * @param obj the obj
+ * @return boolean
+ */
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj instanceof Buch) {
+ Buch b = (Buch) obj;
+ return (seiten == b.seiten && autor.equals(b.autor) && titel.equals(b.titel));
+ } else
+ return super.equals(obj);
+ }
+
+ /**
+ * Hash code.
+ *
+ * @return int
+ */
+ public int hashCode() {
+ return super.hashCode();
+ }
+
+ /**
+ * @return String
+ */
@Override
public String toString() {
return "Buch{" +
- "seiten=" + seiten +
- ", autor='" + autor + '\'' +
- ", titel='" + titel + '\'' +
- ", scanner=" + scanner +
- '}';
+ "seiten=" + seiten +
+ ", autor='" + autor + '\'' +
+ ", titel='" + titel + '\'' +
+ ", scanner=" + scanner +
+ '}';
}
}
diff --git a/src/onlineshop/waren/Sachbuch.java b/src/onlineshop/waren/Sachbuch.java
index 2cec2f1..a1de492 100644
--- a/src/onlineshop/waren/Sachbuch.java
+++ b/src/onlineshop/waren/Sachbuch.java
@@ -1,20 +1,64 @@
package onlineshop.waren;
+// TODO: Auto-generated Javadoc
+/**
+ * The Class Sachbuch.
+ */
public class Sachbuch extends Buch {
- private static final String KLASSEN_PRAEFIX = "SB";
+
+ /** The Constant KLASSEN_PRAEFIX. */
+ // private static final String KLASSEN_PRAEFIX = "SB";
+
+ /** The thema. */
private String thema;
+ /**
+ * Instantiates a new sachbuch.
+ */
public Sachbuch() {
}
+ /**
+ * Instantiates a new sachbuch.
+ *
+ * @param string the string
+ * @param string2 the string 2
+ * @param string3 the string 3
+ * @param d the d
+ * @param string4 the string 4
+ * @param string5 the string 5
+ */
+ public Sachbuch(String string, String string2, String string3, double d, String string4, String string5) {
+ }
+
+ /**
+ * Gets the thema.
+ *
+ * @return the thema
+ */
+ private static final String KLASSEN_PRAEFIX = "SB";
+
+ /**
+ * @return String
+ */
public String getThema() {
return thema;
}
+ /**
+ * Sets the thema.
+ *
+ * @param thema the new thema
+ */
public void setThema(String thema) {
this.thema = thema;
}
+ /**
+ * Zusammenfassen.
+ *
+ * @return the string
+ */
public String zusammenfassen() {
String zusammenfassung = "";
int anzahlThemen = getAnzahlThemen();
@@ -29,7 +73,63 @@ public String zusammenfassen() {
return zusammenfassung;
}
+ /**
+ * Gets the anzahl themen.
+ *
+ * @return the anzahl themen
+ */
private int getAnzahlThemen() {
return 0;
}
+
+ /**
+ * To string.
+ *
+ * @return the string
+ */
+ public String toString() {
+ return super.toString();
+ }
+
+ /**
+ * Equals.
+ *
+ * @param obj the obj
+ * @return boolean
+ */
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj instanceof Sachbuch) {
+ Sachbuch s = (Sachbuch) obj;
+ return (thema.equals(s.beschreibung));
+ } else
+ return super.equals(obj);
+ }
+
+ /**
+ * Hash code.
+ *
+ * @return int
+ */
+ public int hashCode() {
+ return super.hashCode();
+ }
+
+ /**
+ * Clone.
+ *
+ * @return Sachbuch
+ */
+ public Sachbuch clone() {
+ // try {
+ Sachbuch k = (Sachbuch) super.clone();
+ return k;
+ // will never catch exception
+ // }catch (CloneNotSupportedException ex) {
+ // System.out.println("Clone exception");
+ // return null;
+ // }
+ // Frage zu Einheit 2 Task 4.
+ }
}