class Packet {
- InterpreterPath path;
- BitVector value;
- boolean isToken;
+ private final InterpreterPath path;
+ private final BitVector value;
+ private final boolean isToken;
public Packet(InterpreterPath path, BitVector value, boolean isToken) {
this.value = value;
this.path = path;
this.isToken = isToken;
+ this.value.setImmutable();
}
public void send() {
- if (isToken) {
- Log.token(path.getSource(), path.getDestination());
- } else {
- Log.data(value+"", path.getSource(), path.getDestination());
- }
+ Log.packet(this);
((InterpreterDestination)path.getDestination()).addDataFromFabric(this);
}
+ public Destination getDestination() {
+ return path.getDestination();
+ }
+
+ public Dock getSource() {
+ return path.getSource();
+ }
+
+ public BitVector getSignal() {
+ return path.getSignal();
+ }
+
+ public BitVector getValue() {
+ return value;
+ }
+
+ public boolean isToken() {
+ return isToken;
+ }
+
}