NeighborhoodMsg.java 696 B

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