+/EE360P

distributed systems

git clone https://git.julia.blue/+/EE360P

vijaygarg1init6bd33a4

master
666 B26 linesraw
1package dist;
2import java.util.*;
3public class Msg {
4    public int src, dest;
5    public String tag;
6    LinkedList<Object> msgBuf;
7    public Msg(int s, int t, String msgType, LinkedList<Object> buf) {
8        this.src = s;
9        dest = t;
10        tag = msgType;
11        msgBuf = buf;
12    }    
13    public LinkedList<Object> getMsgBuf() {
14        return msgBuf;
15    }
16    public int getMessageInt() {
17         return (Integer) msgBuf.removeFirst();
18    }
19    
20    public String toString(){
21        String s = String.valueOf(src)+" " +
22                    String.valueOf(dest)+ " " +
23                    tag + " " + msgBuf.toString() ;
24        return s;
25    } 
26}