1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
5 <!-- Generated by javadoc (build 1.4.2_16) on Sat Mar 15 20:43:47 PDT 2008 -->
6 <META http-equiv=
"Content-Type" content=
"text/html; charset=ISO-8859-1">
8 NumberUtils (Commons Lang
2.4 API)
11 <META NAME=
"keywords" CONTENT=
"org.apache.commons.lang.NumberUtils class">
13 <LINK REL =
"stylesheet" TYPE=
"text/css" HREF=
"../../../../stylesheet.css" TITLE=
"Style">
15 <SCRIPT type=
"text/javascript">
16 function windowTitle()
18 parent.document.
title=
"NumberUtils (Commons Lang 2.4 API)";
24 <BODY BGCOLOR=
"white" onload=
"windowTitle();">
27 <!-- ========= START OF TOP NAVBAR ======= -->
28 <A NAME=
"navbar_top"><!-- --></A>
29 <A HREF=
"#skip-navbar_top" title=
"Skip navigation links"></A>
30 <TABLE BORDER=
"0" WIDTH=
"100%" CELLPADDING=
"1" CELLSPACING=
"0" SUMMARY=
"">
32 <TD COLSPAN=
3 BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1">
33 <A NAME=
"navbar_top_firstrow"><!-- --></A>
34 <TABLE BORDER=
"0" CELLPADDING=
"0" CELLSPACING=
"3" SUMMARY=
"">
35 <TR ALIGN=
"center" VALIGN=
"top">
36 <TD BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1"> <A HREF=
"../../../../overview-summary.html"><FONT CLASS=
"NavBarFont1"><B>Overview
</B></FONT></A> </TD>
37 <TD BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1"> <A HREF=
"package-summary.html"><FONT CLASS=
"NavBarFont1"><B>Package
</B></FONT></A> </TD>
38 <TD BGCOLOR=
"#FFFFFF" CLASS=
"NavBarCell1Rev"> <FONT CLASS=
"NavBarFont1Rev"><B>Class
</B></FONT> </TD>
39 <TD BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1"> <A HREF=
"class-use/NumberUtils.html"><FONT CLASS=
"NavBarFont1"><B>Use
</B></FONT></A> </TD>
40 <TD BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1"> <A HREF=
"package-tree.html"><FONT CLASS=
"NavBarFont1"><B>Tree
</B></FONT></A> </TD>
41 <TD BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1"> <A HREF=
"../../../../deprecated-list.html"><FONT CLASS=
"NavBarFont1"><B>Deprecated
</B></FONT></A> </TD>
42 <TD BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1"> <A HREF=
"../../../../index-all.html"><FONT CLASS=
"NavBarFont1"><B>Index
</B></FONT></A> </TD>
43 <TD BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1"> <A HREF=
"../../../../help-doc.html"><FONT CLASS=
"NavBarFont1"><B>Help
</B></FONT></A> </TD>
47 <TD ALIGN=
"right" VALIGN=
"top" ROWSPAN=
3><EM>
53 <TD BGCOLOR=
"white" CLASS=
"NavBarCell2"><FONT SIZE=
"-2">
54 <A HREF=
"../../../../org/apache/commons/lang/NumberRange.html" title=
"class in org.apache.commons.lang"><B>PREV CLASS
</B></A>
55 <A HREF=
"../../../../org/apache/commons/lang/ObjectUtils.html" title=
"class in org.apache.commons.lang"><B>NEXT CLASS
</B></A></FONT></TD>
56 <TD BGCOLOR=
"white" CLASS=
"NavBarCell2"><FONT SIZE=
"-2">
57 <A HREF=
"../../../../index.html" target=
"_top"><B>FRAMES
</B></A>
58 <A HREF=
"NumberUtils.html" target=
"_top"><B>NO FRAMES
</B></A>
59 <SCRIPT type=
"text/javascript">
62 document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
67 <A HREF=
"../../../../allclasses-noframe.html"><B>All Classes
</B></A>
73 <TD VALIGN=
"top" CLASS=
"NavBarCell3"><FONT SIZE=
"-2">
74 SUMMARY:
NESTED
|
FIELD
|
<A HREF=
"#constructor_summary">CONSTR
</A> |
<A HREF=
"#method_summary">METHOD
</A></FONT></TD>
75 <TD VALIGN=
"top" CLASS=
"NavBarCell3"><FONT SIZE=
"-2">
76 DETAIL:
FIELD
|
<A HREF=
"#constructor_detail">CONSTR
</A> |
<A HREF=
"#method_detail">METHOD
</A></FONT></TD>
79 <A NAME=
"skip-navbar_top"></A>
80 <!-- ========= END OF TOP NAVBAR ========= -->
83 <!-- ======== START OF CLASS DATA ======== -->
86 org.apache.commons.lang
</FONT>
88 Class NumberUtils
</H2>
91 <IMG SRC=
"../../../../resources/inherit.gif" ALT=
"extended by"><B>org.apache.commons.lang.NumberUtils
</B>
94 <B>Deprecated.
</B> <I>Moved to org.apache.commons.lang.math.
95 Class will be removed in Commons Lang
3.0.
</I>
98 <DT>public final class
<B>NumberUtils
</B><DT>extends java.lang.Object
</DL>
101 <p>Provides extra functionality for Java Number classes.
</p>
106 <DT><B>Since:
</B></DT>
108 <DT><B>Version:
</B></DT>
109 <DD>$Id: NumberUtils.java
488819 2006-
12-
19 21:
50:
04Z bayard $
</DD>
110 <DT><B>Author:
</B></DT>
111 <DD><a href=
"mailto:rand_mcneely@yahoo.com">Rand McNeely
</a>, Stephen Colebourne,
<a href=
"mailto:steve.downey@netfolio.com">Steve Downey
</a>, Eric Pugh, Phil Steitz
</DD>
116 <!-- ======== NESTED CLASS SUMMARY ======== -->
119 <!-- =========== FIELD SUMMARY =========== -->
122 <!-- ======== CONSTRUCTOR SUMMARY ======== -->
124 <A NAME=
"constructor_summary"><!-- --></A>
125 <TABLE BORDER=
"1" WIDTH=
"100%" CELLPADDING=
"3" CELLSPACING=
"0" SUMMARY=
"">
126 <TR BGCOLOR=
"#CCCCFF" CLASS=
"TableHeadingColor">
127 <TD COLSPAN=
2><FONT SIZE=
"+2">
128 <B>Constructor Summary
</B></FONT></TD>
130 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
131 <TD><CODE><B><A HREF=
"../../../../org/apache/commons/lang/NumberUtils.html#NumberUtils()">NumberUtils
</A></B>()
</CODE>
134 <B>Deprecated.
</B> <code>NumberUtils
</code> instances should NOT be constructed in standard programming.
</TD>
138 <!-- ========== METHOD SUMMARY =========== -->
140 <A NAME=
"method_summary"><!-- --></A>
141 <TABLE BORDER=
"1" WIDTH=
"100%" CELLPADDING=
"3" CELLSPACING=
"0" SUMMARY=
"">
142 <TR BGCOLOR=
"#CCCCFF" CLASS=
"TableHeadingColor">
143 <TD COLSPAN=
2><FONT SIZE=
"+2">
144 <B>Method Summary
</B></FONT></TD>
146 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
147 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
148 <CODE>static
int
</CODE></FONT></TD>
149 <TD><CODE><B><A HREF=
"../../../../org/apache/commons/lang/NumberUtils.html#compare(double, double)">compare
</A></B>(double
lhs,
150 double
rhs)
</CODE>
153 <B>Deprecated.
</B> Compares two
<code>doubles
</code> for order.
</TD>
155 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
156 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
157 <CODE>static
int
</CODE></FONT></TD>
158 <TD><CODE><B><A HREF=
"../../../../org/apache/commons/lang/NumberUtils.html#compare(float, float)">compare
</A></B>(float
lhs,
159 float
rhs)
</CODE>
162 <B>Deprecated.
</B> Compares two floats for order.
</TD>
164 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
165 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
166 <CODE>static
java.math.BigDecimal
</CODE></FONT></TD>
167 <TD><CODE><B><A HREF=
"../../../../org/apache/commons/lang/NumberUtils.html#createBigDecimal(java.lang.String)">createBigDecimal
</A></B>(java.lang.String
val)
</CODE>
170 <B>Deprecated.
</B> Convert a
<code>String
</code> to a
<code>BigDecimal
</code>.
</TD>
172 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
173 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
174 <CODE>static
java.math.BigInteger
</CODE></FONT></TD>
175 <TD><CODE><B><A HREF=
"../../../../org/apache/commons/lang/NumberUtils.html#createBigInteger(java.lang.String)">createBigInteger
</A></B>(java.lang.String
val)
</CODE>
178 <B>Deprecated.
</B> Convert a
<code>String
</code> to a
<code>BigInteger
</code>.
</TD>
180 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
181 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
182 <CODE>static
java.lang.Double
</CODE></FONT></TD>
183 <TD><CODE><B><A HREF=
"../../../../org/apache/commons/lang/NumberUtils.html#createDouble(java.lang.String)">createDouble
</A></B>(java.lang.String
val)
</CODE>
186 <B>Deprecated.
</B> Convert a
<code>String
</code> to a
<code>Double
</code>.
</TD>
188 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
189 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
190 <CODE>static
java.lang.Float
</CODE></FONT></TD>
191 <TD><CODE><B><A HREF=
"../../../../org/apache/commons/lang/NumberUtils.html#createFloat(java.lang.String)">createFloat
</A></B>(java.lang.String
val)
</CODE>
194 <B>Deprecated.
</B> Convert a
<code>String
</code> to a
<code>Float
</code>.
</TD>
196 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
197 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
198 <CODE>static
java.lang.Integer
</CODE></FONT></TD>
199 <TD><CODE><B><A HREF=
"../../../../org/apache/commons/lang/NumberUtils.html#createInteger(java.lang.String)">createInteger
</A></B>(java.lang.String
val)
</CODE>
202 <B>Deprecated.
</B> Convert a
<code>String
</code> to a
<code>Integer
</code>, handling
203 hex and octal notations.
</TD>
205 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
206 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
207 <CODE>static
java.lang.Long
</CODE></FONT></TD>
208 <TD><CODE><B><A HREF=
"../../../../org/apache/commons/lang/NumberUtils.html#createLong(java.lang.String)">createLong
</A></B>(java.lang.String
val)
</CODE>
211 <B>Deprecated.
</B> Convert a
<code>String
</code> to a
<code>Long
</code>.
</TD>
213 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
214 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
215 <CODE>static
java.lang.Number
</CODE></FONT></TD>
216 <TD><CODE><B><A HREF=
"../../../../org/apache/commons/lang/NumberUtils.html#createNumber(java.lang.String)">createNumber
</A></B>(java.lang.String
val)
</CODE>
219 <B>Deprecated.
</B> Turns a string value into a java.lang.Number.
</TD>
221 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
222 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
223 <CODE>static
boolean
</CODE></FONT></TD>
224 <TD><CODE><B><A HREF=
"../../../../org/apache/commons/lang/NumberUtils.html#isDigits(java.lang.String)">isDigits
</A></B>(java.lang.String
str)
</CODE>
227 <B>Deprecated.
</B> Checks whether the
<code>String
</code> contains only
228 digit characters.
</TD>
230 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
231 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
232 <CODE>static
boolean
</CODE></FONT></TD>
233 <TD><CODE><B><A HREF=
"../../../../org/apache/commons/lang/NumberUtils.html#isNumber(java.lang.String)">isNumber
</A></B>(java.lang.String
str)
</CODE>
236 <B>Deprecated.
</B> Checks whether the String a valid Java number.
</TD>
238 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
239 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
240 <CODE>static
int
</CODE></FONT></TD>
241 <TD><CODE><B><A HREF=
"../../../../org/apache/commons/lang/NumberUtils.html#maximum(int, int, int)">maximum
</A></B>(int
a,
246 <B>Deprecated.
</B> Gets the maximum of three
<code>int
</code> values.
</TD>
248 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
249 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
250 <CODE>static
long
</CODE></FONT></TD>
251 <TD><CODE><B><A HREF=
"../../../../org/apache/commons/lang/NumberUtils.html#maximum(long, long, long)">maximum
</A></B>(long
a,
256 <B>Deprecated.
</B> Gets the maximum of three
<code>long
</code> values.
</TD>
258 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
259 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
260 <CODE>static
int
</CODE></FONT></TD>
261 <TD><CODE><B><A HREF=
"../../../../org/apache/commons/lang/NumberUtils.html#minimum(int, int, int)">minimum
</A></B>(int
a,
266 <B>Deprecated.
</B> Gets the minimum of three
<code>int
</code> values.
</TD>
268 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
269 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
270 <CODE>static
long
</CODE></FONT></TD>
271 <TD><CODE><B><A HREF=
"../../../../org/apache/commons/lang/NumberUtils.html#minimum(long, long, long)">minimum
</A></B>(long
a,
276 <B>Deprecated.
</B> Gets the minimum of three
<code>long
</code> values.
</TD>
278 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
279 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
280 <CODE>static
int
</CODE></FONT></TD>
281 <TD><CODE><B><A HREF=
"../../../../org/apache/commons/lang/NumberUtils.html#stringToInt(java.lang.String)">stringToInt
</A></B>(java.lang.String
str)
</CODE>
284 <B>Deprecated.
</B> Convert a
<code>String
</code> to an
<code>int
</code>, returning
285 <code>zero
</code> if the conversion fails.
</TD>
287 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
288 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
289 <CODE>static
int
</CODE></FONT></TD>
290 <TD><CODE><B><A HREF=
"../../../../org/apache/commons/lang/NumberUtils.html#stringToInt(java.lang.String, int)">stringToInt
</A></B>(java.lang.String
str,
291 int
defaultValue)
</CODE>
294 <B>Deprecated.
</B> Convert a
<code>String
</code> to an
<code>int
</code>, returning a
295 default value if the conversion fails.
</TD>
298 <A NAME=
"methods_inherited_from_class_java.lang.Object"><!-- --></A>
299 <TABLE BORDER=
"1" WIDTH=
"100%" CELLPADDING=
"3" CELLSPACING=
"0" SUMMARY=
"">
300 <TR BGCOLOR=
"#EEEEFF" CLASS=
"TableSubHeadingColor">
301 <TD><B>Methods inherited from class java.lang.Object
</B></TD>
303 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
304 <TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
</CODE></TD>
310 <!-- ============ FIELD DETAIL =========== -->
313 <!-- ========= CONSTRUCTOR DETAIL ======== -->
315 <A NAME=
"constructor_detail"><!-- --></A>
316 <TABLE BORDER=
"1" WIDTH=
"100%" CELLPADDING=
"3" CELLSPACING=
"0" SUMMARY=
"">
317 <TR BGCOLOR=
"#CCCCFF" CLASS=
"TableHeadingColor">
318 <TD COLSPAN=
1><FONT SIZE=
"+2">
319 <B>Constructor Detail
</B></FONT></TD>
323 <A NAME=
"NumberUtils()"><!-- --></A><H3>
326 public
<B>NumberUtils
</B>()
</PRE>
328 <DD><B>Deprecated.
</B> <DD><p><code>NumberUtils
</code> instances should NOT be constructed in standard programming.
329 Instead, the class should be used as
<code>NumberUtils.stringToInt(
"6");
</code>.
</p>
331 <p>This constructor is public to permit tools that require a JavaBean instance
336 <!-- ============ METHOD DETAIL ========== -->
338 <A NAME=
"method_detail"><!-- --></A>
339 <TABLE BORDER=
"1" WIDTH=
"100%" CELLPADDING=
"3" CELLSPACING=
"0" SUMMARY=
"">
340 <TR BGCOLOR=
"#CCCCFF" CLASS=
"TableHeadingColor">
341 <TD COLSPAN=
1><FONT SIZE=
"+2">
342 <B>Method Detail
</B></FONT></TD>
346 <A NAME=
"stringToInt(java.lang.String)"><!-- --></A><H3>
349 public static int
<B>stringToInt
</B>(java.lang.String
str)
</PRE>
351 <DD><B>Deprecated.
</B> <DD><p>Convert a
<code>String
</code> to an
<code>int
</code>, returning
352 <code>zero
</code> if the conversion fails.
</p>
355 <DT><B>Parameters:
</B><DD><CODE>str
</CODE> - the string to convert
356 <DT><B>Returns:
</B><DD>the int represented by the string, or
<code>zero
</code> if
357 conversion fails
</DL>
362 <A NAME=
"stringToInt(java.lang.String, int)"><!-- --></A><H3>
365 public static int
<B>stringToInt
</B>(java.lang.String
str,
366 int
defaultValue)
</PRE>
368 <DD><B>Deprecated.
</B> <DD><p>Convert a
<code>String
</code> to an
<code>int
</code>, returning a
369 default value if the conversion fails.
</p>
372 <DT><B>Parameters:
</B><DD><CODE>str
</CODE> - the string to convert
<DD><CODE>defaultValue
</CODE> - the default value
373 <DT><B>Returns:
</B><DD>the int represented by the string, or the default if conversion fails
</DL>
378 <A NAME=
"createNumber(java.lang.String)"><!-- --></A><H3>
381 public static java.lang.Number
<B>createNumber
</B>(java.lang.String
val)
382 throws java.lang.NumberFormatException
</PRE>
384 <DD><B>Deprecated.
</B> <DD><p>Turns a string value into a java.lang.Number.
</p>
386 <p>First, the value is examined for a type qualifier on the end
387 (
<code>'f','F','d','D','l','L'
</code>). If it is found, it starts
388 trying to create successively larger types from the type specified
389 until one is found that can hold the value.
</p>
391 <p>If a type specifier is not found, it will check for a decimal point
392 and then try successively larger types from
<code>Integer
</code> to
393 <code>BigInteger
</code> and from
<code>Float
</code> to
394 <code>BigDecimal
</code>.
</p>
396 <p>If the string starts with
<code>0x
</code> or
<code>-
0x
</code>, it
397 will be interpreted as a hexadecimal integer. Values with leading
398 <code>0</code>'s will not be interpreted as octal.
</p>
401 <DT><B>Parameters:
</B><DD><CODE>val
</CODE> - String containing a number
402 <DT><B>Returns:
</B><DD>Number created from the string
404 <DD><CODE>java.lang.NumberFormatException
</CODE> - if the value cannot be converted
</DL>
409 <A NAME=
"createFloat(java.lang.String)"><!-- --></A><H3>
412 public static java.lang.Float
<B>createFloat
</B>(java.lang.String
val)
</PRE>
414 <DD><B>Deprecated.
</B> <DD><p>Convert a
<code>String
</code> to a
<code>Float
</code>.
</p>
417 <DT><B>Parameters:
</B><DD><CODE>val
</CODE> - a
<code>String
</code> to convert
418 <DT><B>Returns:
</B><DD>converted
<code>Float
</code>
420 <DD><CODE>java.lang.NumberFormatException
</CODE> - if the value cannot be converted
</DL>
425 <A NAME=
"createDouble(java.lang.String)"><!-- --></A><H3>
428 public static java.lang.Double
<B>createDouble
</B>(java.lang.String
val)
</PRE>
430 <DD><B>Deprecated.
</B> <DD><p>Convert a
<code>String
</code> to a
<code>Double
</code>.
</p>
433 <DT><B>Parameters:
</B><DD><CODE>val
</CODE> - a
<code>String
</code> to convert
434 <DT><B>Returns:
</B><DD>converted
<code>Double
</code>
436 <DD><CODE>java.lang.NumberFormatException
</CODE> - if the value cannot be converted
</DL>
441 <A NAME=
"createInteger(java.lang.String)"><!-- --></A><H3>
444 public static java.lang.Integer
<B>createInteger
</B>(java.lang.String
val)
</PRE>
446 <DD><B>Deprecated.
</B> <DD><p>Convert a
<code>String
</code> to a
<code>Integer
</code>, handling
447 hex and octal notations.
</p>
450 <DT><B>Parameters:
</B><DD><CODE>val
</CODE> - a
<code>String
</code> to convert
451 <DT><B>Returns:
</B><DD>converted
<code>Integer
</code>
453 <DD><CODE>java.lang.NumberFormatException
</CODE> - if the value cannot be converted
</DL>
458 <A NAME=
"createLong(java.lang.String)"><!-- --></A><H3>
461 public static java.lang.Long
<B>createLong
</B>(java.lang.String
val)
</PRE>
463 <DD><B>Deprecated.
</B> <DD><p>Convert a
<code>String
</code> to a
<code>Long
</code>.
</p>
466 <DT><B>Parameters:
</B><DD><CODE>val
</CODE> - a
<code>String
</code> to convert
467 <DT><B>Returns:
</B><DD>converted
<code>Long
</code>
469 <DD><CODE>java.lang.NumberFormatException
</CODE> - if the value cannot be converted
</DL>
474 <A NAME=
"createBigInteger(java.lang.String)"><!-- --></A><H3>
475 createBigInteger
</H3>
477 public static java.math.BigInteger
<B>createBigInteger
</B>(java.lang.String
val)
</PRE>
479 <DD><B>Deprecated.
</B> <DD><p>Convert a
<code>String
</code> to a
<code>BigInteger
</code>.
</p>
482 <DT><B>Parameters:
</B><DD><CODE>val
</CODE> - a
<code>String
</code> to convert
483 <DT><B>Returns:
</B><DD>converted
<code>BigInteger
</code>
485 <DD><CODE>java.lang.NumberFormatException
</CODE> - if the value cannot be converted
</DL>
490 <A NAME=
"createBigDecimal(java.lang.String)"><!-- --></A><H3>
491 createBigDecimal
</H3>
493 public static java.math.BigDecimal
<B>createBigDecimal
</B>(java.lang.String
val)
</PRE>
495 <DD><B>Deprecated.
</B> <DD><p>Convert a
<code>String
</code> to a
<code>BigDecimal
</code>.
</p>
498 <DT><B>Parameters:
</B><DD><CODE>val
</CODE> - a
<code>String
</code> to convert
499 <DT><B>Returns:
</B><DD>converted
<code>BigDecimal
</code>
501 <DD><CODE>java.lang.NumberFormatException
</CODE> - if the value cannot be converted
</DL>
506 <A NAME=
"minimum(long, long, long)"><!-- --></A><H3>
509 public static long
<B>minimum
</B>(long
a,
513 <DD><B>Deprecated.
</B> <DD><p>Gets the minimum of three
<code>long
</code> values.
</p>
516 <DT><B>Parameters:
</B><DD><CODE>a
</CODE> - value
1<DD><CODE>b
</CODE> - value
2<DD><CODE>c
</CODE> - value
3
517 <DT><B>Returns:
</B><DD>the smallest of the values
</DL>
522 <A NAME=
"minimum(int, int, int)"><!-- --></A><H3>
525 public static int
<B>minimum
</B>(int
a,
529 <DD><B>Deprecated.
</B> <DD><p>Gets the minimum of three
<code>int
</code> values.
</p>
532 <DT><B>Parameters:
</B><DD><CODE>a
</CODE> - value
1<DD><CODE>b
</CODE> - value
2<DD><CODE>c
</CODE> - value
3
533 <DT><B>Returns:
</B><DD>the smallest of the values
</DL>
538 <A NAME=
"maximum(long, long, long)"><!-- --></A><H3>
541 public static long
<B>maximum
</B>(long
a,
545 <DD><B>Deprecated.
</B> <DD><p>Gets the maximum of three
<code>long
</code> values.
</p>
548 <DT><B>Parameters:
</B><DD><CODE>a
</CODE> - value
1<DD><CODE>b
</CODE> - value
2<DD><CODE>c
</CODE> - value
3
549 <DT><B>Returns:
</B><DD>the largest of the values
</DL>
554 <A NAME=
"maximum(int, int, int)"><!-- --></A><H3>
557 public static int
<B>maximum
</B>(int
a,
561 <DD><B>Deprecated.
</B> <DD><p>Gets the maximum of three
<code>int
</code> values.
</p>
564 <DT><B>Parameters:
</B><DD><CODE>a
</CODE> - value
1<DD><CODE>b
</CODE> - value
2<DD><CODE>c
</CODE> - value
3
565 <DT><B>Returns:
</B><DD>the largest of the values
</DL>
570 <A NAME=
"compare(double, double)"><!-- --></A><H3>
573 public static int
<B>compare
</B>(double
lhs,
574 double
rhs)
</PRE>
576 <DD><B>Deprecated.
</B> <DD><p>Compares two
<code>doubles
</code> for order.
</p>
578 <p>This method is more comprehensive than the standard Java greater
579 than, less than and equals operators.
</p>
581 <li>It returns
<code>-
1</code> if the first value is less than the second.
582 <li>It returns
<code>+
1</code> if the first value is greater than the second.
583 <li>It returns
<code>0</code> if the values are equal.
587 The ordering is as follows, largest to smallest:
590 <li>Positive infinity
592 <li>Normal positive numbers
595 <li>Normal negative numbers
596 <li>Minimum double (-Double.MAX_VALUE)
597 <li>Negative infinity
601 <p>Comparing
<code>NaN
</code> with
<code>NaN
</code> will
602 return
<code>0</code>.
</p>
605 <DT><B>Parameters:
</B><DD><CODE>lhs
</CODE> - the first
<code>double
</code><DD><CODE>rhs
</CODE> - the second
<code>double
</code>
606 <DT><B>Returns:
</B><DD><code>-
1</code> if lhs is less,
<code>+
1</code> if greater,
607 <code>0</code> if equal to rhs
</DL>
612 <A NAME=
"compare(float, float)"><!-- --></A><H3>
615 public static int
<B>compare
</B>(float
lhs,
616 float
rhs)
</PRE>
618 <DD><B>Deprecated.
</B> <DD><p>Compares two floats for order.
</p>
620 <p>This method is more comprehensive than the standard Java greater than,
621 less than and equals operators.
</p>
623 <li>It returns
<code>-
1</code> if the first value is less than the second.
624 <li>It returns
<code>+
1</code> if the first value is greater than the second.
625 <li>It returns
<code>0</code> if the values are equal.
628 <p> The ordering is as follows, largest to smallest:
631 <li>Positive infinity
633 <li>Normal positive numbers
636 <li>Normal negative numbers
637 <li>Minimum float (-Float.MAX_VALUE)
638 <li>Negative infinity
641 <p>Comparing
<code>NaN
</code> with
<code>NaN
</code> will return
645 <DT><B>Parameters:
</B><DD><CODE>lhs
</CODE> - the first
<code>float
</code><DD><CODE>rhs
</CODE> - the second
<code>float
</code>
646 <DT><B>Returns:
</B><DD><code>-
1</code> if lhs is less,
<code>+
1</code> if greater,
647 <code>0</code> if equal to rhs
</DL>
652 <A NAME=
"isDigits(java.lang.String)"><!-- --></A><H3>
655 public static boolean
<B>isDigits
</B>(java.lang.String
str)
</PRE>
657 <DD><B>Deprecated.
</B> <DD><p>Checks whether the
<code>String
</code> contains only
658 digit characters.
</p>
660 <p><code>Null
</code> and empty String will return
661 <code>false
</code>.
</p>
664 <DT><B>Parameters:
</B><DD><CODE>str
</CODE> - the
<code>String
</code> to check
665 <DT><B>Returns:
</B><DD><code>true
</code> if str contains only unicode numeric
</DL>
670 <A NAME=
"isNumber(java.lang.String)"><!-- --></A><H3>
673 public static boolean
<B>isNumber
</B>(java.lang.String
str)
</PRE>
675 <DD><B>Deprecated.
</B> <DD><p>Checks whether the String a valid Java number.
</p>
677 <p>Valid numbers include hexadecimal marked with the
<code>0x
</code>
678 qualifier, scientific notation and numbers marked with a type
679 qualifier (e.g.
123L).
</p>
681 <p><code>Null
</code> and empty String will return
682 <code>false
</code>.
</p>
685 <DT><B>Parameters:
</B><DD><CODE>str
</CODE> - the
<code>String
</code> to check
686 <DT><B>Returns:
</B><DD><code>true
</code> if the string is a correctly formatted number
</DL>
689 <!-- ========= END OF CLASS DATA ========= -->
693 <!-- ======= START OF BOTTOM NAVBAR ====== -->
694 <A NAME=
"navbar_bottom"><!-- --></A>
695 <A HREF=
"#skip-navbar_bottom" title=
"Skip navigation links"></A>
696 <TABLE BORDER=
"0" WIDTH=
"100%" CELLPADDING=
"1" CELLSPACING=
"0" SUMMARY=
"">
698 <TD COLSPAN=
3 BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1">
699 <A NAME=
"navbar_bottom_firstrow"><!-- --></A>
700 <TABLE BORDER=
"0" CELLPADDING=
"0" CELLSPACING=
"3" SUMMARY=
"">
701 <TR ALIGN=
"center" VALIGN=
"top">
702 <TD BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1"> <A HREF=
"../../../../overview-summary.html"><FONT CLASS=
"NavBarFont1"><B>Overview
</B></FONT></A> </TD>
703 <TD BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1"> <A HREF=
"package-summary.html"><FONT CLASS=
"NavBarFont1"><B>Package
</B></FONT></A> </TD>
704 <TD BGCOLOR=
"#FFFFFF" CLASS=
"NavBarCell1Rev"> <FONT CLASS=
"NavBarFont1Rev"><B>Class
</B></FONT> </TD>
705 <TD BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1"> <A HREF=
"class-use/NumberUtils.html"><FONT CLASS=
"NavBarFont1"><B>Use
</B></FONT></A> </TD>
706 <TD BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1"> <A HREF=
"package-tree.html"><FONT CLASS=
"NavBarFont1"><B>Tree
</B></FONT></A> </TD>
707 <TD BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1"> <A HREF=
"../../../../deprecated-list.html"><FONT CLASS=
"NavBarFont1"><B>Deprecated
</B></FONT></A> </TD>
708 <TD BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1"> <A HREF=
"../../../../index-all.html"><FONT CLASS=
"NavBarFont1"><B>Index
</B></FONT></A> </TD>
709 <TD BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1"> <A HREF=
"../../../../help-doc.html"><FONT CLASS=
"NavBarFont1"><B>Help
</B></FONT></A> </TD>
713 <TD ALIGN=
"right" VALIGN=
"top" ROWSPAN=
3><EM>
719 <TD BGCOLOR=
"white" CLASS=
"NavBarCell2"><FONT SIZE=
"-2">
720 <A HREF=
"../../../../org/apache/commons/lang/NumberRange.html" title=
"class in org.apache.commons.lang"><B>PREV CLASS
</B></A>
721 <A HREF=
"../../../../org/apache/commons/lang/ObjectUtils.html" title=
"class in org.apache.commons.lang"><B>NEXT CLASS
</B></A></FONT></TD>
722 <TD BGCOLOR=
"white" CLASS=
"NavBarCell2"><FONT SIZE=
"-2">
723 <A HREF=
"../../../../index.html" target=
"_top"><B>FRAMES
</B></A>
724 <A HREF=
"NumberUtils.html" target=
"_top"><B>NO FRAMES
</B></A>
725 <SCRIPT type=
"text/javascript">
728 document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
733 <A HREF=
"../../../../allclasses-noframe.html"><B>All Classes
</B></A>
739 <TD VALIGN=
"top" CLASS=
"NavBarCell3"><FONT SIZE=
"-2">
740 SUMMARY:
NESTED
|
FIELD
|
<A HREF=
"#constructor_summary">CONSTR
</A> |
<A HREF=
"#method_summary">METHOD
</A></FONT></TD>
741 <TD VALIGN=
"top" CLASS=
"NavBarCell3"><FONT SIZE=
"-2">
742 DETAIL:
FIELD
|
<A HREF=
"#constructor_detail">CONSTR
</A> |
<A HREF=
"#method_detail">METHOD
</A></FONT></TD>
745 <A NAME=
"skip-navbar_bottom"></A>
746 <!-- ======== END OF BOTTOM NAVBAR ======= -->
749 Copyright ©
2001-
2008 <a href=
"http://www.apache.org/">The Apache Software Foundation
</a>. All Rights Reserved.