Java Doc for XMath.java in  » GIS » GeoTools-2.4.1 » org » geotools » resources » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » GIS » GeoTools 2.4.1 » org.geotools.resources 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.geotools.resources.XMath

XMath
final public class XMath (Code)
Simple mathematical functions. Some of these functions will be removed if JavaSoft provide a standard implementation or fix some issues in Bug Parade:


since:
   2.0
version:
   $Id: XMath.java 26695 2007-08-23 18:58:56Z desruisseaux $
author:
   Martin Desruisseaux


Field Summary
final public static  doubleLN10
     Natural logarithm of 10.


Method Summary
public static  doublecbrt(double x)
     Combute the cubic root of the specified value.
public static  intcountFractionDigits(double value)
     Count the fraction digits in the string representation of the specified value.
public static  doublefixRoundingError(double value, int n)
     Try to remove at least n fraction digits in the string representation of the specified value.
public static  intgetBitCount(Class type)
     Returns the number of bits used by number of the specified type.
Parameters:
  type - The type (may be null ).
public static  doublehypot(double x, double y)
     Compute the hypotenuse (sqrt(x²+y²)).
public static  booleanisInteger(Class type)
     Returns true if the specified type is one of integer types. Integer types includes Long , Integer , Short and Byte .
Parameters:
  type - The type to test (may be null ).
public static  booleanisReal(Class type)
     Returns true if the specified type is one of real number types.
public static  doublelog10(double x)
     Compute the logarithm in base 10.
public static  floatnext(float f)
     Finds the least float greater than f.
public static  doublenext(double f)
     Finds the least double greater than f.
public static  doublepow10(double x)
     Compute 10 power x.
public static strictfp  doublepow10(int x)
     Compute x to the power of 10.
public static  floatprevious(float f)
     Finds the greatest float less than f.
public static  doubleprevious(double f)
     Finds the greatest double less than f.
