Java Doc for RandomData.java in  » Science » Apache-commons-math-1.1 » org » apache » commons » math » random » 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 » Science » Apache commons math 1.1 » org.apache.commons.math.random 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.apache.commons.math.random.RandomData

All known Subclasses:   org.apache.commons.math.random.RandomDataImpl,
RandomData
public interface RandomData (Code)
Random data generation utilities.
version:
   $Revision: 355770 $ $Date: 2005-12-10 12:48:57 -0700 (Sat, 10 Dec 2005) $




Method Summary
 doublenextExponential(double mean)
     Generates a random value from the exponential distribution with expected value = mean.
 doublenextGaussian(double mu, double sigma)
     Generates a random value from the Normal (or Gaussian) distribution with the given mean and standard deviation.
 StringnextHexString(int len)
     Generates a random string of hex characters of length len.

The generated string will be random, but not cryptographically secure.

 intnextInt(int lower, int upper)
     Generates a uniformly distributed random integer between lower and upper (endpoints included).
 longnextLong(long lower, long upper)
     Generates a uniformly distributed random long integer between lower and upper (endpoints included).
 int[]nextPermutation(int n, int k)
     Generates an integer array of length k whose entries are selected randomly, without repetition, from the integers 0 through n-1 (inclusive).
 longnextPoisson(double mean)
     Generates a random value from the Poisson distribution with the given mean.
 Object[]nextSample(Collection c, int k)
     Returns an array of k objects selected randomly from the Collection c.

Sampling from c is without replacement; but if c contains identical objects, the sample may include repeats.

 StringnextSecureHexString(int len)
     Generates a random string of hex characters from a secure random sequence.
 intnextSecureInt(int lower, int upper)
     Generates a uniformly distributed random integer between lower and upper (endpoints included) from a secure random sequence.

Sequences of integers generated using this method will be cryptographically secure.

 longnextSecureLong(long lower, long upper)
     Generates a random long integer between lower and upper (endpoints included).

Sequences of long values generated using this method will be cryptographically secure.

 doublenextUniform(double lower, double upper)
     Generates a uniformly distributed random value from the open interval (lower,upper) (i.e., endpoints excluded).



Method Detail
nextExponential
double nextExponential(double mean)(Code)
Generates a random value from the exponential distribution with expected value = mean.

Definition: Exponential Distribution

Preconditions:

  • mu >= 0 (otherwise an IllegalArgumentException is thrown.)

Parameters:
  mean - Mean of the distribution random value from exponential distribution



nextGaussian
double nextGaussian(double mu, double sigma)(Code)
Generates a random value from the Normal (or Gaussian) distribution with the given mean and standard deviation.

Definition: Normal Distribution

Preconditions:

  • sigma > 0 (otherwise an IllegalArgumentException is thrown.)

Parameters:
  mu - Mean of the distribution
Parameters:
  sigma - Standard deviation of the distribution random value from Gaussian distribution with mean = mu,standard deviation = sigma



nextHexString
String nextHexString(int len)(Code)
Generates a random string of hex characters of length len.

The generated string will be random, but not cryptographically secure. To generate cryptographically secure strings, use nextSecureHexString

Preconditions:

  • len > 0 (otherwise an IllegalArgumentException is thrown.)

Parameters:
  len - the length of the string to be generated random string of hex characters of length len



nextInt
int nextInt(int lower, int upper)(Code)
Generates a uniformly distributed random integer between lower and upper (endpoints included).

The generated integer will be random, but not cryptographically secure. To generate cryptographically secure integer sequences, use nextSecureInt.

Preconditions:

  • lower < upper (otherwise an IllegalArgumentException is thrown.)

Parameters:
  lower - lower bound for generated integer
Parameters:
  upper - upper bound for generated integer a random integer greater than or equal to lowerand less than or equal to upper.



nextLong
long nextLong(long lower, long upper)(Code)
Generates a uniformly distributed random long integer between lower and upper (endpoints included).

The generated long integer values will be random, but not cryptographically secure. To generate cryptographically secure sequences of longs, use nextSecureLong

Preconditions:

  • lower < upper (otherwise an IllegalArgumentException is thrown.)

Parameters:
  lower - lower bound for generated integer
Parameters:
  upper - upper bound for generated integer a random integer greater than or equal to lowerand less than or equal to upper.



nextPermutation
int[] nextPermutation(int n, int k)(Code)
Generates an integer array of length k whose entries are selected randomly, without repetition, from the integers 0 through n-1 (inclusive).

Generated arrays represent permutations of n taken k at a time.

Preconditions:

  • k <= n
  • n > 0
If the preconditions are not met, an IllegalArgumentException is thrown.
Parameters:
  n - domain of the permutation
Parameters:
  k - size of the permutation random k-permutation of n



nextPoisson
long nextPoisson(double mean)(Code)
Generates a random value from the Poisson distribution with the given mean.

Definition: Poisson Distribution

Preconditions:

  • The specified mean must be positive (otherwise an IllegalArgumentException is thrown.)

Parameters:
  mean - Mean of the distribution poisson deviate with the specified mean



nextSample
Object[] nextSample(Collection c, int k)(Code)
Returns an array of k objects selected randomly from the Collection c.

Sampling from c is without replacement; but if c contains identical objects, the sample may include repeats. If all elements of c are distinct, the resulting object array represents a Simple Random Sample of size k from the elements of c.

Preconditions:

  • k must be less than or equal to the size of c
  • c must not be empty
If the preconditions are not met, an IllegalArgumentException is thrown.
Parameters:
  c - collection to be sampled
Parameters:
  k - size of the sample random sample of k elements from c



nextSecureHexString
String nextSecureHexString(int len)(Code)
Generates a random string of hex characters from a secure random sequence.

If cryptographic security is not required, use nextHexString().

Preconditions:

  • len > 0 (otherwise an IllegalArgumentException is thrown.)

Parameters:
  len - length of return string the random hex string



nextSecureInt
int nextSecureInt(int lower, int upper)(Code)
Generates a uniformly distributed random integer between lower and upper (endpoints included) from a secure random sequence.

Sequences of integers generated using this method will be cryptographically secure. If cryptographic security is not required, nextInt should be used instead of this method.

Definition: Secure Random Sequence

Preconditions:

  • lower < upper (otherwise an IllegalArgumentException is thrown.)

Parameters:
  lower - lower bound for generated integer
Parameters:
  upper - upper bound for generated integer a random integer greater than or equal to lowerand less than or equal to upper.



nextSecureLong
long nextSecureLong(long lower, long upper)(Code)
Generates a random long integer between lower and upper (endpoints included).

Sequences of long values generated using this method will be cryptographically secure. If cryptographic security is not required, nextLong should be used instead of this method.

Definition: Secure Random Sequence

Preconditions:

  • lower < upper (otherwise an IllegalArgumentException is thrown.)

Parameters:
  lower - lower bound for generated integer
Parameters:
  upper - upper bound for generated integer a long integer greater than or equal to lowerand less than or equal to upper.



nextUniform
double nextUniform(double lower, double upper)(Code)
Generates a uniformly distributed random value from the open interval (lower,upper) (i.e., endpoints excluded).

Definition: Uniform Distribution lower and upper - lower are the location and scale parameters, respectively.

Preconditions:

  • lower < upper (otherwise an IllegalArgumentException is thrown.)

Parameters:
  lower - lower endpoint of the interval of support
Parameters:
  upper - upper endpoint of the interval of support uniformly distributed random value between lowerand upper (exclusive)



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