Przeglądaj źródła

Removed excess spaces in javadoc headers

getBoolChaneModes006() uses a better method than a loop to figure out where to put modes


git-svn-id: http://svn.dmdirc.com/trunk@741 00569f92-eb28-0410-84fd-f71c24880f
tags/0.3
Shane Mc Cormack 17 lat temu
rodzic
commit
74eaa92026

+ 9
- 3
src/uk/org/ownage/dmdirc/parser/IRCParser.java Wyświetl plik

@@ -668,17 +668,23 @@ public final class IRCParser implements Runnable {
668 668
 		// method will ALWAYs return the same value.
669 669
 		final char[] modes = new char[hChanModesBool.size()];
670 670
 		int nTemp;
671
+		double pos;
671 672
 		
672 673
 		for (char cTemp : hChanModesBool.keySet()) {
673 674
 			nTemp = hChanModesBool.get(cTemp);
674
-			// Is there an easier way to find out the power of 2 value for a number?
675
+			// nTemp should never be less than 0
676
+			if (nTemp > 0) {
677
+				pos = Math.log(nTemp) / Math.log(2);
678
+				modes[(int)pos] = cTemp;
679
+			}
680
+/*			// Is there an easier way to find out the power of 2 value for a number?
675 681
 			// ie 1024 = 10, 512 = 9 ?
676 682
 			for (int i = 0; i < modes.length; i++) {
677 683
 				if (Math.pow(2, i) == (double) nTemp) {
678 684
 					modes[i] = cTemp;
679 685
 					break;
680 686
 				}
681
-			}
687
+			}*/
682 688
 		}
683 689
 		return new String(modes);
684 690
 	}
