MessageMemberState: use WSYD_Member.STATE, add missing javadocs
authorEddie <dev@fun2be.me>
Sat, 6 Jun 2015 09:48:33 +0000 (10:48 +0100)
committerEddie <dev@fun2be.me>
Sat, 6 Jun 2015 09:48:33 +0000 (10:48 +0100)
src/uk/ac/ntu/n0521366/wsyd/libs/message/MessageMemberState.java

index 52dd4bd..dec6c12 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * The MIT License
  *
- * Copyright 2015 eddie.
+ * Copyright 2015 Eddie Berrisford-Lynch <dev@fun2be.me>.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to deal
  */
 package uk.ac.ntu.n0521366.wsyd.libs.message;
 
+import uk.ac.ntu.n0521366.wsyd.libs.WSYD_Member;
+
 /**
  * Message used to notify a member's state to other members.
  *
- * @author eddie
+ * @author Eddie Berrisford-Lynch <dev@fun2be.me>
  */
 public class MessageMemberState extends MessageAbstract {
-    
+    /**
+     * Message type.
+     */
     private static final String _type = "MemberState";
-    
+
+    /**
+     * Unique user ID.
+     */
     public long _userID;
     
-    public boolean _onlineStatus;
+    /**
+     * true if user is online.
+     */
+    public WSYD_Member.STATE _onlineStatus;
     
+    /** 
+     *  The Message Class type.
+     * 
+     * @return Message type
+     */
     public static String getType() {
         return _type;
     }
     
+    /**
+     * The purpose of this class of message.
+     * 
+     * @return "MemberState"
+     */
     @Override
     public String getMessageType() {
         return _type;
     }
     
+    /**
+     * Default constructor.
+     */
     public MessageMemberState() {
-        this._userID = 0;
-        this._onlineStatus = false;
+        this(0, WSYD_Member.STATE.OFFLINE);
     }
     
-    public MessageMemberState(long userID, boolean state) {
+    /**
+     * Create with current user status.
+     * @param userID the member's ID
+     * @param state  true if online
+     */
+    public MessageMemberState(long userID, WSYD_Member.STATE state) {
+        super();
         this._userID = userID;
         this._onlineStatus = state;
     }