package net.transit.network.swap; import net.transit.network.packet.IPacket; /** * @author Kyle Gunger * * @param The type of data provided (in IPacket<> form) */ public interface IProvider { /** * @return True if the provider can provide a packet. */ public boolean canProvide(); /**Get the next packet from the provider * * @return IPacket<> */ public IPacket provide(); /**Retain the packet if the acceptor did not accept the packet. * * @param rejected The rejected packet */ public void retain(IPacket rejected); /** * @return True if the acceptor has a provider assigned to it */ public boolean hasAcceptor(); /**Set the acceptor of the provider. The provider can decide if it wants to adopt the acceptor. */ public void setAcceptor(); }