
package com.zygon.htm.core.message;

import com.zygon.htm.core.Identifier;
import java.util.Date;

/**
 *
 * @author zygon
 */
public class Message {
    
    public static enum Type {
        ACTIVATION,
        PREDICTION,
    }
    
    private final Type type;
    private final Identifier destination;
    private final double value;
    private final long timestamp;
    
    private final String display;

    public Message(Type type, Identifier destination, double value, long timestamp) {
        this.type = type;
        this.value = value;
        this.destination = destination;
        this.timestamp = timestamp;
        
        this.display = this.type.name() + "," + "[dest:" + this.destination + "]," + this.value + "," + new Date(this.timestamp);
    }
    
    public Identifier getDestination() {
        return destination;
    }

    public String getDisplay() {
        return display;
    }

    public long getTimestamp() {
        return timestamp;
    }
    
    public Type getType() {
        return type;
    }

    public double getValue() {
        return value;
    }

    public Message setDestination(Identifier dest) {
	return new Message(this.type, dest, this.value, this.timestamp);
    }

    @Override
    public String toString() {
        return this.display;
    }
}

@@ -1,9 +1,8 @@
-%0A
 package 
@@ -68,16 +68,17 @@
 tifier;%0A
+%0A
 import j
@@ -144,20 +144,16 @@
 ssage %7B%0A
-    
 %0A    pub
@@ -217,28 +217,24 @@
 TION,%0A    %7D%0A
-    
 %0A    private
@@ -359,20 +359,16 @@
 estamp;%0A
-    
 %0A    pri
@@ -611,24 +611,16 @@
 estamp;%0A
-        
 %0A       
@@ -740,36 +740,32 @@
 mestamp);%0A    %7D%0A
-    
 %0A    public Iden
@@ -760,16 +760,22 @@
  public 
+final 
 Identifi
@@ -906,16 +906,22 @@
  public 
+final 
 long get
@@ -966,20 +966,16 @@
 ;%0A    %7D%0A
-    
 %0A    pub
@@ -978,16 +978,22 @@
  public 
+final 
 Type get
@@ -1040,16 +1040,22 @@
  public 
+final 
 double g
@@ -1152,9 +1152,16 @@
 ) %7B%0A
-%09
+        
 retu

Make some methods final