mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-05-16 12:59:13 +00:00
24 lines
342 B
Java
24 lines
342 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(".");
|
|
}
|
|
|
|
}
|