From e518460e812000c15c8ee3ff32cae9dbc0562c60 Mon Sep 17 00:00:00 2001 From: peet Date: Fri, 7 Jun 2024 15:25:26 +0200 Subject: [PATCH] started on visitor pattern --- bin/uebung08/doc/CountWordsVisitor.class | Bin 0 -> 1206 bytes bin/uebung08/doc/Image.class | Bin 855 -> 534 bytes bin/uebung08/doc/Visitor.class | Bin 0 -> 282 bytes src/uebung08/doc/CountWordsVisitor.java | 11 +++++++++++ src/uebung08/doc/Visitor.java | 5 +++++ 5 files changed, 16 insertions(+) create mode 100644 bin/uebung08/doc/CountWordsVisitor.class create mode 100644 bin/uebung08/doc/Visitor.class create mode 100644 src/uebung08/doc/CountWordsVisitor.java create mode 100644 src/uebung08/doc/Visitor.java diff --git a/bin/uebung08/doc/CountWordsVisitor.class b/bin/uebung08/doc/CountWordsVisitor.class new file mode 100644 index 0000000000000000000000000000000000000000..858c0bd6ba90addbbb3fbd3d7121b3e58889ca7d GIT binary patch literal 1206 zcmbVL%We}f6ur(nL!c$3vsTn3A73Y0!JZtLpgu)yz48kJ5r&v@0Iq= zOc-I6u0n~x{yAH-?vlxQ_pN)*JzIqefmZHj8c(1y5K`D7fnvKeBTyPCpF2>5D-EbZ zjlkYmNPZdyF4t4$E;)hbSb1zYV_HP}^sr%p{_2}+dqhyRRPg#%Q%eeFbRrE74Lkdt>( zbEB4P?o$t$i6yf_NxISsg$Jfbo%$&YIQ5pyEP8ah;56WNp?n%^Z096(sQN(drxm9= zuFwTD)Z%Rup>fR&Dx`RJDNLHe!E{L7&{AJ?S!IJ=0?{DR3d=&=Ray+nEeA6`h`W zeJ#9RJc_M0e(i>!*o`B_ZDu4vy%{vx13uB7{ + + + @Override + public Integer visit(TextComponent textComponent) { + image.accept(this); + return 0; + } +} diff --git a/src/uebung08/doc/Visitor.java b/src/uebung08/doc/Visitor.java new file mode 100644 index 0000000..80e6282 --- /dev/null +++ b/src/uebung08/doc/Visitor.java @@ -0,0 +1,5 @@ +package uebung08.doc; + +public interface Visitor { + T visit(TextComponent textComponent); +}