mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-05-17 20:59:29 +00:00
25 lines
344 B
Java
25 lines
344 B
Java
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(".");
|
|
}
|
|
|
|
|
|
}
|