This commit is contained in:
Simoes Lukas
2025-10-16 16:23:43 +02:00
parent ca833fec2f
commit 63a15fc6c7
25 changed files with 457 additions and 1 deletions

View File

@@ -0,0 +1,32 @@
import java.awt.*;
import javax.swing.*;
import java.util.List;
import java.util.Iterator;
import java.util.NoSuchElementException;
public class Iterateur<T> implements Iterator<T> {
private CouleurList<T> actuel;
public Iterateur(CouleurList debut) {
this.actuel = debut;
}
@Override
public boolean hasNext() {
return (this.actuel != null && this.actuel.valeur != null);
}
@Override
public T next() {
if (!hasNext()) {
throw new java.util.NoSuchElementException();
}
T valeur = this.actuel.valeur;
this.actuel = this.actuel.suivant;
return valeur;
}
}