You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by sc...@apache.org on 2002/09/28 12:34:54 UTC
cvs commit: jakarta-commons/lang/src/java/org/apache/commons/lang NumberUtils.java CharSet.java RandomStringUtils.java CharSetUtils.java StringUtils.java
scolebourne 2002/09/28 03:34:54
Modified: lang/src/java/org/apache/commons/lang NumberUtils.java
CharSet.java RandomStringUtils.java
CharSetUtils.java StringUtils.java
Log:
Javadoc fixes and enhancements from Steve Downey
Revision Changes Path
1.3 +2 -2 jakarta-commons/lang/src/java/org/apache/commons/lang/NumberUtils.java
Index: NumberUtils.java
===================================================================
RCS file: /home/cvs/jakarta-commons/lang/src/java/org/apache/commons/lang/NumberUtils.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- NumberUtils.java 15 Sep 2002 10:26:42 -0000 1.2
+++ NumberUtils.java 28 Sep 2002 10:34:54 -0000 1.3
@@ -491,8 +491,8 @@
* <li>Normal positve numbers
* <li>+0.0
* <li>-0.0
- * <li>Minimum double (-Double.MAX_VALUE)
* <li>Normal negative numbers
+ * <li>Minimum double (-Double.MAX_VALUE)
* <li>Negative infinity
* </ul>
* Comparing NaN with NaN will return 0.
1.2 +5 -2 jakarta-commons/lang/src/java/org/apache/commons/lang/CharSet.java
Index: CharSet.java
===================================================================
RCS file: /home/cvs/jakarta-commons/lang/src/java/org/apache/commons/lang/CharSet.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- CharSet.java 19 Jul 2002 03:35:54 -0000 1.1
+++ CharSet.java 28 Sep 2002 10:34:54 -0000 1.2
@@ -70,7 +70,9 @@
private LinkedList set = new LinkedList();
/**
- * Restricted consructor. Use the factory method evaluateSet().
+ * Restricted constructor. Use the factory method evaluateSet().
+ *
+ * @throws NullPointerException if any of set[i] is null or if set is null
*/
protected CharSet(String[] set) {
int sz = set.length;
@@ -107,6 +109,7 @@
* Add a set definition string to the set
*
* @param str set definition string
+ * @throws NullPointerException if str is null
*/
protected void add(String str) {
int sz = str.length();
1.5 +9 -1 jakarta-commons/lang/src/java/org/apache/commons/lang/RandomStringUtils.java
Index: RandomStringUtils.java
===================================================================
RCS file: /home/cvs/jakarta-commons/lang/src/java/org/apache/commons/lang/RandomStringUtils.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- RandomStringUtils.java 18 Sep 2002 19:53:52 -0000 1.4
+++ RandomStringUtils.java 28 Sep 2002 10:34:54 -0000 1.5
@@ -178,6 +178,12 @@
/**
* Creates a random string based on a variety of options.
+ * If start and end are both 0, start and end are set to ' ' and 'z', the ASCII
+ * printable characters, will be used, unless letters and numbers are both
+ * false, in which case, start and end are set to 0 and Integer.MAX_VALUE.
+ * <p>
+ * If set is not null, characters between start and end are chosen.
+ * <p>
*
* @param count int length of random string to create
* @param start int position in set of chars to start at
@@ -187,6 +193,8 @@
* @param set char[] set of chars to choose randoms from.
* If null, then it will use the set of all chars.
* @return the random string
+ * @throws ArrayIndexOutOfBoundsException if there are not (end - start) + 1
+ * characters in the set array.
*/
public static String random(int count, int start, int end, boolean letters, boolean numbers, char[] set) {
if( (start == 0) && (end == 0) ) {
1.5 +9 -2 jakarta-commons/lang/src/java/org/apache/commons/lang/CharSetUtils.java
Index: CharSetUtils.java
===================================================================
RCS file: /home/cvs/jakarta-commons/lang/src/java/org/apache/commons/lang/CharSetUtils.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- CharSetUtils.java 18 Sep 2002 19:55:32 -0000 1.4
+++ CharSetUtils.java 28 Sep 2002 10:34:54 -0000 1.5
@@ -84,6 +84,11 @@
* "^e" implies not e. However it only negates, it's not
* a set in itself due to the size of that set in unicode.
* "ej-m" implies e,j->m. e,j,k,l,m.
+ * @param set
+ * @return CharSet
+ * @throws NullPointerException if any of set[i] is null or if set is null
+ * @param set
+ * @return CharSet
*/
public static CharSet evaluateSet(String[] set) {
return new CharSet(set);
@@ -112,6 +117,7 @@
*
* @param str the string to work from
* @param set the character set to use for manipulation
+ * @throws NullPointerException if str is null
*/
public static String squeeze(String str, String[] set) {
CharSet chars = evaluateSet(set);
@@ -189,6 +195,7 @@
*
* @param str String target to delete characters from
* @param set String[] set of characters to delete
+ * @throws NullPointerException of str is null
*/
public static String delete(String str, String[] set) {
CharSet chars = evaluateSet(set);
@@ -204,7 +211,6 @@
}
/**
- * NEEDS TO TAKE A CHAR-SET.
* Translate characters in a String.
* An example is: translate("hello", "ho", "jy") => jelly
* If the length of characters to search for is greater than the
@@ -214,6 +220,7 @@
* @param target String to replace characters in
* @param repl String to find that will be replaced
* @param with String to put into the target String
+ * @throws NullPointerException if target, with or repl is null
*/
public static String translate(String target, String repl, String with) {
StringBuffer buffer = new StringBuffer(target.length());
1.16 +1 -6 jakarta-commons/lang/src/java/org/apache/commons/lang/StringUtils.java
Index: StringUtils.java
===================================================================
RCS file: /home/cvs/jakarta-commons/lang/src/java/org/apache/commons/lang/StringUtils.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- StringUtils.java 27 Sep 2002 06:08:16 -0000 1.15
+++ StringUtils.java 28 Sep 2002 10:34:54 -0000 1.16
@@ -78,11 +78,6 @@
public class StringUtils {
/**
- * The size of the buffer to use when working with I/O (4 kB).
- */
- public static final int CHAR_BUFFER_SIZE = 4 * 1024;
-
- /**
* StringUtils instances should NOT be constructed in standard programming.
* Instead, the class should be used as <code>StringUtils.trim(" foo ");</code>.
* This constructor is public to permit tools that require a JavaBean instance
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>