NeighborhoodMsg.java 755 B

12345678910111213141516171819202122232425262728293031323334
  1. package classes.holonControlUnit.messages;
  2. import java.util.ArrayList;
  3. import classes.Holon;
  4. public class NeighborhoodMsg {
  5. public enum Type {
  6. NEW_VIRTUAL_NEIGHBOR, REMOVE_VIRTUAL_NEIGHBOR }
  7. // NEW_PHYSICAL_NEIGHBOR, REMOVE_PHYSICAL_NEIGHBOR, SEARCH_PHYSICAL_NEIGHBOR_REQ, SEARCH_PHYSICAL_NEIGHBOR_ANS }
  8. private Type type;
  9. private ArrayList<String> neighbors;
  10. public NeighborhoodMsg(Type type, ArrayList<String> newVirtualNeighbor) {
  11. super();
  12. this.type = type;
  13. this.neighbors = newVirtualNeighbor;
  14. }
  15. @Override
  16. public String toString() {
  17. return "NeighborhoodMsg [type=" + type + ", neighbors=" + neighbors + "]";
  18. }
  19. public ArrayList<String> getNeighbors() {
  20. return neighbors;
  21. }
  22. public Type getType() {
  23. return type;
  24. }
  25. }