1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- package classes.holonControlUnit.messages;
- import java.util.ArrayList;
- import classes.Holon;
- public class NeighborhoodMsg {
- public enum Type {
- NEW_VIRTUAL_NEIGHBOR, REMOVE_VIRTUAL_NEIGHBOR,
- NEW_PHYSICAL_NEIGHBOR, REMOVE_PHYSICAL_NEIGHBOR, SEARCH_PHYSICAL_NEIGHBOR_REQ, SEARCH_PHYSICAL_NEIGHBOR_ANS }
- private Type type;
- private ArrayList<String> neighbors;
- private int layer;
- private String id;
- public NeighborhoodMsg(Type type, ArrayList<String> newVirtualNeighbor) {
- super();
- this.type = type;
- this.neighbors = newVirtualNeighbor;
- }
- public NeighborhoodMsg(Type type, int layer) {
- super();
- this.type = type;
- this.layer = layer;
- }
- public NeighborhoodMsg(Type type, String id) {
- super();
- this.type = type;
- this.id = id;
- }
- @Override
- public String toString() {
- return "NeighborhoodMsg [type=" + type + ", neighbors=" + neighbors + ", layer=" + layer + ", id=" + id + "]";
- }
- public ArrayList<String> getNeighbors() {
- return neighbors;
- }
- public Type getType() {
- return type;
- }
- public int getLayer() {
- return layer;
- }
- public String getId() {
- return id;
- }
-
- }
|