I am searching Javadoc to identify an implementation of the “strategy pattern” inside Javadoc due to research reasons. I found 2 classes that actually inherited from the FilterInputStream class, the class BufferedInputStream and the DataInputStream. The inherited classes override the read() method of FilterInputStream class. Now according to “strategy pattern” I have to find a method from another class in Javadoc which in its body the read() method is called as well. Can anyone help me, please?.
P.S If you have any other implementation of strategy pattern inside Javadoc in your mind please tell me.
Thanks in advance
Input streams look more as an example of Decorator pattern rather than Strategy.
Better examples of strategy pattern are uses of
ThreadFactoryandRejectedExecutionHandlerinThreadPoolExecutor.EDIT:
RejectedExecutionHandleris an interface of a strategy which determines howThreadPoolExecutorhandles rejection of tasks. There are several concrete implementations of such strategires (ThreadPoolExecutor.AbortPolicy,ThreadPoolExecutor.DiscardPolicy, etc).ThreadPoolExecutorcan be configured to use one of them.So, it corresponds to this picture (from wikipedia article) in the following way:
ThreadPoolExecutoris aContextRejectedExecutionHandleris aStrategyinterfaceThreadPoolExecutor.AbortPolicy,ThreadPoolExecutor.DiscardPolicyare concrete strategies (ConcreteStrategyA,ConcreteStrategyB)