public static  ClassprimitiveToWrapper(Class type)
     Change a primitive class to its wrapper (e.g.
public static  doublerool(Class type, double value, int amount)
     Returns the next or previous representable number.
public static  doubleround(double value, int flu)
     Round the specified value, providing that the difference between the original value and the rounded value is not greater than the specified amount of floating point units.
public static  intsgn(double x)
     Returns the sign of x.
public static  intsgn(float x)
     Returns the sign of x.
public static  intsgn(long x)
     Returns the sign of x.
public static  intsgn(int x)
     Returns the sign of x.
public static  shortsgn(short x)
     Returns the sign of x.
public static  bytesgn(byte x)
     Returns the sign of x.
public static  floattoNaN(int index)
     Returns a Float.NaN NaN number for the specified index.
public static  ObjectvalueOf(Class type, String value)
     Converts the specified string into a value object.

Field Detail
LN10
final public static double LN10(Code)
Natural logarithm of 10. Approximately equal to 2.302585.





Method Detail
cbrt
public static double cbrt(double x)(Code)
Combute the cubic root of the specified value. This is method will be removed if RFE 4633024 is implemented.



countFractionDigits
public static int countFractionDigits(double value)(Code)
Count the fraction digits in the string representation of the specified value. This method is equivalent to a call to (value) and counting the number of digits after the decimal separator.



fixRoundingError
public static double fixRoundingError(double value, int n)(Code)
Try to remove at least n fraction digits in the string representation of the specified value. This method try small changes to value , by adding or substracting a maximum of 4 ulps. If there is no small change that remove at least n fraction digits, then the value is returned unchanged. This method is used for hiding rounding errors, like in conversions from radians to degrees.

Example: XMath.fixRoundingError(-61.500000000000014, 12) returns -61.5 .
Parameters:
  value - The value to fix.
Parameters:
  n - The minimum amount of fraction digits. The fixed value, or the unchanged value if there is no small changethat remove at least n fraction digits.




getBitCount
public static int getBitCount(Class type)(Code)
Returns the number of bits used by number of the specified type.
Parameters:
  type - The type (may be null ). The number of bits, or 0 if unknow.



hypot
public static double hypot(double x, double y)(Code)
Compute the hypotenuse (sqrt(x²+y²)).



isInteger
public static boolean isInteger(Class type)(Code)
Returns true if the specified type is one of integer types. Integer types includes Long , Integer , Short and Byte .
Parameters:
  type - The type to test (may be null ). true if type is the class Long, Integer,Short or Byte.



isReal
public static boolean isReal(Class type)(Code)
Returns true if the specified type is one of real number types. Real number types includes Float and Double .
Parameters:
  type - The type to test (may be null ). true if type is the class Float or Double.



log10
public static double log10(double x)(Code)
Compute the logarithm in base 10. See http://developer.java.sun.com/developer/bugParade/bugs/4074599.html.



next
public static float next(float f)(Code)
Finds the least float greater than f. If NaN , returns same value.



next
public static double next(double f)(Code)
Finds the least double greater than f. If NaN , returns same value.
See Also:   java.text.ChoiceFormat.nextDouble



pow10
public static double pow10(double x)(Code)
Compute 10 power x.



pow10
public static strictfp double pow10(int x)(Code)
Compute x to the power of 10. This computation is very fast for small power of 10 but has some rounding error issues (see http://developer.java.sun.com/developer/bugParade/bugs/4358794.html).



previous
public static float previous(float f)(Code)
Finds the greatest float less than f. If NaN , returns same value.



previous
public static double previous(double f)(Code)
Finds the greatest double less than f. If NaN , returns same value.
See Also:   java.text.ChoiceFormat.previousDouble



primitiveToWrapper
public static Class primitiveToWrapper(Class type)(Code)
Change a primitive class to its wrapper (e.g. double to Double ). If the specified class is not a primitive type, then it is returned unchanged.
Parameters:
  type - The primitive type (may be null ). The type as a wrapper.



rool
public static double rool(Class type, double value, int amount) throws IllegalArgumentException(Code)
Returns the next or previous representable number. If amount is equals to 0 , then this method returns the value unchanged. Otherwise, The operation performed depends on the specified type :
Parameters:
  type - The type. Should be the class of Double, Float,Long, Integer, Short or Byte.
Parameters:
  value - The number to rool.
Parameters:
  amount - -1 to return the previous representable number,+1 to return the next representable number, or0 to return the number with no change. One of previous or next representable number as a double .
throws:
  IllegalArgumentException - if type is not one of supported types.



round
public static double round(double value, int flu)(Code)
Round the specified value, providing that the difference between the original value and the rounded value is not greater than the specified amount of floating point units. This method can be used for hiding floating point error likes 2.9999999996.
Parameters:
  value - The value to round.
Parameters:
  flu - The amount of floating point units. The rounded value, of value if it was not close enough to an integer.



sgn
public static int sgn(double x)(Code)
Returns the sign of x. This method returns -1 if x is negative, 0 if x is null or NaN and +1 if x is positive.



sgn
public static int sgn(float x)(Code)
Returns the sign of x. This method returns -1 if x is negative, 0 if x is null or NaN and +1 if x is positive.



sgn
public static int sgn(long x)(Code)
Returns the sign of x. This method returns -1 if x is negative, 0 if x is null and +1 if x is positive.



sgn
public static int sgn(int x)(Code)
Returns the sign of x. This method returns -1 if x is negative, 0 if x is null and +1 if x is positive.



sgn
public static short sgn(short x)(Code)
Returns the sign of x. This method returns -1 if x is negative, 0 if x is null and +1 if x is positive.



sgn
public static byte sgn(byte x)(Code)
Returns the sign of x. This method returns -1 if x is negative, 0 if x is null and +1 if x is positive.



toNaN
public static float toNaN(int index) throws IndexOutOfBoundsException(Code)
Returns a Float.NaN NaN number for the specified index. Valid NaN numbers have bit fields ranging from 0x7f800001 through 0x7fffffff or 0xff800001 through 0xffffffff . The standard Float.NaN has bit fields 0x7fc00000 .
Parameters:
  index - The index, from -2097152 to 2097151 inclusive. One of the legal Float.NaN NaN values as a float.
throws:
  IndexOutOfBoundsException - if the specified index is out of bounds.



valueOf
public static Object valueOf(Class type, String value) throws IllegalArgumentException, NumberFormatException(Code)
Converts the specified string into a value object. The value object will be an instance of Boolean , Integer , Double , etc. according the specified type.
Parameters:
  type - The requested type.
Parameters:
  value - the value to parse. The value object, or null if value was null.
throws:
  IllegalArgumentException - if type is not a recognized type.
throws:
  NumberFormatException - if the string value is not parseable as a numberof the specified type.
since:
   2.4



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.