Sync Decorator to Java 25: H6 file labels, fix Main.java JDK-output mismatch, README mapping

This commit is contained in:
2026-06-24 14:39:15 +05:30
parent ad6a65a95d
commit d6df1fd013
9 changed files with 79 additions and 60 deletions

View File

@@ -231,6 +231,24 @@ javac 02-structural/composite/*.java -d out/composite
java -cp out/composite composite.Main
```
### Decorator (`02-structural/decorator/`)
| Post Section | File(s) |
|---|---|
| Step 1 — Component Interface | `TextProcessor.java` |
| Step 2 — Concrete Component | `PlainTextProcessor.java` |
| Step 3 — Base Decorator | `TextDecorator.java` |
| Step 4 — Concrete Decorators | `UpperCaseDecorator.java`, `TrimDecorator.java`, `ProfanityFilterDecorator.java` |
| Stacking the Decorators — Order Matters | `Main.java` |
Note: the JDK `InputStream`/`BufferedInputStream`/`GZIPInputStream` snippet is illustrative only — it is not part of this repository's runnable example.
Run it:
```bash
javac 02-structural/decorator/*.java -d out/decorator
java -cp out/decorator decorator.Main
```
## Reference
- *Design Patterns: Elements of Reusable Object-Oriented Software* — Gamma, Helm, Johnson, Vlissides