@@ -686,7 +692,7 @@ public final class IRCParser implements Runnable {
686 692
 	/**
687 693
 	 * Process CHANMODES from 005.
688 694
 	 */	
689
-	protected void parseChanModes() {
695
+	public void parseChanModes() {
690 696
 		final StringBuilder sDefaultModes = new StringBuilder("b,k,l,");
691 697
 		String[] bits = null;
692 698
 		String modeStr;

+ 16
- 18
src/uk/org/ownage/dmdirc/parser/IRCProcessor.java Wyświetl plik

@@ -30,8 +30,8 @@ import uk.org.ownage.dmdirc.parser.callbacks.CallbackManager;
30 30
  * IRCProcessor.
31 31
  * Superclass for all IRCProcessor types.
32 32
  *
33
- * @author            Shane Mc Cormack
34
- * @version           $Id$
33
+ * @author Shane Mc Cormack
34
+ * @version $Id$
35 35
  */
36 36
 public abstract class IRCProcessor {
37 37
 	/** Reference to the IRCParser that owns this IRCProcessor. */
@@ -42,8 +42,6 @@ public abstract class IRCProcessor {
42 42
 
43 43
 	// Some functions from the main parser are useful, and having to use myParser.functionName
44 44
 	// is annoying, so we also implement them here (calling them again using myParser)
45
-
46
-        	
47 45
 	/**
48 46
 	 * Create a new instance of the IRCProcessor Object.
49 47
 	 *
@@ -54,13 +52,13 @@ public abstract class IRCProcessor {
54 52
 		this.myParser = parser;
55 53
 		this.myManager = manager;
56 54
 	}
57
-        
55
+
58 56
 	/**
59 57
 	 * Callback to all objects implementing the IErrorInfo Interface.
60 58
 	 *
61 59
 	 * @see uk.org.ownage.dmdirc.parser.callbacks.interfaces.IErrorInfo
62 60
 	 * @param errorInfo ParserError object representing the error.
63
-         * @return true if a method was called, false otherwise
61
+	 * @return true if a method was called, false otherwise
64 62
 	 */
65 63
 	protected final boolean callErrorInfo(final ParserError errorInfo) {
66 64
 		return myParser.callErrorInfo(errorInfo);
@@ -73,7 +71,7 @@ public abstract class IRCProcessor {
73 71
 	 * @param level Debugging Level (DEBUG_INFO, ndSocket etc)
74 72
 	 * @param data Debugging Information
75 73
 	 * @param args Formatting String Options
76
-         * @return true if a method was called, false otherwise
74
+	 * @return true if a method was called, false otherwise
77 75
 	 */
78 76
 	protected final boolean callDebugInfo(final int level, final String data, final Object... args) {
79 77
 		return myParser.callDebugInfo(level, String.format(data, args));
@@ -85,7 +83,7 @@ public abstract class IRCProcessor {
85 83
 	 * @see uk.org.ownage.dmdirc.parser.callbacks.interfaces.IDebugInfo
86 84
 	 * @param level Debugging Level (DEBUG_INFO, ndSocket etc)
87 85
 	 * @param data Debugging Information
88
-         * @return true if a method was called, false otherwise
86
+	 * @return true if a method was called, false otherwise
89 87
 	 */
90 88
 	protected final boolean callDebugInfo(final int level, final String data) {
91 89
 		return myParser.callDebugInfo(level, data);
@@ -95,7 +93,7 @@ public abstract class IRCProcessor {
95 93
 	 * Check if a channel name is valid .
96 94
 	 *
97 95
 	 * @param sChannelName Channel name to test
98
-         * @return true if name is valid on the current connection, false otherwise. (Always false before noMOTD/MOTDEnd)
96
+	 * @return true if name is valid on the current connection, false otherwise. (Always false before noMOTD/MOTDEnd)
99 97
 	 */
100 98
 	protected final boolean isValidChannelName(final String sChannelName) {
101 99
 		return myParser.isValidChannelName(sChannelName);
@@ -155,9 +153,9 @@ public abstract class IRCProcessor {
155 153
 	public abstract String[] handles();
156 154
 	
157 155
 	/** 
158
-         * Get the name for this Processor.
159
-         * @return the name of this processor
160
-         */
156
+	 * Get the name for this Processor.
157
+	 * @return the name of this processor
158
+	 */
161 159
 	public final String getName() {
162 160
 		final Package thisPackage = this.getClass().getPackage();
163 161
 		int packageLength = 0;
@@ -168,17 +166,17 @@ public abstract class IRCProcessor {
168 166
 	}
169 167
 	
170 168
 	/** 
171
-         * Get the name for this Processor in lowercase.
172
-         * @return lower case name of this processor
173
-         */
169
+	 * Get the name for this Processor in lowercase.
170
+	 * @return lower case name of this processor
171
+	 */
174 172
 	public final String getLowerName() {
175 173
 		return this.getName().toLowerCase();
176 174
 	}
177 175
 	
178 176
 	/** 
179
-         * Get the name for this Processor.
180
-         * @return the name of this processor
181
-         */
177
+	 * Get the name for this Processor.
178
+	 * @return the name of this processor
179
+	 */
182 180
 	public final String toString() { return this.getName(); }
183 181
 	
184 182
 	/**

+ 3
- 3
src/uk/org/ownage/dmdirc/parser/MyInfo.java Wyświetl plik

@@ -27,9 +27,9 @@ package uk.org.ownage.dmdirc.parser;
27 27
 /**
28 28
  * Contains User information.
29 29
  * 
30
- * @author            Shane Mc Cormack
31
- * @author            Chris Smith
32
- * @version           $Id$
30
+ * @author Shane Mc Cormack
31
+ * @author Chris Smith
32
+ * @version $Id$
33 33
  * @see IRCParser
34 34
  */
35 35
 public final class MyInfo {

+ 2
- 2
src/uk/org/ownage/dmdirc/parser/ParserError.java Wyświetl plik

@@ -27,8 +27,8 @@ package uk.org.ownage.dmdirc.parser;
27 27
 /**
28 28
  * IRC Parser Error.
29 29
  *
30
- * @author            Shane Mc Cormack
31
- * @version           $Id$
30
+ * @author Shane Mc Cormack
31
+ * @version $Id$
32 32
  */
33 33
 public final class ParserError {
34 34
 	/** Error is potentially Fatal, Desync 99% Guaranteed! */

+ 2
- 2
src/uk/org/ownage/dmdirc/parser/ProcessingManager.java Wyświetl plik

@@ -32,8 +32,8 @@ import java.util.Enumeration;
32 32
  * IRC Parser Processing Manager.
33 33
  * Manages adding/removing/calling processing stuff.
34 34
  *
35
- * @author            Shane Mc Cormack
36
- * @version           $Id$
35
+ * @author Shane Mc Cormack
36
+ * @version $Id$
37 37
  */
38 38
 public class ProcessingManager {
39 39
 	/** Reference to the parser object that owns this ProcessingManager */

+ 2
- 2
src/uk/org/ownage/dmdirc/parser/ProcessorNotFound.java Wyświetl plik

@@ -27,8 +27,8 @@ package uk.org.ownage.dmdirc.parser;
27 27
 /**
28 28
  * IRC Parser Processor Not Found Exception.
29 29
  *
30
- * @author            Shane Mc Cormack
31
- * @version           $Id$
30
+ * @author Shane Mc Cormack
31
+ * @version $Id$
32 32
  */
33 33
 public class ProcessorNotFound extends Exception {
34 34
 	/**

+ 2
- 2
src/uk/org/ownage/dmdirc/parser/RegexStringList.java Wyświetl plik

@@ -29,8 +29,8 @@ import java.util.ArrayList;
29 29
 /**
30 30
  * IRC Parser Ignore list.
31 31
  *
32
- * @author            Shane Mc Cormack
33
- * @version           $Id$
32
+ * @author Shane Mc Cormack
33
+ * @version $Id$
34 34
  */
35 35
 public class RegexStringList {
36 36
 	/** Arraylist storing ignore patterns */

+ 3
- 3
src/uk/org/ownage/dmdirc/parser/ServerInfo.java Wyświetl plik

@@ -27,9 +27,9 @@ package uk.org.ownage.dmdirc.parser;
27 27
 /**
28 28
  * Contains Server information.
29 29
  * 
30
- * @author            Shane Mc Cormack
31
- * @author            Chris Smith
32
- * @version           $Id$
30
+ * @author Shane Mc Cormack
31
+ * @author Chris Smith
32
+ * @version $Id$
33 33
  * @see IRCParser
34 34
  */
35 35
 public class ServerInfo {

Ładowanie…
Anuluj
Zapisz