For an assignment, I have to find out which of the Gang of Four design pattern the classes java.io.Reader
and its subclasses java.io.PushbackReader
, java.io.BufferedReader
and java.io.FilterReader
were built with.
According to this post, the design pattern would be the Decorator Pattern. This only makes sense to me if PushbackReader
, BufferedReader
and FilterReader
can be decorated to be used at the same time, creating effectively a BufferedPushbackFilterReader
. Is that the idea?
Buffered
nature on top of theFilter
nature? – Kilian Foth Jun 19 '11 at 10:33