Advertisement
Guest User

Untitled

a guest
May 24th, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. public class Canal {
  2.  
  3. private List<Consumidor> consumidores = new LinkedList<>();
  4.  
  5. public void registrarConsumidor(Consumidor consumidor){
  6. consumidores.add(consumidor);
  7. }
  8.  
  9. public void borrarConsumidor(Consumidor consumidor){
  10. consumidores.remove(consumidor);
  11. }
  12.  
  13. public void pasarMensaje(Mensaje mensaje){
  14. consumidores.forEach(consumidor -> {
  15. consumidor.procesarMensaje(mensaje);
  16. });
  17. }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement