added composite sample

This commit is contained in:
Ilkka Seppala
2014-08-13 21:14:03 +03:00
parent 6a3c206bce
commit 0c9136ac01
8 changed files with 184 additions and 0 deletions
@@ -0,0 +1,24 @@
package com.iluwatar;
import java.util.List;
public class Sentence extends LetterComposite {
public Sentence(List<Word> words) {
for (Word w: words) {
this.add(w);
}
}
@Override
protected void printThisBefore() {
// nop
}
@Override
protected void printThisAfter() {
System.out.print(".");
}
}