started on visitor pattern
This commit is contained in:
parent
753d5e2780
commit
e518460e81
BIN
bin/uebung08/doc/CountWordsVisitor.class
Normal file
BIN
bin/uebung08/doc/CountWordsVisitor.class
Normal file
Binary file not shown.
Binary file not shown.
BIN
bin/uebung08/doc/Visitor.class
Normal file
BIN
bin/uebung08/doc/Visitor.class
Normal file
Binary file not shown.
11
src/uebung08/doc/CountWordsVisitor.java
Normal file
11
src/uebung08/doc/CountWordsVisitor.java
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
package uebung08.doc;
|
||||||
|
|
||||||
|
public class CountWordsVisitor implements Visitor<Integer>{
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public <T> Integer visit(TextComponent textComponent) {
|
||||||
|
image.accept(this);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
5
src/uebung08/doc/Visitor.java
Normal file
5
src/uebung08/doc/Visitor.java
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
package uebung08.doc;
|
||||||
|
|
||||||
|
public interface Visitor<T> {
|
||||||
|
T visit(TextComponent textComponent);
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user