Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Canal {
- private List<Consumidor> consumidores = new LinkedList<>();
- public void registrarConsumidor(Consumidor consumidor){
- consumidores.add(consumidor);
- }
- public void borrarConsumidor(Consumidor consumidor){
- consumidores.remove(consumidor);
- }
- public void pasarMensaje(Mensaje mensaje){
- consumidores.forEach(consumidor -> {
- consumidor.procesarMensaje(mensaje);
- });
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement