Class ShortsReceiverDecorator

All Implemented Interfaces:
org.refcodes.component.Closable, org.refcodes.component.Closable.CloseAutomaton, org.refcodes.component.ClosedAccessor, org.refcodes.component.ConnectableComponent, org.refcodes.component.ConnectableComponent.ConnectableAutomaton, org.refcodes.component.ConnectionStatusAccessor, org.refcodes.component.OpenedAccessor, Availability, Receivable, ShortDestination, ShortReceiver, ShortsDestination, ShortsReceiver

public class ShortsReceiverDecorator extends AbstractShortsReceiver
The ShortsReceiverDecorator decorates a ShortsDestination with the additional methods of a ShortsReceiver making it easy to use a ShortsDestination wherever a ShortsReceiver is expected. This is a very plain implementation: available() always returns true if AbstractShortsReceiver.isOpened() is true and as long as none of the receiveShort(), receiveAllShorts() or receiveShorts(int) methods threw an IOException ( InterruptedException). This implementation actually behaves as if close() has been called after verifying available() and before any of the read methods have been called.