For a school report I have to explain how the java.io.Reader package implements the Decorator pattern. I have seen multiple explanations for the java.io package (here for example) but not for the java.io.Reader package (if that's even any different). Here is what I have now, I know this design doesn't show it correctly, but I am not sure how the java.io.Reader package actually does implement it.
So in this case the Reader
would be the Component
, the InputStreamReader
the Concrete Component
, the BufferedReader
the Decorator
and the LineNumberReader
the Concrete Decorator
. Again, I know this is wrong but I don't know how to correctly display it.