From b061c9e1f749f6e1392eaa9e1746e30f3a2a6d0d Mon Sep 17 00:00:00 2001 From: Dor Bivas Date: Tue, 15 Apr 2014 11:25:19 +0300 Subject: Code documentation fixes --- src/Client/ChatClient.java | 7 +++---- src/Client/ChatClientReader.java | 7 +++++-- src/Client/ChatClientWriter.java | 10 ++++++---- src/Client/ParsedLine.java | 6 +++--- src/Client/UserInterface.java | 6 +++--- src/Server/ChatServer.java | 6 +++--- 6 files changed, 23 insertions(+), 19 deletions(-) diff --git a/src/Client/ChatClient.java b/src/Client/ChatClient.java index 283e983..7872c94 100644 --- a/src/Client/ChatClient.java +++ b/src/Client/ChatClient.java @@ -67,7 +67,7 @@ public class ChatClient } /** if the line is special command privmsg will handle it, else it will send the line as a privmsg. - * @param the line.*/ + * @param line the line.*/ public void PRIVMSG (String line) { String[] words = line.split("[ \t]", 2); @@ -123,9 +123,8 @@ public class ChatClient } /** opening new connection - * @param - * host name. - * port name. */ + * @param host name. + * @param port name. */ public boolean connect (String host, int port) { try diff --git a/src/Client/ChatClientReader.java b/src/Client/ChatClientReader.java index c5a279a..bc0645c 100644 --- a/src/Client/ChatClientReader.java +++ b/src/Client/ChatClientReader.java @@ -8,8 +8,11 @@ public class ChatClientReader extends Thread private Socket soc; private UserInterface ui; - /** constructor - * @param the socket */ + /** constructor + * @param client the chat client instance + * @param soc the socket + * @param ui the user interface + */ public ChatClientReader (ChatClient client, Socket soc, UserInterface ui) { this.client = client; diff --git a/src/Client/ChatClientWriter.java b/src/Client/ChatClientWriter.java index 9d89cea..91a1d99 100644 --- a/src/Client/ChatClientWriter.java +++ b/src/Client/ChatClientWriter.java @@ -14,16 +14,18 @@ public class ChatClientWriter extends Thread public static Scanner reader = new Scanner(System.in); /** constructor - * @param the socket and the client info */ + * @param soc - the socket + * @param client - the CLient info */ + public ChatClientWriter(Socket soc ,ChatClient client) { this.soc = soc; this.client = client; this.queue = new LinkedBlockingQueue(); } - + /** add message to queue. - * @param message */ + * @param line which is the message */ public void sendLine (String line) { try @@ -37,7 +39,7 @@ public class ChatClientWriter extends Thread } /** writing the line and making sure the package will be pushed on the stream - * @param the line and the client info */ + * @param line and the client info */ public void println(String line) { try diff --git a/src/Client/ParsedLine.java b/src/Client/ParsedLine.java index ebc45b1..972a9b2 100644 --- a/src/Client/ParsedLine.java +++ b/src/Client/ParsedLine.java @@ -8,13 +8,13 @@ public class ParsedLine private Hashtable dict; /** constructor, returning dictionary. - * @param text line + * @param line which is the text * for example input: ":sweetmorn.cohens.org.il 352 tzafrir #chat-dor ~tzafrir localhost" * output: a dictionary with the following entries: * - server: sweetmorn.cohens.org.il * - command: 352 * - nick: tzafrir - * - message: #chat-dor ~tzafrir localhost + * - message: "#chat-dor ~tzafrir localhost" */ public ParsedLine(String line) { @@ -79,7 +79,7 @@ public class ParsedLine } /** getting the results from the dictionary - @param property */ + @param property the key to look for in the parsed request */ public String get(String property) { return dict.get(property); diff --git a/src/Client/UserInterface.java b/src/Client/UserInterface.java index df56ec3..984ecb6 100644 --- a/src/Client/UserInterface.java +++ b/src/Client/UserInterface.java @@ -138,7 +138,7 @@ public class UserInterface extends JFrame implements ActionListener, KeyListener int counterClick = 0; /** Syncing the the action that the button send to the perform - * @param name of the action */ + * @param e -name of the action */ public void actionPerformed(ActionEvent e) { String command = e.getActionCommand(); @@ -164,7 +164,7 @@ public class UserInterface extends JFrame implements ActionListener, KeyListener } /** Syncing the the action that the event caused to the perform - * @param event key press */ + * @param e - event key press */ @Override public void keyPressed(KeyEvent e) { @@ -190,7 +190,7 @@ public class UserInterface extends JFrame implements ActionListener, KeyListener } /** Syncing the the action closing window to the shutdown - * @param event window closing */ + * @param e - event window closing */ public void windowClosing(WindowEvent e) { client.shutdown(); diff --git a/src/Server/ChatServer.java b/src/Server/ChatServer.java index 6d58c49..641c173 100644 --- a/src/Server/ChatServer.java +++ b/src/Server/ChatServer.java @@ -15,7 +15,7 @@ public class ChatServer public static ChatServer server; /** removing connection from the iterator. - * @param connection */ + * @param con connection */ public void connectionRemove(Connection con) { this.connections.remove(con); @@ -35,7 +35,7 @@ public class ChatServer } /** check if nick already used. if not add it. - * @param nick */ + * @param nick the new nick name to set */ public boolean addNick (String nick) { if (this.nicks.get(nick) != null) @@ -48,7 +48,7 @@ public class ChatServer } /** remove nick which is no longer in use. - * @param nick */ + * @param nick the nick to remove*/ public void removeNick (String nick) { this.nicks.remove(nick); -- cgit v1.2.3