forked from denyskon/info-java
29 lines
587 B
Java
29 lines
587 B
Java
import java.util.ArrayList;
|
|
|
|
public class Bibliothek {
|
|
private ArrayList<Buch> books = new ArrayList<>();
|
|
|
|
public void buchHinzufuegen(Buch buch) {
|
|
books.add(buch);
|
|
}
|
|
|
|
public Buch buchSuchen(String isbn) {
|
|
for (Buch buch : books) {
|
|
if (buch.ISBN.toLowerCase().equals(isbn.toLowerCase())) {
|
|
return buch;
|
|
}
|
|
}
|
|
|
|
return null;
|
|
}
|
|
|
|
public void alleBuecherAnzeigen() {
|
|
for (Buch buch : books) {
|
|
buch.buchInfo();
|
|
System.out.println("-".repeat(10));
|
|
}
|
|
}
|
|
|
|
|
|
}
|