Skip to content

Commit

Permalink
twsxyrdcf"vgeurhtkùlm
Browse files Browse the repository at this point in the history
  • Loading branch information
GuusDb committed Mar 18, 2022
1 parent ad7cad3 commit c89b832
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,22 @@
import java.util.Iterator;


public class EnumerationIterator {
public class EnumerationIterator<E> implements Iterator<E>{

private Enumeration<E> enumeration;


public EnumerationIterator(Enumeration<E> enumeration) {
this.enumeration = enumeration;
}

@Override
public boolean hasNext() {
return enumeration.hasMoreElements();
}

@Override
public E next() {
return enumeration.nextElement();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,19 @@
import java.util.Iterator;


public class IteratorEnumeration {
public class IteratorEnumeration<E> implements Enumeration<E>{

@Override
public boolean hasMoreElements() {
// TODO Auto-generated method stub
return false;
}

@Override
public E nextElement() {
// TODO Auto-generated method stub
return null;
}



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

import domein.ApplicatieFout;
import domein.EnumerationIterator;
import domein.IteratorEnumeration;
import domein.MenuActie;
import javax.swing.tree.TreeNode;

Expand Down Expand Up @@ -66,13 +67,13 @@ private void voegToeAanOuder(DefaultMutableTreeNode root,
= root.depthFirstEnumeration();

//TODO Instantieer adaptor

Iterator<TreeNode> iterator = new EnumerationIterator<>(enumeration);
int ouder = ((MenuActie) kind.getUserObject()).getOuder();
//while (enumeration.hasMoreElements() && !gevonden)
while ( && !gevonden) { //TODO gebruik adaptor
while ( iterator.hasNext() && !gevonden) { //TODO gebruik adaptor

//DefaultMutableTreeNode node = enumeration.nextElement();
DefaultMutableTreeNode node = ; //TODO gebruik adaptor
DefaultMutableTreeNode node = (DefaultMutableTreeNode) iterator.next(); //TODO gebruik adaptor

MenuActie menuActie = (MenuActie) node.getUserObject();

Expand Down

0 comments on commit c89b832

Please sign in to comment.